hw_x86_64: Create Idt instance in mtc region
Use the _mt_idt label and the placement new operator to create the Idt instance in the mtc region.
This commit is contained in:
parent
9c8109c276
commit
89add00518
|
@ -15,11 +15,14 @@
|
||||||
#define _CPU_H_
|
#define _CPU_H_
|
||||||
|
|
||||||
#include <util/register.h>
|
#include <util/register.h>
|
||||||
|
#include <unmanaged_singleton.h>
|
||||||
#include <kernel/interface_support.h>
|
#include <kernel/interface_support.h>
|
||||||
#include <cpu/cpu_state.h>
|
#include <cpu/cpu_state.h>
|
||||||
#include <idt.h>
|
#include <idt.h>
|
||||||
#include <tss.h>
|
#include <tss.h>
|
||||||
|
|
||||||
|
extern int _mt_idt;
|
||||||
|
|
||||||
namespace Genode
|
namespace Genode
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +41,7 @@ namespace Kernel { using Genode::Cpu_lazy_state; }
|
||||||
class Genode::Cpu
|
class Genode::Cpu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Idt _idt;
|
Idt *_idt;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -46,11 +49,12 @@ class Genode::Cpu
|
||||||
{
|
{
|
||||||
/* Setup IDT only once */
|
/* Setup IDT only once */
|
||||||
if (primary_id() == executing_id()) {
|
if (primary_id() == executing_id()) {
|
||||||
_idt.setup();
|
_idt = new (&_mt_idt) Idt();
|
||||||
|
_idt->setup();
|
||||||
Tss::setup();
|
Tss::setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
_idt.load();
|
_idt->load();
|
||||||
Tss::load();
|
Tss::load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user