]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/IA32/S3Asm.S
QuarkPlatformPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / QuarkPlatformPkg / Acpi / Dxe / BootScriptExecutorDxe / IA32 / S3Asm.S
1 ## @file
2 #
3 # Copyright (c) 2013-2015 Intel Corporation.
4 #
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 #-----------------------------------------
8 #VOID
9 #AsmTransferControl (
10 # IN UINT32 S3WakingVector,
11 # IN UINT32 AcpiLowMemoryBase
12 # );
13 #-----------------------------------------
14
15 ASM_GLOBAL ASM_PFX(AsmTransferControl)
16 ASM_PFX(AsmTransferControl):
17 # S3WakingVector :DWORD
18 # AcpiLowMemoryBase :DWORD
19 pushl %ebp
20 movl %esp,%ebp
21 leal LABLE, %eax
22 pushl $0x28 # CS
23 pushl %eax
24 movl 8(%ebp),%ecx
25 shrdl $20,%ecx,%ebx
26 andl $0xf,%ecx
27 movw %cx,%bx
28 movl %ebx, jmp_addr
29 lret
30 LABLE:
31 .byte 0xb8,0x30,0 # mov ax, 30h as selector
32 movw %ax,%ds
33 movw %ax,%es
34 movw %ax,%fs
35 movw %ax,%gs
36 movw %ax,%ss
37 movl %cr0, %eax # Get control register 0
38 .byte 0x66
39 .byte 0x83,0xe0,0xfe # and eax, 0fffffffeh ; Clear PE bit (bit #0)
40 .byte 0xf,0x22,0xc0 # mov cr0, eax ; Activate real mode
41 .byte 0xea # jmp far @jmp_addr
42 jmp_addr:
43 .long 0
44