]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/LoadLinuxLib.h
OvmfPkg: LoadLinuxLib: Fix check for relocatable kernel
[mirror_edk2.git] / OvmfPkg / Include / Library / LoadLinuxLib.h
CommitLineData
f6c6c020 1/** @file\r
2 Load/boot UEFI Linux.\r
3\r
4 Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __LOAD_LINUX_LIB__\r
16#define __LOAD_LINUX_LIB__\r
17\r
18\r
19/**\r
20 Verifies that the kernel setup image is valid and supported.\r
21 The kernel setup image should be checked before using other library\r
22 routines which take the kernel setup as an input.\r
23\r
24 @param[in] KernelSetup - The kernel setup image\r
25 @param[in] KernelSetupSize - The kernel setup size\r
26\r
27 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported\r
28 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL\r
29 @retval EFI_UNSUPPORTED - The Linux kernel is not supported\r
30\r
31**/\r
32EFI_STATUS\r
33EFIAPI\r
34LoadLinuxCheckKernelSetup (\r
35 IN VOID *KernelSetup,\r
36 IN UINTN KernelSetupSize\r
37 );\r
38\r
39\r
40/**\r
41 Gets the initial runtime size of the Linux kernel image by examining\r
42 the kernel setup image.\r
43\r
44 @param[in] KernelSetup - The kernel setup image\r
45 @param[in] KernelSize - The kernel size on disk.\r
46\r
47 @retval 0 An error occured\r
48 @retval !0 The initial size required by the kernel to\r
49 begin execution.\r
50\r
51**/\r
52UINTN\r
53EFIAPI\r
54LoadLinuxGetKernelSize (\r
55 IN VOID *KernelSetup,\r
56 IN UINTN KernelSize\r
57 );\r
58\r
59\r
60/**\r
61 Loads and boots UEFI Linux.\r
62\r
63 Note: If successful, then this routine will not return\r
64\r
65 @param[in] Kernel - The main kernel image\r
66 @param[in,out] KernelSetup - The kernel setup image\r
67\r
68 @retval EFI_NOT_FOUND - The Linux kernel was not found\r
69 @retval EFI_INVALID_PARAMETER - Kernel or KernelSetup was NULL\r
70 @retval EFI_UNSUPPORTED - The Linux kernel version is not supported\r
71\r
72**/\r
73EFI_STATUS\r
74EFIAPI\r
75LoadLinux (\r
76 IN VOID *Kernel,\r
77 IN OUT VOID *KernelSetup\r
78 );\r
79\r
80\r
81/**\r
82 Allocates pages for the kernel setup image.\r
83\r
84 @param[in] Pages - The number of pages\r
85\r
86 @retval NULL - Unable to allocate pages\r
87 @retval !NULL - The address of the pages allocated\r
88\r
89**/\r
90VOID*\r
91EFIAPI\r
92LoadLinuxAllocateKernelSetupPages (\r
93 IN UINTN Pages\r
94 );\r
95\r
96\r
97/**\r
98 Allocates pages for the kernel.\r
99\r
100 @param[in] KernelSetup - The kernel setup image\r
101 @param[in] Pages - The number of pages. (It is recommended to use the\r
102 size returned from LoadLinuxGetKernelSize.)\r
103\r
104 @retval NULL - Unable to allocate pages\r
105 @retval !NULL - The address of the pages allocated\r
106\r
107**/\r
108VOID*\r
109EFIAPI\r
110LoadLinuxAllocateKernelPages (\r
111 IN VOID *KernelSetup,\r
112 IN UINTN Pages\r
113 );\r
114\r
115\r
116/**\r
117 Allocates pages for the kernel command line.\r
118\r
119 @param[in] Pages - The number of pages.\r
120\r
121 @retval NULL - Unable to allocate pages\r
122 @retval !NULL - The address of the pages allocated\r
123\r
124**/\r
125VOID*\r
126EFIAPI\r
127LoadLinuxAllocateCommandLinePages (\r
128 IN UINTN Pages\r
129 );\r
130\r
131\r
132/**\r
133 Allocates pages for the initrd image.\r
134\r
135 @param[in,out] KernelSetup - The kernel setup image\r
136 @param[in] Pages - The number of pages.\r
137\r
138 @retval NULL - Unable to allocate pages\r
139 @retval !NULL - The address of the pages allocated\r
140\r
141**/\r
142VOID*\r
143EFIAPI\r
144LoadLinuxAllocateInitrdPages (\r
145 IN VOID *KernelSetup,\r
146 IN UINTN Pages\r
147 );\r
148\r
149\r
150/**\r
151 Sets the kernel command line parameter within the setup image.\r
152\r
153 @param[in,out] KernelSetup - The kernel setup image\r
154 @param[in] CommandLine - The kernel command line\r
155\r
156 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported\r
157 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL\r
158 @retval EFI_UNSUPPORTED - The Linux kernel is not supported\r
159\r
160**/\r
161EFI_STATUS\r
162EFIAPI\r
163LoadLinuxSetCommandLine (\r
164 IN OUT VOID *KernelSetup,\r
165 IN CHAR8 *CommandLine\r
166 );\r
167\r
168\r
169/**\r
170 Sets the kernel initial ram disk pointer within the setup image.\r
171\r
172 @param[in,out] KernelSetup - The kernel setup image\r
173 @param[in] Initrd - Pointer to the initial ram disk\r
174 @param[in] InitrdSize - The initial ram disk image size\r
175\r
176 @retval EFI_SUCCESS - The Linux kernel setup is valid and supported\r
177 @retval EFI_INVALID_PARAMETER - KernelSetup was NULL\r
178 @retval EFI_UNSUPPORTED - The Linux kernel is not supported\r
179\r
180**/\r
181EFI_STATUS\r
182EFIAPI\r
183LoadLinuxSetInitrd (\r
184 IN OUT VOID *KernelSetup,\r
185 IN VOID *Initrd,\r
186 IN UINTN InitrdSize\r
187 );\r
188\r
189\r
190#endif\r
191\r