--- /dev/null
+;; @file\r
+; This is the assembly code for transferring to control to OS S3 waking vector\r
+; for IA32 platform\r
+;\r
+; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+;\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution. The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;;\r
+ SECTION .text\r
+\r
+global ASM_PFX(AsmFixAddress16)\r
+global ASM_PFX(AsmJmpAddr32)\r
+\r
+;-----------------------------------------\r
+;VOID\r
+;AsmTransferControl (\r
+; IN UINT32 S3WakingVector,\r
+; IN UINT32 AcpiLowMemoryBase\r
+; );\r
+;-----------------------------------------\r
+\r
+global ASM_PFX(AsmTransferControl)\r
+ASM_PFX(AsmTransferControl):\r
+ ; S3WakingVector :DWORD\r
+ ; AcpiLowMemoryBase :DWORD\r
+ push ebp\r
+ mov ebp, esp\r
+ lea eax, [.0]\r
+ push 0x28 ; CS\r
+ push eax\r
+ mov ecx, [ebp + 8]\r
+ shrd ebx, ecx, 20\r
+ and ecx, 0xf\r
+ mov bx, cx\r
+ mov [@jmp_addr], ebx\r
+ retf\r
+.0:\r
+ DB 0xb8, 0x30, 0 ; mov ax, 30h as selector\r
+ mov ds, ax\r
+ mov es, ax\r
+ mov fs, ax\r
+ mov gs, ax\r
+ mov ss, ax\r
+ mov eax, cr0 ; Get control register 0\r
+ DB 0x66\r
+ DB 0x83, 0xe0, 0xfe ; and eax, 0fffffffeh ; Clear PE bit (bit #0)\r
+ DB 0xf, 0x22, 0xc0 ; mov cr0, eax ; Activate real mode\r
+ DB 0xea ; jmp far @jmp_addr\r
+@jmp_addr: DD 0\r
+\r
+global ASM_PFX(AsmTransferControl32)\r
+ASM_PFX(AsmTransferControl32):\r
+ jmp ASM_PFX(AsmTransferControl)\r
+\r
+; dummy\r
+global ASM_PFX(AsmTransferControl16)\r
+ASM_PFX(AsmTransferControl16):\r
+ASM_PFX(AsmFixAddress16): DD 0\r
+ASM_PFX(AsmJmpAddr32): DD 0\r
+\r