VirtualBox

Ignore:
Timestamp:
Aug 14, 2024 1:16:30 PM (4 months ago)
Author:
vboxsync
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/EmbeddedPkg/Scripts/LauterbachT32/EfiLoadDxe.cmm

    r85718 r105670  
    11;
     2; Copyright (c) 2024, Ampere Computing LLC. All rights reserved.<BR>
    23; Copyright (c) 2011, Hewlett-Packard Company. All rights reserved.<BR>
    34;
     
    56;
    67
    7   LOCAL &maxmem &systbl &memsize
     8  PARAMETERS &systbl
    89
    9   &memsize=0x20000000   ; default to 512MB
    10 
    11   gosub FindSystemTable &memsize
    12   ENTRY &systbl
    13 
    14   if &systbl!=0
    15   (
    16     print "found system table at &systbl"
    17     gosub FindDebugInfo &systbl
    18   )
    19   else
    20   (
    21     print "ERROR: system table not found, check memory size"
    22   )
     10  gosub FindDebugInfo &systbl
    2311  enddo
    24 
    25 FindSystemTable:
    26   LOCAL   &TopOfRam &offset
    27   ENTRY   &TopOfRam
    28 
    29   print "FindSystemTable"
    30   print "top of mem is &TopOfRam$"
    31 
    32   &offset=&TopOfRam
    33 
    34   ; align to highest 4MB boundary
    35   &offset=&offset&0xFFC00000
    36 
    37   ; start at top and look on 4MB boundaries for system table ptr structure
    38   while &offset>0
    39   (
    40     ; low signature match
    41     if Data.Long(a:&offset)==0x20494249
    42     (
    43       ; high signature match
    44       if Data.Long(a:&offset+4)==0x54535953
    45       (
    46         ; less than 4GB?
    47         if Data.Long(a:&offset+0x0c)==0
    48         (
    49           ; less than top of ram?
    50           if Data.Long(a:&offset+8)<&TopOfRam
    51           (
    52             return Data.Long(a:&offset+8)
    53           )
    54         )
    55       )
    56     )
    57 
    58     if &offset<0x400000
    59     (
    60       return 0
    61     )
    62     &offset=&offset-0x400000
    63   )
    64 
    65   return 0
    66 
    6712
    6813FindDebugInfo:
     
    7015  ENTRY   &SystemTable
    7116
    72   print "FindDebugInfo"
    73 
    7417  &dbgentries=0
    75   &CfgTableEntries=Data.Long(a:&SystemTable+0x40)
    76   &ConfigTable=Data.Long(a:&SystemTable+0x44)
     18  &CfgTableEntries=Data.Long(a:&SystemTable+0x68)
     19  &ConfigTable=Data.Long(a:&SystemTable+0x70)
    7720
    7821  print "config table is at &ConfigTable (&CfgTableEntries entries)"
     
    8326  while &i<&CfgTableEntries
    8427  (
    85     &offset=&ConfigTable+(&i*0x14)
     28    &offset=&ConfigTable+(&i*0x18)
    8629    if Data.Long(a:&offset)==0x49152E77
    8730    (
     
    12164      if Data.Long(a:&dbginfo)==1 ; normal debug info type
    12265      (
    123         &loadedimg=Data.Long(a:&dbginfo+4)
    124         do EfiProcessPeImage Data.Long(a:&loadedimg+0x20)
     66        &loadedimg=Data.Long(a:&dbginfo+8)
     67        &imagebaseptr=&loadedimg+0x40
     68        &imagebase=Data.Long(a:&imagebaseptr)
     69        do ~~~~/EfiProcessPeImage.cmm "&imagebase"
    12570      )
    12671    )
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette