VirtualBox

Ignore:
Timestamp:
Jun 17, 2010 7:19:17 AM (15 years ago)
Author:
vboxsync
Message:

EFI: fixes signature of GetSystemMemorySize, fetching amount of memory from CMOS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/edk2.patch-memdetect

    r30230 r30271  
    33--- OvmfPkg/PlatformPei/MemDetect.c     (revision 9332)
    44+++ OvmfPkg/PlatformPei/MemDetect.c     (working copy)
    5 @@ -53,7 +53,7 @@
    6    Cmos0x34 = (UINT8) CmosRead8 (0x34);
    7    Cmos0x35 = (UINT8) CmosRead8 (0x35);
     5@@ -34,12 +34,12 @@
     6 #include "Cmos.h"
    87 
    9 -  return ((((Cmos0x35 << 8) + Cmos0x34) << 16) + SIZE_16MB);
    10 +  return ((((UINTN)(Cmos0x35 << 8) + Cmos0x34) << 16) + SIZE_16MB);
     8 STATIC
     9-UINTN
     10+UINT64
     11 GetSystemMemorySize (
     12   )
     13 {
     14-  UINT8 Cmos0x34;
     15-  UINT8 Cmos0x35;
     16+  UINT64 Cmos0x34;
     17+  UINT64 Cmos0x35;
     18 
     19   //
     20   // CMOS 0x34/0x35 specifies the system memory above 16 MB.
     21@@ -50,8 +50,8 @@
     22   //   into the calculation to get the total memory size.
     23   //
     24 
     25-  Cmos0x34 = (UINT8) CmosRead8 (0x34);
     26-  Cmos0x35 = (UINT8) CmosRead8 (0x35);
     27+  Cmos0x34 = CmosRead8(0x34);
     28+  Cmos0x35 = CmosRead8(0x35);
     29 
     30   return ((((Cmos0x35 << 8) + Cmos0x34) << 16) + SIZE_16MB);
    1131 }
     32@@ -77,7 +77,7 @@
     33   //
     34   // Determine total memory size available
     35   //
     36-  TotalMemorySize = (UINT64)GetSystemMemorySize ();
     37+  TotalMemorySize = GetSystemMemorySize ();
    1238 
    13  
     39   MemoryBase = 0x800000;
     40   MemorySize = TotalMemorySize - MemoryBase - 0x100000;
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