fixed one bug that old rsp was calculate incorrectly.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9745 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2010-01-14 05:49:16 +00:00
parent b1a803d153
commit c7a5da72f0
2 changed files with 32 additions and 32 deletions

View File

@ -1,7 +1,7 @@
///**@file ///**@file
// Low leve x64 specific debug support functions. // Low leve x64 specific debug support functions.
// //
// Copyright (c) 2006 - 2009, Intel Corporation // Copyright (c) 2006 - 2010, Intel Corporation
// Portions copyright (c) 2008-2009 Apple Inc. All rights reserved. // Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.
// 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
@ -263,10 +263,10 @@ ExtraPushDone:
movq 24(%rsp), %rax movq 24(%rsp), %rax
movq %rax, ASM_PFX(DebugRsp)(%rip) movq %rax, ASM_PFX(DebugRsp)(%rip)
movq ASM_PFX(AppRsp)(%rip), %rax movq ASM_PFX(AppRsp)(%rip), %rax
addq $40, %rax movq 24(%rax), %rax
# application stack has ss, rsp, rflags, cs, & rip, so # application stack has ss, rsp, rflags, cs, & rip, so
# last actual application stack entry is 40 bytes # last actual application stack entry is saved at offset
# into the application stack. # 24 bytes from stack top.
movq %rax, 24(%rsp) movq %rax, 24(%rsp)
// continue building context record // continue building context record
@ -445,7 +445,7 @@ ExtraPushDone:
movq 24(%rsp), %rbx # move the potentially modified AppRsp into rbx movq 24(%rsp), %rbx # move the potentially modified AppRsp into rbx
movq ASM_PFX(AppRsp)(%rip), %rax movq ASM_PFX(AppRsp)(%rip), %rax
addq $40, %rax movq 24(%rax), %rax
cmpq %rax, %rbx cmpq %rax, %rbx
je NoAppStackMove je NoAppStackMove

View File

@ -1,7 +1,7 @@
;/** @file ;/** @file
; Low level x64 routines used by the debug support driver. ; Low level x64 routines used by the debug support driver.
; ;
; Copyright (c) 2007 - 2008, Intel Corporation. ; Copyright (c) 2007 - 2010, 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
@ -296,10 +296,10 @@ ExtraPushDone:
mov rax, [rsp + 24] mov rax, [rsp + 24]
mov DebugRsp, rax mov DebugRsp, rax
mov rax, AppRsp mov rax, AppRsp
add rax, 40 mov rax, QWORD PTR [rax + 24]
; application stack has ss, rsp, rflags, cs, & rip, so ; application stack has ss, rsp, rflags, cs, & rip, so
; last actual application stack entry is ; last actual application stack entry is saved at offset
; 40 bytes into the application stack. ; 24 bytes from stack top.
mov [rsp + 24], rax mov [rsp + 24], rax
;; continue building context record ;; continue building context record
@ -482,7 +482,7 @@ ExtraPushDone:
mov rbx, [rsp + 24] ; move the potentially modified AppRsp into rbx mov rbx, [rsp + 24] ; move the potentially modified AppRsp into rbx
mov rax, AppRsp mov rax, AppRsp
add rax, 40 mov rax, QWORD PTR [rax + 24]
cmp rbx, rax cmp rbx, rax
je NoAppStackMove je NoAppStackMove