Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
1eaab9ad
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,发现更多精彩内容 >>
提交
1eaab9ad
编写于
8月 29, 2020
作者:
G
Goldfish64
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCoreKernel: Fix 64-bit detection behavior
上级
f723a503
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
16 deletion
+38
-16
Include/Acidanthera/Library/OcBootManagementLib.h
Include/Acidanthera/Library/OcBootManagementLib.h
+8
-4
Library/OcMacInfoLib/OcMacInfoLib.c
Library/OcMacInfoLib/OcMacInfoLib.c
+4
-1
Platform/OpenCore/OpenCoreKernel.c
Platform/OpenCore/OpenCoreKernel.c
+26
-11
未找到文件。
Include/Acidanthera/Library/OcBootManagementLib.h
浏览文件 @
1eaab9ad
...
...
@@ -129,9 +129,13 @@ typedef enum OC_PICKER_MODE_ {
10.6 - K32_U32 | K32_U64 | K64_U64.
10.7+ - K32_U64 | K64_U64.
**/
#define OC_KERN_CAPABILITY_K32_U32 BIT0 ///< Supports K32 and U32 (10.4~10.6)
#define OC_KERN_CAPABILITY_K32_U64 BIT1 ///< Supports K32 and U64 (10.4~10.7)
#define OC_KERN_CAPABILITY_K64_U64 BIT2 ///< Supports K64 and U64 (10.6+)
#define OC_KERN_CAPABILITY_K32_U32 BIT0 ///< Supports K32 and U32 (10.4~10.6)
#define OC_KERN_CAPABILITY_K32_U64 BIT1 ///< Supports K32 and U64 (10.4~10.7)
#define OC_KERN_CAPABILITY_K64_U64 BIT2 ///< Supports K64 and U64 (10.6+)
#define OC_KERN_CAPABILITY_K32_K64_U64 (OC_KERN_CAPABILITY_K32_U64 | OC_KERN_CAPABILITY_K64_U64)
#define OC_KERN_CAPABILITY_K32_U32_U64 (OC_KERN_CAPABILITY_K32_U32 | OC_KERN_CAPABILITY_K32_U64)
#define OC_KERN_CAPABILITY_ALL (OC_KERN_CAPABILITY_K32_U32 | OC_KERN_CAPABILITY_K32_K64_U64)
/**
Action to perform as part of executing a system boot entry.
...
...
@@ -1081,7 +1085,7 @@ OcParseBootArgs (
@param[in] GetVariable Preferred UEFI NVRAM reader, optional.
@param[in] Argument Argument, e.g. -v, slide=, debug=, etc.
@param[in] ArgumentLength Argument length, e.g. L_STR_LEN ("-v").
@param[in,out] Value Argument value
length
allocated from pool.
@param[in,out] Value Argument value allocated from pool.
@retval TRUE if argument is present.
**/
...
...
Library/OcMacInfoLib/OcMacInfoLib.c
浏览文件 @
1eaab9ad
...
...
@@ -192,5 +192,8 @@ IsMacModel64BitCompatible (
}
}
return
FALSE
;
//
// Default behavior allows 64-bit on both 10.6 and 10.7 if the model is not found.
//
return
TRUE
;
}
Platform/OpenCore/OpenCoreKernel.c
浏览文件 @
1eaab9ad
...
...
@@ -52,8 +52,11 @@ OcKernelConfigureCapabilities (
UINT32
ArgumentCount
;
UINT32
RequestedArch
;
BOOLEAN
HasAppleArch
;
BOOLEAN
SnowLeo64
;
BOOLEAN
Lion64
;
UINT32
KernelVersion
;
BOOLEAN
IsSnowLeo
;
BOOLEAN
IsLion
;
DEBUG
((
DEBUG_VERBOSE
,
"OC: Supported boot capabilities %u
\n
"
,
Capabilities
));
//
// Reset to the default value.
...
...
@@ -104,27 +107,39 @@ OcKernelConfigureCapabilities (
//
// Determine the current operating system.
//
SnowLeo64
=
(
Capabilities
&
(
OC_KERN_CAPABILITY_K32_U32
|
OC_KERN_CAPABILITY_K32_U64
|
OC_KERN_CAPABILITY_K64_U64
))
==
(
OC_KERN_CAPABILITY_K32_U32
|
OC_KERN_CAPABILITY_K32_U64
|
OC_KERN_CAPABILITY_K64_U64
);
Lion64
=
(
Capabilities
&
(
OC_KERN_CAPABILITY_K32_U32
|
OC_KERN_CAPABILITY_K32_U64
|
OC_KERN_CAPABILITY_K64_U64
))
==
(
OC_KERN_CAPABILITY_K32_U64
|
OC_KERN_CAPABILITY_K64_U64
);
IsSnowLeo
=
FALSE
;
IsLion
=
FALSE
;
if
((
Capabilities
&
OC_KERN_CAPABILITY_ALL
)
==
OC_KERN_CAPABILITY_ALL
)
{
KernelVersion
=
KERNEL_VERSION_SNOW_LEOPARD_MIN
;
IsSnowLeo
=
TRUE
;
}
else
if
((
Capabilities
&
OC_KERN_CAPABILITY_ALL
)
==
OC_KERN_CAPABILITY_K32_K64_U64
)
{
KernelVersion
=
KERNEL_VERSION_LION_MIN
;
IsLion
=
TRUE
;
}
else
if
((
Capabilities
&
OC_KERN_CAPABILITY_ALL
)
==
OC_KERN_CAPABILITY_K32_U32_U64
)
{
KernelVersion
=
KERNEL_VERSION_LEOPARD_MIN
;
}
else
{
KernelVersion
=
KERNEL_VERSION_MOUNTAIN_LION_MIN
;
}
//
// In automatic mode, if we do not support SSSE3 and can downgrade to U32, do it.
//
if
(
RequestedArch
==
0
&&
(
mOcCpuInfo
->
ExtFeatures
&
CPUID_EXTFEATURE_EM64T
)
==
0
&&
(
mOcCpuInfo
->
Features
&
CPUID_FEATURE_SSSE3
)
==
0
&&
(
Capabilities
&
OC_KERN_CAPABILITY_K32_U32
)
!=
0
&&
(
Capabilities
&
(
OC_KERN_CAPABILITY_K32_U64
|
OC_KERN_CAPABILITY_K64_U64
)
)
!=
0
)
{
&&
(
Capabilities
&
OC_KERN_CAPABILITY_K32_K64_U64
)
!=
0
)
{
DEBUG
((
DEBUG_INFO
,
"OC: Missing SSSE3 disables U64 capabilities %u
\n
"
,
Capabilities
));
Capabilities
&=
~
(
OC_KERN_CAPABILITY_K32_
U64
|
OC_KERN_CAPABILITY_
K64_U64
);
Capabilities
&=
~
(
OC_KERN_CAPABILITY_K32_K64_U64
);
}
//
// If we support K64 mode, check whether the board supports it.
//
if
((
Capabilities
&
OC_KERN_CAPABILITY_K64_U64
)
!=
0
&&
!
OcPlatformIs64BitSupported
(
SnowLeo64
?
KERNEL_VERSION_SNOW_LEOPARD_MIN
:
KERNEL_VERSION_LION_MIN
))
{
&&
!
OcPlatformIs64BitSupported
(
KernelVersion
))
{
DEBUG
((
DEBUG_INFO
,
"OC: K64 forbidden due to current platform on version %u
\n
"
,
KernelVersion
));
Capabilities
&=
~
(
OC_KERN_CAPABILITY_K64_U64
);
}
...
...
@@ -150,9 +165,9 @@ OcKernelConfigureCapabilities (
// - SnowLeo64 or Lion64 and try to boot i386.
//
ArgumentCount
=
0
;
if
(
Capabilities
==
OC_KERN_CAPABILITY_K64_U64
&&
SnowLeo64
)
{
if
(
Capabilities
==
OC_KERN_CAPABILITY_K64_U64
&&
IsSnowLeo
)
{
NewArguments
[
ArgumentCount
++
]
=
"arch=x86_64"
;
}
else
if
(
Capabilities
!=
OC_KERN_CAPABILITY_K64_U64
&&
(
SnowLeo64
||
Lion64
))
{
}
else
if
(
Capabilities
!=
OC_KERN_CAPABILITY_K64_U64
&&
(
IsSnowLeo
||
IsLion
))
{
NewArguments
[
ArgumentCount
++
]
=
"arch=i386"
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录