mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 11:16:57 +00:00
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:
parent
89add00518
commit
ecaad9ecce
@ -21,6 +21,12 @@ class Genode::Idt
|
|||||||
SYSCALL_VEC = 0x80,
|
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.
|
* 64-Bit Mode IDT gate, see Intel SDM Vol. 3A, section 6.14.1.
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#include "idt.h"
|
#include "idt.h"
|
||||||
|
|
||||||
|
extern int _mt_begin;
|
||||||
|
extern int _mt_idt;
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
class Descriptor
|
class Descriptor
|
||||||
@ -13,6 +16,13 @@ class Descriptor
|
|||||||
} __attribute__((packed));
|
} __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()
|
void Idt::setup()
|
||||||
{
|
{
|
||||||
/* TODO: Calculate from _mt_isrs label */
|
/* TODO: Calculate from _mt_isrs label */
|
||||||
|
Loading…
Reference in New Issue
Block a user