mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
hw_x86_64: Make _virt_idt_addr member more generic
Add label argument to function and rename it to _virt_mtc_addr. It can be used to retrieve the virtual mtc address of any given label.
This commit is contained in:
parent
b8e2249f51
commit
bf5118fe54
@ -22,10 +22,12 @@ class Genode::Idt
|
||||
};
|
||||
|
||||
/**
|
||||
* Return virtual address of the IDT for given virtual mode transition
|
||||
* base.
|
||||
* Return virtual mtc address of the given label for the specified
|
||||
* virtual mode transition base.
|
||||
*
|
||||
* \param virt_base virtual address of the mode transition pages
|
||||
*/
|
||||
static addr_t _virt_idt_addr(addr_t const virt_base);
|
||||
static addr_t _virt_mtc_addr(addr_t const virt_base, addr_t const label);
|
||||
|
||||
/**
|
||||
* 64-Bit Mode IDT gate, see Intel SDM Vol. 3A, section 6.14.1.
|
||||
|
@ -16,11 +16,10 @@ class Descriptor
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
addr_t Idt::_virt_idt_addr(addr_t const virt_base)
|
||||
addr_t Idt::_virt_mtc_addr(addr_t const virt_base, addr_t const label)
|
||||
{
|
||||
addr_t const phys = (addr_t)&_mt_idt;
|
||||
addr_t const phys_base = (addr_t)&_mt_begin;
|
||||
return virt_base + (phys - phys_base);
|
||||
return virt_base + (label - phys_base);
|
||||
}
|
||||
|
||||
void Idt::setup()
|
||||
@ -47,5 +46,5 @@ void Idt::setup()
|
||||
void Idt::load(addr_t const virt_base)
|
||||
{
|
||||
asm volatile ("lidt %0" : : "m" (Descriptor (sizeof(_table) - 1,
|
||||
_virt_idt_addr(virt_base))));
|
||||
_virt_mtc_addr(virt_base, (addr_t)&_mt_idt))));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user