]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/S3Asm.asm
MdeModulePkg BootScriptExecutorDxe: EXTERNDEF=>PUBLIC in S3Asm
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / BootScriptExecutorDxe / IA32 / S3Asm.asm
CommitLineData
be46cd5f 1;; @file\r
2; This is the assembly code for transferring to control to OS S3 waking vector\r
3; for IA32 platform\r
4;\r
5; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
6;\r
7; This program and the accompanying materials\r
8; are licensed and made available under the terms and conditions of the BSD License\r
9; which accompanies this distribution. The full text of the license may be found at\r
10; http://opensource.org/licenses/bsd-license.php\r
11;\r
12; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14;\r
15;;\r
16 .586P\r
17 .model flat,C\r
18 .code\r
19\r
5262695c
JJ
20PUBLIC AsmFixAddress16\r
21PUBLIC AsmJmpAddr32\r
be46cd5f 22 \r
23;-----------------------------------------\r
24;VOID\r
25;AsmTransferControl (\r
26; IN UINT32 S3WakingVector,\r
27; IN UINT32 AcpiLowMemoryBase\r
28; );\r
29;-----------------------------------------\r
30 \r
31AsmTransferControl PROC\r
32 ; S3WakingVector :DWORD\r
33 ; AcpiLowMemoryBase :DWORD\r
34 push ebp\r
35 mov ebp, esp \r
36 lea eax, @F\r
37 push 28h ; CS\r
38 push eax\r
39 mov ecx, [ebp + 8]\r
40 shrd ebx, ecx, 20\r
41 and ecx, 0fh \r
42 mov bx, cx \r
a2308456 43 mov [@jmp_addr], ebx\r
be46cd5f 44 retf\r
45@@:\r
46 DB 0b8h, 30h, 0 ; mov ax, 30h as selector\r
47 mov ds, ax\r
48 mov es, ax\r
49 mov fs, ax\r
50 mov gs, ax\r
51 mov ss, ax\r
52 mov eax, cr0 ; Get control register 0 \r
53 DB 66h\r
54 DB 83h, 0e0h, 0feh ; and eax, 0fffffffeh ; Clear PE bit (bit #0)\r
55 DB 0fh, 22h, 0c0h ; mov cr0, eax ; Activate real mode\r
56 DB 0eah ; jmp far @jmp_addr\r
57@jmp_addr DD ?\r
58\r
59AsmTransferControl ENDP\r
60\r
61AsmTransferControl32 PROC\r
62 jmp AsmTransferControl\r
63AsmTransferControl32 ENDP\r
64\r
65; dummy\r
66AsmTransferControl16 PROC\r
67AsmFixAddress16 DD ?\r
68AsmJmpAddr32 DD ?\r
69AsmTransferControl16 ENDP\r
70\r
71 END