]>
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 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __LOAD_LINUX_LIB__
10 #define __LOAD_LINUX_LIB__
13 Verifies that the kernel setup image is valid and supported.
14 The kernel setup image should be checked before using other library
15 routines which take the kernel setup as an input.
17 @param[in] KernelSetup - The kernel setup image
18 @param[in] KernelSetupSize - The kernel setup size
20 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
21 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
22 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
27 LoadLinuxCheckKernelSetup (
29 IN UINTN KernelSetupSize
33 Gets the initial runtime size of the Linux kernel image by examining
34 the kernel setup image.
36 @param[in] KernelSetup - The kernel setup image
37 @param[in] KernelSize - The kernel size on disk.
39 @retval 0 An error occurred
40 @retval !0 The initial size required by the kernel to
46 LoadLinuxGetKernelSize (
52 Loads and boots UEFI Linux.
54 Note: If successful, then this routine will not return
56 @param[in] Kernel - The main kernel image
57 @param[in,out] KernelSetup - The kernel setup image
59 @retval EFI_NOT_FOUND - The Linux kernel was not found
60 @retval EFI_INVALID_PARAMETER - Kernel or KernelSetup was NULL
61 @retval EFI_UNSUPPORTED - The Linux kernel version is not supported
68 IN OUT VOID
*KernelSetup
72 Allocates pages for the kernel setup image.
74 @param[in] Pages - The number of pages
76 @retval NULL - Unable to allocate pages
77 @retval !NULL - The address of the pages allocated
82 LoadLinuxAllocateKernelSetupPages (
87 Clears the uninitialised space before and after the struct setup_header
88 in the kernel setup image. The kernel requires that these be zeroed
89 unless explicitly initialised, so this function should be called after
90 the setup_header has been copied in from a bzImage, before setting up
93 @param[in] KernelSetup - The kernel setup image
95 @retval EFI_SUCCESS - The Linux kernel setup was successfully initialized
96 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
97 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
102 LoadLinuxInitializeKernelSetup (
107 Allocates pages for the kernel.
109 @param[in] KernelSetup - The kernel setup image
110 @param[in] Pages - The number of pages. (It is recommended to use the
111 size returned from LoadLinuxGetKernelSize.)
113 @retval NULL - Unable to allocate pages
114 @retval !NULL - The address of the pages allocated
119 LoadLinuxAllocateKernelPages (
120 IN VOID
*KernelSetup
,
125 Allocates pages for the kernel command line.
127 @param[in] Pages - The number of pages.
129 @retval NULL - Unable to allocate pages
130 @retval !NULL - The address of the pages allocated
135 LoadLinuxAllocateCommandLinePages (
140 Allocates pages for the initrd image.
142 @param[in,out] KernelSetup - The kernel setup image
143 @param[in] Pages - The number of pages.
145 @retval NULL - Unable to allocate pages
146 @retval !NULL - The address of the pages allocated
151 LoadLinuxAllocateInitrdPages (
152 IN VOID
*KernelSetup
,
157 Sets the kernel command line parameter within the setup image.
159 @param[in,out] KernelSetup - The kernel setup image
160 @param[in] CommandLine - The kernel command line
162 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
163 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
164 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
169 LoadLinuxSetCommandLine (
170 IN OUT VOID
*KernelSetup
,
171 IN CHAR8
*CommandLine
175 Sets the kernel initial ram disk pointer within the setup image.
177 @param[in,out] KernelSetup - The kernel setup image
178 @param[in] Initrd - Pointer to the initial ram disk
179 @param[in] InitrdSize - The initial ram disk image size
181 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
182 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
183 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
189 IN OUT VOID
*KernelSetup
,