hw_x86_64: Calculate limit using _mt_gdt_end in Gdt::load

This commit is contained in:
Reto Buerki 2015-02-27 10:54:11 +01:00 committed by Christian Helmuth
parent 6f5ea78a51
commit 1102b2b562
2 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,7 @@
#include <mtc_util.h>
extern int _mt_gdt_start;
extern int _mt_gdt_end;
namespace Genode
{
@ -26,8 +27,9 @@ class Genode::Gdt
*/
static void load(addr_t const virt_base)
{
asm volatile ("lgdt %0" : : "m" (Pseudo_descriptor (0x37,
_virt_mtc_addr(virt_base, (addr_t)&_mt_gdt_start))));
asm volatile ("lgdt %0" : : "m" (Pseudo_descriptor
(_mt_gdt_end - _mt_gdt_start - 1,
_virt_mtc_addr(virt_base, (addr_t)&_mt_gdt_start))));
}
};

View File

@ -300,6 +300,7 @@
.long 0x8900
.long 0
.long 0
.global _mt_gdt_end
_mt_gdt_end:
/* end of the mode transition code */