Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
aaabecac
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,发现更多精彩内容 >>
未验证
提交
aaabecac
编写于
4月 24, 2020
作者:
T
TaiPhamD
提交者:
GitHub
4月 24, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCanopy: Add timeout support (#36)
Co-authored-by:
N
vit9696
<
vit9696@users.noreply.github.com
>
上级
a1f60694
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
60 addition
and
30 deletion
+60
-30
Platform/OpenCanopy/OcBootstrap.c
Platform/OpenCanopy/OcBootstrap.c
+1
-1
Platform/OpenCanopy/OpenCanopy.c
Platform/OpenCanopy/OpenCanopy.c
+26
-10
Platform/OpenCanopy/OpenCanopy.h
Platform/OpenCanopy/OpenCanopy.h
+2
-1
Platform/OpenCanopy/Views/BootPicker.c
Platform/OpenCanopy/Views/BootPicker.c
+1
-18
Platform/OpenCanopy/Views/BootPicker.h
Platform/OpenCanopy/Views/BootPicker.h
+30
-0
未找到文件。
Platform/OpenCanopy/OcBootstrap.c
浏览文件 @
aaabecac
...
...
@@ -82,7 +82,7 @@ OcShowMenuByOc (
}
}
GuiDrawLoop
(
&
mDrawContext
);
GuiDrawLoop
(
&
mDrawContext
,
Context
->
TimeoutSeconds
);
ASSERT
(
mGuiContext
.
BootEntry
!=
NULL
||
mGuiContext
.
Refresh
);
//
...
...
Platform/OpenCanopy/OpenCanopy.c
浏览文件 @
aaabecac
...
...
@@ -16,6 +16,7 @@
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/MtrrLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcCompressionLib.h>
#include <Library/OcCpuLib.h>
#include <Library/OcGuardLib.h>
...
...
@@ -25,6 +26,8 @@
#include "OpenCanopy.h"
#include "GuiIo.h"
#include "GuiApp.h"
#include "Views/BootPicker.h"
typedef
struct
{
UINT32
MinX
;
...
...
@@ -33,6 +36,12 @@ typedef struct {
UINT32
MaxY
;
}
GUI_DRAW_REQUEST
;
//
// Variables to assign the picked volume automatically once menu times out
//
extern
BOOT_PICKER_GUI_CONTEXT
mGuiContext
;
extern
GUI_VOLUME_PICKER
mBootPicker
;
//
// I/O contexts
//
...
...
@@ -1112,7 +1121,8 @@ GuiGetBaseCoords (
VOID
GuiDrawLoop
(
IN
OUT
GUI_DRAWING_CONTEXT
*
DrawContext
IN
OUT
GUI_DRAWING_CONTEXT
*
DrawContext
,
IN
UINT32
TimeOutSeconds
)
{
EFI_STATUS
Status
;
...
...
@@ -1123,9 +1133,9 @@ GuiDrawLoop (
GUI_OBJ
*
HoldObject
;
INT64
HoldObjBaseX
;
INT64
HoldObjBaseY
;
CONST
LIST_ENTRY
*
AnimEntry
;
CONST
GUI_ANIMATION
*
Animation
;
UINT64
LoopStartTsc
;
ASSERT
(
DrawContext
!=
NULL
);
...
...
@@ -1141,9 +1151,8 @@ GuiDrawLoop (
//
// Main drawing loop, time and derieve sub-frequencies as required.
//
mStartTsc
=
AsmReadTsc
();
LoopStartTsc
=
mStartTsc
=
AsmReadTsc
();
do
{
//UINT64 StartTsc = AsmReadTsc ();
if
(
mPointerContext
!=
NULL
)
{
//
// Process pointer events.
...
...
@@ -1206,11 +1215,9 @@ GuiDrawLoop (
&
InputKey
);
//
//
HACK: MSVC complains about unreachable code.
//
If detected key press then disable menu timeout
//
if
(
Status
!=
EFI_SUCCESS
)
{
return
;
}
TimeOutSeconds
=
0
;
}
}
...
...
@@ -1235,8 +1242,17 @@ GuiDrawLoop (
//
GuiFlushScreen
(
DrawContext
);
//UINT64 EndTsc = AsmReadTsc ();
//DEBUG ((DEBUG_ERROR, "Loop delta TSC: %lld, target: %lld\n", EndTsc - StartTsc, mDeltaTscTarget));
//
// Exit early if reach timer timeout and timer isn't disabled due to key event
//
if
(
TimeOutSeconds
>
0
&&
GetTimeInNanoSecond
(
AsmReadTsc
()
-
LoopStartTsc
)
>=
TimeOutSeconds
*
1000000000ULL
)
{
//
// FIXME: There should be view function or alike.
//
mGuiContext
.
BootEntry
=
mBootPicker
.
SelectedEntry
->
Context
;
break
;
}
}
while
(
!
DrawContext
->
ExitLoop
(
DrawContext
->
GuiContext
));
}
...
...
Platform/OpenCanopy/OpenCanopy.h
浏览文件 @
aaabecac
...
...
@@ -245,7 +245,8 @@ GuiViewCurrentCursor (
VOID
GuiDrawLoop
(
IN
OUT
GUI_DRAWING_CONTEXT
*
DrawContext
IN
OUT
GUI_DRAWING_CONTEXT
*
DrawContext
,
IN
UINT32
TimeoutSeconds
);
EFI_STATUS
...
...
Platform/OpenCanopy/Views/BootPicker.c
浏览文件 @
aaabecac
...
...
@@ -22,25 +22,8 @@
#include "../OpenCanopy.h"
#include "../BmfLib.h"
#include "../GuiApp.h"
#include "BootPicker.h"
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
CONST
GUI_IMAGE
*
ClickImage
;
CONST
GUI_IMAGE
*
CurrentImage
;
}
GUI_OBJ_CLICKABLE
;
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
GUI_IMAGE
EntryIcon
;
GUI_IMAGE
Label
;
VOID
*
Context
;
BOOLEAN
CustomIcon
;
}
GUI_VOLUME_ENTRY
;
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
GUI_VOLUME_ENTRY
*
SelectedEntry
;
}
GUI_VOLUME_PICKER
;
extern
GUI_OBJ
mBootPickerView
;
extern
GUI_VOLUME_PICKER
mBootPicker
;
...
...
Platform/OpenCanopy/Views/BootPicker.h
0 → 100644
浏览文件 @
aaabecac
/** @file
This file is part of OpenCanopy, OpenCore GUI.
Copyright (c) 2018-2019, Download-Fritz. All rights reserved.<BR>
SPDX-License-Identifier: BSD-3-Clause
**/
#ifndef BOOT_PICKER_H
#define BOOT_PICKER_H
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
CONST
GUI_IMAGE
*
ClickImage
;
CONST
GUI_IMAGE
*
CurrentImage
;
}
GUI_OBJ_CLICKABLE
;
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
GUI_IMAGE
EntryIcon
;
GUI_IMAGE
Label
;
VOID
*
Context
;
BOOLEAN
CustomIcon
;
}
GUI_VOLUME_ENTRY
;
typedef
struct
{
GUI_OBJ_CHILD
Hdr
;
GUI_VOLUME_ENTRY
*
SelectedEntry
;
}
GUI_VOLUME_PICKER
;
#endif // BOOT_PICKER_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录