Chameleon

Chameleon Commit Details

Date:2011-05-11 05:39:03 (12 years 11 months ago)
Author:Evan Lojewski
Commit:783
Parents: 782
Message:Added back board-id coded.
Changes:
M/trunk/i386/libsaio/fake_efi.c

File differences

trunk/i386/libsaio/fake_efi.c
140140
141141
142142
143
144
145
146
143
144
145
146
147147
148148
149149
......
409409
410410
411411
412
413
414
412
413
414
415415
416416
417
418
419
417
418
419
420420
421421
422422
......
436436
437437
438438
439
439440
440441
441442
......
498499
499500
500501
501
502
502503
503504
504505
......
573574
574575
575576
576
577
577578
578579
579580
......
598599
599600
600601
601
602
602
603
603604
604605
605606
......
612613
613614
614615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
615632
616633
617634
......
640657
641658
642659
643
660
644661
645662
646663
647664
648
665
649666
650667
651668
652
669
653670
654671
655672
......
662679
663680
664681
682
683
665684
666685
667686
......
686705
687706
688707
689
708
690709
691
710
692711
693712
694713
695714
696
715
697716
698717
699718
//Azi: crc32 done in place, on the cases were it wasn't.
/*static inline void fixupEfiSystemTableCRC32(EFI_SYSTEM_TABLE_64 *efiSystemTable)
{
efiSystemTable->Hdr.CRC32 = 0;
efiSystemTable->Hdr.CRC32 = crc32(0L, efiSystemTable, efiSystemTable->Hdr.HeaderSize);
}*/
{
efiSystemTable->Hdr.CRC32 = 0;
efiSystemTable->Hdr.CRC32 = crc32(0L, efiSystemTable, efiSystemTable->Hdr.HeaderSize);
}*/
/*
* What we do here is simply allocate a fake EFI system table and a fake EFI
#define SMBIOS_ANCHOR_UINT32_LE 0x5f4d535f
#define EFI_ACPI_TABLE_GUID \
{ \
0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
{ \
0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define EFI_ACPI_20_TABLE_GUID \
{ \
0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
{ \
0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
EFI_GUID gEfiAcpiTableGuid = EFI_ACPI_TABLE_GUID;
EFI_GUID gEfiAcpi20TableGuid = EFI_ACPI_20_TABLE_GUID;
static const char const SYSTEM_SERIAL_PROP[] = "SystemSerialNumber";
static const char const SYSTEM_TYPE_PROP[] = "system-type";
static const char const MODEL_PROP[] = "Model";
static const char const BOARDID_PROP[] = "board-id";
/*
// belong to smbios config only ...
const char *sysId = getStringForKey(kSystemID, &bootInfo->bootConfig);
EFI_CHAR8*ret = getUUIDFromString(sysId);
if (!sysId || !ret) // try bios dmi info UUID extraction
{
ret = getSmbiosUUID();
{
DT__AddProperty(runtimeServicesNode, "table", sizeof(uint64_t), &gST64->RuntimeServices);
}
// Set up the /efi/configuration-table node which will eventually have several child nodes for
// all of the configuration tables needed by various kernel extensions.
gEfiConfigurationTableNode = DT__AddChild(node, "configuration-table");
// Export system-id. Can be disabled with SystemId=No in com.apple.Boot.plist
if ((ret=getSystemID()))
DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, (EFI_UINT32*) ret);
// Export SystemSerialNumber if present
// Export SystemSerialNumber if present
if ((ret16=getSmbiosChar16("SMserial", &len)))
DT__AddProperty(efiPlatformNode, SYSTEM_SERIAL_PROP, len, ret16);
}
/*
* Must be called AFTER getSmbios
*/
void setupBoardId()
{
Node *node;
node = DT__FindNode("/", false);
if (node == 0) {
stop("Couldn't get root node");
}
const char *boardid = getStringForKey("SMboardproduct", &bootInfo->smbiosConfig);
if (boardid)
DT__AddProperty(node, BOARDID_PROP, strlen(boardid)+1, (EFI_CHAR16*)boardid);
}
/*
* Load the smbios.plist override config file if any
*/
err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig);
}
}
if (err)
{
verbose("No SMBIOS replacement found.\n");
}
// get a chance to scan mem dynamically if user asks for it while having the config options loaded as well,
// as opposed to when it was in scan_platform(); also load the orig. smbios so that we can access dmi info without
// patching the smbios yet
scan_mem();
}
smbios_p = (EFI_PTR32)getSmbios(SMBIOS_PATCHED);
addConfigurationTable(&gEfiSmbiosTableGuid, &smbios_p, NULL);
setupBoardId(); //need to be called after getSmbios
// Setup ACPI with DSDT overrides (mackerintel's patch)
setupAcpi();
{
// Generate efi device strings
setup_pci_devs(root_pci_dev);
readSMBIOSInfo(getSmbios(SMBIOS_ORIGINAL));
// load smbios.plist file if any
setupSmbiosConfigFile("smbios.plist");
setupSMBIOSTable();
// Initialize the base table
if (archCpuType == CPU_TYPE_I386)
{

Archive Download the corresponding diff file

Revision: 783