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.
This commit is contained in:
Reto Buerki 2015-02-27 11:31:52 +01:00 committed by Christian Helmuth
parent a5efe04656
commit 15d131b723
1 changed files with 5 additions and 4 deletions

View File

@ -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 */