From 15d131b72301b35164d75fe36490acbf9a0dc3c6 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 27 Feb 2015 11:31:52 +0100 Subject: [PATCH] hw_x86_64: Use _virt_mtc_addr to calculate ISR base Call the _virt_mtc_addr function with the _mt_isrs label to calculate the ISR base address in Idt::setup. Again, assume the address to be below 0x10000. --- repos/base-hw/src/core/spec/x86_64/idt.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 */