diff --git a/repos/base-hw/src/core/include/spec/x86_64/idt.h b/repos/base-hw/src/core/include/spec/x86_64/idt.h index 004122f96..3980502fc 100644 --- a/repos/base-hw/src/core/include/spec/x86_64/idt.h +++ b/repos/base-hw/src/core/include/spec/x86_64/idt.h @@ -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. */ diff --git a/repos/base-hw/src/core/include/spec/x86_64/mtc_util.h b/repos/base-hw/src/core/include/spec/x86_64/mtc_util.h new file mode 100644 index 000000000..64a30d8d4 --- /dev/null +++ b/repos/base-hw/src/core/include/spec/x86_64/mtc_util.h @@ -0,0 +1,23 @@ +#ifndef _MTC_UTIL_H_ +#define _MTC_UTIL_H_ + +#include + +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_ */ diff --git a/repos/base-hw/src/core/spec/x86_64/idt.cc b/repos/base-hw/src/core/spec/x86_64/idt.cc index 10755c7da..30d666e17 100644 --- a/repos/base-hw/src/core/spec/x86_64/idt.cc +++ b/repos/base-hw/src/core/spec/x86_64/idt.cc @@ -1,19 +1,13 @@ #include +#include #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 */