new folder PosixCompilation. Ressources to compile Clover as a mac

application, for unit tests.
This commit is contained in:
jief666 2021-04-03 13:55:25 +03:00
parent 96909661a0
commit d54fc63747
178 changed files with 18416 additions and 4555 deletions

View File

@ -2569,7 +2569,7 @@ RELEASE_XCODE8_*_MTOC_FLAGS = -align 0x20
# X64 definitions
##################
DEBUG_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEBUGMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEBUGMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x800,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
RELEASE_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
*_XCODE8_X64_SLINK_FLAGS = -static -no_warning_for_no_symbols -o

View File

@ -208,13 +208,25 @@
/// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
///
#ifdef __cplusplus
// So this MUST be compiled with short wchar
// I am considering switching to char16_t, to be independant of sizeof wchar_t
#define CHAR16 wchar_t
#else
typedef unsigned short CHAR16;
#if __WCHAR_MAX__ <= 0xFFFF
#define CHAR16 wchar_t
#else
// Here, we are compiling with wchar_t as 4 bytes. So CHAR16 is equivalent to wchar_t.
// To work with edk2 library, you need to compile them without -short-wchar.
// And of course that cannot be used to create a launchable efi file !
// But that works for unit tests that run on macOS, Linux, Windows...
#define CHAR16 wchar_t
#endif
#else
#if __WCHAR_MAX__ <= 0xFFFF
typedef unsigned short CHAR16;
typedef UINT16 wchar_t;
#else
// Here, we are compiling with wchar_t as 4 bytes. So CHAR16 is equivalent to wchar_t.
// To work with edk2 library, you need to compile them without -short-wchar.
// And of course that cannot be used to create a launchable efi file !
// But that works for unit tests that run on macOS, Linux, Windows...
typedef int CHAR16;
#endif
typedef UINT16 char16_t;
typedef UINT32 char32_t;

View File

@ -28,9 +28,15 @@
#define DEFINE_SECTIONS 0
#endif
#define PRINTF_LITE_DEFINE_PRINTF_SPRINTF 1
#define PRINTF_LITE_BUF_SIZE 255 // not more than 255
#define PRINTF_LITE_TIMESTAMP_SUPPORT 1
#define PRINTF_EMIT_CR_SUPPORT 1
#define PRINTF_LITE_TIMESTAMP_CUSTOM_FUNCTION 1
#define PRINTF_EMIT_CR_SUPPORT 0
#define PRINTF_LITE_REPLACE_STANDARD_FUNCTION 1
#endif // __PRINTF_LITE_CONF_H__

View File

@ -0,0 +1,207 @@
/** @file
Default instance of MemLogLib library for simple log services to memory buffer.
**/
#include <Efi.h>
#include <Library/printf_lite.h>
CHAR8*
GetTiming(VOID)
{
return "";
}
/**
Inits mem log.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
MemLogInit (
VOID
)
{
return EFI_SUCCESS;
}
/**
Prints a log message to memory buffer.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param Marker VA_LIST with variable arguments for Format.
**/
VOID
EFIAPI
MemLogVA (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
IN VA_LIST Marker
)
{
panic("not yet");
}
/**
Prints a log to message memory buffer.
If Format is NULL, then does nothing.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param ... The variable argument list whose contents are accessed
based on the format string specified by Format.
**/
VOID
EFIAPI
MemLog (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
...
)
{
panic("not yet");
}
/**
Returns pointer to MemLog buffer.
**/
CHAR8*
EFIAPI
GetMemLogBuffer (
VOID
)
{
panic("not yet");
}
/**
Returns the length of log (number of chars written) in mem buffer.
**/
UINTN
EFIAPI
GetMemLogLen (
VOID
)
{
panic("not yet");
}
/**
Sets callback that will be called when message is added to mem log.
**/
VOID
EFIAPI
SetMemLogCallback (
MEM_LOG_CALLBACK Callback
)
{
panic("not yet");
}
/**
Sets callback that will be called when message is added to mem log.
**/
MEM_LOG_CALLBACK
EFIAPI
GetMemLogCallback ()
{
panic("not yet");
}
/**
Returns TSC ticks per second.
**/
UINT64
EFIAPI
GetMemLogTscTicksPerSecond (VOID)
{
panic("not yet");
}
// Microsoft wants _fltused
#ifdef _MSC_VER
#ifdef __cplusplus
extern "C" {
#endif
int _fltused=0; // it should be a single underscore since the double one is the mangled name
#ifdef __cplusplus
}
#endif
#endif
//static int printfNewline = 1;
//static void transmitS8Printf(const char* buf, unsigned int nbchar, void* context)
//{
//}
const char* printf_lite_get_timestamp()
{
return "";
}
/**
Prints a log message to memory buffer.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param Marker VA_LIST with variable arguments for Format.
**/
VOID
EFIAPI
MemLogfVA (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
IN VA_LIST Marker
)
{
panic("not yet");
}
/**
Prints a log to message memory buffer.
If Format is NULL, then does nothing.
@param Timing TRUE to prepend timing to log.
@param DebugMode DebugMode will be passed to Callback function if it is set.
@param Format The format string for the debug message to print.
@param ... The variable argument list whose contents are accessed
based on the format string specified by Format.
**/
VOID
EFIAPI
MemLogf (
IN CONST BOOLEAN Timing,
IN CONST INTN DebugMode,
IN CONST CHAR8 *Format,
...
)
{
panic("not yet");
}

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.c

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.h

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/CloverEFI/UefiCpuPkg/Library/MtrrLib/MtrrLib/OUTPUT/MtrrLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/Library/DuetTimerLib/DuetTimerLib/OUTPUT/DuetTimerLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/Library/HdaDevicesLib/HdaDevicesLib/OUTPUT/HdaDevicesLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/Library/OpensslLib/OpensslLibNull/OUTPUT/OpensslLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/Library/VBoxPeCoffLib/VBoxPeCoffLib/OUTPUT/VBoxPeCoffLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/Library/VideoBiosPatchLib/VideoBiosPatchLib/OUTPUT/VideoBiosPatchLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/Library/WaveLib/WaveLib/OUTPUT/WaveLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull/OUTPUT/BasePlatformHookLibNull.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550/OUTPUT/BaseSerialPortLib16550.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib/OUTPUT/FrameBufferBltLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BaseCpuLib/BaseCpuLib/OUTPUT/BaseCpuLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort/OUTPUT/BaseDebugLibSerialPort.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic/OUTPUT/BaseIoLibIntrinsic.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/BaseLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/BaseMemoryLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib/OUTPUT/BasePciCf8Lib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BasePciLibCf8/BasePciLibCf8/OUTPUT/BasePciLibCf8.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BasePrintLib/BasePrintLib/OUTPUT/BasePrintLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/DxeHobLib/DxeHobLib/OUTPUT/DxeHobLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/DxeServicesLib/DxeServicesLib/OUTPUT/DxeServicesLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib/OUTPUT/DxeServicesTableLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull/OUTPUT/PeCoffExtraActionLibNull.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint/OUTPUT/UefiApplicationEntryPoint.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib/OUTPUT/UefiBootServicesTableLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib/OUTPUT/UefiDevicePathLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib/OUTPUT/UefiFileHandleLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiLib/UefiLib/OUTPUT/UefiLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib/OUTPUT/UefiMemoryAllocationLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib/OUTPUT/UefiRuntimeServicesTableLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Application/ControlMsrE2/ControlMsrE2/OUTPUT/ControlMsrE2.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib/OUTPUT/OcAcpiLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAfterBootCompatLib/OcAfterBootCompatLib/OUTPUT/OcAfterBootCompatLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcApfsLib/OcApfsLib/OUTPUT/OcApfsLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleBootPolicyLib/OcAppleBootPolicyLib/OUTPUT/OcAppleBootPolicyLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleChunklistLib/OcAppleChunklistLib/OUTPUT/OcAppleChunklistLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleDiskImageLib/OcAppleDiskImageLib/OUTPUT/OcAppleDiskImageLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleEventLib/OcAppleEventLib/OUTPUT/OcAppleEventLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleImageVerificationLib/OcAppleImageVerificationLib/OUTPUT/OcAppleImageVerificationLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleImg4Lib/OcAppleImg4Lib/OUTPUT/OcAppleImg4Lib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleKernelLib/OcAppleKernelLib/OUTPUT/OcAppleKernelLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleKeyMapLib/OcAppleKeyMapLib/OUTPUT/OcAppleKeyMapLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleKeysLib/OcAppleKeysLib/OUTPUT/OcAppleKeysLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleRamDiskLib/OcAppleRamDiskLib/OUTPUT/OcAppleRamDiskLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleSecureBootLib/OcAppleSecureBootLib/OUTPUT/OcAppleSecureBootLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleUserInterfaceThemeLib/OcAppleUserInterfaceThemeLib/OUTPUT/OcAppleUserInterfaceThemeLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcAudioLib/OcAudioLib/OUTPUT/OcAudioLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcBootManagementLib/OcBootManagementLib/OUTPUT/OcBootManagementLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcCompressionLib/OcCompressionLib/OUTPUT/OcCompressionLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcConfigurationLib/OcConfigurationLib/OUTPUT/OcConfigurationLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcConsoleLib/OcConsoleLib/OUTPUT/OcConsoleLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcCpuLib/OcCpuLib/OUTPUT/OcCpuLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcCryptoLib/OcCryptoLib/OUTPUT/OcCryptoLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcDataHubLib/OcDataHubLib/OUTPUT/OcDataHubLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcDebugLogLibOc2Clover/OcDebugLogLibOc2Clover/OUTPUT/OcDebugLogLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib/OUTPUT/OcDevicePathLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcDevicePropertyLib/OcDevicePropertyLib/OUTPUT/OcDevicePropertyLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcDeviceTreeLib/OcDeviceTreeLib/OUTPUT/OcDeviceTreeLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcDriverConnectionLib/OcDriverConnectionLib/OUTPUT/OcDriverConnectionLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcFileLib/OcFileLib/OUTPUT/OcFileLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcFirmwareVolumeLib/OcFirmwareVolumeLib/OUTPUT/OcFirmwareVolumeLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcGuardLib/OcGuardLib/OUTPUT/OcGuardLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcHashServicesLib/OcHashServicesLib/OUTPUT/OcHashServicesLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcInputLib/OcInputLib/OUTPUT/OcInputLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcMacInfoLib/OcMacInfoLib/OUTPUT/OcMacInfoLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcMachoLib/OcMachoLib/OUTPUT/OcMachoLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcMemoryLib/OcMemoryLib/OUTPUT/OcMemoryLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcMiscLib/OcMiscLib/OUTPUT/OcMiscLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcOSInfoLib/OcOSInfoLib/OUTPUT/OcOSInfoLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcPeCoffLib/OcPeCoffLib/OUTPUT/OcPeCoffLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcRngLib/OcRngLib/OUTPUT/OcRngLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcRtcLib/OcRtcLib/OUTPUT/OcRtcLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcSerializeLib/OcSerializeLib/OUTPUT/OcSerializeLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcSmbiosLib/OcSmbiosLib/OUTPUT/OcSmbiosLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcSmcLib/OcSmcLib/OUTPUT/OcSmcLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcStorageLib/OcStorageLib/OUTPUT/OcStorageLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcStringLib/OcStringLib/OUTPUT/OcStringLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcTemplateLib/OcTemplateLib/OUTPUT/OcTemplateLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcUnicodeCollationEngLib/OcUnicodeCollationEngGenericLib/OUTPUT/OcUnicodeCollationEngGenericLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcVirtualFsLib/OcVirtualFsLib/OUTPUT/OcVirtualFsLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Library/OcXmlLib/OcXmlLib/OUTPUT/OcXmlLib.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Platform/OpenCore/OpenCoreLib/OUTPUT/OpenCore.lib

View File

@ -0,0 +1 @@
../../../Build/Clover/DEBUGMACOS_XCODE8/X64/OpenCorePkg/Platform/OpenRuntime/OpenRuntime/OUTPUT/OpenRuntime.lib

View File

@ -0,0 +1,2 @@
wcslen=wcslen_fixed wcscmp=__wcscmp_is_disabled__ wcsncmp=wcsncmp_fixed wcsstr=wcsstr_fixed sprintf=__sprintf_is_disabled__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
//
// Globals.c
// cpp_tests_compare_settings
//
// Created by Jief on 05/02/2021.
// Copyright © 2021 Jief_Machak. All rights reserved.
//
#include <Platform.h>
#include <Efi.h>
//EFI_HANDLE gImageHandle = NULL;
//EFI_SYSTEM_TABLE *gST = NULL;
//EFI_BOOT_SERVICES *gBS = NULL;
//EFI_RUNTIME_SERVICES *gRT = NULL;
//EFI_DXE_SERVICES *gDS = NULL;
static class Init {
public:
Init() {
gImageHandle = NULL;
gST = NULL;
gBS = NULL;
gRT = NULL;
gDS = NULL;
}
} init;

View File

@ -0,0 +1,174 @@
//
// BaseMemoryLib.c
// cpp_tests UTF16 signed char
//
// Created by Jief on 12/10/2020.
// Copyright © 2020 Jief_Machak. All rights reserved.
//
#include <Efi.h>
#include <Library/BaseMemoryLib.h>
//#include "../../../../MdePkg/Library/BaseMemoryLib/MemLibInternals.h"
#include <memory.h>
void* SetMem(void *Destination, UINTN Length, UINT8 c)
{
return memset(Destination, c, (size_t)Length);
}
VOID *
EFIAPI
SetMem32 (
OUT VOID *Buffer,
IN UINTN Length,
IN UINT32 Value
)
{
for( uint32_t i = 0 ; i < Length/sizeof(Value) ; i++ )
{
((__typeof__(&Value))Buffer)[i] = Value;
}
return Buffer;
}
VOID *
EFIAPI
SetMem64 (
OUT VOID *Buffer,
IN UINTN Length,
IN UINT64 Value
)
{
for( uint32_t i = 0 ; i < Length/sizeof(Value) ; i++ )
{
((__typeof__(&Value))Buffer)[i] = Value;
}
return Buffer;
}
INTN CompareMem(const void* DestinationBuffer, const void* SourceBuffer, UINTN Length)
{
return memcmp(SourceBuffer, DestinationBuffer, Length);
}
void* CopyMem(void *Destination, const void *Source, UINTN Length)
{
return memmove(Destination, Source, (size_t)Length);
}
void* ZeroMem(void *Destination, UINTN Length)
{
return memset(Destination, 0, (size_t)Length);
}
BOOLEAN
EFIAPI
CompareGuid (
IN CONST GUID *Guid1,
IN CONST GUID *Guid2
)
{
UINT64 LowPartOfGuid1;
UINT64 LowPartOfGuid2;
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
LowPartOfGuid1 = * ((CONST UINT64*) Guid1);
LowPartOfGuid2 = * ((CONST UINT64*) Guid2);
HighPartOfGuid1 = * ((CONST UINT64*) Guid1 + 1);
HighPartOfGuid2 = * ((CONST UINT64*) Guid2 + 1);
return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
}
GUID *
EFIAPI
CopyGuid (
OUT GUID *DestinationGuid,
IN CONST GUID *SourceGuid
)
{
*DestinationGuid = *SourceGuid;
return DestinationGuid;
}
BOOLEAN
EFIAPI
IsZeroGuid (
IN CONST GUID *Guid
)
{
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
LowPartOfGuid = * ((CONST UINT64*) Guid);
HighPartOfGuid = * ((CONST UINT64*) Guid + 1);
return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
}
VOID *
EFIAPI
ScanGuid (
IN CONST VOID *Buffer,
IN UINTN Length,
IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
GuidPtr = (GUID*)Buffer;
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
if (CompareGuid (GuidPtr, Guid)) {
return (VOID*)GuidPtr;
}
GuidPtr++;
}
return NULL;
}
CONST VOID *
EFIAPI
InternalMemScanMem16 (
IN CONST VOID *Buffer,
IN UINTN Length,
IN UINT16 Value
)
{
CONST UINT16 *Pointer;
Pointer = (CONST UINT16*)Buffer;
do {
if (*Pointer == Value) {
return Pointer;
}
++Pointer;
} while (--Length != 0);
return NULL;
}
VOID *
EFIAPI
ScanMem16 (
IN CONST VOID *Buffer,
IN UINTN Length,
IN UINT16 Value
)
{
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -0,0 +1,113 @@
//
// DebugLib.c
// cpp_tests UTF16 signed char
//
// Created by Jief on 12/10/2020.
// Copyright © 2020 Jief_Machak. All rights reserved.
//
#include <Library/DebugLib.h>
#include <posix/abort.h>
/**
Prints an assert message containing a filename, line number, and description.
This may be followed by a breakpoint or a dead loop.
Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
CpuDeadLoop() is called. If neither of these bits are set, then this function
returns immediately after the message is printed to the debug output device.
DebugAssert() must actively prevent recursion. If DebugAssert() is called while
processing another DebugAssert(), then DebugAssert() must return immediately.
If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
@param FileName The pointer to the name of the source file that generated the assert condition.
@param LineNumber The line number in the source file that generated the assert condition
@param Description The pointer to the description of the assert condition.
**/
VOID
EFIAPI
DebugAssert (
IN CONST CHAR8 *FileName,
IN UINTN LineNumber,
IN CONST CHAR8 *Description
)
{
// panic();
// panic("ouch\n");
panic("%s %llu %s\n", FileName, LineNumber, Description);
}
/**
Returns TRUE if ASSERT() macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise, FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugAssertEnabled (
VOID
)
{
return TRUE;
}
RETURN_STATUS
EFIAPI
BaseDebugLibSerialPortConstructor (
VOID
)
{
return EFI_SUCCESS;
}
VOID
EFIAPI
DebugPrint (
IN UINTN ErrorLevel,
IN CONST CHAR8 *Format,
...
)
{
VA_LIST Marker;
VA_START (Marker, Format);
vprintf(Format, Marker);
VA_END (Marker);
}
BOOLEAN
EFIAPI
DebugCodeEnabled (
VOID
)
{
return TRUE;
}
BOOLEAN
EFIAPI
DebugPrintEnabled (
VOID
)
{
return TRUE;
}
BOOLEAN
EFIAPI
DebugPrintLevelEnabled (
IN CONST UINTN ErrorLevel
)
{
return TRUE;
}

View File

@ -0,0 +1,84 @@
//
// MemoryAllocationLib.c
// cpp_tests UTF16 signed char
//
// Created by Jief on 30/01/2021.
// Copyright © 2021 Jief_Machak. All rights reserved.
//
#include <Library/MemoryAllocationLib.h>
void* AllocatePool(UINTN AllocationSize)
{
return (void*)malloc((size_t)AllocationSize);
}
void* AllocateZeroPool(UINTN AllocationSize)
{
void* p = (void*)malloc((size_t)AllocationSize);
memset(p, 0, (size_t)AllocationSize);
return p;
}
void* AllocateCopyPool (UINTN AllocationSize, CONST VOID *Buffer)
{
void* p = malloc(AllocationSize);
memcpy(p, Buffer, AllocationSize);
return p;
}
void* ReallocatePool(UINTN OldSize, UINTN NewSize, void* OldBuffer)
{
(void)OldSize;
if ( !OldBuffer ) return AllocatePool(NewSize);
return (void*)realloc(OldBuffer, (size_t)NewSize);
}
void FreePool(IN JCONST VOID *Buffer)
{
free((void*)Buffer);
}
//#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
VOID *
EFIAPI
AllocateAlignedPages (
IN UINTN Pages,
IN UINTN Alignment
)
{
panic("not yet");
}
VOID
EFIAPI
FreeAlignedPages (
IN VOID *Buffer,
IN UINTN Pages
)
{
panic("not yet");
}
VOID *
EFIAPI
AllocatePages (
IN UINTN Pages
)
{
panic("not yet");
}
VOID
EFIAPI
FreePages (
IN VOID *Buffer,
IN UINTN Pages
)
{
panic("not yet");
}

View File

@ -0,0 +1,93 @@
//
// PrintLib.c
// cpp_tests
//
// Created by Jief on 30/01/2021.
// Copyright © 2021 Jief_Machak. All rights reserved.
//
#include <Library/PrintLib.h>
UINTN
EFIAPI
AsciiSPrint (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
...
)
{
va_list va;
va_start(va, FormatString);
int ret = vsnprintf(StartOfBuffer, BufferSize, FormatString, va);
va_end(va);
return (UINTN)ret; // vsnprintf seems to always return >= 0. So cast should be safe.
}
UINTN
EFIAPI
AsciiBSPrint (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
IN BASE_LIST Marker
)
{
panic("not yet");
}
UINTN
EFIAPI
AsciiVSPrint (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
IN VA_LIST Marker
)
{
panic("not yet");
}
UINTN
EFIAPI
SPrintLength (
IN CONST CHAR16 *FormatString,
IN VA_LIST Marker
)
{
panic("not yet");
}
UINTN
EFIAPI
SPrintLengthAsciiFormat (
IN CONST CHAR8 *FormatString,
IN VA_LIST Marker
)
{
panic("not yet");
}
UINTN
EFIAPI
UnicodeSPrint (
OUT CHAR16 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR16 *FormatString,
...
)
{
panic("not yet");
}
UINTN
EFIAPI
UnicodeVSPrint (
OUT CHAR16 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR16 *FormatString,
IN VA_LIST Marker
)
{
panic("not yet");
}

View File

@ -3,7 +3,7 @@
// cpp_tests
//
// Created by jief on 15.03.20.
// Copyright © 2020 JF Knudsen. All rights reserved.
// Copyright © 2020 Jief_Machak. All rights reserved.
//
/*
@ -31,6 +31,8 @@
//#include "../../../Include/Library/printf_lite.h"
#include "../../../rEFIt_UEFI/Platform/BootLog.h"
#include "xcode_utf_fixed.h"
/* few tests for debug purpose */
extern "C" void xcode_utf_fixed_tests()
{
@ -80,7 +82,7 @@ extern "C" void xcode_utf_fixed_tests()
}
#include "../Include/xcode_utf_fixed.h"
#include "xcode_utf_fixed.h"
#if __WCHAR_MAX__ < 0x10000
@ -221,19 +223,18 @@ extern "C" int printf(const char* format, ...)
#endif
return ret;
}
#if __WCHAR_MAX__ <= 0xFFFF
extern "C" int vprintf(const char* format, va_list va)
{
int ret;
#if __WCHAR_MAX__ <= 0xFFFF
char buf[4095];
ret = PRINTF_FUNCTION_NAME(PRINTF_CFUNCTION_PREFIX, vsnprint, PRINTF_CFUNCTION_SUFFIX)(buf, sizeof(buf)-1, format, va);
write(1, buf, strlen(buf));
#else
ret = vprintf(format, va);
#endif
char buf[4095];
ret = PRINTF_FUNCTION_NAME(PRINTF_CFUNCTION_PREFIX, vsnprint, PRINTF_CFUNCTION_SUFFIX)(buf, sizeof(buf)-1, format, va);
write(1, buf, strlen(buf));
return ret;
}
#endif
#endif
//extern "C" int snprintf(char * __restrict buf, size_t len, const char * __restrict format, ...)
//{

View File

@ -3,7 +3,7 @@
// cpp_tests
//
// Created by jief on 15.03.20.
// Copyright © 2020 JF Knudsen. All rights reserved.
// Copyright © 2020 Jief_Machak. All rights reserved.
//
#ifndef __xcode_utf16_h__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

Some files were not shown because too many files have changed in this diff Show More