Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
892f9fd1
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,发现更多精彩内容 >>
提交
892f9fd1
编写于
4月 18, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCoreUefi: Added `AppleRtcRam` protocol implementation
closes acidanthera/bugtracker#765
上级
b508b429
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
116 addition
and
9 deletion
+116
-9
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+14
-2
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+18
-4
Docs/Sample.plist
Docs/Sample.plist
+11
-0
Docs/SampleFull.plist
Docs/SampleFull.plist
+11
-0
Include/Guid/OcVariables.h
Include/Guid/OcVariables.h
+5
-0
Include/Library/OcConfigurationLib.h
Include/Library/OcConfigurationLib.h
+1
-0
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Library/OcRtcLib/AppleRtcRam.c
Library/OcRtcLib/AppleRtcRam.c
+45
-3
Library/OcRtcLib/OcRtcLib.inf
Library/OcRtcLib/OcRtcLib.inf
+4
-0
Platform/OpenCore/OpenCoreUefi.c
Platform/OpenCore/OpenCoreUefi.c
+5
-0
未找到文件。
Changelog.md
浏览文件 @
892f9fd1
...
...
@@ -14,6 +14,7 @@ OpenCore Changelog
-
Added memory region reservation support
-
Added RtcRw tool to manipulate RTC memory
-
Added
`PatchAppleRtcChecksum`
kernel quirk
-
Added
`AppleRtcRam`
protocol implementation
#### v0.5.7
-
Added TimeMachine detection to picker
...
...
Docs/Configuration.pdf
浏览文件 @
892f9fd1
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
892f9fd1
...
...
@@ -1987,8 +1987,8 @@ blocking.
kernel extension if this is desired.
\emph
{
Note 2
}
: This option will not protect areas from being overwritten
at firmware stage (e.g. macOS bootloader), see
\texttt
{
RTC
}
(FIXME) section
if this is desired.
at firmware stage (e.g. macOS bootloader), see
\texttt
{
AppleRtc
}
protocol
description
if this is desired.
\item
\texttt
{
DummyPowerManagement
}
\\
...
...
@@ -4826,6 +4826,18 @@ functioning. Feature highlights:
\textbf
{
Description
}
: Reinstalls Apple Key Map protocols with builtin
versions.
\item
\texttt
{
AppleRtc
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Reinstalls Apple RTC RAM protocol with builtin
version.
\emph
{
Note
}
: Builtin version of Apple RTC RAM protocol may filter out
I
/
O attempts to select RTC memory addresses. The list of addresses
can be specified in
\texttt
{
4
D
1
FDA
02
-
38
C
7
-
4
A
6
A
-
9
CC
6
-
4
BCCA
8
B
30102
:rtc
-
blacklist
}
variable as a data array.
\item
\texttt
{
AppleSmcIo
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
...
Docs/Differences/Differences.pdf
浏览文件 @
892f9fd1
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
892f9fd1
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Apr 7 19:32:13 2020
%DIF ADD ../Configuration.tex Sat Apr 18
15:39:07
2020
%DIF ADD ../Configuration.tex Sat Apr 18
22:12:54
2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -2050,8 +2050,8 @@ blocking.
}
\emph
{
\DIFadd
{
Note 2
}}
\DIFadd
{
: This option will not protect areas from being overwritten
at firmware stage (e.g. macOS bootloader), see
}
\texttt
{
\DIFadd
{
RTC
}}
\DIFadd
{
(FIXME) section
if this is desired.
at firmware stage (e.g. macOS bootloader), see
}
\texttt
{
\DIFadd
{
AppleRtc
}}
\DIFadd
{
protocol
description
if this is desired.
}
\item
...
...
@@ -4911,7 +4911,21 @@ functioning. Feature highlights:
versions.
\item
\texttt
{
AppleSmcIo
}
\\
\DIFaddbegin
\texttt
{
\DIFadd
{
AppleRtc
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
false
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Reinstalls Apple RTC RAM protocol with builtin
version.
}
\emph
{
\DIFadd
{
Note
}}
\DIFadd
{
: Builtin version of Apple RTC RAM protocol may filter out
I
/
O attempts to select RTC memory addresses. The list of addresses
can be specified in
}
\texttt
{
\DIFadd
{
4
D
1
FDA
02
-
38
C
7
-
4
A
6
A
-
9
CC
6
-
4
BCCA
8
B
30102
:rtc
-
blacklist
}}
\DIFadd
{
variable as a data array.
}
\item
\DIFaddend
\texttt
{
AppleSmcIo
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Reinstalls Apple SMC I
/
O protocol with a builtin
...
...
Docs/Sample.plist
浏览文件 @
892f9fd1
...
...
@@ -683,6 +683,11 @@
<key>
prev-lang:kbd
</key>
<data>
cnUtUlU6MjUy
</data>
</dict>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
<dict>
<key>
rtc-blacklist
</key>
<data></data>
</dict>
</dict>
<key>
Block
</key>
<dict>
...
...
@@ -695,6 +700,10 @@
<array>
<string>
boot-args
</string>
</array>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
<array>
<string>
rtc-blacklist
</string>
</array>
</dict>
<key>
LegacyEnable
</key>
<false/>
...
...
@@ -864,6 +873,8 @@
<false/>
<key>
AppleKeyMap
</key>
<false/>
<key>
AppleRtcRam
</key>
<false/>
<key>
AppleSmcIo
</key>
<false/>
<key>
AppleUserInterfaceTheme
</key>
...
...
Docs/SampleFull.plist
浏览文件 @
892f9fd1
...
...
@@ -683,6 +683,11 @@
<key>
prev-lang:kbd
</key>
<data>
cnUtUlU6MjUy
</data>
</dict>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
<dict>
<key>
rtc-blacklist
</key>
<data></data>
</dict>
</dict>
<key>
Block
</key>
<dict>
...
...
@@ -695,6 +700,10 @@
<array>
<string>
boot-args
</string>
</array>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
<array>
<string>
rtc-blacklist
</string>
</array>
</dict>
<key>
LegacyEnable
</key>
<false/>
...
...
@@ -967,6 +976,8 @@
<false/>
<key>
AppleKeyMap
</key>
<false/>
<key>
AppleRtcRam
</key>
<false/>
<key>
AppleSmcIo
</key>
<false/>
<key>
AppleUserInterfaceTheme
</key>
...
...
Include/Guid/OcVariables.h
浏览文件 @
892f9fd1
...
...
@@ -77,6 +77,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
#define OC_ACPI_CPU_FREQUENCY_VARIABLE_NAME L"acpi-cpu-frequency"
//
// Variable used to mark blacklisted RTC values.
//
#define OC_RTC_BLACKLIST_VARIABLE_NAME L"rtc-blacklist"
//
// 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
// This GUID is specifically used for normal variable access by Lilu kernel extension and its plugins.
...
...
Include/Library/OcConfigurationLib.h
浏览文件 @
892f9fd1
...
...
@@ -535,6 +535,7 @@ typedef enum {
_(BOOLEAN , AppleEvent , , FALSE , ()) \
_(BOOLEAN , AppleImageConversion , , FALSE , ()) \
_(BOOLEAN , AppleKeyMap , , FALSE , ()) \
_(BOOLEAN , AppleRtcRam , , FALSE , ()) \
_(BOOLEAN , AppleSmcIo , , FALSE , ()) \
_(BOOLEAN , AppleUserInterfaceTheme , , FALSE , ()) \
_(BOOLEAN , DataHub , , FALSE , ()) \
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
892f9fd1
...
...
@@ -547,6 +547,7 @@ mUefiProtocolsSchema[] = {
OC_SCHEMA_BOOLEAN_IN
(
"AppleEvent"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
AppleEvent
),
OC_SCHEMA_BOOLEAN_IN
(
"AppleImageConversion"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
AppleImageConversion
),
OC_SCHEMA_BOOLEAN_IN
(
"AppleKeyMap"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
AppleKeyMap
),
OC_SCHEMA_BOOLEAN_IN
(
"AppleRtcRam"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
AppleRtcRam
),
OC_SCHEMA_BOOLEAN_IN
(
"AppleSmcIo"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
AppleSmcIo
),
OC_SCHEMA_BOOLEAN_IN
(
"AppleUserInterfaceTheme"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
AppleUserInterfaceTheme
),
OC_SCHEMA_BOOLEAN_IN
(
"DataHub"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Protocols
.
DataHub
),
...
...
Library/OcRtcLib/AppleRtcRam.c
浏览文件 @
892f9fd1
...
...
@@ -16,9 +16,11 @@
**/
#include <Guid/OcVariables.h>
#include <Protocol/AppleRtcRam.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcRtcLib.h>
#include <Library/UefiBootServicesTableLib.h>
...
...
@@ -26,6 +28,9 @@
#include "OcRtcLibInternal.h"
STATIC
EFI_LOCK
mAppleRtcRamLock
;
STATIC
UINT8
mEmulatedRtcArea
[
APPLE_RTC_TOTAL_SIZE
];
STATIC
BOOLEAN
mEmulatedRtcStatus
[
APPLE_RTC_TOTAL_SIZE
];
STATIC
EFI_STATUS
...
...
@@ -36,6 +41,10 @@ SyncRtcRead (
{
EFI_STATUS
Status
;
if
(
mEmulatedRtcStatus
[
Address
])
{
return
mEmulatedRtcArea
[
Address
];
}
Status
=
EfiAcquireLockOrFail
(
&
mAppleRtcRamLock
);
if
(
EFI_ERROR
(
Status
))
{
return
Status
;
...
...
@@ -55,6 +64,11 @@ SyncRtcWrite (
{
EFI_STATUS
Status
;
if
(
mEmulatedRtcStatus
[
Address
])
{
mEmulatedRtcArea
[
Address
]
=
Value
;
return
EFI_SUCCESS
;
}
Status
=
EfiAcquireLockOrFail
(
&
mAppleRtcRamLock
);
if
(
EFI_ERROR
(
Status
))
{
return
Status
;
...
...
@@ -150,7 +164,7 @@ AppleRtcRamReadData (
return
Status
;
}
if
((
(
UINT32
)
Temp
^
(
UINT32
)
*
Buffer
)
!=
0xFF
)
{
if
((
Temp
^
*
Buffer
)
!=
0xFF
)
{
*
Buffer
=
0
;
}
}
...
...
@@ -275,8 +289,11 @@ OcAppleRtcRamInstallProtocol (
IN
BOOLEAN
Reinstall
)
{
EFI_STATUS
Status
;
APPLE_RTC_RAM_PROTOCOL
*
Protocol
;
EFI_STATUS
Status
;
APPLE_RTC_RAM_PROTOCOL
*
Protocol
;
UINT8
*
RtcBlacklist
;
UINTN
Index
;
UINTN
RtcBlacklistSize
;
DEBUG
((
DEBUG_VERBOSE
,
"OcAppleRtcRamInstallProtocol
\n
"
));
...
...
@@ -298,6 +315,31 @@ OcAppleRtcRamInstallProtocol (
}
}
DEBUG
((
DEBUG_INFO
,
"OCRTC: Wake log is 0x%02X 0x%02X % 3d 0x%02X
\n
"
,
OcRtcRead
(
APPLE_RTC_TRACE_DATA_ADDR
),
OcRtcRead
(
APPLE_RTC_WL_MASK_ADDR
),
OcRtcRead
(
APPLE_RTC_WL_EVENT_ADDR
),
OcRtcRead
(
APPLE_RTC_WL_EVENT_EXTRA_ADDR
)
));
Status
=
GetVariable2
(
OC_RTC_BLACKLIST_VARIABLE_NAME
,
&
gOcVendorVariableGuid
,
(
VOID
**
)
&
RtcBlacklist
,
&
RtcBlacklistSize
);
if
(
!
EFI_ERROR
(
Status
))
{
for
(
Index
=
0
;
Index
<
APPLE_RTC_TOTAL_SIZE
;
++
Index
)
{
mEmulatedRtcStatus
[
RtcBlacklist
[
Index
]]
=
TRUE
;
DEBUG
((
DEBUG_INFO
,
"OCRTC: Blacklisted %02x address
\n
"
,
RtcBlacklist
[
Index
]));
}
FreePool
(
RtcBlacklist
);
}
//
// Note, for debugging on QEMU this will need to changed to TPL_CALLBACK.
// By default we follow AppleRtcRam implementation.
...
...
Library/OcRtcLib/OcRtcLib.inf
浏览文件 @
892f9fd1
...
...
@@ -38,6 +38,9 @@
MdePkg/MdePkg.dec
OpenCorePkg/OpenCorePkg.dec
[Guids]
gOcVendorVariableGuid
[Protocols]
gAppleRtcRamProtocolGuid
...
...
@@ -45,6 +48,7 @@
BaseMemoryLib
DebugLib
IoLib
MemoryAllocationLib
OcMiscLib
UefiLib
UefiBootServicesTableLib
Platform/OpenCore/OpenCoreUefi.c
浏览文件 @
892f9fd1
...
...
@@ -38,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcFirmwareVolumeLib.h>
#include <Library/OcHashServicesLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcRtcLib.h>
#include <Library/OcSmcLib.h>
#include <Library/OcOSInfoLib.h>
#include <Library/OcUnicodeCollationEngGenericLib.h>
...
...
@@ -339,6 +340,10 @@ OcReinstallProtocols (
if
(
OcOSInfoInstallProtocol
(
Config
->
Uefi
.
Protocols
.
OSInfo
)
==
NULL
)
{
DEBUG
((
DEBUG_ERROR
,
"OC: Failed to install os info protocol
\n
"
));
}
if
(
OcAppleRtcRamInstallProtocol
(
Config
->
Uefi
.
Protocols
.
AppleRtcRam
)
==
NULL
)
{
DEBUG
((
DEBUG_ERROR
,
"OC: Failed to install rtc ram protocol
\n
"
));
}
}
VOID
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录