--- /dev/null
+/** @file\r
+ Load/boot UEFI Linux.\r
+\r
+ Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __LOAD_LINUX_LIB__\r
+#define __LOAD_LINUX_LIB__\r
+\r
+\r
+/**\r
+ Verifies that the kernel setup image is valid and supported.\r
+ The kernel setup image should be checked before using other library\r
+ routines which take the kernel setup as an input.\r
+\r
+ @param[in] KernelSetup - The kernel setup image\r
+ @param[in] KernelSetupSize - The kernel setup size\r
+\r
+ @retval EFI_SUCCESS - The Linux kernel setup is valid and supported\r
+ @retval EFI_INVALID_PARAMETER - KernelSetup was NULL\r
+ @retval EFI_UNSUPPORTED - The Linux kernel is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LoadLinuxCheckKernelSetup (\r
+ IN VOID *KernelSetup,\r
+ IN UINTN KernelSetupSize\r
+ );\r
+\r
+\r
+/**\r
+ Gets the initial runtime size of the Linux kernel image by examining\r
+ the kernel setup image.\r
+\r
+ @param[in] KernelSetup - The kernel setup image\r
+ @param[in] KernelSize - The kernel size on disk.\r
+\r
+ @retval 0 An error occured\r
+ @retval !0 The initial size required by the kernel to\r
+ begin execution.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+LoadLinuxGetKernelSize (\r
+ IN VOID *KernelSetup,\r
+ IN UINTN KernelSize\r
+ );\r
+\r
+\r
+/**\r
+ Loads and boots UEFI Linux.\r
+\r
+ Note: If successful, then this routine will not return\r
+\r
+ @param[in] Kernel - The main kernel image\r
+ @param[in,out] KernelSetup - The kernel setup image\r
+\r
+ @retval EFI_NOT_FOUND - The Linux kernel was not found\r
+ @retval EFI_INVALID_PARAMETER - Kernel or KernelSetup was NULL\r
+ @retval EFI_UNSUPPORTED - The Linux kernel version is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LoadLinux (\r
+ IN VOID *Kernel,\r
+ IN OUT VOID *KernelSetup\r
+ );\r
+\r
+\r
+/**\r
+ Allocates pages for the kernel setup image.\r
+\r
+ @param[in] Pages - The number of pages\r
+\r
+ @retval NULL - Unable to allocate pages\r
+ @retval !NULL - The address of the pages allocated\r
+\r
+**/\r
+VOID*\r
+EFIAPI\r
+LoadLinuxAllocateKernelSetupPages (\r
+ IN UINTN Pages\r
+ );\r
+\r
+\r
+/**\r
+ Allocates pages for the kernel.\r
+\r
+ @param[in] KernelSetup - The kernel setup image\r
+ @param[in] Pages - The number of pages. (It is recommended to use the\r
+ size returned from LoadLinuxGetKernelSize.)\r
+\r
+ @retval NULL - Unable to allocate pages\r
+ @retval !NULL - The address of the pages allocated\r
+\r
+**/\r
+VOID*\r
+EFIAPI\r
+LoadLinuxAllocateKernelPages (\r
+ IN VOID *KernelSetup,\r
+ IN UINTN Pages\r
+ );\r
+\r
+\r
+/**\r
+ Allocates pages for the kernel command line.\r
+\r
+ @param[in] Pages - The number of pages.\r
+\r
+ @retval NULL - Unable to allocate pages\r
+ @retval !NULL - The address of the pages allocated\r
+\r
+**/\r
+VOID*\r
+EFIAPI\r
+LoadLinuxAllocateCommandLinePages (\r
+ IN UINTN Pages\r
+ );\r
+\r
+\r
+/**\r
+ Allocates pages for the initrd image.\r
+\r
+ @param[in,out] KernelSetup - The kernel setup image\r
+ @param[in] Pages - The number of pages.\r
+\r
+ @retval NULL - Unable to allocate pages\r
+ @retval !NULL - The address of the pages allocated\r
+\r
+**/\r
+VOID*\r
+EFIAPI\r
+LoadLinuxAllocateInitrdPages (\r
+ IN VOID *KernelSetup,\r
+ IN UINTN Pages\r
+ );\r
+\r
+\r
+/**\r
+ Sets the kernel command line parameter within the setup image.\r
+\r
+ @param[in,out] KernelSetup - The kernel setup image\r
+ @param[in] CommandLine - The kernel command line\r
+\r
+ @retval EFI_SUCCESS - The Linux kernel setup is valid and supported\r
+ @retval EFI_INVALID_PARAMETER - KernelSetup was NULL\r
+ @retval EFI_UNSUPPORTED - The Linux kernel is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LoadLinuxSetCommandLine (\r
+ IN OUT VOID *KernelSetup,\r
+ IN CHAR8 *CommandLine\r
+ );\r
+\r
+\r
+/**\r
+ Sets the kernel initial ram disk pointer within the setup image.\r
+\r
+ @param[in,out] KernelSetup - The kernel setup image\r
+ @param[in] Initrd - Pointer to the initial ram disk\r
+ @param[in] InitrdSize - The initial ram disk image size\r
+\r
+ @retval EFI_SUCCESS - The Linux kernel setup is valid and supported\r
+ @retval EFI_INVALID_PARAMETER - KernelSetup was NULL\r
+ @retval EFI_UNSUPPORTED - The Linux kernel is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LoadLinuxSetInitrd (\r
+ IN OUT VOID *KernelSetup,\r
+ IN VOID *Initrd,\r
+ IN UINTN InitrdSize\r
+ );\r
+\r
+\r
+#endif\r
+\r