hw_x86_64: Calculate limit using _mt_gdt_end in Gdt::load
This commit is contained in:
parent
6f5ea78a51
commit
1102b2b562
|
@ -5,6 +5,7 @@
|
||||||
#include <mtc_util.h>
|
#include <mtc_util.h>
|
||||||
|
|
||||||
extern int _mt_gdt_start;
|
extern int _mt_gdt_start;
|
||||||
|
extern int _mt_gdt_end;
|
||||||
|
|
||||||
namespace Genode
|
namespace Genode
|
||||||
{
|
{
|
||||||
|
@ -26,8 +27,9 @@ class Genode::Gdt
|
||||||
*/
|
*/
|
||||||
static void load(addr_t const virt_base)
|
static void load(addr_t const virt_base)
|
||||||
{
|
{
|
||||||
asm volatile ("lgdt %0" : : "m" (Pseudo_descriptor (0x37,
|
asm volatile ("lgdt %0" : : "m" (Pseudo_descriptor
|
||||||
_virt_mtc_addr(virt_base, (addr_t)&_mt_gdt_start))));
|
(_mt_gdt_end - _mt_gdt_start - 1,
|
||||||
|
_virt_mtc_addr(virt_base, (addr_t)&_mt_gdt_start))));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,7 @@
|
||||||
.long 0x8900
|
.long 0x8900
|
||||||
.long 0
|
.long 0
|
||||||
.long 0
|
.long 0
|
||||||
|
.global _mt_gdt_end
|
||||||
_mt_gdt_end:
|
_mt_gdt_end:
|
||||||
|
|
||||||
/* end of the mode transition code */
|
/* end of the mode transition code */
|
||||||
|
|
Loading…
Reference in New Issue