Skip to content

Commit c1684da

Browse files
committed
UefiPayloadPkg: add ramdisk=base,len,type command line option
Signed-off-by: Trammell Hudson <[email protected]>
1 parent 554e791 commit c1684da

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ typedef struct {
2121
UINT32 AcpiTableSize;
2222
UINT64 SmbiosTableBase;
2323
UINT32 SmbiosTableSize;
24+
UINT64 RamDiskBase;
25+
UINT32 RamDiskSize;
2426
} SYSTEM_TABLE_INFO;
2527

2628
#endif

UefiPayloadPkg/Library/LbParseLib/LbParseLib.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ const UefiPayloadConfig* GetUefiPayLoadConfig() {
5555

5656
DEBUG((DEBUG_ERROR, "Expect payload config version %016lx or %016lx, but get %016lx\n",
5757
UEFI_PAYLOAD_CONFIG_VERSION1, UEFI_PAYLOAD_CONFIG_VERSION2, config->Version));
58-
CpuDeadLoop ();
59-
while(1)
60-
;
58+
return NULL;
6159
}
6260

6361
// Align the address and add memory rang to MemInfoCallback
@@ -189,7 +187,8 @@ ParseMemoryInfo(IN BL_MEM_INFO_CALLBACK MemInfoCallback, IN VOID* Params) {
189187
// look for the mem=start,end,type
190188
while((cmdline = cmdline_next(cmdline, &option)))
191189
{
192-
if (strncmp(option, "mem=", 4) != 0)
190+
if (strncmp(option, "mem=", 4) != 0
191+
&& strncmp(option, "ramdisk=", 8) != 0)
193192
continue;
194193

195194
if (cmdline_ints(option, args, 3) != 3)
@@ -243,7 +242,7 @@ ParseSystemTable(OUT SYSTEM_TABLE_INFO* SystemTableInfo) {
243242
{
244243
const char * cmdline = config->config.v2.cmdline;
245244
const char * option;
246-
uint64_t args[2];
245+
uint64_t args[3];
247246

248247
// look for the acpi config
249248
while((cmdline = cmdline_next(cmdline, &option)))
@@ -277,6 +276,21 @@ ParseSystemTable(OUT SYSTEM_TABLE_INFO* SystemTableInfo) {
277276
if (count > 1)
278277
SystemTableInfo->SmbiosTableSize = args[1];
279278
}
279+
280+
if (strncmp(option, "ramdisk=", 8) == 0)
281+
{
282+
const int count = cmdline_ints(option, args, 3);
283+
if (count < 0)
284+
{
285+
DEBUG((DEBUG_ERROR, "Parse error: '%a'\n", option));
286+
continue;
287+
}
288+
289+
if (count > 0)
290+
SystemTableInfo->RamDiskBase = args[0];
291+
if (count > 1)
292+
SystemTableInfo->RamDiskSize = args[1];
293+
}
280294
}
281295
}
282296

0 commit comments

Comments
 (0)