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:
parent
a5efe04656
commit
15d131b723
|
@ -4,14 +4,14 @@
|
||||||
#include "idt.h"
|
#include "idt.h"
|
||||||
|
|
||||||
extern int _mt_idt;
|
extern int _mt_idt;
|
||||||
|
extern int _mt_isrs;
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
|
|
||||||
void Idt::setup(addr_t const virt_base)
|
void Idt::setup(addr_t const virt_base)
|
||||||
{
|
{
|
||||||
/* TODO: Calculate from _mt_isrs label */
|
int base = _virt_mtc_addr(virt_base, (addr_t)&_mt_isrs);
|
||||||
uint64_t base = 0;
|
|
||||||
|
|
||||||
for (unsigned vec = 0; vec < SIZE_IDT; vec++) {
|
for (unsigned vec = 0; vec < SIZE_IDT; vec++) {
|
||||||
/* ISRs are padded to 4 bytes */
|
/* 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].offset_15_00 = base & 0xffff;
|
||||||
_table[vec].segment_sel = 8;
|
_table[vec].segment_sel = 8;
|
||||||
_table[vec].flags = 0x8e00;
|
_table[vec].flags = 0x8e00;
|
||||||
_table[vec].offset_31_16 = (base >> 16) & 0xffff;
|
/* Assume base to be below address 0x10000 */
|
||||||
_table[vec].offset_63_32 = (base >> 32) & 0xffff;
|
_table[vec].offset_31_16 = 0;
|
||||||
|
_table[vec].offset_63_32 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set DPL of syscall entry to 3 */
|
/* Set DPL of syscall entry to 3 */
|
||||||
|
|
Loading…
Reference in New Issue