diff --git a/repos/base-hw/src/core/spec/x86_64/idt.cc b/repos/base-hw/src/core/spec/x86_64/idt.cc index d10ed702a..ffffc8319 100644 --- a/repos/base-hw/src/core/spec/x86_64/idt.cc +++ b/repos/base-hw/src/core/spec/x86_64/idt.cc @@ -4,14 +4,14 @@ #include "idt.h" extern int _mt_idt; +extern int _mt_isrs; using namespace Genode; void Idt::setup(addr_t const virt_base) { - /* TODO: Calculate from _mt_isrs label */ - uint64_t base = 0; + int base = _virt_mtc_addr(virt_base, (addr_t)&_mt_isrs); for (unsigned vec = 0; vec < SIZE_IDT; vec++) { /* ISRs are padded to 4 bytes */ @@ -20,8 +20,9 @@ void Idt::setup(addr_t const virt_base) _table[vec].offset_15_00 = base & 0xffff; _table[vec].segment_sel = 8; _table[vec].flags = 0x8e00; - _table[vec].offset_31_16 = (base >> 16) & 0xffff; - _table[vec].offset_63_32 = (base >> 32) & 0xffff; + /* Assume base to be below address 0x10000 */ + _table[vec].offset_31_16 = 0; + _table[vec].offset_63_32 = 0; } /* Set DPL of syscall entry to 3 */