4 Copyright (c) 2011 - 2012, 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.
15 #ifndef __LOAD_LINUX_LIB__
16 #define __LOAD_LINUX_LIB__
20 Verifies that the kernel setup image is valid and supported.
21 The kernel setup image should be checked before using other library
22 routines which take the kernel setup as an input.
24 @param[in] KernelSetup - The kernel setup image
25 @param[in] KernelSetupSize - The kernel setup size
27 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
28 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
29 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
34 LoadLinuxCheckKernelSetup (
36 IN UINTN KernelSetupSize
41 Gets the initial runtime size of the Linux kernel image by examining
42 the kernel setup image.
44 @param[in] KernelSetup - The kernel setup image
45 @param[in] KernelSize - The kernel size on disk.
47 @retval 0 An error occured
48 @retval !0 The initial size required by the kernel to
54 LoadLinuxGetKernelSize (
61 Loads and boots UEFI Linux.
63 Note: If successful, then this routine will not return
65 @param[in] Kernel - The main kernel image
66 @param[in,out] KernelSetup - The kernel setup image
68 @retval EFI_NOT_FOUND - The Linux kernel was not found
69 @retval EFI_INVALID_PARAMETER - Kernel or KernelSetup was NULL
70 @retval EFI_UNSUPPORTED - The Linux kernel version is not supported
77 IN OUT VOID
*KernelSetup
82 Allocates pages for the kernel setup image.
84 @param[in] Pages - The number of pages
86 @retval NULL - Unable to allocate pages
87 @retval !NULL - The address of the pages allocated
92 LoadLinuxAllocateKernelSetupPages (
98 Allocates pages for the kernel.
100 @param[in] KernelSetup - The kernel setup image
101 @param[in] Pages - The number of pages. (It is recommended to use the
102 size returned from LoadLinuxGetKernelSize.)
104 @retval NULL - Unable to allocate pages
105 @retval !NULL - The address of the pages allocated
110 LoadLinuxAllocateKernelPages (
111 IN VOID
*KernelSetup
,
117 Allocates pages for the kernel command line.
119 @param[in] Pages - The number of pages.
121 @retval NULL - Unable to allocate pages
122 @retval !NULL - The address of the pages allocated
127 LoadLinuxAllocateCommandLinePages (
133 Allocates pages for the initrd image.
135 @param[in,out] KernelSetup - The kernel setup image
136 @param[in] Pages - The number of pages.
138 @retval NULL - Unable to allocate pages
139 @retval !NULL - The address of the pages allocated
144 LoadLinuxAllocateInitrdPages (
145 IN VOID
*KernelSetup
,
151 Sets the kernel command line parameter within the setup image.
153 @param[in,out] KernelSetup - The kernel setup image
154 @param[in] CommandLine - The kernel command line
156 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
157 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
158 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
163 LoadLinuxSetCommandLine (
164 IN OUT VOID
*KernelSetup
,
165 IN CHAR8
*CommandLine
170 Sets the kernel initial ram disk pointer within the setup image.
172 @param[in,out] KernelSetup - The kernel setup image
173 @param[in] Initrd - Pointer to the initial ram disk
174 @param[in] InitrdSize - The initial ram disk image size
176 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
177 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
178 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
184 IN OUT VOID
*KernelSetup
,