mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
Some buildfixes for MSVC, thanks joedm
This commit is contained in:
parent
4172ce7757
commit
a1b790556f
@ -84,7 +84,7 @@ GetAppleRecoveryNameFromPlist (
|
||||
CHAR16 *RecoveryName;
|
||||
UINTN RecoveryNameSize;
|
||||
|
||||
Document = XmlParseDocument (SystemVersionData, SystemVersionDataSize);
|
||||
Document = XmlParseDocument (SystemVersionData, (UINT32) SystemVersionDataSize);
|
||||
|
||||
if (Document == NULL) {
|
||||
return NULL;
|
||||
|
||||
@ -38,6 +38,8 @@
|
||||
|
||||
#include "Ubsan.h"
|
||||
|
||||
#ifdef HAVE_UBSAN_SUPPORT
|
||||
|
||||
// OC change: unsupported in EDK2
|
||||
// #include <sys/cdefs.h>
|
||||
#if defined(_KERNEL)
|
||||
@ -1641,3 +1643,6 @@ isShiftExponentTooLarge(char *szLocation, struct CTypeDescriptor *pType, unsigne
|
||||
|
||||
return llluGetNumber(szLocation, pType, ulNumber) >= zWidth;
|
||||
}
|
||||
|
||||
#endif // HAVE_UBSAN_SUPPORT
|
||||
|
||||
|
||||
@ -29,6 +29,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define _KERNEL 1
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_UBSAN_SUPPORT) && defined(__clang__)
|
||||
#define HAVE_UBSAN_SUPPORT 1
|
||||
#endif
|
||||
|
||||
|
||||
// Mark long double as supported (since we may use softfp).
|
||||
#ifndef __HAVE_LONG_DOUBLE
|
||||
#define __HAVE_LONG_DOUBLE
|
||||
@ -154,7 +159,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
// Note, that we do not use UEFI-like printf.
|
||||
#ifndef __printflike
|
||||
#ifdef __GNUC__
|
||||
#define __printflike(x, y) __attribute__((format(printf, (x), (y))))
|
||||
#else
|
||||
#define __printflike(x, y)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Route arraycount to ARRAY_SIZE
|
||||
|
||||
@ -30,6 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "Ubsan.h"
|
||||
|
||||
#ifdef HAVE_UBSAN_SUPPORT
|
||||
|
||||
/*
|
||||
* Configuration
|
||||
*/
|
||||
@ -529,3 +531,6 @@ int EFIAPI tfp_sprintf(char *str, const char *format, ...)
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HAVE_UBSAN_SUPPORT
|
||||
|
||||
|
||||
@ -782,41 +782,58 @@ SmbiosDebugAnyStructure (
|
||||
{
|
||||
switch (Record.Standard.Hdr->Type) {
|
||||
case SMBIOS_TYPE_BIOS_INFORMATION:
|
||||
return SmbiosDebugBiosInformation (Record);
|
||||
SmbiosDebugBiosInformation (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_SYSTEM_INFORMATION:
|
||||
return SmbiosDebugSystemInformation (Record);
|
||||
SmbiosDebugSystemInformation (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_BASEBOARD_INFORMATION:
|
||||
return SmbiosDebugBaseboardInformation (Record);
|
||||
SmbiosDebugBaseboardInformation (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_SYSTEM_ENCLOSURE:
|
||||
return SmbiosDebugSystemEnclosure (Record);
|
||||
SmbiosDebugSystemEnclosure (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_PROCESSOR_INFORMATION:
|
||||
return SmbiosDebugProcessorInformation (Record);
|
||||
SmbiosDebugProcessorInformation (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION:
|
||||
return SmbiosDebugSystemPorts (Record);
|
||||
SmbiosDebugSystemPorts (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_CACHE_INFORMATION:
|
||||
return SmbiosDebugCacheInformation (Record);
|
||||
SmbiosDebugCacheInformation (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_SYSTEM_SLOTS:
|
||||
return SmbiosDebugSystemSlots (Record);
|
||||
SmbiosDebugSystemSlots (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY:
|
||||
return SmbiosDebugPhysicalMemoryArray (Record);
|
||||
SmbiosDebugPhysicalMemoryArray (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_MEMORY_DEVICE:
|
||||
return SmbiosDebugMemoryDevice (Record);
|
||||
SmbiosDebugMemoryDevice (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS:
|
||||
return SmbiosDebugMemoryMappedAddress (Record);
|
||||
SmbiosDebugMemoryMappedAddress (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS:
|
||||
return SmbiosDebugMemoryMappedDevice (Record);
|
||||
SmbiosDebugMemoryMappedDevice (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_PORTABLE_BATTERY:
|
||||
return SmbiosDebugPortableBatteryDevice (Record);
|
||||
SmbiosDebugPortableBatteryDevice (Record);
|
||||
return;
|
||||
case SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION:
|
||||
return SmbiosDebugBootInformation (Record);
|
||||
SmbiosDebugBootInformation (Record);
|
||||
return;
|
||||
case APPLE_SMBIOS_TYPE_FIRMWARE_INFORMATION:
|
||||
return SmbiosDebugAppleFirmwareVolume (Record);
|
||||
SmbiosDebugAppleFirmwareVolume (Record);
|
||||
return;
|
||||
case APPLE_SMBIOS_TYPE_PROCESSOR_TYPE:
|
||||
return SmbiosDebugAppleProcessorType (Record);
|
||||
SmbiosDebugAppleProcessorType (Record);
|
||||
return;
|
||||
case APPLE_SMBIOS_TYPE_PROCESSOR_BUS_SPEED:
|
||||
return SmbiosDebugAppleProcessorSpeed (Record);
|
||||
SmbiosDebugAppleProcessorSpeed (Record);
|
||||
return;
|
||||
default:
|
||||
return SmbiosDebugGeneric (Record);
|
||||
SmbiosDebugGeneric (Record);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ SmbiosExtendTable (
|
||||
if (Table->Table == NULL) {
|
||||
TableSize = 0;
|
||||
} else {
|
||||
TableSize = (UINT8 *) Table->CurrentStrPtr - Table->Table;
|
||||
TableSize = (UINT32)((UINT8 *) Table->CurrentStrPtr - Table->Table);
|
||||
}
|
||||
|
||||
//
|
||||
@ -94,7 +94,7 @@ SmbiosOverrideString (
|
||||
IN BOOLEAN Hex
|
||||
)
|
||||
{
|
||||
UINTN Length;
|
||||
UINT32 Length;
|
||||
UINT32 ByteLength;
|
||||
UINT32 MaxLength;
|
||||
|
||||
@ -110,7 +110,7 @@ SmbiosOverrideString (
|
||||
//
|
||||
MaxLength = Hex ? SMBIOS_STRING_MAX_LENGTH / 2 - SMBIOS_STRING_HEX_PREFIX_SIZE : SMBIOS_STRING_MAX_LENGTH;
|
||||
|
||||
Length = AsciiStrLen (Override);
|
||||
Length = (UINT32) AsciiStrLen (Override);
|
||||
|
||||
//
|
||||
// Truncate to fit but do not error.
|
||||
@ -329,8 +329,8 @@ SmbiosAssignStructHandle (
|
||||
EFI_STATUS
|
||||
SmbiosInitialiseStruct (
|
||||
IN OUT OC_SMBIOS_TABLE *Table,
|
||||
IN UINT32 Type,
|
||||
IN UINT32 MinLength,
|
||||
IN SMBIOS_TYPE Type,
|
||||
IN UINT8 MinLength,
|
||||
IN UINT16 Index
|
||||
)
|
||||
{
|
||||
|
||||
@ -178,8 +178,8 @@ SmbiosOverrideString (
|
||||
EFI_STATUS
|
||||
SmbiosInitialiseStruct (
|
||||
IN OUT OC_SMBIOS_TABLE *Table,
|
||||
IN UINT32 Type,
|
||||
IN UINT32 MinLength,
|
||||
IN SMBIOS_TYPE Type,
|
||||
IN UINT8 MinLength,
|
||||
IN UINT16 Index
|
||||
);
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ PatchBiosInformation (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_BIOS_INFORMATION, 1);
|
||||
@ -170,7 +170,7 @@ PatchSystemInformation (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_SYSTEM_INFORMATION, 1);
|
||||
@ -208,7 +208,7 @@ PatchBaseboardInformation (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_BASEBOARD_INFORMATION, 1);
|
||||
@ -260,7 +260,7 @@ PatchSystemEnclosure (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_SYSTEM_ENCLOSURE, 1);
|
||||
@ -328,7 +328,7 @@ PatchProcessorInformation (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
UINT8 TmpCount;
|
||||
|
||||
@ -408,7 +408,7 @@ PatchCacheInformation (
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT16 NumberEntries;
|
||||
UINT16 EntryNo;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
UINT16 CacheLevel;
|
||||
BOOLEAN CacheLevels[3];
|
||||
@ -475,7 +475,7 @@ PatchSystemPorts (
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT16 NumberEntries;
|
||||
UINT16 EntryNo;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
NumberEntries = SmbiosGetOriginalTableCount (SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION);
|
||||
@ -520,7 +520,7 @@ PatchSystemSlots (
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT16 NumberEntries;
|
||||
UINT16 EntryNo;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
|
||||
EFI_STATUS Status;
|
||||
@ -645,7 +645,7 @@ PatchMemoryArray (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, 1);
|
||||
@ -687,7 +687,7 @@ PatchMemoryDevice (
|
||||
OUT SMBIOS_HANDLE *Handle
|
||||
)
|
||||
{
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
BOOLEAN IsEmpty;
|
||||
|
||||
@ -769,7 +769,7 @@ PatchMemoryMappedAddress (
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT16 NumberEntries;
|
||||
UINT16 EntryNo;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
NumberEntries = SmbiosGetOriginalTableCount (SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS);
|
||||
@ -815,7 +815,7 @@ PatchMemoryMappedDevice (
|
||||
OUT SMBIOS_HANDLE MemoryDeviceHandle
|
||||
)
|
||||
{
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS, Index);
|
||||
@ -857,7 +857,7 @@ PatchPortableBatteryDevice (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_PORTABLE_BATTERY, 1);
|
||||
@ -909,7 +909,7 @@ PatchBootInformation (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, 1);
|
||||
@ -941,7 +941,7 @@ PatchAppleFirmwareVolume (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (APPLE_SMBIOS_TYPE_FIRMWARE_INFORMATION, 1);
|
||||
@ -977,7 +977,7 @@ PatchAppleProcessorType (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
APPLE_PROCESSOR_TYPE *ProcessorType;
|
||||
|
||||
@ -1460,7 +1460,7 @@ PatchAppleProcessorSpeed (
|
||||
(VOID) CpuInfo;
|
||||
#else
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (APPLE_SMBIOS_TYPE_PROCESSOR_BUS_SPEED, 1);
|
||||
@ -1496,7 +1496,7 @@ PatchSmBiosEndOfTable (
|
||||
)
|
||||
{
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER Original;
|
||||
UINT32 MinLength;
|
||||
UINT8 MinLength;
|
||||
UINT8 StringIndex;
|
||||
|
||||
Original = SmbiosGetOriginalTable (SMBIOS_TYPE_END_OF_TABLE, 1);
|
||||
@ -1670,7 +1670,7 @@ SmbiosTableApply (
|
||||
SmbiosTable->CurrentPtr.Raw - SmbiosTable->Table
|
||||
);
|
||||
|
||||
mOriginalSmbios->TableLength = SmbiosTable->CurrentPtr.Raw - SmbiosTable->Table;
|
||||
mOriginalSmbios->TableLength = (UINT16) (SmbiosTable->CurrentPtr.Raw - SmbiosTable->Table);
|
||||
mOriginalSmbios->MaxStructureSize = SmbiosTable->MaxStructureSize;
|
||||
mOriginalSmbios->NumberOfSmbiosStructures = SmbiosTable->NumberOfStructures;
|
||||
|
||||
@ -1716,7 +1716,7 @@ CreateSmBios (
|
||||
SMBIOS_HANDLE MemoryDeviceHandle;
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER MemoryDeviceInfo;
|
||||
APPLE_SMBIOS_STRUCTURE_POINTER MemoryDeviceAddress;
|
||||
UINT8 NumberMemoryDevices;
|
||||
UINT16 NumberMemoryDevices;
|
||||
UINT8 MemoryDeviceNo;
|
||||
UINT8 RamModuleNo;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user