From 89add005186cd3c0842dfcd05a4b15c777f6d596 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 26 Feb 2015 13:06:14 +0100 Subject: [PATCH] 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. --- repos/base-hw/src/core/include/spec/x86/cpu.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/repos/base-hw/src/core/include/spec/x86/cpu.h b/repos/base-hw/src/core/include/spec/x86/cpu.h index 230da4302..7315262a5 100644 --- a/repos/base-hw/src/core/include/spec/x86/cpu.h +++ b/repos/base-hw/src/core/include/spec/x86/cpu.h @@ -15,11 +15,14 @@ #define _CPU_H_ #include +#include #include #include #include #include +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(); }