mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-29 12:35:53 +01:00
Move displayFreeMemory in its own file for Utils not to depend on OC.
This commit is contained in:
parent
495dd319c3
commit
ca166219f0
@ -142,23 +142,6 @@ UINT32 GetCrc32(UINT8 *Buffer, UINTN Size)
|
||||
return x;
|
||||
}
|
||||
|
||||
//#ifndef UNIT_TESTS_MACOS
|
||||
|
||||
extern "C" {
|
||||
#include <Library/OcMemoryLib.h>
|
||||
}
|
||||
|
||||
void displayFreeMemory(const XString8& prefix)
|
||||
{
|
||||
UINTN LowMemory;
|
||||
UINTN TotalMemory;
|
||||
|
||||
TotalMemory = OcCountFreePages (&LowMemory);
|
||||
DebugLog(1, "--> %s: Firmware has %llu free pages (%llu in lower 4 GB)\n", prefix.c_str(), TotalMemory, LowMemory);
|
||||
}
|
||||
|
||||
//#endif
|
||||
|
||||
|
||||
XBool haveError = false;
|
||||
|
||||
|
@ -130,10 +130,5 @@ extern XBool haveError;
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
//#ifndef UNIT_TESTS_MACOS
|
||||
extern "C" {
|
||||
void displayFreeMemory(const XString8& prefix);
|
||||
}
|
||||
//#endif
|
||||
|
||||
#endif // _UTILS_H_
|
||||
|
26
rEFIt_UEFI/Platform/UtilsEFI.cpp
Executable file
26
rEFIt_UEFI/Platform/UtilsEFI.cpp
Executable file
@ -0,0 +1,26 @@
|
||||
///*++
|
||||
//
|
||||
//All rights reserved. This program and the accompanying materials
|
||||
//are licensed and made available under the terms and conditions of the BSD License
|
||||
//which accompanies this distribution. The full text of the license may be found at
|
||||
//http://opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
//THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
//WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
//
|
||||
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
|
||||
#include <Efi.h>
|
||||
|
||||
extern "C" {
|
||||
#include <Library/OcMemoryLib.h>
|
||||
}
|
||||
|
||||
void displayFreeMemory(const XString8& prefix)
|
||||
{
|
||||
UINTN LowMemory;
|
||||
UINTN TotalMemory;
|
||||
|
||||
TotalMemory = OcCountFreePages (&LowMemory);
|
||||
DebugLog(1, "--> %s: Firmware has %llu free pages (%llu in lower 4 GB)\n", prefix.c_str(), TotalMemory, LowMemory);
|
||||
}
|
20
rEFIt_UEFI/Platform/UtilsEFI.h
Executable file
20
rEFIt_UEFI/Platform/UtilsEFI.h
Executable file
@ -0,0 +1,20 @@
|
||||
//
|
||||
//All rights reserved. This program and the accompanying materials
|
||||
//are licensed and made available under the terms and conditions of the BSD License
|
||||
//which accompanies this distribution. The full text of the license may be found at
|
||||
//http://opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
//THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
//WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef _UTILSEFI_H_
|
||||
#define _UTILSEFI_H_
|
||||
|
||||
//extern "C" {
|
||||
void displayFreeMemory(const XString8& prefix);
|
||||
//}
|
||||
|
||||
|
||||
#endif // _UTILSEFI_H_
|
Loading…
Reference in New Issue
Block a user