]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Add LoadLinuxLib library interface
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 2 Nov 2012 18:26:48 +0000 (18:26 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 2 Nov 2012 18:26:48 +0000 (18:26 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13921 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Include/Library/LoadLinuxLib.h [new file with mode: 0644]
OvmfPkg/OvmfPkg.dec

diff --git a/OvmfPkg/Include/Library/LoadLinuxLib.h b/OvmfPkg/Include/Library/LoadLinuxLib.h
new file mode 100644 (file)
index 0000000..d1064d2
--- /dev/null
@@ -0,0 +1,191 @@
+/** @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
index 73db6af7728a0fb6d3b8936f0fdc00984ad19cab..d874f0c44f6d3f2dc34d36f3b70b2ccde564ee20 100644 (file)
   Include\r
 \r
 [LibraryClasses]\r
+  ##  @libraryclass  Loads and boots a Linux kernel image\r
+  #\r
+  LoadLinuxLib|Include/Library/LoadLinuxLib.h\r
+\r
   ##  @libraryclass  Save and restore variables using a file\r
   #\r
   NvVarsFileLib|Include/Library/NvVarsFileLib.h\r