@@ -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