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 2d3a89f31..9a6931a2c 100644 --- a/repos/base-hw/src/core/include/spec/x86/cpu.h +++ b/repos/base-hw/src/core/include/spec/x86/cpu.h @@ -42,6 +42,7 @@ class Genode::Cpu { private: Idt *_idt; + Tss _tss; public: @@ -51,11 +52,10 @@ class Genode::Cpu if (primary_id() == executing_id()) { _idt = new (&_mt_idt) Idt(); _idt->setup(); - Tss::setup(); + _tss.load(); } - _idt->load(Cpu::exception_entry); - Tss::load(); + _tss.setup(); } static constexpr addr_t exception_entry = 0x0; /* XXX */ diff --git a/repos/base-hw/src/core/include/spec/x86_64/tss.h b/repos/base-hw/src/core/include/spec/x86_64/tss.h index da8e20790..48818fe92 100644 --- a/repos/base-hw/src/core/include/spec/x86_64/tss.h +++ b/repos/base-hw/src/core/include/spec/x86_64/tss.h @@ -31,22 +31,17 @@ class Genode::Tss uint16_t : 16; uint16_t iomap_base; - /** - * TSS - */ - static Tss _tss asm ("_tss"); - public: /** * Setup TSS. */ - static void setup(); + void setup(); /** * Load TSS into TR. */ - static void load(); + void load(); }__attribute__((packed)); diff --git a/repos/base-hw/src/core/spec/x86_64/mode_transition.s b/repos/base-hw/src/core/spec/x86_64/mode_transition.s index 4e2e58be1..9c239bee3 100644 --- a/repos/base-hw/src/core/spec/x86_64/mode_transition.s +++ b/repos/base-hw/src/core/spec/x86_64/mode_transition.s @@ -281,9 +281,9 @@ /* GDTE_LONG | GDTE_PRESENT | GDTE_TYPE_DATA_A | GDTE_TYPE_DATA_W | GDTE_NON_SYSTEM */ .long 0x20f300 /* Task segment descriptor */ - .long 0x01000068 + .long 0x35b10068 /* GDTE_PRESENT | GDTE_SYS_TSS */ - .long 0x893a + .long 0x8929 .long 0 .long 0 _gdt_end: diff --git a/repos/base-hw/src/core/spec/x86_64/tss.cc b/repos/base-hw/src/core/spec/x86_64/tss.cc index b4922bca9..bba9ca145 100644 --- a/repos/base-hw/src/core/spec/x86_64/tss.cc +++ b/repos/base-hw/src/core/spec/x86_64/tss.cc @@ -4,13 +4,11 @@ using namespace Genode; extern char kernel_stack[]; -__attribute__((aligned(8))) Tss Tss::_tss; - void Tss::setup() { - _tss.rsp0 = (addr_t)kernel_stack; - _tss.rsp1 = (addr_t)kernel_stack; - _tss.rsp2 = (addr_t)kernel_stack; + this->rsp0 = (addr_t)kernel_stack; + this->rsp1 = (addr_t)kernel_stack; + this->rsp2 = (addr_t)kernel_stack; }