Fix the risk of AP stack conflict.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10714 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2010-07-30 01:49:51 +00:00
parent 28d1916584
commit d6d858c4b7
8 changed files with 98 additions and 95 deletions

View File

@@ -22,6 +22,7 @@
#define GdtrProfile RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x10
#define IdtrProfile RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x16
#define BufferStart RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x1C
#define ProcessorNumber, RendezvousFunnelProcEnd - RendezvousFunnelProcStart + 0x20
#-------------------------------------------------------------------------------------
#RendezvousFunnelProc procedure follows. All APs execute their procedure. This
@@ -94,30 +95,33 @@ ProtectedModeStart: # protected mode entry point
.byte 0x66
movw %ax,%ss # Flat mode setup.
#
# ProgramStack
#
movl $0x1b, %ecx
rdmsr
andl $0xfffff000, %eax
addl $0x20, %eax
movl (%eax), %ebx
shrl $24, %ebx
xorl %ecx, %ecx
movl %esi,%edi
addl $LockLocation, %edi
movb $NotVacantFlag, %al
TestLock:
xchgb (%edi), %al
cmpb $NotVacantFlag, %al
jz TestLock
addl $ProcessorNumber, %edi
movl (%edi, %ebx, 4), %ecx
ProgramStack:
movl %esi,%edi
addl $StackSize, %edi
movl (%edi), %eax
incl %ecx
mull %ecx
movl %esi,%edi
addl $StackStart, %edi
addl (%edi), %eax
movl %eax,%esp
movl %eax, (%edi)
movl (%edi), %ebx
addl %ebx, %eax
Releaselock:
movb $VacantFlag, %al
movl %esi,%edi
addl $LockLocation, %edi
xchgb (%edi), %al
movl %eax, %esp
#
# Call C Function