1 #------------------------------------------------------------------------------
3 # Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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.
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.
13 #------------------------------------------------------------------------------
15 ASM_GLOBAL ASM_PFX(JumpToKernel)
16 ASM_GLOBAL ASM_PFX(JumpToUefiKernel)
18 #------------------------------------------------------------------------------
22 # VOID *KernelStart, // %rcx
23 # VOID *KernelBootParams // %rdx
25 #------------------------------------------------------------------------------
26 ASM_PFX(JumpToKernel):
28 // Set up for executing kernel. BP in %esi, entry point on the stack
29 // (64-bit when the 'ret' will use it as 32-bit, but we're little-endian)
33 // Jump into the compatibility mode CS
37 .byte 0x48, 0xcb // retfq
39 1: // Now in compatibility mode
53 // Disable long mode in EFER
54 movl $0x0c0000080, %ecx
64 // Zero registers and 'return' to kernel
71 #------------------------------------------------------------------------------
75 # EFI_HANDLE ImageHandle, // rcx
76 # EFI_SYSTEM_TABLE *SystemTable, // rdx
77 # VOID *KernelBootParams, // r8
78 # VOID *KernelStart // r9
80 #------------------------------------------------------------------------------
81 ASM_PFX(JumpToUefiKernel):