Fix the bug that EntryPoint of DisablePaging64() is corrupted.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7250 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -51,6 +51,8 @@ L1:
|
|||||||
mov %cr0,%rax
|
mov %cr0,%rax
|
||||||
btr $0x1f,%eax
|
btr $0x1f,%eax
|
||||||
mov %rax,%cr0 # disable paging
|
mov %rax,%cr0 # disable paging
|
||||||
|
|
||||||
|
mov %rdx,%rbx # save EntryPoint to rbx, for rdmsr will overwrite rdx
|
||||||
mov $0xc0000080,%ecx
|
mov $0xc0000080,%ecx
|
||||||
rdmsr
|
rdmsr
|
||||||
and $0xfe,%ah # clear LME
|
and $0xfe,%ah # clear LME
|
||||||
@@ -60,6 +62,6 @@ L1:
|
|||||||
mov %rax,%cr4
|
mov %rax,%cr4
|
||||||
push %rdi # push Context2
|
push %rdi # push Context2
|
||||||
push %rsi # push Context1
|
push %rsi # push Context1
|
||||||
callq *%rdx # transfer control to EntryPoint
|
callq *%rbx # transfer control to EntryPoint
|
||||||
jmp . # no one should get here
|
jmp . # no one should get here
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;
|
;
|
||||||
; Copyright (c) 2006, Intel Corporation
|
; Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
; All rights reserved. This program and the accompanying materials
|
; All rights reserved. This program and the accompanying materials
|
||||||
; are licensed and made available under the terms and conditions of the BSD License
|
; are licensed and made available under the terms and conditions of the BSD License
|
||||||
; which accompanies this distribution. The full text of the license may be found at
|
; which accompanies this distribution. The full text of the license may be found at
|
||||||
@@ -49,6 +49,8 @@ InternalX86DisablePaging64 PROC
|
|||||||
mov rax, cr0
|
mov rax, cr0
|
||||||
btr eax, 31
|
btr eax, 31
|
||||||
mov cr0, rax ; disable paging
|
mov cr0, rax ; disable paging
|
||||||
|
|
||||||
|
mov rbx, rdx ; save EntryPoint to rbx, for rdmsr will overwrite rdx
|
||||||
mov ecx, 0c0000080h
|
mov ecx, 0c0000080h
|
||||||
rdmsr
|
rdmsr
|
||||||
and ah, NOT 1 ; clear LME
|
and ah, NOT 1 ; clear LME
|
||||||
@@ -58,7 +60,7 @@ InternalX86DisablePaging64 PROC
|
|||||||
mov cr4, rax
|
mov cr4, rax
|
||||||
push rdi ; push Context2
|
push rdi ; push Context2
|
||||||
push rsi ; push Context1
|
push rsi ; push Context1
|
||||||
call rdx ; transfer control to EntryPoint
|
call rbx ; transfer control to EntryPoint
|
||||||
hlt ; no one should get here
|
hlt ; no one should get here
|
||||||
InternalX86DisablePaging64 ENDP
|
InternalX86DisablePaging64 ENDP
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user