ArmPlatformPkg/Bds: Add Linux 'initrd' support to BDS

An 'initrd' file can be specified for a Linux kernel.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12169 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin
2011-08-18 13:21:14 +00:00
parent 326d1df919
commit 656416bc2e
11 changed files with 286 additions and 96 deletions

View File

@@ -35,7 +35,7 @@
#define BOOT_DEVICE_DESCRIPTION_MAX 100
#define BOOT_DEVICE_FILEPATH_MAX 100
#define BOOT_DEVICE_OPTION_MAX 100
#define BOOT_DEVICE_OPTION_MAX 300
#define BOOT_DEVICE_ADDRESS_MAX 20
typedef enum {
@@ -44,9 +44,19 @@ typedef enum {
BDS_LOADER_KERNEL_LINUX_FDT,
} BDS_LOADER_TYPE;
typedef struct{
UINT16 InitrdPathListLength;
EFI_DEVICE_PATH_PROTOCOL *InitrdPathList;
CHAR8 CmdLine[BOOT_DEVICE_OPTION_MAX + 1];
} BDS_LINUX_ATAG_ARGUMENTS;
typedef union {
BDS_LINUX_ATAG_ARGUMENTS LinuxAtagArguments;
} BDS_LOADER_ARGUMENTS;
typedef struct {
BDS_LOADER_TYPE LoaderType;
CHAR8 Arguments[];
BDS_LOADER_TYPE LoaderType;
BDS_LOADER_ARGUMENTS Arguments;
} BDS_LOADER_OPTIONAL_DATA;
typedef enum {
@@ -68,6 +78,7 @@ typedef struct {
typedef UINT8* EFI_LOAD_OPTION;
/* This is defined by the UEFI specs, don't change it */
typedef struct {
LIST_ENTRY Link;
@@ -86,8 +97,8 @@ typedef struct _BDS_LOAD_OPTION_SUPPORT {
BDS_SUPPORTED_DEVICE_TYPE Type;
EFI_STATUS (*ListDevices)(IN OUT LIST_ENTRY* BdsLoadOptionList);
BOOLEAN (*IsSupported)(IN BDS_LOAD_OPTION* BdsLoadOption);
EFI_STATUS (*CreateDevicePathNode)(IN BDS_SUPPORTED_DEVICE* BdsLoadOption, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode, OUT BDS_LOADER_TYPE *BootType, OUT UINT32 *Attributes);
EFI_STATUS (*UpdateDevicePathNode)(IN BDS_LOAD_OPTION *BootOption, OUT EFI_DEVICE_PATH_PROTOCOL** NewDevicePath, OUT BDS_LOADER_TYPE *BootType, OUT UINT32 *Attributes);
EFI_STATUS (*CreateDevicePathNode)(IN BDS_SUPPORTED_DEVICE* BdsLoadOption, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNode, OUT BDS_LOADER_TYPE *BootType, OUT UINT32 *Attributes);
EFI_STATUS (*UpdateDevicePathNode)(IN EFI_DEVICE_PATH *OldDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL** NewDevicePath, OUT BDS_LOADER_TYPE *BootType, OUT UINT32 *Attributes);
} BDS_LOAD_OPTION_SUPPORT;
#define LOAD_OPTION_FROM_LINK(a) BASE_CR(a, BDS_LOAD_OPTION, Link)
@@ -107,7 +118,8 @@ BootDeviceListSupportedInit (
EFI_STATUS
BootDeviceListSupportedFree (
IN LIST_ENTRY *SupportedDeviceList
IN LIST_ENTRY *SupportedDeviceList,
IN BDS_SUPPORTED_DEVICE *Except
);
EFI_STATUS
@@ -187,7 +199,7 @@ BootOptionCreate (
IN CHAR16* BootDescription,
IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
IN BDS_LOADER_TYPE BootType,
IN CHAR8* BootArguments,
IN BDS_LOADER_ARGUMENTS *BootArguments,
OUT BDS_LOAD_OPTION **BdsLoadOption
);
@@ -198,7 +210,7 @@ BootOptionUpdate (
IN CHAR16* BootDescription,
IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
IN BDS_LOADER_TYPE BootType,
IN CHAR8* BootArguments
IN BDS_LOADER_ARGUMENTS *BootArguments
);
EFI_STATUS