]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/IA32/S3Asm.asm
ArmPkg/CompilerIntrinsicsLib: Add uread, uwrite GCC assembly sources
[mirror_edk2.git] / QuarkPlatformPkg / Acpi / Dxe / BootScriptExecutorDxe / IA32 / S3Asm.asm
1 ;; @file
2 ; This is the assembly code for transferring to control to OS S3 waking vector
3 ; for IA32 platform
4 ;
5 ; Copyright (c) 2013-2015 Intel Corporation.
6 ;
7 ; SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 .586P
10 .model flat,C
11 .code
12
13 ;-----------------------------------------
14 ;VOID
15 ;AsmTransferControl (
16 ; IN UINT32 S3WakingVector,
17 ; IN UINT32 AcpiLowMemoryBase
18 ; );
19 ;-----------------------------------------
20
21 AsmTransferControl PROC
22 ; S3WakingVector :DWORD
23 ; AcpiLowMemoryBase :DWORD
24 push ebp
25 mov ebp, esp
26 lea eax, @F
27 push 28h ; CS
28 push eax
29 mov ecx, [ebp + 8]
30 shrd ebx, ecx, 20
31 and ecx, 0fh
32 mov bx, cx
33 mov @jmp_addr, ebx
34 retf
35 @@:
36 DB 0b8h, 30h, 0 ; mov ax, 30h as selector
37 mov ds, ax
38 mov es, ax
39 mov fs, ax
40 mov gs, ax
41 mov ss, ax
42 mov eax, cr0 ; Get control register 0
43 DB 66h
44 DB 83h, 0e0h, 0feh ; and eax, 0fffffffeh ; Clear PE bit (bit #0)
45 DB 0fh, 22h, 0c0h ; mov cr0, eax ; Activate real mode
46 DB 0eah ; jmp far @jmp_addr
47 @jmp_addr DD ?
48
49 AsmTransferControl ENDP
50
51 END