Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
b69a9bbd
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,发现更多精彩内容 >>
提交
b69a9bbd
编写于
1月 08, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Build: Improve IA32 compatibility
上级
47a10510
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
109 addition
and
31 deletion
+109
-31
Library/OcAppleBootCompatLib/CustomSlide.c
Library/OcAppleBootCompatLib/CustomSlide.c
+2
-2
Library/OcAppleBootCompatLib/IA32/ContextSwitch.h
Library/OcAppleBootCompatLib/IA32/ContextSwitch.h
+0
-25
Library/OcAppleBootCompatLib/IA32/ContextSwitchSupport.c
Library/OcAppleBootCompatLib/IA32/ContextSwitchSupport.c
+27
-0
Library/OcAppleBootCompatLib/OcAppleBootCompatLib.inf
Library/OcAppleBootCompatLib/OcAppleBootCompatLib.inf
+4
-2
Library/OcAppleEventLib/PointerHandler.c
Library/OcAppleEventLib/PointerHandler.c
+1
-1
Library/OcRngLib/IA32/RngDelay.nasm
Library/OcRngLib/IA32/RngDelay.nasm
+72
-0
Library/OcRngLib/OcRngLib.inf
Library/OcRngLib/OcRngLib.inf
+3
-0
Library/OcRngLib/X64/RngDelay.nasm
Library/OcRngLib/X64/RngDelay.nasm
+0
-1
未找到文件。
Library/OcAppleBootCompatLib/CustomSlide.c
浏览文件 @
b69a9bbd
...
...
@@ -80,7 +80,7 @@ GenerateSlideValue (
IN
SLIDE_SUPPORT_STATE
*
SlideSupport
)
{
UINT
64
Slide
;
UINT
32
Slide
;
//
// Handle 0 slide case.
...
...
@@ -90,7 +90,7 @@ GenerateSlideValue (
}
do
{
Slide
=
GetPseudoRandomNumber64
()
%
SlideSupport
->
ValidSlideCount
;
DivU64x32Remainder
(
GetPseudoRandomNumber64
(),
SlideSupport
->
ValidSlideCount
,
&
Slide
)
;
}
while
(
Slide
==
0
);
return
SlideSupport
->
ValidSlides
[
Slide
];
...
...
Library/OcAppleBootCompatLib/IA32/ContextSwitch.h
浏览文件 @
b69a9bbd
...
...
@@ -46,29 +46,4 @@ typedef PACKED struct ASM_KERNEL_JUMP_ {
#pragma pack(pop)
/**
Assembly interface to save UEFI environment state in specific way.
@param[in,out] AsmState Assembly state to update, can be preserved.
**/
VOID
EFIAPI
AsmAppleMapPlatformSaveState
(
IN
OUT
ASM_SUPPORT_STATE
*
AsmState
);
/**
Assembly interface for backjump from kernel code.
Takes kernel arguments through RAX or EAX register.
**/
VOID
AsmAppleMapPlatformPrepareKernelState
(
);
/**
Assembly global variable containing ASM_SUPPORT_STATE address.
Must fit into lower 32-bit bytes due to 32-bit .
**/
extern
UINT32
gOcAbcAsmStateAddr32
;
#endif // CONTEXT_SWITCH_H
Library/OcAppleBootCompatLib/IA32/ContextSwitchSupport.c
0 → 100644
浏览文件 @
b69a9bbd
/** @file
Copyright (C) 2019, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "../BootCompatInternal.h"
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
VOID
AppleMapPlatformSaveState
(
IN
OUT
ASM_SUPPORT_STATE
*
AsmState
,
OUT
ASM_KERNEL_JUMP
*
KernelJump
)
{
CpuDeadLoop
();
}
Library/OcAppleBootCompatLib/OcAppleBootCompatLib.inf
浏览文件 @
b69a9bbd
...
...
@@ -36,12 +36,14 @@
KernelSupport.c
OcAppleBootCompatLib.c
ServiceOverrides.c
# All headers should go to [Sources], this sounds like a bug in EDK II Build System.
IA32/ContextSwitch.h
X64/ContextSwitch.h
[Sources.IA32]
IA32/ContextSwitch
.h
IA32/ContextSwitch
Support.c
[Sources.X64]
X64/ContextSwitch.h
X64/ContextSwitch.nasm
X64/ContextSwitchSupport.c
...
...
Library/OcAppleEventLib/PointerHandler.c
浏览文件 @
b69a9bbd
...
...
@@ -792,7 +792,7 @@ InternalSimplePointerPollNotifyFunction (
EndTime
=
GetTimeInNanoSecond
(
EndTime
-
StartTime
);
// Maximum time allowed in this function is half the interval plus some margin (0.55 * 100ns)
if
(
EndTime
>
mSimplePointerPollTime
*
55ULL
)
{
mSimplePointerPollTime
=
EndTime
/
50ULL
;
mSimplePointerPollTime
=
DivU64x32
(
EndTime
,
50
)
;
if
(
mSimplePointerPollTime
>
MAX_POINTER_POLL_FREQUENCY
)
{
mSimplePointerPollTime
=
MAX_POINTER_POLL_FREQUENCY
;
}
...
...
Library/OcRngLib/IA32/RngDelay.nasm
0 → 100644
浏览文件 @
b69a9bbd
;------------------------------------------------------------------------------
; @file
; Copyright (C) 2020, vit9696. All rights reserved.
;
; All rights reserved.
;
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;------------------------------------------------------------------------------
BITS 32
DEFAULT REL
SECTION .text
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; AsmAddRngJitter (
; IN UINT64 Value
; );
;------------------------------------------------------------------------------
align 8
global ASM_PFX(AsmAddRngJitter)
ASM_PFX(AsmAddRngJitter):
; This assembly code corresponds to Hamming Weight implementation for targets
; with fast multiplication.
; REF: https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation
push esi
mov edx, [esp+8]
mov eax, [esp+12]
mov ecx, edx
shr ecx, 1
mov esi, eax
shr esi, 1
and esi, 55555555h
and ecx, 55555555h
sub edx, ecx
sbb eax, esi
mov ecx, eax
and ecx, 33333333h
mov esi, edx
and esi, 33333333h
shr edx, 2
shr eax, 2
and eax, 33333333h
add eax, ecx
and edx, 33333333h
add edx, esi
mov ecx, eax
shld ecx, edx, 1Ch
mov esi, eax
shr esi, 4
add ecx, edx
adc esi, eax
and esi, 0F0F0F0Fh
and ecx, 0F0F0F0Fh
mov edx, 1010101h
mov eax, ecx
mul edx
imul ecx, 1010101h
add ecx, edx
imul eax, esi, 1010101h
add eax, ecx
shr eax, 18h
pop esi
ret
Library/OcRngLib/OcRngLib.inf
浏览文件 @
b69a9bbd
...
...
@@ -32,6 +32,9 @@
OcRngLib.c
OcRngInternals.h
[Sources.IA32]
IA32/RngDelay.nasm
[Sources.X64]
X64/RngDelay.nasm
...
...
Library/OcRngLib/X64/RngDelay.nasm
浏览文件 @
b69a9bbd
...
...
@@ -28,7 +28,6 @@ SECTION .text
align 8
global ASM_PFX(AsmAddRngJitter)
ASM_PFX(AsmAddRngJitter):
BITS 64
; This assembly code corresponds to Hamming Weight implementation for targets
; with fast multiplication.
; REF: https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录