]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Acpi/Dxe/BootScriptExecutorDxe/IA32/S3Asm.S
QuarkPlatformPkg: Add new package for Galileo boards
[mirror_edk2.git] / QuarkPlatformPkg / Acpi / Dxe / BootScriptExecutorDxe / IA32 / S3Asm.S
1 ## @file
2 #
3 # Copyright (c) 2013-2015 Intel Corporation.
4 #
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
9 #
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 #-----------------------------------------
14 #VOID
15 #AsmTransferControl (
16 # IN UINT32 S3WakingVector,
17 # IN UINT32 AcpiLowMemoryBase
18 # );
19 #-----------------------------------------
20
21 ASM_GLOBAL ASM_PFX(AsmTransferControl)
22 ASM_PFX(AsmTransferControl):
23 # S3WakingVector :DWORD
24 # AcpiLowMemoryBase :DWORD
25 pushl %ebp
26 movl %esp,%ebp
27 leal LABLE, %eax
28 pushl $0x28 # CS
29 pushl %eax
30 movl 8(%ebp),%ecx
31 shrdl $20,%ecx,%ebx
32 andl $0xf,%ecx
33 movw %cx,%bx
34 movl %ebx, jmp_addr
35 lret
36 LABLE:
37 .byte 0xb8,0x30,0 # mov ax, 30h as selector
38 movw %ax,%ds
39 movw %ax,%es
40 movw %ax,%fs
41 movw %ax,%gs
42 movw %ax,%ss
43 movl %cr0, %eax # Get control register 0
44 .byte 0x66
45 .byte 0x83,0xe0,0xfe # and eax, 0fffffffeh ; Clear PE bit (bit #0)
46 .byte 0xf,0x22,0xc0 # mov cr0, eax ; Activate real mode
47 .byte 0xea # jmp far @jmp_addr
48 jmp_addr:
49 .long 0
50