]>
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__
14 Verifies that the kernel setup image is valid and supported.
15 The kernel setup image should be checked before using other library
16 routines which take the kernel setup as an input.
18 @param[in] KernelSetup - The kernel setup image
19 @param[in] KernelSetupSize - The kernel setup size
21 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
22 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
23 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
28 LoadLinuxCheckKernelSetup (
30 IN UINTN KernelSetupSize
35 Gets the initial runtime size of the Linux kernel image by examining
36 the kernel setup image.
38 @param[in] KernelSetup - The kernel setup image
39 @param[in] KernelSize - The kernel size on disk.
41 @retval 0 An error occurred
42 @retval !0 The initial size required by the kernel to
48 LoadLinuxGetKernelSize (
55 Loads and boots UEFI Linux.
57 Note: If successful, then this routine will not return
59 @param[in] Kernel - The main kernel image
60 @param[in,out] KernelSetup - The kernel setup image
62 @retval EFI_NOT_FOUND - The Linux kernel was not found
63 @retval EFI_INVALID_PARAMETER - Kernel or KernelSetup was NULL
64 @retval EFI_UNSUPPORTED - The Linux kernel version is not supported
71 IN OUT VOID
*KernelSetup
76 Allocates pages for the kernel setup image.
78 @param[in] Pages - The number of pages
80 @retval NULL - Unable to allocate pages
81 @retval !NULL - The address of the pages allocated
86 LoadLinuxAllocateKernelSetupPages (
92 Clears the uninitialised space before and after the struct setup_header
93 in the kernel setup image. The kernel requires that these be zeroed
94 unless explicitly initialised, so this function should be called after
95 the setup_header has been copied in from a bzImage, before setting up
98 @param[in] KernelSetup - The kernel setup image
100 @retval EFI_SUCCESS - The Linux kernel setup was successfully initialized
101 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
102 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
107 LoadLinuxInitializeKernelSetup (
112 Allocates pages for the kernel.
114 @param[in] KernelSetup - The kernel setup image
115 @param[in] Pages - The number of pages. (It is recommended to use the
116 size returned from LoadLinuxGetKernelSize.)
118 @retval NULL - Unable to allocate pages
119 @retval !NULL - The address of the pages allocated
124 LoadLinuxAllocateKernelPages (
125 IN VOID
*KernelSetup
,
131 Allocates pages for the kernel command line.
133 @param[in] Pages - The number of pages.
135 @retval NULL - Unable to allocate pages
136 @retval !NULL - The address of the pages allocated
141 LoadLinuxAllocateCommandLinePages (
147 Allocates pages for the initrd image.
149 @param[in,out] KernelSetup - The kernel setup image
150 @param[in] Pages - The number of pages.
152 @retval NULL - Unable to allocate pages
153 @retval !NULL - The address of the pages allocated
158 LoadLinuxAllocateInitrdPages (
159 IN VOID
*KernelSetup
,
165 Sets the kernel command line parameter within the setup image.
167 @param[in,out] KernelSetup - The kernel setup image
168 @param[in] CommandLine - The kernel command line
170 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
171 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
172 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
177 LoadLinuxSetCommandLine (
178 IN OUT VOID
*KernelSetup
,
179 IN CHAR8
*CommandLine
184 Sets the kernel initial ram disk pointer within the setup image.
186 @param[in,out] KernelSetup - The kernel setup image
187 @param[in] Initrd - Pointer to the initial ram disk
188 @param[in] InitrdSize - The initial ram disk image size
190 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported
191 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL
192 @retval EFI_UNSUPPORTED - The Linux kernel is not supported
198 IN OUT VOID
*KernelSetup
,