提交 a9af4abd 编写于 作者: V vit9696

OcBootManagementLib: Fixed `ScanPolicy` NVMe handling on MacPro5,1

closes acidanthera/bugtracker#1234
上级 a5267aab
...@@ -17,6 +17,7 @@ OpenCore Changelog ...@@ -17,6 +17,7 @@ OpenCore Changelog
- Fixed intermittent 32-bit prelinking failures caused by improper Mach-O expansion - Fixed intermittent 32-bit prelinking failures caused by improper Mach-O expansion
- Fixed failures in cacheless injection dependency resolution - Fixed failures in cacheless injection dependency resolution
- Fixed detection issues with older Atom CPUs - Fixed detection issues with older Atom CPUs
- Fixed `ScanPolicy` NVMe handling on MacPro5,1
#### v0.6.2 #### v0.6.2
- Updated builtin firmware versions for SMBIOS and the rest - Updated builtin firmware versions for SMBIOS and the rest
......
...@@ -15,6 +15,14 @@ ...@@ -15,6 +15,14 @@
#ifndef OC_DEVICE_PATH_LIB_H #ifndef OC_DEVICE_PATH_LIB_H
#define OC_DEVICE_PATH_LIB_H #define OC_DEVICE_PATH_LIB_H
/**
Apple MacPro5,1 includes NVMe driver, however, it contains a typo in MSG_SASEX_DP.
Instead of 0x16 aka 22 (SasEx) it uses 0x22 aka 34 (Unspecified).
Here we replace it with the "right" value.
Reference: https://forums.macrumors.com/posts/28169441.
**/
#define MSG_APPLE_NVME_NAMESPACE_DP 0x22
/** /**
Append file name to device path. Append file name to device path.
......
...@@ -80,6 +80,7 @@ OcGetDevicePolicyType ( ...@@ -80,6 +80,7 @@ OcGetDevicePolicyType (
return OC_SCAN_ALLOW_DEVICE_SASEX; return OC_SCAN_ALLOW_DEVICE_SASEX;
case MSG_SCSI_DP: case MSG_SCSI_DP:
return OC_SCAN_ALLOW_DEVICE_SCSI; return OC_SCAN_ALLOW_DEVICE_SCSI;
case MSG_APPLE_NVME_NAMESPACE_DP:
case MSG_NVME_NAMESPACE_DP: case MSG_NVME_NAMESPACE_DP:
return OC_SCAN_ALLOW_DEVICE_NVME; return OC_SCAN_ALLOW_DEVICE_NVME;
case MSG_ATAPI_DP: case MSG_ATAPI_DP:
......
...@@ -484,16 +484,13 @@ OcFixAppleBootDevicePathNode ( ...@@ -484,16 +484,13 @@ OcFixAppleBootDevicePathNode (
case MSG_NVME_NAMESPACE_DP: case MSG_NVME_NAMESPACE_DP:
// //
// Apple MacPro5,1 includes NVMe driver, however, it contains a typo in MSG_SASEX_DP. // Workaround for MacPro5,1 using custom NVMe type.
// Instead of 0x16 aka 22 (SasEx) it uses 0x22 aka 34 (Unspecified).
// Here we replace it with the "right" value.
// Reference: https://forums.macrumors.com/posts/28169441.
// //
if (RestoreContext != NULL) { if (RestoreContext != NULL) {
RestoreContext->Types.SasExNvme.SubType = Node.DevPath->SubType; RestoreContext->Types.SasExNvme.SubType = Node.DevPath->SubType;
} }
Node.NvmeNamespace->Header.SubType = 0x22; Node.NvmeNamespace->Header.SubType = MSG_APPLE_NVME_NAMESPACE_DP;
return 1; return 1;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册