]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/Library/LoadLinuxLib.h
4 Copyright (c) 2011 - 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.
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 occurred
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 Clears the uninitialised space before and after the struct setup_header
99 in the kernel setup image. The kernel requires that these be zeroed
100 unless explicitly initialised, so this function should be called after
101 the setup_header has been copied in from a bzImage, before setting up
104 @param[in] KernelSetup - The kernel setup image
106 @retval EFI_SUCCESS - The Linux kernel setup was successfully initialized
107 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
108 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
113 LoadLinuxInitializeKernelSetup (
118 Allocates pages for the kernel.
120 @param[in] KernelSetup - The kernel setup image
121 @param[in] Pages - The number of pages. (It is recommended to use the
122 size returned from LoadLinuxGetKernelSize.)
124 @retval NULL - Unable to allocate pages
125 @retval !NULL - The address of the pages allocated
130 LoadLinuxAllocateKernelPages (
131 IN VOID
*KernelSetup
,
137 Allocates pages for the kernel command line.
139 @param[in] Pages - The number of pages.
141 @retval NULL - Unable to allocate pages
142 @retval !NULL - The address of the pages allocated
147 LoadLinuxAllocateCommandLinePages (
153 Allocates pages for the initrd image.
155 @param[in,out] KernelSetup - The kernel setup image
156 @param[in] Pages - The number of pages.
158 @retval NULL - Unable to allocate pages
159 @retval !NULL - The address of the pages allocated
164 LoadLinuxAllocateInitrdPages (
165 IN VOID
*KernelSetup
,
171 Sets the kernel command line parameter within the setup image.
173 @param[in,out] KernelSetup - The kernel setup image
174 @param[in] CommandLine - The kernel command line
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
183 LoadLinuxSetCommandLine (
184 IN OUT VOID
*KernelSetup
,
185 IN CHAR8
*CommandLine
190 Sets the kernel initial ram disk pointer within the setup image.
192 @param[in,out] KernelSetup - The kernel setup image
193 @param[in] Initrd - Pointer to the initial ram disk
194 @param[in] InitrdSize - The initial ram disk image size
196 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
197 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
198 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
204 IN OUT VOID
*KernelSetup
,