Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
28c316fc
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,发现更多精彩内容 >>
提交
28c316fc
编写于
6月 17, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcDevicePathLib: Fix freezes during boot option expansion with PXE
上级
ddfe2b82
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
168 deletion
+5
-168
Changelog.md
Changelog.md
+1
-0
Library/OcDevicePathLib/ExpandDevicePath.c
Library/OcDevicePathLib/ExpandDevicePath.c
+4
-168
未找到文件。
Changelog.md
浏览文件 @
28c316fc
...
...
@@ -10,6 +10,7 @@ OpenCore Changelog
-
Added
`Firmware`
mode to
`ResetSystem`
to reboot into preferences
-
Replaced
`BlacklistAppleUpdate`
with
`run-efi-updater`
NVRAM variable
-
Fixed reset value in
`FadtEnableReset`
ACPI quirk
-
Fixed freezes during boot option expansion with PXE boot entries
#### v0.5.9
-
Added full HiDPI support in OpenCanopy
...
...
Library/OcDevicePathLib/ExpandDevicePath.c
浏览文件 @
28c316fc
...
...
@@ -542,170 +542,6 @@ BmExpandMediaDevicePath (
return
NextFullPath
;
}
/**
Get the file buffer from the specified Load File instance.
@param LoadFileHandle The specified Load File instance.
@param FilePath The file path which will pass to LoadFile().
@return The full device path pointing to the load option buffer.
**/
STATIC
EFI_DEVICE_PATH_PROTOCOL
*
BmExpandLoadFile
(
IN
EFI_HANDLE
LoadFileHandle
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
FilePath
)
{
EFI_STATUS
Status
;
EFI_LOAD_FILE_PROTOCOL
*
LoadFile
;
VOID
*
FileBuffer
;
UINTN
BufferSize
;
Status
=
gBS
->
OpenProtocol
(
LoadFileHandle
,
&
gEfiLoadFileProtocolGuid
,
(
VOID
**
)
&
LoadFile
,
gImageHandle
,
NULL
,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
ASSERT_EFI_ERROR
(
Status
);
FileBuffer
=
NULL
;
BufferSize
=
0
;
Status
=
LoadFile
->
LoadFile
(
LoadFile
,
FilePath
,
TRUE
,
&
BufferSize
,
FileBuffer
);
if
((
Status
!=
EFI_WARN_FILE_SYSTEM
)
&&
(
Status
!=
EFI_BUFFER_TOO_SMALL
))
{
return
NULL
;
}
if
(
Status
==
EFI_BUFFER_TOO_SMALL
)
{
//
// The load option buffer is directly returned by LoadFile.
//
return
DuplicateDevicePath
(
DevicePathFromHandle
(
LoadFileHandle
));
}
//
// The load option resides in a RAM disk.
// CHANGE: Removed RAM disk support.
//
return
NULL
;
}
/**
Return the full device path pointing to the load option.
FilePath may:
1. Exactly matches to a LoadFile instance.
2. Cannot match to any LoadFile instance. Wide match is required.
In either case, the routine may return:
1. A copy of FilePath when FilePath matches to a LoadFile instance and
the LoadFile returns a load option buffer.
2. A new device path with IP and URI information updated when wide match
happens.
3. A new device path pointing to a load option in RAM disk.
In either case, only one full device path is returned for a specified
FilePath.
@param FilePath The media device path pointing to a LoadFile instance.
@return The load option buffer.
**/
STATIC
EFI_DEVICE_PATH_PROTOCOL
*
BmExpandLoadFiles
(
IN
EFI_DEVICE_PATH_PROTOCOL
*
FilePath
)
{
EFI_STATUS
Status
;
EFI_HANDLE
Handle
;
EFI_DEVICE_PATH_PROTOCOL
*
Node
;
//
// Get file buffer from load file instance.
//
Node
=
FilePath
;
Status
=
gBS
->
LocateDevicePath
(
&
gEfiLoadFileProtocolGuid
,
&
Node
,
&
Handle
);
// CHANGE: Removed HTTP support.
if
(
EFI_ERROR
(
Status
)
||
!
IsDevicePathEnd
(
Node
))
{
return
NULL
;
}
//
// When wide match happens, pass full device path to LoadFile (),
// otherwise, pass remaining device path to LoadFile ().
//
FilePath
=
Node
;
return
BmExpandLoadFile
(
Handle
,
FilePath
);
}
/**
Expand URI device path node to be full device path in platform.
@param FilePath The device path pointing to a load option.
It could be a short-form device path.
@param FullPath The full path returned by the routine in last call.
Set to NULL in first call.
@return The next possible full path pointing to the load option.
Caller is responsible to free the memory.
**/
STATIC
EFI_DEVICE_PATH_PROTOCOL
*
BmExpandUriDevicePath
(
IN
EFI_DEVICE_PATH_PROTOCOL
*
FilePath
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
FullPath
)
{
EFI_STATUS
Status
;
UINTN
Index
;
UINTN
HandleCount
;
EFI_HANDLE
*
Handles
;
EFI_DEVICE_PATH_PROTOCOL
*
NextFullPath
;
BOOLEAN
GetNext
;
// CHANGE: Only connect all on failure.
Status
=
gBS
->
LocateHandleBuffer
(
ByProtocol
,
&
gEfiLoadFileProtocolGuid
,
NULL
,
&
HandleCount
,
&
Handles
);
if
(
EFI_ERROR
(
Status
))
{
HandleCount
=
0
;
Handles
=
NULL
;
}
NextFullPath
=
NULL
;
GetNext
=
(
BOOLEAN
)(
FullPath
==
NULL
);
for
(
Index
=
0
;
Index
<
HandleCount
;
Index
++
)
{
NextFullPath
=
BmExpandLoadFile
(
Handles
[
Index
],
FilePath
);
if
(
NextFullPath
==
NULL
)
{
continue
;
}
if
(
GetNext
)
{
break
;
}
else
{
GetNext
=
(
BOOLEAN
)(
CompareMem
(
NextFullPath
,
FullPath
,
GetDevicePathSize
(
NextFullPath
))
==
0
);
//
// Free the resource occupied by the RAM disk.
// CHANGE: RAM Disk support removed.
//
FreePool
(
NextFullPath
);
NextFullPath
=
NULL
;
}
}
if
(
Handles
!=
NULL
)
{
FreePool
(
Handles
);
}
if
((
NextFullPath
==
NULL
)
&&
!
mConnectAllExecuted
)
{
InternalConnectAll
();
return
BmExpandUriDevicePath
(
FilePath
,
FullPath
);
}
return
NextFullPath
;
}
/**
Check whether there is a instance in BlockIoDevicePath, which contain multi device path
instances, has the same partition node with HardDriveDevicePath device path
...
...
@@ -1011,9 +847,9 @@ OcGetNextLoadOptionDevicePath (
}
else
if
((
DevicePathType
(
FilePath
)
==
MESSAGING_DEVICE_PATH
)
&&
(
DevicePathSubType
(
FilePath
)
==
MSG_URI_DP
))
{
//
//
Expand
the URI device path
//
CHANGE: Removed expansion of
the URI device path
//
return
BmExpandUriDevicePath
(
FilePath
,
FullPath
)
;
return
NULL
;
}
else
{
Node
=
FilePath
;
Status
=
gBS
->
LocateDevicePath
(
&
gEfiUsbIoProtocolGuid
,
&
Node
,
&
Handle
);
...
...
@@ -1060,7 +896,7 @@ OcGetNextLoadOptionDevicePath (
// CHANGE: Removed FV support.
//
//
Last chance to try: Load option may be loaded through LoadFile
.
//
CHANGE: Remove LoadFile support (e.g. PXE network boot)
.
//
return
BmExpandLoadFiles
(
FilePath
)
;
return
NULL
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录