Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
0ea633ef
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,发现更多精彩内容 >>
提交
0ea633ef
编写于
4月 10, 2019
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcDevicePathLib: Implement AbsoluteDevicePath
上级
f4acfe5f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
62 addition
and
13 deletion
+62
-13
Include/Library/OcDevicePathLib.h
Include/Library/OcDevicePathLib.h
+33
-12
Library/OcDevicePathLib/OcDevicePathLib.c
Library/OcDevicePathLib/OcDevicePathLib.c
+28
-0
Library/OcSmbiosLib/SmbiosPatch.c
Library/OcSmbiosLib/SmbiosPatch.c
+1
-1
未找到文件。
Include/Library/OcDevicePathLib.h
浏览文件 @
0ea633ef
...
@@ -12,11 +12,11 @@
...
@@ -12,11 +12,11 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
**/
#ifndef OC_DEVICE_PATH_LIB_H
_
#ifndef OC_DEVICE_PATH_LIB_H
#define OC_DEVICE_PATH_LIB_H
_
#define OC_DEVICE_PATH_LIB_H
// AppendFileNameDevicePath
/**
/**
Append file name to device path.
@param[in] DevicePath The device path which to append the file path.
@param[in] DevicePath The device path which to append the file path.
@param[in] FileName The file name to append to the device path.
@param[in] FileName The file name to append to the device path.
...
@@ -31,8 +31,8 @@ AppendFileNameDevicePath (
...
@@ -31,8 +31,8 @@ AppendFileNameDevicePath (
IN
CHAR16
*
FileName
IN
CHAR16
*
FileName
);
);
/
/ DevicePathToText
/
**
/**
Converts a device path structure to its string representative.
Converts a device path structure to its string representative.
@param[in] StorageDevicePath The device path to convert to unicode string.
@param[in] StorageDevicePath The device path to convert to unicode string.
@param[in] DisplayOnly If DisplayOnly is TRUE, then the shorter text
@param[in] DisplayOnly If DisplayOnly is TRUE, then the shorter text
...
@@ -55,8 +55,8 @@ DevicePathToText (
...
@@ -55,8 +55,8 @@ DevicePathToText (
IN
BOOLEAN
AllowShortcuts
IN
BOOLEAN
AllowShortcuts
);
);
/
/ FindDevicePathNodeWithType
/
**
/**
Locate the node inside the device path specified by Type an SubType values.
Locate the node inside the device path specified by Type an SubType values.
@param[in] DevicePath The device path used in the search.
@param[in] DevicePath The device path used in the search.
@param[in] Type The Type field of the device path node specified by Node.
@param[in] Type The Type field of the device path node specified by Node.
...
@@ -71,8 +71,8 @@ FindDevicePathNodeWithType (
...
@@ -71,8 +71,8 @@ FindDevicePathNodeWithType (
IN
UINT8
SubType
OPTIONAL
IN
UINT8
SubType
OPTIONAL
);
);
/
/ IsDevicePathEqual
/
**
/**
Check whether device paths are equal.
@param[in] DevicePath1 The first device path protocol to compare.
@param[in] DevicePath1 The first device path protocol to compare.
@param[in] DevicePath2 The second device path protocol to compare.
@param[in] DevicePath2 The second device path protocol to compare.
...
@@ -87,8 +87,8 @@ IsDevicePathEqual (
...
@@ -87,8 +87,8 @@ IsDevicePathEqual (
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath2
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath2
);
);
/
/ IsDeviceChild
/
**
/**
Check whether one device path exists in the other.
@param[in] ParentPath The parent device path protocol to check against.
@param[in] ParentPath The parent device path protocol to check against.
@param[in] ChildPath The device path protocol of the child device to compare.
@param[in] ChildPath The device path protocol of the child device to compare.
...
@@ -104,6 +104,13 @@ IsDeviceChild (
...
@@ -104,6 +104,13 @@ IsDeviceChild (
IN
UINT8
EndPathType
IN
UINT8
EndPathType
);
);
/**
Print debug path to log.
@param[in] ErrorLevel Debug error level.
@param[in] ChildPath Prefixed message.
@param[in] DevicePath Device path to print.
**/
VOID
VOID
DebugPrintDevicePath
(
DebugPrintDevicePath
(
IN
UINTN
ErrorLevel
,
IN
UINTN
ErrorLevel
,
...
@@ -111,4 +118,18 @@ DebugPrintDevicePath (
...
@@ -111,4 +118,18 @@ DebugPrintDevicePath (
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
);
);
#endif // OC_DEVICE_PATH_LIB_H_
/**
Get absolute device path.
@param[in] Handle Device handle.
@param[in] RelativePath Relative device path to handle, optional.
@retval New device path or NULL.
**/
EFI_DEVICE_PATH_PROTOCOL
*
AbsoluteDevicePath
(
IN
EFI_HANDLE
Handle
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
RelativePath
OPTIONAL
);
#endif // OC_DEVICE_PATH_LIB_H
Library/OcDevicePathLib/OcDevicePathLib.c
浏览文件 @
0ea633ef
...
@@ -371,3 +371,31 @@ DebugPrintDevicePath (
...
@@ -371,3 +371,31 @@ DebugPrintDevicePath (
DEBUG_CODE_END
();
DEBUG_CODE_END
();
}
}
EFI_DEVICE_PATH_PROTOCOL
*
AbsoluteDevicePath
(
IN
EFI_HANDLE
Handle
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
RelativePath
OPTIONAL
)
{
EFI_DEVICE_PATH_PROTOCOL
*
HandlePath
;
EFI_DEVICE_PATH_PROTOCOL
*
NewPath
;
HandlePath
=
DevicePathFromHandle
(
Handle
);
if
(
HandlePath
==
NULL
)
{
return
NULL
;
}
if
(
RelativePath
==
NULL
)
{
return
HandlePath
;
}
NewPath
=
AppendDevicePath
(
HandlePath
,
RelativePath
);
if
(
NewPath
==
NULL
)
{
return
HandlePath
;
}
FreePool
(
HandlePath
);
return
NewPath
;
}
Library/OcSmbiosLib/SmbiosPatch.c
浏览文件 @
0ea633ef
...
@@ -1384,7 +1384,7 @@ SmbiosTableApply (
...
@@ -1384,7 +1384,7 @@ SmbiosTableApply (
Mode
=
OcSmbiosUpdateCreate
;
Mode
=
OcSmbiosUpdateCreate
;
}
else
if
(
mOriginalSmbios3
!=
NULL
&&
(
TableLength
>
mOriginalSmbios3
->
TableMaximumSize
}
else
if
(
mOriginalSmbios3
!=
NULL
&&
(
TableLength
>
mOriginalSmbios3
->
TableMaximumSize
||
mOriginalSmbios3
->
EntryPointLength
<
sizeof
(
SMBIOS_TABLE_3_0_ENTRY_POINT
)))
{
||
mOriginalSmbios3
->
EntryPointLength
<
sizeof
(
SMBIOS_TABLE_3_0_ENTRY_POINT
)))
{
DEBUG
((
DEBUG_
WARN
,
"SmbiosTableApply(%u) cannot fit SMBIOSv3 (%p, %u, %u) with %u
\n
"
,
DEBUG
((
DEBUG_
INFO
,
"SmbiosTableApply(%u) cannot fit SMBIOSv3 (%p, %u, %u) with %u
\n
"
,
Mode
,
mOriginalSmbios3
,
mOriginalSmbios3
->
EntryPointLength
,
mOriginalSmbios3
->
TableMaximumSize
,
TableLength
));
Mode
,
mOriginalSmbios3
,
mOriginalSmbios3
->
EntryPointLength
,
mOriginalSmbios3
->
TableMaximumSize
,
TableLength
));
Mode
=
OcSmbiosUpdateCreate
;
Mode
=
OcSmbiosUpdateCreate
;
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录