Eliminate EFI_IMAGE_MACHINE_TYPE_SUPPORTED.

Move Gdt initialization from InitializeMpServiceData() to CPU Arch specific function.
We create SmmFuncsArch.c for hold CPU specific function, so that
EFI_IMAGE_MACHINE_TYPE_SUPPORTED(EFI_IMAGE_MACHINE_X64) can be removed.

For IA32 version, we always allocate new page for GDT entry, for easy maintenance.
For X64 version, we fixed TssBase in GDT entry to make sure TSS data is correct.
Remove TSS fixup for GDT in ASM file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18937 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yao, Jiewen
2015-11-25 04:23:01 +00:00
committed by jyao1
parent 02f02b16e2
commit fe5f194943
7 changed files with 186 additions and 96 deletions

View File

@@ -128,14 +128,6 @@ ASM_PFX(gSmiCr3): .space 4
sgdt (%rsp)
movl 2(%rsp), %eax # eax = GDT base
addl $8, %esp
movl %eax, %edx
addl $GDT_SIZE, %edx
movb %dl, (TSS_SEGMENT + 2)(%rax)
movb %dh, (TSS_SEGMENT + 3)(%rax)
.byte 0xc1, 0xea, 0x10 # shr edx, 16
movb %dl, (TSS_SEGMENT + 4)(%rax)
movb %dh, (TSS_SEGMENT + 7)(%rax)
movl %eax, %edx
movb $0x89, %dl
movb %dl, (TSS_SEGMENT + 5)(%rax) # clear busy flag
movl $TSS_SEGMENT, %eax