mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 13:47:56 +00:00
hw_x86_64: Factor out _virt_mtc_addr to mtc_util.h header
This commit is contained in:
parent
cfe89996e8
commit
251b270e4b
@ -21,14 +21,6 @@ class Genode::Idt
|
||||
SYSCALL_VEC = 0x80,
|
||||
};
|
||||
|
||||
/**
|
||||
* 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_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.
|
||||
*/
|
||||
|
23
repos/base-hw/src/core/include/spec/x86_64/mtc_util.h
Normal file
23
repos/base-hw/src/core/include/spec/x86_64/mtc_util.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef _MTC_UTIL_H_
|
||||
#define _MTC_UTIL_H_
|
||||
|
||||
#include <base/stdint.h>
|
||||
|
||||
extern int _mt_begin;
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
/**
|
||||
* Return virtual mtc address of the given label for the specified
|
||||
* virtual mode transition base.
|
||||
*
|
||||
* \param virt_base virtual base of the mode transition pages
|
||||
*/
|
||||
static addr_t _virt_mtc_addr(addr_t const virt_base, addr_t const label)
|
||||
{
|
||||
addr_t const phys_base = (addr_t)&_mt_begin;
|
||||
return virt_base + (label - phys_base);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _MTC_UTIL_H_ */
|
@ -1,19 +1,13 @@
|
||||
#include <pseudo_descriptor.h>
|
||||
#include <mtc_util.h>
|
||||
|
||||
#include "idt.h"
|
||||
|
||||
extern int _mt_begin;
|
||||
extern int _mt_idt;
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
addr_t Idt::_virt_mtc_addr(addr_t const virt_base, addr_t const label)
|
||||
{
|
||||
addr_t const phys_base = (addr_t)&_mt_begin;
|
||||
return virt_base + (label - phys_base);
|
||||
}
|
||||
|
||||
void Idt::setup()
|
||||
{
|
||||
/* TODO: Calculate from _mt_isrs label */
|
||||
|
Loading…
Reference in New Issue
Block a user