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:
Reto Buerki 2015-02-26 13:06:14 +01:00 committed by Christian Helmuth
parent 9c8109c276
commit 89add00518
1 changed files with 7 additions and 3 deletions

View File

@ -15,11 +15,14 @@
#define _CPU_H_
#include <util/register.h>
#include <unmanaged_singleton.h>
#include <kernel/interface_support.h>
#include <cpu/cpu_state.h>
#include <idt.h>
#include <tss.h>
extern int _mt_idt;
namespace Genode
{
/**
@ -38,7 +41,7 @@ namespace Kernel { using Genode::Cpu_lazy_state; }
class Genode::Cpu
{
private:
Idt _idt;
Idt *_idt;
public:
@ -46,11 +49,12 @@ class Genode::Cpu
{
/* Setup IDT only once */
if (primary_id() == executing_id()) {
_idt.setup();
_idt = new (&_mt_idt) Idt();
_idt->setup();
Tss::setup();
}
_idt.load();
_idt->load();
Tss::load();
}