2 # This is the assembly code for transferring to control to OS S3 waking vector
5 # Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
7 # This program and the accompanying materials are
8 # licensed and made available under the terms and conditions of the BSD License
9 # which accompanies this distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 ASM_GLOBAL ASM_PFX(AsmTransferControl)
18 ASM_PFX(AsmTransferControl):
19 # rcx S3WakingVector :DWORD
20 # rdx AcpiLowMemoryBase :DWORD
21 lea _AsmTransferControl_al_0000, %eax
22 movq $0x2800000000, %r8
30 _AsmTransferControl_al_0000:
31 .byte 0x0b8, 0x30, 0 # mov ax, 30h as selector
40 andl $0x7ffffffe, %eax
44 movl $0x0c0000080, %ecx
49 .byte 0x0ea # jmp far jmp_addr
53 ASM_GLOBAL ASM_PFX(AsmTransferControl32)
54 ASM_PFX(AsmTransferControl32):
55 # S3WakingVector :DWORD
56 # AcpiLowMemoryBase :DWORD
59 .byte 0x8d, 0x05 # lea eax, AsmTransferControl16
60 ASM_GLOBAL ASM_PFX(AsmFixAddress16)
61 ASM_PFX(AsmFixAddress16):
67 ASM_GLOBAL ASM_PFX(AsmTransferControl16)
68 ASM_PFX(AsmTransferControl16):
69 .byte 0xb8,0x30,0 # mov ax, 30h as selector
75 movq %cr0, %rax # Get control register 0
77 .byte 0x83,0xe0,0xfe # and eax, 0fffffffeh ; Clear PE bit (bit #0)
78 .byte 0xf,0x22,0xc0 # mov cr0, eax ; Activate real mode
79 .byte 0xea # jmp far AsmJmpAddr32
80 ASM_GLOBAL ASM_PFX(AsmJmpAddr32)
81 ASM_PFX(AsmJmpAddr32):