OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OpenCorePlatform.c
Go to the documentation of this file.
1
15#include <Library/OcMainLib.h>
16
17#include <Protocol/DataHub.h>
18
19#include <Library/BaseLib.h>
20#include <Library/DebugLib.h>
22#include <Library/MemoryAllocationLib.h>
23#include <Library/PrintLib.h>
24#include <Library/OcCpuLib.h>
26#include <Library/OcSmbiosLib.h>
27#include <Library/OcStringLib.h>
28#include <Library/UefiBootServicesTableLib.h>
29#include <Library/UefiRuntimeServicesTableLib.h>
30
33
34#include <Guid/AppleVariable.h>
35
37
38STATIC
39VOID
41 IN OC_GLOBAL_CONFIG *Config,
42 IN OC_CPU_INFO *CpuInfo,
43 IN MAC_INFO_DATA *MacInfo
44 )
45{
46 EFI_STATUS Status;
48 EFI_GUID Uuid;
49 UINT64 StartupPowerEvents;
50 UINT64 InitialTSC;
51 EFI_DATA_HUB_PROTOCOL *DataHub;
52
53 DataHub = OcDataHubInstallProtocol (FALSE);
54 if (DataHub == NULL) {
55 DEBUG ((DEBUG_WARN, "OC: Failed to install Data Hub\n"));
56 return;
57 }
58
59 ZeroMem (&Data, sizeof (Data));
60
61 if (MacInfo == NULL) {
62 //
63 // Manual mode, read data from DataHub.
64 //
65 if (OC_BLOB_GET (&Config->PlatformInfo.DataHub.PlatformName)[0] != '\0') {
66 Data.PlatformName = OC_BLOB_GET (&Config->PlatformInfo.DataHub.PlatformName);
67 }
68
69 if (OC_BLOB_GET (&Config->PlatformInfo.DataHub.SystemProductName)[0] != '\0') {
70 Data.SystemProductName = OC_BLOB_GET (&Config->PlatformInfo.DataHub.SystemProductName);
71 }
72
73 if (OC_BLOB_GET (&Config->PlatformInfo.DataHub.SystemSerialNumber)[0] != '\0') {
74 Data.SystemSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.DataHub.SystemSerialNumber);
75 }
76
77 if (!EFI_ERROR (OcAsciiStrToRawGuid (OC_BLOB_GET (&Config->PlatformInfo.DataHub.SystemUuid), &Uuid))) {
78 Data.SystemUUID = &Uuid;
79 }
80
81 if (OC_BLOB_GET (&Config->PlatformInfo.DataHub.BoardProduct)[0] != '\0') {
82 Data.BoardProduct = OC_BLOB_GET (&Config->PlatformInfo.DataHub.BoardProduct);
83 }
84
85 Data.BoardRevision = &Config->PlatformInfo.DataHub.BoardRevision[0];
86 Data.StartupPowerEvents = &Config->PlatformInfo.DataHub.StartupPowerEvents;
87 Data.InitialTSC = &Config->PlatformInfo.DataHub.InitialTSC;
88
89 if (Config->PlatformInfo.DataHub.FSBFrequency != 0) {
90 Data.FSBFrequency = &Config->PlatformInfo.DataHub.FSBFrequency;
91 }
92
93 if (Config->PlatformInfo.DataHub.ARTFrequency != 0) {
94 Data.ARTFrequency = &Config->PlatformInfo.DataHub.ARTFrequency;
95 }
96
97 if (Config->PlatformInfo.DataHub.DevicePathsSupported != 0) {
98 Data.DevicePathsSupported = &Config->PlatformInfo.DataHub.DevicePathsSupported;
99 }
100
101 if ( (Config->PlatformInfo.DataHub.SmcRevision[0] != 0)
102 || (Config->PlatformInfo.DataHub.SmcRevision[1] != 0)
103 || (Config->PlatformInfo.DataHub.SmcRevision[2] != 0)
104 || (Config->PlatformInfo.DataHub.SmcRevision[3] != 0)
105 || (Config->PlatformInfo.DataHub.SmcRevision[4] != 0)
106 || (Config->PlatformInfo.DataHub.SmcRevision[5] != 0))
107 {
108 Data.SmcRevision = &Config->PlatformInfo.DataHub.SmcRevision[0];
109 }
110
111 if ( (Config->PlatformInfo.DataHub.SmcBranch[0] != 0)
112 || (Config->PlatformInfo.DataHub.SmcBranch[1] != 0)
113 || (Config->PlatformInfo.DataHub.SmcBranch[2] != 0)
114 || (Config->PlatformInfo.DataHub.SmcBranch[3] != 0)
115 || (Config->PlatformInfo.DataHub.SmcBranch[4] != 0)
116 || (Config->PlatformInfo.DataHub.SmcBranch[5] != 0)
117 || (Config->PlatformInfo.DataHub.SmcBranch[6] != 0)
118 || (Config->PlatformInfo.DataHub.SmcBranch[7] != 0))
119 {
120 Data.SmcBranch = &Config->PlatformInfo.DataHub.SmcBranch[0];
121 }
122
123 if ( (Config->PlatformInfo.DataHub.SmcPlatform[0] != 0)
124 || (Config->PlatformInfo.DataHub.SmcPlatform[1] != 0)
125 || (Config->PlatformInfo.DataHub.SmcPlatform[2] != 0)
126 || (Config->PlatformInfo.DataHub.SmcPlatform[3] != 0)
127 || (Config->PlatformInfo.DataHub.SmcPlatform[4] != 0)
128 || (Config->PlatformInfo.DataHub.SmcPlatform[5] != 0)
129 || (Config->PlatformInfo.DataHub.SmcPlatform[6] != 0)
130 || (Config->PlatformInfo.DataHub.SmcPlatform[7] != 0))
131 {
132 Data.SmcPlatform = &Config->PlatformInfo.DataHub.SmcPlatform[0];
133 }
134 } else {
135 //
136 // Automatic mode read data from Generic & MacInfo.
137 //
138 Data.PlatformName = MacInfo->DataHub.PlatformName;
139 Data.SystemProductName = MacInfo->DataHub.SystemProductName;
140
141 if (MacInfo->Oem.SystemSerialNumber[0] != '\0') {
142 Data.SystemSerialNumber = MacInfo->Oem.SystemSerialNumber;
143 }
144
145 if (!IsZeroGuid (&MacInfo->Oem.SystemUuid)) {
146 CopyGuid (&Uuid, &MacInfo->Oem.SystemUuid);
147 Data.SystemUUID = &Uuid;
148 }
149
150 Data.BoardProduct = MacInfo->DataHub.BoardProduct;
151 Data.BoardRevision = &MacInfo->DataHub.BoardRevision[0];
152 StartupPowerEvents = 0;
153 Data.StartupPowerEvents = &StartupPowerEvents;
154 InitialTSC = 0;
155 Data.InitialTSC = &InitialTSC;
156 Data.DevicePathsSupported = &MacInfo->DataHub.DevicePathsSupported[0];
157
158 Data.SmcRevision = &MacInfo->DataHub.SmcRevision[0];
159 Data.SmcBranch = &MacInfo->DataHub.SmcBranch[0];
160 Data.SmcPlatform = &MacInfo->DataHub.SmcPlatform[0];
161 }
162
163 Status = UpdateDataHub (DataHub, &Data, CpuInfo);
164 if (EFI_ERROR (Status)) {
165 DEBUG ((DEBUG_WARN, "OC: Failed to update Data Hub - %r\n", Status));
166 }
167}
168
169STATIC
170VOID
172 IN OC_GLOBAL_CONFIG *Config,
173 IN OC_CPU_INFO *CpuInfo,
174 IN MAC_INFO_DATA *MacInfo,
175 IN OUT OC_SMBIOS_TABLE *SmbiosTable,
176 IN OC_SMBIOS_UPDATE_MODE UpdateMode
177 )
178{
179 EFI_STATUS Status;
180 OC_SMBIOS_DATA Data;
181 UINT32 PlatformFeature;
182 EFI_GUID Uuid;
184 CONST CHAR8 *SystemMemoryStatus;
185 UINT16 Index;
186
187 OC_PLATFORM_MEMORY_DEVICE_ENTRY *MemoryEntry;
188
189 ZeroMem (&Data, sizeof (Data));
190
191 //
192 // Forcibly use MemoryFormFactor on non-Automatic mode.
193 //
194 Data.ForceMemoryFormFactor = !Config->PlatformInfo.Automatic;
195
196 if (MacInfo == NULL) {
197 //
198 // Manual mode, read data from SMBIOS.
199 //
200 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BIOSVendor)[0] != '\0') {
201 Data.BIOSVendor = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BIOSVendor);
202 }
203
204 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BIOSVersion)[0] != '\0') {
205 Data.BIOSVersion = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BIOSVersion);
206 }
207
208 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BIOSReleaseDate)[0] != '\0') {
209 Data.BIOSReleaseDate = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BIOSReleaseDate);
210 }
211
212 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemManufacturer)[0] != '\0') {
213 Data.SystemManufacturer = OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemManufacturer);
214 }
215
216 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemProductName)[0] != '\0') {
217 Data.SystemProductName = OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemProductName);
218 }
219
220 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemVersion)[0] != '\0') {
221 Data.SystemVersion = OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemVersion);
222 }
223
224 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemSerialNumber)[0] != '\0') {
225 Data.SystemSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemSerialNumber);
226 }
227
228 if (Config->PlatformInfo.UseRawUuidEncoding) {
229 Status = OcAsciiStrToRawGuid (
230 OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemUuid),
231 &Uuid
232 );
233 } else {
234 Status = AsciiStrToGuid (
235 OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemUuid),
236 &Uuid
237 );
238 }
239
240 if (!EFI_ERROR (Status)) {
241 Data.SystemUUID = &Uuid;
242 }
243
244 if (Config->PlatformInfo.Smbios.BoardType != 0) {
245 Data.BoardType = &Config->PlatformInfo.Smbios.BoardType;
246 }
247
248 if (Config->PlatformInfo.Smbios.ChassisType != 0) {
249 Data.ChassisType = &Config->PlatformInfo.Smbios.ChassisType;
250 }
251
252 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemSKUNumber)[0] != '\0') {
253 Data.SystemSKUNumber = OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemSKUNumber);
254 }
255
256 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemFamily)[0] != '\0') {
257 Data.SystemFamily = OC_BLOB_GET (&Config->PlatformInfo.Smbios.SystemFamily);
258 }
259
260 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardManufacturer)[0] != '\0') {
261 Data.BoardManufacturer = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardManufacturer);
262 }
263
264 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardProduct)[0] != '\0') {
265 Data.BoardProduct = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardProduct);
266 }
267
268 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardVersion)[0] != '\0') {
269 Data.BoardVersion = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardVersion);
270 }
271
272 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardSerialNumber)[0] != '\0') {
273 Data.BoardSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardSerialNumber);
274 }
275
276 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardAssetTag)[0] != '\0') {
277 Data.BoardAssetTag = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardAssetTag);
278 }
279
280 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardLocationInChassis)[0] != '\0') {
281 Data.BoardLocationInChassis = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardLocationInChassis);
282 }
283
284 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisManufacturer)[0] != '\0') {
285 Data.ChassisManufacturer = OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisManufacturer);
286 }
287
288 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisVersion)[0] != '\0') {
289 Data.ChassisVersion = OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisVersion);
290 }
291
292 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisSerialNumber)[0] != '\0') {
293 Data.ChassisSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisSerialNumber);
294 }
295
296 if (OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisAssetTag)[0] != '\0') {
297 Data.ChassisAssetTag = OC_BLOB_GET (&Config->PlatformInfo.Smbios.ChassisAssetTag);
298 }
299
300 Data.FirmwareFeatures = Config->PlatformInfo.Smbios.FirmwareFeatures;
301 Data.FirmwareFeaturesMask = Config->PlatformInfo.Smbios.FirmwareFeaturesMask;
302
303 if (Config->PlatformInfo.Smbios.ProcessorType != 0) {
304 Data.ProcessorType = &Config->PlatformInfo.Smbios.ProcessorType;
305 }
306
307 if (Config->PlatformInfo.Smbios.PlatformFeature != 0xFFFFFFFFU) {
308 Data.PlatformFeature = &Config->PlatformInfo.Smbios.PlatformFeature;
309 }
310
311 if (Config->PlatformInfo.Smbios.SmcVersion[0] != '\0') {
312 Data.SmcVersion = &Config->PlatformInfo.Smbios.SmcVersion[0];
313 }
314 } else {
315 //
316 // Automatic mode read data from Generic & MacInfo.
317 //
318 if (Config->PlatformInfo.Generic.SpoofVendor) {
323 }
324
325 Data.BIOSVersion = MacInfo->Smbios.BIOSVersion;
326 Data.BIOSReleaseDate = MacInfo->Smbios.BIOSReleaseDate;
327 Data.SystemProductName = MacInfo->Smbios.SystemProductName;
328 Data.SystemVersion = MacInfo->Smbios.SystemVersion;
329
330 if (MacInfo->Oem.SystemSerialNumber[0] != '\0') {
331 Data.SystemSerialNumber = MacInfo->Oem.SystemSerialNumber;
332 }
333
334 if (!IsZeroGuid (&MacInfo->Oem.SystemUuid)) {
335 CopyGuid (&Uuid, &MacInfo->Oem.SystemUuid);
336 if (!Config->PlatformInfo.UseRawUuidEncoding) {
337 //
338 // Change from RAW to LE.
339 //
340 Uuid.Data1 = SwapBytes32 (Uuid.Data1);
341 Uuid.Data2 = SwapBytes16 (Uuid.Data2);
342 Uuid.Data3 = SwapBytes16 (Uuid.Data3);
343 }
344
345 Data.SystemUUID = &Uuid;
346 }
347
348 Data.BoardType = MacInfo->Smbios.BoardType;
349 Data.ChassisType = MacInfo->Smbios.ChassisType;
350 Data.SystemSKUNumber = MacInfo->Smbios.SystemSKUNumber;
351 Data.SystemFamily = MacInfo->Smbios.SystemFamily;
352 Data.BoardProduct = MacInfo->Smbios.BoardProduct;
353 Data.BoardVersion = MacInfo->Smbios.BoardVersion;
354
355 if (MacInfo->Oem.Mlb[0] != '\0') {
356 Data.BoardSerialNumber = MacInfo->Oem.Mlb;
357 }
358
359 Data.BoardAssetTag = MacInfo->Smbios.BoardAssetTag;
360 Data.BoardLocationInChassis = MacInfo->Smbios.BoardLocationInChassis;
361 Data.ChassisVersion = MacInfo->Smbios.ChassisVersion;
362
363 if (MacInfo->Oem.SystemSerialNumber[0] != '\0') {
364 Data.ChassisSerialNumber = MacInfo->Oem.SystemSerialNumber;
365 }
366
367 Data.ChassisAssetTag = MacInfo->Smbios.ChassisAssetTag;
368 Data.MemoryFormFactor = MacInfo->Smbios.MemoryFormFactor;
369 Data.FirmwareFeatures = MacInfo->Smbios.FirmwareFeatures;
370 Data.FirmwareFeaturesMask = MacInfo->Smbios.FirmwareFeaturesMask;
371
372 //
373 // Adopt to arbitrary hardware specifics. See description in NVRAM handling code.
374 //
375 if (Config->PlatformInfo.Generic.AdviseFeatures) {
384 }
385
386 //
387 // Permit overriding the CPU type for those that want it.
388 //
389 if (Config->PlatformInfo.Generic.ProcessorType != 0) {
390 Data.ProcessorType = &Config->PlatformInfo.Generic.ProcessorType;
391 }
392
393 Data.PlatformFeature = MacInfo->Smbios.PlatformFeature;
394 if (Data.PlatformFeature != NULL) {
396 } else {
397 PlatformFeature = 0;
398 }
399
400 if (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemMemoryStatus)[0] != '\0') {
401 SystemMemoryStatus = OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemMemoryStatus);
402
403 if (AsciiStrCmp (SystemMemoryStatus, "Upgradable") == 0) {
404 PlatformFeature &= ~PT_FEATURE_HAS_SOLDERED_SYSTEM_MEMORY;
406 } else if (AsciiStrCmp (SystemMemoryStatus, "Soldered") == 0) {
409 } else if (AsciiStrCmp (SystemMemoryStatus, "Auto") != 0) {
410 DEBUG ((DEBUG_WARN, "OC: Invalid SMBIOS system memory status %a\n", SystemMemoryStatus));
411 }
412 }
413
414 //
415 // Override default BIOSVersion.
416 //
417 if (Config->PlatformInfo.Generic.MaxBIOSVersion) {
418 Data.BIOSVersion = "9999.999.999.999.999";
419 }
420
421 if (MacInfo->DataHub.SmcRevision != NULL) {
422 OcSmbiosGetSmcVersion (MacInfo->DataHub.SmcRevision, SmcVersion);
423 Data.SmcVersion = SmcVersion;
424 }
425 }
426
427 //
428 // Inject custom memory info.
429 //
430 if (Config->PlatformInfo.CustomMemory) {
431 Data.HasCustomMemory = TRUE;
432
433 if (Config->PlatformInfo.Memory.Devices.Count <= MAX_UINT16) {
434 Data.MemoryDevicesCount = (UINT16)Config->PlatformInfo.Memory.Devices.Count;
435 } else {
436 Data.MemoryDevicesCount = MAX_UINT16;
437 }
438
439 Data.MemoryErrorCorrection = &Config->PlatformInfo.Memory.ErrorCorrection;
440 Data.MemoryMaxCapacity = &Config->PlatformInfo.Memory.MaxCapacity;
441 Data.MemoryDataWidth = &Config->PlatformInfo.Memory.DataWidth;
442 Data.MemoryFormFactor = &Config->PlatformInfo.Memory.FormFactor;
443 Data.MemoryTotalWidth = &Config->PlatformInfo.Memory.TotalWidth;
444 Data.MemoryType = &Config->PlatformInfo.Memory.Type;
445 Data.MemoryTypeDetail = &Config->PlatformInfo.Memory.TypeDetail;
446
447 if (Data.MemoryDevicesCount) {
448 Data.MemoryDevices = AllocateZeroPool (sizeof (OC_SMBIOS_MEMORY_DEVICE_DATA) * Data.MemoryDevicesCount);
449 if (Data.MemoryDevices == NULL) {
450 DEBUG ((DEBUG_WARN, "OC: Failed to allocate custom memory devices\n"));
451 Data.MemoryDevicesCount = 0;
452 }
453
454 for (Index = 0; Index < Data.MemoryDevicesCount; ++Index) {
455 MemoryEntry = Config->PlatformInfo.Memory.Devices.Values[Index];
456
457 Data.MemoryDevices[Index].AssetTag = OC_BLOB_GET (&MemoryEntry->AssetTag);
458 Data.MemoryDevices[Index].BankLocator = OC_BLOB_GET (&MemoryEntry->BankLocator);
459 Data.MemoryDevices[Index].DeviceLocator = OC_BLOB_GET (&MemoryEntry->DeviceLocator);
460 Data.MemoryDevices[Index].Manufacturer = OC_BLOB_GET (&MemoryEntry->Manufacturer);
461 Data.MemoryDevices[Index].PartNumber = OC_BLOB_GET (&MemoryEntry->PartNumber);
462 Data.MemoryDevices[Index].SerialNumber = OC_BLOB_GET (&MemoryEntry->SerialNumber);
463 Data.MemoryDevices[Index].Size = &MemoryEntry->Size;
464 Data.MemoryDevices[Index].Speed = &MemoryEntry->Speed;
465 }
466 }
467 }
468
469 if (Data.SystemProductName != NULL) {
470 DEBUG ((DEBUG_INFO, "OC: New SMBIOS: %a model %a\n", Data.SystemManufacturer, Data.SystemProductName));
471 Status = AsciiStrCpyS (mCurrentSmbiosProductName, sizeof (mCurrentSmbiosProductName), Data.SystemProductName);
472 if (EFI_ERROR (Status)) {
473 DEBUG ((DEBUG_INFO, "OC: Failed to copy new SMBIOS product name %a\n", Data.SystemProductName));
474 }
475 }
476
477 Status = OcSmbiosCreate (SmbiosTable, &Data, UpdateMode, CpuInfo);
478 if (EFI_ERROR (Status)) {
479 DEBUG ((DEBUG_WARN, "OC: Failed to update SMBIOS - %r\n", Status));
480 }
481
482 if (Data.MemoryDevices != NULL) {
483 FreePool (Data.MemoryDevices);
484 }
485}
486
487STATIC
488VOID
490 IN OC_GLOBAL_CONFIG *Config,
491 IN MAC_INFO_DATA *MacInfo
492 )
493{
494 EFI_STATUS Status;
495 CONST CHAR8 *Bid;
496 UINTN BidSize;
497 CONST CHAR8 *Mlb;
498 UINTN MlbSize;
499 CONST CHAR8 *Ssn;
500 UINTN SsnSize;
501 CONST UINT8 *Rom;
502 UINTN RomSize;
503 EFI_GUID Uuid;
504 UINT64 ExFeatures;
505 UINT64 ExFeaturesMask;
506 UINT32 Features;
507 UINT32 FeaturesMask;
508
509 if (MacInfo == NULL) {
510 Bid = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Bid);
511 BidSize = Config->PlatformInfo.Nvram.Bid.Size - 1;
512 Mlb = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Mlb);
513 MlbSize = Config->PlatformInfo.Nvram.Mlb.Size - 1;
514 Ssn = OC_BLOB_GET (&Config->PlatformInfo.Nvram.SystemSerialNumber);
515 SsnSize = Config->PlatformInfo.Nvram.SystemSerialNumber.Size - 1;
516 Rom = &Config->PlatformInfo.Nvram.Rom[0];
517 RomSize = sizeof (Config->PlatformInfo.Nvram.Rom);
518 Status = OcAsciiStrToRawGuid (OC_BLOB_GET (&Config->PlatformInfo.Nvram.SystemUuid), &Uuid);
519 if (EFI_ERROR (Status)) {
520 ZeroMem (&Uuid, sizeof (Uuid));
521 }
522
523 ExFeatures = Config->PlatformInfo.Nvram.FirmwareFeatures;
524 ExFeaturesMask = Config->PlatformInfo.Nvram.FirmwareFeaturesMask;
525 } else {
526 Bid = MacInfo->Smbios.BoardProduct;
527 BidSize = AsciiStrLen (Bid);
528 Mlb = MacInfo->Oem.Mlb;
529 MlbSize = AsciiStrLen (Mlb);
530 Ssn = MacInfo->Oem.SystemSerialNumber;
531 SsnSize = AsciiStrLen (Ssn);
532 Rom = &MacInfo->Oem.Rom[0];
533 RomSize = OC_OEM_ROM_MAX;
534 CopyGuid (&Uuid, &MacInfo->Oem.SystemUuid);
535 ExFeatures = MacInfo->Smbios.FirmwareFeatures;
536 ExFeaturesMask = MacInfo->Smbios.FirmwareFeaturesMask;
537
538 //
539 // Adopt to arbitrary hardware specifics. This bit allows the use
540 // of legacy Windows installation in boot selector preference pane.
541 // We need it because Windows systems with EFI partition not being 1st
542 // are recognised as legacy. See:
543 // https://github.com/acidanthera/bugtracker/issues/327
544 // https://sourceforge.net/p/cloverefiboot/tickets/435
545 //
546 if (Config->PlatformInfo.Generic.AdviseFeatures) {
555 }
556 }
557
558 Features = (UINT32)ExFeatures;
559 FeaturesMask = (UINT32)ExFeaturesMask;
560
561 if (Bid[0] != '\0') {
562 Status = gRT->SetVariable (
563 L"HW_BID",
565 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
566 BidSize,
567 (CHAR8 *)Bid
568 );
569 DEBUG ((
570 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
571 "OC: Setting HW_BID %a - %r\n",
572 Bid,
573 Status
574 ));
575 }
576
577 if ((Rom[0] != 0) || (Rom[1] != 0) || (Rom[2] != 0) || (Rom[3] != 0) || (Rom[4] != 0) || (Rom[5] != 0)) {
578 Status = gRT->SetVariable (
579 L"HW_ROM",
581 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
582 RomSize,
583 (UINT8 *)Rom
584 );
585 DEBUG ((
586 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
587 "OC: Setting HW_ROM %02x:%02x:%02x:%02x:%02x:%02x - %r\n",
588 Rom[0],
589 Rom[1],
590 Rom[2],
591 Rom[3],
592 Rom[4],
593 Rom[5],
594 Status
595 ));
596
597 Status = gRT->SetVariable (
598 L"ROM",
600 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
601 RomSize,
602 (UINT8 *)Rom
603 );
604 DEBUG ((
605 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
606 "OC: Setting ROM %02x:%02x:%02x:%02x:%02x:%02x - %r\n",
607 Rom[0],
608 Rom[1],
609 Rom[2],
610 Rom[3],
611 Rom[4],
612 Rom[5],
613 Status
614 ));
615 }
616
617 if (Mlb[0] != '\0') {
618 Status = gRT->SetVariable (
619 L"HW_MLB",
621 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
622 MlbSize,
623 (CHAR8 *)Mlb
624 );
625 DEBUG ((
626 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
627 "OC: Setting HW_MLB %a - %r\n",
628 Mlb,
629 Status
630 ));
631
632 Status = gRT->SetVariable (
633 L"MLB",
635 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
636 MlbSize,
637 (CHAR8 *)Mlb
638 );
639 DEBUG ((
640 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
641 "OC: Setting MLB %a - %r\n",
642 Mlb,
643 Status
644 ));
645 }
646
647 if (Ssn[0] != '\0') {
648 Status = gRT->SetVariable (
649 L"HW_SSN",
651 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
652 SsnSize,
653 (CHAR8 *)Ssn
654 );
655 DEBUG ((
656 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
657 "OC: Setting HW_SSN %a - %r\n",
658 Ssn,
659 Status
660 ));
661
662 Status = gRT->SetVariable (
663 L"SSN",
665 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
666 SsnSize,
667 (CHAR8 *)Ssn
668 );
669 DEBUG ((
670 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
671 "OC: Setting SSN %a - %r\n",
672 Ssn,
673 Status
674 ));
675 }
676
677 //
678 // system-id is only visible in BS scope and may be used by EfiBoot
679 // in macOS 11.0 to generate x86legacy ApECID from the first 8 bytes.
680 //
681 if (!IsZeroGuid (&Uuid)) {
682 Status = gRT->SetVariable (
683 L"system-id",
685 EFI_VARIABLE_BOOTSERVICE_ACCESS,
686 sizeof (Uuid),
687 &Uuid
688 );
689 DEBUG ((
690 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
691 "OC: Setting system-id %g - %r\n",
692 &Uuid,
693 Status
694 ));
695 }
696
697 if ((ExFeatures != 0) || (ExFeaturesMask != 0)) {
698 Status = gRT->SetVariable (
699 L"FirmwareFeatures",
701 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
702 sizeof (Features),
703 &Features
704 );
705 DEBUG ((
706 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
707 "OC: Setting FirmwareFeatures %08x - %r\n",
708 Features,
709 Status
710 ));
711
712 Status = gRT->SetVariable (
713 L"ExtendedFirmwareFeatures",
715 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
716 sizeof (ExFeatures),
717 &ExFeatures
718 );
719 DEBUG ((
720 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
721 "OC: Setting ExtendedFirmwareFeatures %016Lx - %r\n",
722 ExFeatures,
723 Status
724 ));
725
726 Status = gRT->SetVariable (
727 L"FirmwareFeaturesMask",
729 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
730 sizeof (FeaturesMask),
731 &FeaturesMask
732 );
733 DEBUG ((
734 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
735 "OC: Setting FirmwareFeaturesMask %08x - %r\n",
736 FeaturesMask,
737 Status
738 ));
739
740 Status = gRT->SetVariable (
741 L"ExtendedFirmwareFeaturesMask",
743 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
744 sizeof (ExFeaturesMask),
745 &ExFeaturesMask
746 );
747 DEBUG ((
748 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
749 "OC: Setting ExtendedFirmwareFeaturesMask %016Lx - %r\n",
750 ExFeaturesMask,
751 Status
752 ));
753 }
754}
755
756VOID
758 IN OC_GLOBAL_CONFIG *Config,
759 IN OC_CPU_INFO *CpuInfo
760 )
761{
762 OC_SMBIOS_UPDATE_MODE SmbiosUpdateMode;
763 MAC_INFO_DATA InfoData;
764 MAC_INFO_DATA *UsedMacInfo;
765 EFI_STATUS Status;
766 OC_SMBIOS_TABLE SmbiosTable;
767 BOOLEAN ExposeOem;
768 BOOLEAN UseOemSerial;
769 BOOLEAN UseOemUuid;
770 BOOLEAN UseOemMlb;
771 BOOLEAN UseOemRom;
772
773 if (Config->PlatformInfo.Automatic) {
774 GetMacInfo (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemProductName), &InfoData);
775 UsedMacInfo = &InfoData;
776 UseOemSerial = AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber), "OEM") == 0;
777 UseOemUuid = AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid), "OEM") == 0;
778 UseOemMlb = AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb), "OEM") == 0;
779 UseOemRom = AsciiStrCmp ((CHAR8 *)Config->PlatformInfo.Generic.Rom, "OEM") == 0;
780 } else {
781 UsedMacInfo = NULL;
782 UseOemSerial = FALSE;
783 UseOemUuid = FALSE;
784 UseOemMlb = FALSE;
785 UseOemRom = FALSE;
786 }
787
788 ExposeOem = (Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_OEM_INFO) != 0;
789
790 Status = OcSmbiosTablePrepare (&SmbiosTable);
791 if (!EFI_ERROR (Status)) {
793 &SmbiosTable,
795 UseOemSerial ? InfoData.Oem.SystemSerialNumber : NULL,
796 UseOemUuid ? &InfoData.Oem.SystemUuid : NULL,
797 UseOemMlb ? InfoData.Oem.Mlb : NULL,
798 UseOemRom ? InfoData.Oem.Rom : NULL,
799 Config->PlatformInfo.UseRawUuidEncoding,
800 ExposeOem
801 );
802 }
803
804 DEBUG ((
805 DEBUG_INFO,
806 "OC: PlatformInfo auto %d OEM SN %d OEM UUID %d OEM MLB %d OEM ROM %d - %r\n",
807 Config->PlatformInfo.Automatic,
808 UseOemSerial,
809 UseOemUuid,
810 UseOemMlb,
811 UseOemRom,
812 Status
813 ));
814
815 if (Config->PlatformInfo.Automatic) {
816 if (!UseOemSerial) {
817 AsciiStrCpyS (
818 InfoData.Oem.SystemSerialNumber,
820 OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber)
821 );
822 }
823
824 if (!UseOemUuid) {
826 OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid),
827 &InfoData.Oem.SystemUuid
828 );
829 }
830
831 if (!UseOemMlb) {
832 AsciiStrCpyS (
833 InfoData.Oem.Mlb,
835 OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb)
836 );
837 }
838
839 if (!UseOemRom) {
840 CopyMem (InfoData.Oem.Rom, Config->PlatformInfo.Generic.Rom, OC_OEM_ROM_MAX);
841 }
842 }
843
844 if (!EFI_ERROR (Status)) {
845 if (Config->PlatformInfo.UpdateSmbios) {
846 SmbiosUpdateMode = OcSmbiosGetUpdateMode (
847 OC_BLOB_GET (&Config->PlatformInfo.UpdateSmbiosMode)
848 );
850 Config,
851 CpuInfo,
852 UsedMacInfo,
853 &SmbiosTable,
854 SmbiosUpdateMode
855 );
856 }
857
858 OcSmbiosTableFree (&SmbiosTable);
859 } else {
860 DEBUG ((DEBUG_WARN, "OC: Unable to obtain SMBIOS - %r\n", Status));
861 }
862
863 if (Config->PlatformInfo.UpdateDataHub) {
864 OcPlatformUpdateDataHub (Config, CpuInfo, UsedMacInfo);
865 }
866
867 if (Config->PlatformInfo.UpdateNvram) {
868 OcPlatformUpdateNvram (Config, UsedMacInfo);
869 }
870}
871
872VOID
874 IN OC_GLOBAL_CONFIG *Config,
875 OUT UINT64 *ApECID
876 )
877{
878 EFI_STATUS Status;
879 OC_SMBIOS_TABLE SmbiosTable;
880 EFI_GUID Uuid;
881 UINTN ReadSize;
882
883 ASSERT (Config != NULL);
884 ASSERT (ApECID != NULL);
885
886 ZeroMem (&Uuid, sizeof (Uuid));
887
888 //
889 // TODO: Cache platform IDs for both interfaces: OcGetSystemId and OcLoadPlatformSupport,
890 // as currently this duplicates the code above.
891 //
892 if (Config->PlatformInfo.UpdateNvram) {
893 if (Config->PlatformInfo.Automatic) {
894 if (AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid), "OEM") == 0) {
895 Status = OcSmbiosTablePrepare (&SmbiosTable);
896 if (!EFI_ERROR (Status)) {
898 &SmbiosTable,
900 NULL,
901 &Uuid,
902 NULL,
903 NULL,
904 Config->PlatformInfo.UseRawUuidEncoding,
905 FALSE
906 );
907 OcSmbiosTableFree (&SmbiosTable);
908 }
909
910 DEBUG ((DEBUG_INFO, "OC: Grabbed SB uuid %g from SMBIOS - %r\n", &Uuid, Status));
911 } else {
912 Status = OcAsciiStrToRawGuid (
913 OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid),
914 &Uuid
915 );
916 if (EFI_ERROR (Status)) {
917 ZeroMem (&Uuid, sizeof (Uuid));
918 }
919
920 DEBUG ((DEBUG_INFO, "OC: Grabbed SB uuid %g from auto config - %r\n", &Uuid, Status));
921 }
922 } else {
923 Status = OcAsciiStrToRawGuid (OC_BLOB_GET (&Config->PlatformInfo.Nvram.SystemUuid), &Uuid);
924 if (EFI_ERROR (Status)) {
925 ZeroMem (&Uuid, sizeof (Uuid));
926 }
927
928 DEBUG ((DEBUG_INFO, "OC: Grabbed SB uuid %g from manual config - %r\n", &Uuid, Status));
929 }
930 }
931
932 if (!Config->PlatformInfo.UpdateNvram || IsZeroGuid (&Uuid)) {
933 ReadSize = sizeof (Uuid);
934 Status = gRT->GetVariable (
935 L"system-id",
937 NULL,
938 &ReadSize,
939 &Uuid
940 );
941 if (EFI_ERROR (Status)) {
942 ZeroMem (&Uuid, sizeof (Uuid));
943 }
944
945 DEBUG ((DEBUG_INFO, "OC: Grabbed SB uuid %g direct from NVRAM - %r\n", &Uuid, Status));
946 }
947
948 if (IsZeroGuid (&Uuid)) {
949 DEBUG ((DEBUG_ERROR, "OC: Grabbed zero system-id for SB, this is not allowed\n"));
950 CpuDeadLoop ();
951 }
952
953 CopyMem (ApECID, &Uuid, sizeof (*ApECID));
954 DEBUG ((DEBUG_INFO, "OC: ApECID %Ld from system-id\n", *ApECID));
955}
956
957CONST CHAR8 *
959 IN OC_GLOBAL_CONFIG *Config,
960 IN OC_CPU_INFO *CpuInfo
961 )
962{
963 EFI_STATUS Status;
964 CONST CHAR8 *Model;
965 CONST CHAR8 *Board;
966 CONST CHAR8 *SbModel;
967 OC_SMBIOS_TABLE SmbiosTable;
968
969 //
970 // Make sure hypervisor secure boot model is x86legacy.
971 // macOS 11.x will not install otherwise.
972 //
973 if (CpuInfo->Hypervisor) {
974 DEBUG ((DEBUG_INFO, "OC: Hypervisor SB model is x86legacy\n"));
975 return "x86legacy";
976 }
977
978 //
979 // For automatic setups it is direct DB retrieval.
980 //
981 if (Config->PlatformInfo.Automatic) {
982 Model = OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemProductName);
983 SbModel = GetSecureBootModel (Model);
984 DEBUG ((DEBUG_INFO, "OC: Automatic SB model %a from model %a\n", SbModel, Model));
985 return SbModel;
986 }
987
988 //
989 // For manual setups only use the SMBIOS board identifier.
990 //
991 Board = OC_BLOB_GET (&Config->PlatformInfo.Smbios.BoardProduct);
992 if (Config->PlatformInfo.UpdateSmbios && (Board[0] != '\0')) {
993 SbModel = GetSecureBootModelFromBoardId (Board);
994 DEBUG ((DEBUG_INFO, "OC: Manual SB model %a from board %a\n", SbModel, Board));
995 return SbModel;
996 }
997
998 //
999 // For Mac setups without spoofing use SMBIOS.
1000 //
1001 Status = OcSmbiosTablePrepare (&SmbiosTable);
1002 if (!EFI_ERROR (Status)) {
1004 &SmbiosTable,
1006 NULL,
1007 NULL,
1008 NULL,
1009 NULL,
1010 Config->PlatformInfo.UseRawUuidEncoding,
1011 FALSE
1012 );
1013 OcSmbiosTableFree (&SmbiosTable);
1014 }
1015
1017 DEBUG ((DEBUG_INFO, "OC: OEM SB model %a from model %a\n", SbModel, mCurrentSmbiosProductName));
1018 return SbModel;
1019}
1020
1021BOOLEAN
1023 IN UINT32 KernelVersion
1024 )
1025{
1026 #if defined (MDE_CPU_IA32)
1027 return FALSE;
1028 #elif defined (MDE_CPU_X64)
1030 #else
1031 #error "Unsupported architecture"
1032 #endif
1033}
GUID Uuid
#define FW_FEATURE_SUPPORTS_APFS
#define FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM
#define FW_FEATURE_SUPPORTS_UEFI_WINDOWS_BOOT
#define PT_FEATURE_HAS_SOLDERED_SYSTEM_MEMORY
#define FW_FEATURE_SUPPORTS_CSM_LEGACY_MODE
#define APPLE_SMBIOS_SMC_VERSION_SIZE
Definition AppleSmBios.h:29
UINT8 SmcVersion[APPLE_SMBIOS_SMC_VERSION_SIZE]
EFI_GUID gAppleVendorVariableGuid
STATIC UINT32 KernelVersion
Definition KextInject.c:28
#define OCS_EXPOSE_OEM_INFO
EFI_STATUS UpdateDataHub(IN EFI_DATA_HUB_PROTOCOL *DataHub, IN OC_DATA_HUB_DATA *Data, IN OC_CPU_INFO *CpuInfo)
EFI_DATA_HUB_PROTOCOL * OcDataHubInstallProtocol(IN BOOLEAN Reinstall)
CONST CHAR8 * GetSecureBootModelFromBoardId(IN CONST CHAR8 *BoardId)
CONST CHAR8 * GetSecureBootModel(IN CONST CHAR8 *ProductName)
#define OC_OEM_ROM_MAX
VOID GetMacInfo(IN CONST CHAR8 *ProductName, OUT MAC_INFO_DATA *MacInfo)
BOOLEAN IsMacModel64BitCompatible(IN CONST CHAR8 *ProductName, IN UINT32 KernelVersion)
#define OC_OEM_NAME_MAX
#define OC_OEM_SERIAL_MAX
OC_SMBIOS_UPDATE_MODE OcSmbiosGetUpdateMode(IN CONST CHAR8 *UpdateMode)
#define OC_SMBIOS_VENDOR_NAME
Definition OcSmbiosLib.h:33
enum OC_SMBIOS_UPDATE_MODE_ OC_SMBIOS_UPDATE_MODE
VOID OcSmbiosExtractOemInfo(IN OC_SMBIOS_TABLE *SmbiosTable, OUT CHAR8 *ProductName OPTIONAL, OUT CHAR8 *SerialNumber OPTIONAL, OUT EFI_GUID *SystemUuid OPTIONAL, OUT CHAR8 *Mlb OPTIONAL, OUT UINT8 *Rom OPTIONAL, IN BOOLEAN UuidIsRawEncoded, IN BOOLEAN UseVariableStorage)
VOID OcSmbiosTableFree(IN OUT OC_SMBIOS_TABLE *Table)
EFI_STATUS OcSmbiosCreate(IN OUT OC_SMBIOS_TABLE *SmbiosTable, IN OC_SMBIOS_DATA *Data, IN OC_SMBIOS_UPDATE_MODE Mode, IN OC_CPU_INFO *CpuInfo)
EFI_STATUS OcSmbiosTablePrepare(IN OUT OC_SMBIOS_TABLE *SmbiosTable)
VOID OcSmbiosGetSmcVersion(IN CONST UINT8 *SmcRevision, OUT UINT8 *SmcVersion)
EFI_STATUS EFIAPI OcAsciiStrToRawGuid(IN CONST CHAR8 *String, OUT GUID *Guid)
Definition OcAsciiLib.c:458
#define OC_BLOB_GET(Blob)
VOID OcLoadPlatformSupport(IN OC_GLOBAL_CONFIG *Config, IN OC_CPU_INFO *CpuInfo)
BOOLEAN OcPlatformIs64BitSupported(IN UINT32 KernelVersion)
STATIC VOID OcPlatformUpdateSmbios(IN OC_GLOBAL_CONFIG *Config, IN OC_CPU_INFO *CpuInfo, IN MAC_INFO_DATA *MacInfo, IN OUT OC_SMBIOS_TABLE *SmbiosTable, IN OC_SMBIOS_UPDATE_MODE UpdateMode)
CONST CHAR8 * OcGetDefaultSecureBootModel(IN OC_GLOBAL_CONFIG *Config, IN OC_CPU_INFO *CpuInfo)
VOID OcGetLegacySecureBootECID(IN OC_GLOBAL_CONFIG *Config, OUT UINT64 *ApECID)
STATIC VOID OcPlatformUpdateDataHub(IN OC_GLOBAL_CONFIG *Config, IN OC_CPU_INFO *CpuInfo, IN MAC_INFO_DATA *MacInfo)
STATIC CHAR8 mCurrentSmbiosProductName[OC_OEM_NAME_MAX]
STATIC VOID OcPlatformUpdateNvram(IN OC_GLOBAL_CONFIG *Config, IN MAC_INFO_DATA *MacInfo)
STATIC UINT32 PlatformFeature
Definition Smbios.c:38
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
BOOLEAN EFIAPI IsZeroGuid(IN CONST GUID *Guid)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT(x)
Definition coder.h:55
MAC_INFO_DATA_OEM Oem
CHAR8 Mlb[OC_OEM_SERIAL_MAX]
UINT8 Rom[OC_OEM_ROM_MAX]
CHAR8 SystemSerialNumber[OC_OEM_SERIAL_MAX]
CONST UINT64 * FSBFrequency
CONST GUID * SystemUUID
CONST UINT64 * InitialTSC
CONST UINT32 * DevicePathsSupported
CONST CHAR8 * SystemSerialNumber
CONST CHAR8 * PlatformName
CONST UINT8 * SmcBranch
CONST UINT64 * ARTFrequency
CONST CHAR8 * BoardProduct
CONST UINT8 * BoardRevision
CONST UINT64 * StartupPowerEvents
CONST UINT8 * SmcRevision
CONST UINT8 * SmcPlatform
CONST CHAR8 * SystemProductName
CONST CHAR8 * ChassisSerialNumber
Definition OcSmbiosLib.h:85
CONST CHAR8 * SystemProductName
Definition OcSmbiosLib.h:63
CONST UINT8 * MemoryErrorCorrection
Definition OcSmbiosLib.h:91
UINT64 FirmwareFeatures
CONST UINT32 * PlatformFeature
CONST UINT8 * MemoryType
CONST CHAR8 * ChassisManufacturer
Definition OcSmbiosLib.h:83
CONST UINT8 * SmcVersion
CONST CHAR8 * SystemFamily
Definition OcSmbiosLib.h:68
CONST CHAR8 * SystemManufacturer
Definition OcSmbiosLib.h:62
CONST UINT16 * MemoryTotalWidth
CONST CHAR8 * BIOSVendor
Definition OcSmbiosLib.h:56
CONST CHAR8 * ChassisVersion
Definition OcSmbiosLib.h:84
CONST UINT8 * MemoryFormFactor
Definition OcSmbiosLib.h:99
CONST CHAR8 * SystemSerialNumber
Definition OcSmbiosLib.h:65
CONST UINT16 * ProcessorType
CONST CHAR8 * BoardManufacturer
Definition OcSmbiosLib.h:72
CONST CHAR8 * BoardVersion
Definition OcSmbiosLib.h:74
BOOLEAN ForceMemoryFormFactor
CONST UINT8 * ChassisType
Definition OcSmbiosLib.h:82
CONST CHAR8 * BoardLocationInChassis
Definition OcSmbiosLib.h:77
CONST CHAR8 * BIOSReleaseDate
Definition OcSmbiosLib.h:58
CONST UINT16 * MemoryTypeDetail
CONST UINT8 * BoardType
Definition OcSmbiosLib.h:78
CONST CHAR8 * BoardAssetTag
Definition OcSmbiosLib.h:76
CONST CHAR8 * BoardProduct
Definition OcSmbiosLib.h:73
CONST CHAR8 * SystemVersion
Definition OcSmbiosLib.h:64
CONST UINT64 * MemoryMaxCapacity
Definition OcSmbiosLib.h:93
CONST UINT16 * MemoryDataWidth
Definition OcSmbiosLib.h:97
OC_SMBIOS_MEMORY_DEVICE_DATA * MemoryDevices
Definition OcSmbiosLib.h:98
UINT16 MemoryDevicesCount
Definition OcSmbiosLib.h:92
BOOLEAN HasCustomMemory
Definition OcSmbiosLib.h:90
CONST CHAR8 * SystemSKUNumber
Definition OcSmbiosLib.h:67
CONST CHAR8 * BoardSerialNumber
Definition OcSmbiosLib.h:75
CONST CHAR8 * BIOSVersion
Definition OcSmbiosLib.h:57
CONST CHAR8 * ChassisAssetTag
Definition OcSmbiosLib.h:86
UINT64 FirmwareFeaturesMask
CONST GUID * SystemUUID
Definition OcSmbiosLib.h:66