diff options
author | Liming Gao <liming.gao@intel.com> | 2016-06-12 16:25:20 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2016-06-28 09:52:00 +0800 |
commit | 9fa08ee485f87302dc4fdefbf6b6823382594b0b (patch) | |
tree | 5514bed3f879e2a275505c412b528cf6fe991294 | |
parent | 0ed65cc2f998afadc2edf6f9c18f847fb928c492 (diff) | |
download | edk2-9fa08ee485f87302dc4fdefbf6b6823382594b0b.tar.gz edk2-9fa08ee485f87302dc4fdefbf6b6823382594b0b.tar.bz2 edk2-9fa08ee485f87302dc4fdefbf6b6823382594b0b.zip |
MdeModulePkg BootScriptExecutorDxe: Convert IA32/S3Asm.asm to NASM
Use real nasm instruction to replace DB bytes.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.nasm | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.nasm b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.nasm index 3687e64409..cedc11a066 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.nasm +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.nasm @@ -39,21 +39,22 @@ ASM_PFX(AsmTransferControl): shrd ebx, ecx, 20
and ecx, 0xf
mov bx, cx
- mov [@jmp_addr], ebx
+ mov [@jmp_addr + 1], ebx
retf
+
+BITS 16
.0:
- DB 0xb8, 0x30, 0 ; mov ax, 30h as selector
- mov ds, ax
- mov es, ax
- mov fs, ax
- mov gs, ax
- mov ss, ax
+ mov ax, 0x30
+o32 mov ds, eax
+o32 mov es, eax
+o32 mov fs, eax
+o32 mov gs, eax
+o32 mov ss, eax
mov eax, cr0 ; Get control register 0
- DB 0x66
- DB 0x83, 0xe0, 0xfe ; and eax, 0fffffffeh ; Clear PE bit (bit #0)
- DB 0xf, 0x22, 0xc0 ; mov cr0, eax ; Activate real mode
- DB 0xea ; jmp far @jmp_addr
-@jmp_addr: DD 0
+ and eax, 0x0fffffffe ; Clear PE bit (bit #0)
+ mov cr0, eax ; Activate real mode
+@jmp_addr:
+ jmp 0x0:0x0
global ASM_PFX(AsmTransferControl32)
ASM_PFX(AsmTransferControl32):
|