hw_x86_64: Add private _virt_idt_address member to Idt class

This function calculates the address of the IDT for a given virtual
mode transition base address.
This commit is contained in:
Reto Buerki 2015-02-26 13:51:56 +01:00 committed by Christian Helmuth
parent 89add00518
commit ecaad9ecce
2 changed files with 16 additions and 0 deletions

View File

@ -21,6 +21,12 @@ class Genode::Idt
SYSCALL_VEC = 0x80,
};
/**
* Return virtual address of the IDT for given virtual mode transition
* base.
*/
static addr_t _virt_idt_addr(addr_t const virt_base);
/**
* 64-Bit Mode IDT gate, see Intel SDM Vol. 3A, section 6.14.1.
*/

View File

@ -1,5 +1,8 @@
#include "idt.h"
extern int _mt_begin;
extern int _mt_idt;
using namespace Genode;
class Descriptor
@ -13,6 +16,13 @@ class Descriptor
} __attribute__((packed));
addr_t Idt::_virt_idt_addr(addr_t const virt_base)
{
addr_t const phys = (addr_t)&_mt_idt;
addr_t const phys_base = (addr_t)&_mt_begin;
return virt_base + (phys - phys_base);
}
void Idt::setup()
{
/* TODO: Calculate from _mt_isrs label */