Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
81ec3311
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,发现更多精彩内容 >>
未验证
提交
81ec3311
编写于
3月 03, 2021
作者:
P
PMheart
提交者:
GitHub
3月 03, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcSmbiosLib: Report actual MemoryFormFactor in SMBIOS (#225)
closes acidanthera/bugtracker#1537
上级
27b036c4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
74 addition
and
1 deletion
+74
-1
Docs/Configuration.tex
Docs/Configuration.tex
+6
-0
Include/Acidanthera/Library/OcSmbiosLib.h
Include/Acidanthera/Library/OcSmbiosLib.h
+4
-0
Library/OcMainLib/OpenCorePlatform.c
Library/OcMainLib/OpenCorePlatform.c
+5
-0
Library/OcSmbiosLib/SmbiosPatch.c
Library/OcSmbiosLib/SmbiosPatch.c
+59
-1
未找到文件。
Docs/Configuration.tex
浏览文件 @
81ec3311
...
...
@@ -5100,6 +5100,12 @@ be used. Version with macOS specific enhancements can be downloaded from
When
\texttt
{
CustomMemory
}
is
\texttt
{
false
}
, this value is automatically set
based on Mac product name.
When
\texttt
{
Automatic
}
is
\texttt
{
true
}
, the original value from the the corresponding Mac model will be set if available.
Otherwise, the value from
\texttt
{
OcMacInfoLib
}
will be set.
When
\texttt
{
Automatic
}
is
\texttt
{
false
}
, a user
-
specified value will be set if available.
Otherwise, the original value from the firmware will be set.
If no value is provided, the fallback value
(
\texttt
{
zero
}
)
will be set.
\begin
{
itemize
}
\tightlist
\item
...
...
Include/Acidanthera/Library/OcSmbiosLib.h
浏览文件 @
81ec3311
...
...
@@ -97,6 +97,10 @@ typedef struct OC_SMBIOS_DATA_ {
CONST
UINT16
*
MemoryDataWidth
;
OC_SMBIOS_MEMORY_DEVICE_DATA
*
MemoryDevices
;
CONST
UINT8
*
MemoryFormFactor
;
//
// Forcibly override MemoryFormFactor on non-Automatic mode when TRUE.
//
BOOLEAN
ForceMemoryFormFactor
;
CONST
UINT16
*
MemoryTotalWidth
;
CONST
UINT8
*
MemoryType
;
CONST
UINT16
*
MemoryTypeDetail
;
...
...
Library/OcMainLib/OpenCorePlatform.c
浏览文件 @
81ec3311
...
...
@@ -185,6 +185,11 @@ OcPlatformUpdateSmbios (
ZeroMem
(
&
Data
,
sizeof
(
Data
));
//
// Forcibly use MemoryFormFactor on non-Automatic mode.
//
Data
.
ForceMemoryFormFactor
=
!
Config
->
PlatformInfo
.
Automatic
;
if
(
MacInfo
==
NULL
)
{
//
// Manual mode, read data from SMBIOS.
...
...
Library/OcSmbiosLib/SmbiosPatch.c
浏览文件 @
81ec3311
...
...
@@ -105,6 +105,62 @@ SmbiosGetOriginalStructureCount (
return
SmbiosGetStructureCount
(
mOriginalTable
,
mOriginalTableSize
,
Type
);
}
STATIC
BOOLEAN
SmbiosHasValidOemFormFactor
(
IN
APPLE_SMBIOS_STRUCTURE_POINTER
Original
)
{
return
Original
.
Raw
!=
NULL
&&
SMBIOS_ACCESSIBLE
(
Original
,
Standard
.
Type17
->
FormFactor
)
&&
Original
.
Standard
.
Type17
->
FormFactor
!=
0
;
}
STATIC
UINT8
SmbiosGetFormFactor
(
IN
OC_SMBIOS_DATA
*
Data
,
IN
APPLE_SMBIOS_STRUCTURE_POINTER
Original
)
{
BOOLEAN
IsAutomatic
;
IsAutomatic
=
!
Data
->
ForceMemoryFormFactor
;
if
(
IsAutomatic
)
{
//
// Try to use the original value if valid first.
//
if
(
SmbiosHasValidOemFormFactor
(
Original
))
{
return
Original
.
Standard
.
Type17
->
FormFactor
;
}
//
// If not, use the value from database.
//
if
(
Data
->
MemoryFormFactor
!=
NULL
)
{
return
*
Data
->
MemoryFormFactor
;
}
}
//
// Under non-Automatic mode, simply use the value from config.
//
if
(
Data
->
MemoryFormFactor
!=
NULL
)
{
return
*
Data
->
MemoryFormFactor
;
}
//
// If the value is not available from config, then try to use the original value.
//
if
(
SmbiosHasValidOemFormFactor
(
Original
))
{
return
Original
.
Standard
.
Type17
->
FormFactor
;
}
//
// If not valid at all, fall back to zero.
//
return
0
;
}
/** Type 0
@param[in] Table Pointer to location containing the current address within the buffer.
...
...
@@ -755,10 +811,12 @@ PatchMemoryDevice (
{
UINT8
MinLength
;
UINT8
StringIndex
;
UINT8
FormFactor
;
*
Handle
=
OcSmbiosInvalidHandle
;
MinLength
=
sizeof
(
*
Original
.
Standard
.
Type17
);
StringIndex
=
0
;
FormFactor
=
SmbiosGetFormFactor
(
Data
,
Original
);
if
(
EFI_ERROR
(
SmbiosInitialiseStruct
(
Table
,
SMBIOS_TYPE_MEMORY_DEVICE
,
MinLength
,
Index
)))
{
return
;
...
...
@@ -770,7 +828,7 @@ PatchMemoryDevice (
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type17
->
TotalWidth
,
Original
,
NULL
,
NULL
);
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type17
->
DataWidth
,
Original
,
NULL
,
NULL
);
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type17
->
Size
,
Original
,
NULL
,
NULL
);
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type17
->
FormFactor
,
Original
,
Data
->
Memory
FormFactor
,
NULL
);
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type17
->
FormFactor
,
Original
,
&
FormFactor
,
NULL
);
SMBIOS_OVERRIDE_V
(
Table
,
Standard
.
Type17
->
DeviceSet
,
Original
,
NULL
,
NULL
);
SMBIOS_OVERRIDE_S
(
Table
,
Standard
.
Type17
->
DeviceLocator
,
Original
,
NULL
,
&
StringIndex
,
NULL
);
SMBIOS_OVERRIDE_S
(
Table
,
Standard
.
Type17
->
BankLocator
,
Original
,
NULL
,
&
StringIndex
,
NULL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录