Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
a1b79055
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1b79055
编写于
3月 03, 2019
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some buildfixes for MSVC, thanks joedm
上级
4172ce77
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
82 addition
and
46 deletion
+82
-46
Library/OcAppleBootPolicyLib/OcSupportBootPolicy.c
Library/OcAppleBootPolicyLib/OcSupportBootPolicy.c
+1
-1
Library/OcGuardLib/Ubsan.c
Library/OcGuardLib/Ubsan.c
+5
-0
Library/OcGuardLib/Ubsan.h
Library/OcGuardLib/Ubsan.h
+9
-0
Library/OcGuardLib/UbsanPrintf.c
Library/OcGuardLib/UbsanPrintf.c
+5
-0
Library/OcSmbiosLib/DebugSmbios.c
Library/OcSmbiosLib/DebugSmbios.c
+35
-18
Library/OcSmbiosLib/SmbiosInternal.c
Library/OcSmbiosLib/SmbiosInternal.c
+5
-5
Library/OcSmbiosLib/SmbiosInternal.h
Library/OcSmbiosLib/SmbiosInternal.h
+2
-2
Library/OcSmbiosLib/SmbiosPatch.c
Library/OcSmbiosLib/SmbiosPatch.c
+20
-20
未找到文件。
Library/OcAppleBootPolicyLib/OcSupportBootPolicy.c
浏览文件 @
a1b79055
...
...
@@ -84,7 +84,7 @@ GetAppleRecoveryNameFromPlist (
CHAR16
*
RecoveryName
;
UINTN
RecoveryNameSize
;
Document
=
XmlParseDocument
(
SystemVersionData
,
SystemVersionDataSize
);
Document
=
XmlParseDocument
(
SystemVersionData
,
(
UINT32
)
SystemVersionDataSize
);
if
(
Document
==
NULL
)
{
return
NULL
;
...
...
Library/OcGuardLib/Ubsan.c
浏览文件 @
a1b79055
...
...
@@ -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
Library/OcGuardLib/Ubsan.h
浏览文件 @
a1b79055
...
...
@@ -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
...
...
Library/OcGuardLib/UbsanPrintf.c
浏览文件 @
a1b79055
...
...
@@ -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
Library/OcSmbiosLib/DebugSmbios.c
浏览文件 @
a1b79055
...
...
@@ -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
);
}
}
Library/OcSmbiosLib/SmbiosInternal.c
浏览文件 @
a1b79055
...
...
@@ -51,7 +51,7 @@ SmbiosExtendTable (
if
(
Table
->
Table
==
NULL
)
{
TableSize
=
0
;
}
else
{
TableSize
=
(
UINT
8
*
)
Table
->
CurrentStrPtr
-
Table
->
Table
;
TableSize
=
(
UINT
32
)((
UINT8
*
)
Table
->
CurrentStrPtr
-
Table
->
Table
)
;
}
//
...
...
@@ -94,7 +94,7 @@ SmbiosOverrideString (
IN
BOOLEAN
Hex
)
{
UINT
N
Length
;
UINT
32
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
UINT
32
MinLength
,
IN
SMBIOS_TYPE
Type
,
IN
UINT
8
MinLength
,
IN
UINT16
Index
)
{
...
...
Library/OcSmbiosLib/SmbiosInternal.h
浏览文件 @
a1b79055
...
...
@@ -178,8 +178,8 @@ SmbiosOverrideString (
EFI_STATUS
SmbiosInitialiseStruct
(
IN
OUT
OC_SMBIOS_TABLE
*
Table
,
IN
UINT32
Type
,
IN
UINT
32
MinLength
,
IN
SMBIOS_TYPE
Type
,
IN
UINT
8
MinLength
,
IN
UINT16
Index
);
...
...
Library/OcSmbiosLib/SmbiosPatch.c
浏览文件 @
a1b79055
...
...
@@ -127,7 +127,7 @@ PatchBiosInformation (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_BIOS_INFORMATION
,
1
);
...
...
@@ -170,7 +170,7 @@ PatchSystemInformation (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_SYSTEM_INFORMATION
,
1
);
...
...
@@ -208,7 +208,7 @@ PatchBaseboardInformation (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_BASEBOARD_INFORMATION
,
1
);
...
...
@@ -260,7 +260,7 @@ PatchSystemEnclosure (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_SYSTEM_ENCLOSURE
,
1
);
...
...
@@ -328,7 +328,7 @@ PatchProcessorInformation (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
UINT8
TmpCount
;
...
...
@@ -408,7 +408,7 @@ PatchCacheInformation (
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT16
NumberEntries
;
UINT16
EntryNo
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
UINT16
CacheLevel
;
BOOLEAN
CacheLevels
[
3
];
...
...
@@ -475,7 +475,7 @@ PatchSystemPorts (
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT16
NumberEntries
;
UINT16
EntryNo
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
NumberEntries
=
SmbiosGetOriginalTableCount
(
SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION
);
...
...
@@ -520,7 +520,7 @@ PatchSystemSlots (
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT16
NumberEntries
;
UINT16
EntryNo
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*
PciRootBridgeIo
;
EFI_STATUS
Status
;
...
...
@@ -645,7 +645,7 @@ PatchMemoryArray (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY
,
1
);
...
...
@@ -687,7 +687,7 @@ PatchMemoryDevice (
OUT
SMBIOS_HANDLE
*
Handle
)
{
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
BOOLEAN
IsEmpty
;
...
...
@@ -769,7 +769,7 @@ PatchMemoryMappedAddress (
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT16
NumberEntries
;
UINT16
EntryNo
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
NumberEntries
=
SmbiosGetOriginalTableCount
(
SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS
);
...
...
@@ -815,7 +815,7 @@ PatchMemoryMappedDevice (
OUT
SMBIOS_HANDLE
MemoryDeviceHandle
)
{
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS
,
Index
);
...
...
@@ -857,7 +857,7 @@ PatchPortableBatteryDevice (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_PORTABLE_BATTERY
,
1
);
...
...
@@ -909,7 +909,7 @@ PatchBootInformation (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION
,
1
);
...
...
@@ -941,7 +941,7 @@ PatchAppleFirmwareVolume (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
APPLE_SMBIOS_TYPE_FIRMWARE_INFORMATION
,
1
);
...
...
@@ -977,7 +977,7 @@ PatchAppleProcessorType (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
APPLE_PROCESSOR_TYPE
*
ProcessorType
;
...
...
@@ -1460,7 +1460,7 @@ PatchAppleProcessorSpeed (
(
VOID
)
CpuInfo
;
#else
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
MinLength
;
UINT8
StringIndex
;
Original
=
SmbiosGetOriginalTable
(
APPLE_SMBIOS_TYPE_PROCESSOR_BUS_SPEED
,
1
);
...
...
@@ -1496,7 +1496,7 @@ PatchSmBiosEndOfTable (
)
{
APPLE_SMBIOS_STRUCTURE_POINTER
Original
;
UINT
32
MinLength
;
UINT
8
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
;
UINT
8
NumberMemoryDevices
;
UINT
16
NumberMemoryDevices
;
UINT8
MemoryDeviceNo
;
UINT8
RamModuleNo
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录