diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-09 10:51:13 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-09 10:51:13 +0000 |
commit | 2ccfb71ebebd54c57aad8f9bb5fb20539e7b892f (patch) | |
tree | a5afdd24b8939bb90f385cc05453c2ec67c88a27 /ArmPlatformPkg/Bds/Bds.c | |
parent | 74b961324c1cc3ae3f97523e085fb169ec63b608 (diff) | |
download | edk2-platforms-2ccfb71ebebd54c57aad8f9bb5fb20539e7b892f.tar.xz |
ArmPlatformPkg/Bds: Add a signature in front of the Boot Argument propoer to this Bds
Each application loader has its own OptionalData format. To avoid to start a Boot Entry
that has not been created by ArmPlatform/Bds a signature has been added to the
OptionalData.
ArmPlatformPkg/Bds: Rename some internal structure from BDS_* to ARM_BDS_*
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12311 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Bds/Bds.c')
-rw-r--r-- | ArmPlatformPkg/Bds/Bds.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c index a1fa21a0f9..cdfea03228 100644 --- a/ArmPlatformPkg/Bds/Bds.c +++ b/ArmPlatformPkg/Bds/Bds.c @@ -203,8 +203,11 @@ DefineDefaultBootEntries ( EFI_STATUS Status; EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol; EFI_DEVICE_PATH* BootDevicePath; - BDS_LOADER_ARGUMENTS BootArguments; - BDS_LOADER_TYPE BootType; + ARM_BDS_LOADER_ARGUMENTS* BootArguments; + ARM_BDS_LOADER_TYPE BootType; + EFI_DEVICE_PATH* InitrdPath; + UINTN CmdLineSize; + UINTN InitrdSize; // // If Boot Order does not exist then create a default entry @@ -240,19 +243,28 @@ DefineDefaultBootEntries ( // Create the entry is the Default values are correct if (BootDevicePath != NULL) { - BootType = (BDS_LOADER_TYPE)PcdGet32 (PcdDefaultBootType); + BootType = (ARM_BDS_LOADER_TYPE)PcdGet32 (PcdDefaultBootType); - if (BootType == BDS_LOADER_KERNEL_LINUX_ATAG) { - BootArguments.LinuxAtagArguments.CmdLine[0] = '\0'; - AsciiStrnCpy (BootArguments.LinuxAtagArguments.CmdLine,(CHAR8*)PcdGetPtr(PcdDefaultBootArgument),BOOT_DEVICE_OPTION_MAX); - BootArguments.LinuxAtagArguments.InitrdPathList = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdDefaultBootInitrdPath)); + if ((BootType == BDS_LOADER_KERNEL_LINUX_ATAG) || (BootType == BDS_LOADER_KERNEL_LINUX_FDT)) { + CmdLineSize = AsciiStrSize ((CHAR8*)PcdGetPtr(PcdDefaultBootArgument)); + InitrdPath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdDefaultBootInitrdPath)); + InitrdSize = GetDevicePathSize (InitrdPath); + + BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)AllocatePool (sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineSize + InitrdSize); + BootArguments->LinuxArguments.CmdLineSize = CmdLineSize; + BootArguments->LinuxArguments.InitrdSize = InitrdSize; + + CopyMem ((VOID*)(BootArguments + 1), (CHAR8*)PcdGetPtr(PcdDefaultBootArgument), CmdLineSize); + CopyMem ((VOID*)(BootArguments + 1) + CmdLineSize, (CHAR8*)PcdGetPtr(PcdDefaultBootArgument), InitrdSize); + } else { + BootArguments = NULL; } BootOptionCreate (LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_BOOT, (CHAR16*)PcdGetPtr(PcdDefaultBootDescription), BootDevicePath, BootType, - &BootArguments, + BootArguments, &BdsLoadOption ); FreePool (BdsLoadOption); |