Chameleon

Chameleon Commit Details

Date:2010-09-09 09:01:34 (3 years 10 months ago)
Author:Azimutz
Commit:512
Parents: 511
Message:Adding "Key" termination to the rest of the bunch and fixing a previous paste error.
Changes:
M/branches/azimutz/Chazi/i386/libsaio/pci_root.c
M/branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c
M/branches/azimutz/Chazi/i386/libsaio/smbios_patcher.c
M/branches/azimutz/Chazi/i386/libsaio/platform.c
M/branches/azimutz/Chazi/i386/boot2/boot.c
M/branches/azimutz/Chazi/i386/libsaio/fake_efi.c
M/branches/azimutz/Chazi/i386/libsaio/usb.c
M/branches/azimutz/Chazi/i386/libsaio/nvidia.c
M/branches/azimutz/Chazi/i386/boot2/boot.h
M/branches/azimutz/Chazi/i386/libsaio/pci_setup.c
M/branches/azimutz/Chazi/i386/boot2/ramdisk.c
M/branches/azimutz/Chazi/i386/libsaio/ati.c

File differences

branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c
285285
286286
287287
288
288
289289
290290
291291
......
616616
617617
618618
619
619
620620
621621
622622
......
640640
641641
642642
643
643
644644
645645
646646
......
738738
739739
740740
741
742
743
741
742
743
744744
745745
746746
bool c3_enabled = fadt->C3_Latency < 1000;
bool c4_enabled = false;
getBoolForKey(kEnableC4States, &c4_enabled, &bootInfo->bootConfig);
getBoolForKey(kEnableC4StatesKey, &c4_enabled, &bootInfo->bootConfig);
unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + (c3_enabled ? 1 : 0);
{
fix_restart = false; //Azi: think this should be false by default!?
// On the other hand, i could use a shutdown fix now and then :)
getBoolForKey(kRestartFix, &fix_restart, &bootInfo->bootConfig);
getBoolForKey(kRestartFixKey, &fix_restart, &bootInfo->bootConfig);
}
else
{
memcpy(fadt_mod, fadt, fadt->Length);
}
// Determine system type / PM_Model
if ( (value=getStringForKey(kSystemType, &bootInfo->bootConfig))!=NULL)
if ( (value=getStringForKey(kSystemTypeKey, &bootInfo->bootConfig))!=NULL)
{
if (Platform.Type > 6)
{
// SSDT Options
bool drop_ssdt=false, generate_pstates=false, generate_cstates=false;
getBoolForKey(kDropSSDT, &drop_ssdt, &bootInfo->bootConfig);
getBoolForKey(kGeneratePStates, &generate_pstates, &bootInfo->bootConfig);
getBoolForKey(kGenerateCStates, &generate_cstates, &bootInfo->bootConfig);
getBoolForKey(kDropSSDTKey, &drop_ssdt, &bootInfo->bootConfig);
getBoolForKey(kGeneratePStatesKey, &generate_pstates, &bootInfo->bootConfig);
getBoolForKey(kGenerateCStatesKey, &generate_cstates, &bootInfo->bootConfig);
{
int i;
branches/azimutz/Chazi/i386/libsaio/smbios_patcher.c
513513
514514
515515
516
516
517517
518518
519519
......
668668
669669
670670
671
671
672672
673673
674674
bzero(tablespresent, sizeof(tablespresent));
getBoolForKey(kSMBIOSdefaults, &do_auto, &bootInfo->bootConfig);
getBoolForKey(kSMBIOSdefaultsKey, &do_auto, &bootInfo->bootConfig);
ret = (struct SMBEntryPoint *)AllocateKernelMemory(sizeof(struct SMBEntryPoint));
if (origsmbios) {
bzero(tablespresent, sizeof(tablespresent));
bzero(handles, sizeof(handles));
getBoolForKey(kSMBIOSdefaults, &do_auto, &bootInfo->bootConfig);
getBoolForKey(kSMBIOSdefaultsKey, &do_auto, &bootInfo->bootConfig);
newsmbios->dmi.tableAddress = (uint32_t)AllocateKernelMemory(newsmbios->dmi.tableLength);
if (origsmbios) {
branches/azimutz/Chazi/i386/libsaio/pci_root.c
5454
5555
5656
57
57
5858
5959
6060
if (rootuid < 10) return rootuid;
rootuid = 0;/* default uid = 0 */
if (getValueForKey(kPCIRootUID, &val, &len, &bootInfo->bootConfig)) {
if (getValueForKey(kPCIRootUIDKey, &val, &len, &bootInfo->bootConfig)) {
if (isdigit(val[0])) rootuid = val[0] - '0';
goto out;
}
branches/azimutz/Chazi/i386/libsaio/usb.c
6868
6969
7070
71
71
7272
7373
7474
7575
7676
77
78
79
77
78
79
8080
8181
8282
......
211211
212212
213213
214
214
215215
216216
217217
bool fix_ehci, fix_uhci, fix_usb, fix_legacy;
fix_ehci = fix_uhci = fix_usb = fix_legacy = false;
if (getBoolForKey(kUSBBusFix, &fix_usb, &bootInfo->bootConfig))
if (getBoolForKey(kUSBBusFixKey, &fix_usb, &bootInfo->bootConfig))
{
fix_ehci = fix_uhci = fix_legacy = fix_usb;// Disable all if none set
}
else
{
getBoolForKey(kEHCIacquire, &fix_ehci, &bootInfo->bootConfig);
getBoolForKey(kUHCIreset, &fix_uhci, &bootInfo->bootConfig);
getBoolForKey(kLegacyOff, &fix_legacy, &bootInfo->bootConfig);
getBoolForKey(kEHCIacquireKey, &fix_ehci, &bootInfo->bootConfig);
getBoolForKey(kUHCIresetKey, &fix_uhci, &bootInfo->bootConfig);
getBoolForKey(kLegacyOffKey, &fix_legacy, &bootInfo->bootConfig);
}
struct pciList* current = usbList;
boolalwaysHardBIOSReset;
alwaysHardBIOSReset = false;
if (!getBoolForKey(kEHCIhard, &alwaysHardBIOSReset, &bootInfo->bootConfig)) {
if (!getBoolForKey(kEHCIhardKey, &alwaysHardBIOSReset, &bootInfo->bootConfig)) {
alwaysHardBIOSReset = true;
}
branches/azimutz/Chazi/i386/libsaio/nvidia.c
728728
729729
730730
731
731
732732
733733
734734
......
870870
871871
872872
873
873
874874
875875
876876
rom = malloc(NVIDIA_ROM_SIZE);
sprintf(nvFilename, "/Extra/%04x_%04x.rom", (uint16_t)nvda_dev->vendor_id, (uint16_t)nvda_dev->device_id);
if (getBoolForKey(kUseNvidiaROM, &doit, &bootInfo->bootConfig) && doit) {
if (getBoolForKey(kUseNvidiaROMKey, &doit, &bootInfo->bootConfig) && doit) {
verbose("Looking for nvidia video bios file %s\n", nvFilename);
nvBiosOveride = load_nvidia_bios_file(nvFilename, rom, NVIDIA_ROM_SIZE);
if (nvBiosOveride > 0) {
devprop_add_value(device, "VRAM,totalsize", (uint8_t*)&videoRam, 4);
devprop_add_value(device, "model", (uint8_t*)model, strlen(model) + 1);
devprop_add_value(device, "rom-revision", (uint8_t*)biosVersion, strlen(biosVersion) + 1);
if (getBoolForKey(kVBIOS, &doit, &bootInfo->bootConfig) && doit) {
if (getBoolForKey(kVBIOSKey, &doit, &bootInfo->bootConfig) && doit) {
devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512));
}
branches/azimutz/Chazi/i386/libsaio/ati.c
711711
712712
713713
714
714
715715
716716
717717
devprop_add_value(device, (char *) ati_name_1[0], (uint8_t *)tmp, strlen(tmp) + 1);
sprintf(tmp, "/Extra/%04x_%04x.rom", (uint16_t)ati_dev->vendor_id, (uint16_t)ati_dev->device_id);
if (getBoolForKey(kUseAtiROM, &doit, &bootInfo->bootConfig) && doit) {
if (getBoolForKey(kUseAtiROMKey, &doit, &bootInfo->bootConfig) && doit) {
verbose("looking for ati video bios file %s\n", tmp);
rom = malloc(0x20000);
rom_size = load_ati_bios_file(tmp, rom, 0x20000);
branches/azimutz/Chazi/i386/libsaio/platform.c
4343
4444
4545
46
46
4747
4848
4949
if (done) return;
bool useAutodetection = true;
getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig);
getBoolForKey(kUseMemDetectKey, &useAutodetection, &bootInfo->bootConfig);
if (useAutodetection) {
if (dram_controller_dev!=NULL) {
branches/azimutz/Chazi/i386/libsaio/pci_setup.c
2121
2222
2323
24
25
26
24
25
26
2727
2828
2929
do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;
getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
getBoolForKey(kEthernetBuiltInKey, &do_eth_devprop, &bootInfo->bootConfig);
getBoolForKey(kGraphicsEnablerKey, &do_gfx_devprop, &bootInfo->bootConfig);
getBoolForKey(kForceHPETKey, &do_enable_hpet, &bootInfo->bootConfig);
while (current)
{
branches/azimutz/Chazi/i386/libsaio/fake_efi.c
505505
506506
507507
508
508
509509
510510
511511
// unable to determine UUID for host. Error: 35 fix
// Rek: new SMsystemid option conforming to smbios notation standards, this option should
// belong to smbios config only ...
const char *sysId = getStringForKey(kSystemID, &bootInfo->bootConfig);
const char *sysId = getStringForKey(kSystemIDKey, &bootInfo->bootConfig);
EFI_CHAR8* ret = getUUIDFromString(sysId);
if (!sysId || !ret) // try bios dmi info UUID extraction
branches/azimutz/Chazi/i386/boot2/boot.c
511511
512512
513513
514
514
515515
516516
517517
518518
519519
520520
521
521
522522
523523
524524
......
530530
531531
532532
533
533
534534
535535
536536
archCpuType = CPU_TYPE_X86_64;
}
if (!getBoolForKey (kWake, &tryresume, &bootInfo->bootConfig)) {
if (!getBoolForKey (kWakeKey, &tryresume, &bootInfo->bootConfig)) {
tryresume = true;
tryresumedefault = true;
} else {
tryresumedefault = false;
}
if (!getBoolForKey (kForceWake, &forceresume, &bootInfo->bootConfig)) {
if (!getBoolForKey (kForceWakeKey, &forceresume, &bootInfo->bootConfig)) {
forceresume = false;
}
while (tryresume) {
const char *tmp;
BVRef bvr;
if (!getValueForKey(kWakeImage, &val, &len, &bootInfo->bootConfig))
if (!getValueForKey(kWakeKeyImageKey, &val, &len, &bootInfo->bootConfig))
val="/private/var/vm/sleepimage";
// Do this first to be sure that root volume is mounted
branches/azimutz/Chazi/i386/boot2/boot.h
9999
100100
101101
102
102
103103
104104
105105
......
108108
109109
110110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154154
155155
156156
157157
158
159
160
161
162
163
164
165
158
159
160
161
162
163
164
165
166166
167167
168168
169169
170
171
170
171
172172
173173
174174
#define kRescanPromptKey "Rescan Prompt" // boot.c
#define kRescanKey "Rescan" // boot.c
#define kScanSingleDriveKey "Scan Single Drive" // boot.c
#define kRenamePartitionKey "device-properties" // device_inject.c
#define kDevicePropertiesKey "device-properties" // device_inject.c
/*
* Keys that make some/all sense at boot prompt or any Boot.plist.
*
*/
#define kWaitForKeypressKey"Wait"// boot.c
#define kTestConfigKey"config"// stringTable.c
#define kCanOverrideKey"CanOverride"// stringTable.c
#define kRootDeviceKey"rd"// options.c
#define kBootDeviceKey"Boot Device"// options.c - ????? internal
#define kBootUUIDKey"boot-uuid"// options.c
#define kHelperRootUUIDKey"Root UUID"// options.c
#define kKernelNameKey"Kernel"// options.c
#define kKernelCacheKey"Kernel Cache"// boot.c
#define kKernelFlagsKey"Kernel Flags"// options.c
#define kKPatcherKey"PatchKernel"// kernel_patcher.c
#define kExtensionsKey"kext"// drivers.c
#define kMKextCacheKey"MKext Cache"// options.c
#define kMD0Image"md0"// ramdisk.h
#define kWake"Wake"// boot.c
#define kForceWake"ForceWake"// boot.c
#define kWakeImage"WakeImage"// boot.c
#define kUseAtiROM"UseAtiROM"// ati.c
#define kUseNvidiaROM"UseNvidiaROM"// nvidia.c
#define kVBIOS"VBIOS"// nvidia.c
#define kGraphicsModeKey"Graphics Mode"// graphics.c - here because of AutoResolution patch, which uses it + F2!!
#define kAutoResolutionKey"AutoResolution"// boot.c
#define kGraphicsEnabler"GraphicsEnabler"// pci_setup.c
#define kLegacyLogoKey"Legacy Logo"// gui.c
#define kDSDTKey"DSDT"// acpi_patcher.c
#define kDropSSDT"DropSSDT"// acpi_patcher.c
#define kRestartFix"RestartFix" // acpi_patcher.c
#define kGeneratePStates"GeneratePStates"// acpi_patcher.c
#define kGenerateCStates"GenerateCStates"// acpi_patcher.c
#define kEnableC4States"EnableC4State"// acpi_patcher.c
#define kUseMemDetect"UseMemDetect" // platform.c
#define kSMBIOSdefaults"SMBIOSdefaults"// smbios_patcher.c
#define kSMBIOSKey"SMBIOS"// fake_efi.c
#define kSystemID"SystemId"// fake_efi.c
#define kSystemType"SystemType"// fake_efi.c
#define kPCIRootUID"PciRoot"// pci_root.c
#define kEthernetBuiltIn"EthernetBuiltIn"// pci_setup.c
#define kForceHPET"ForceHPET"// pci_setup.c
#define kUSBBusFix"USBBusFix"// usb.c
#define kEHCIacquire"EHCIacquire"// usb.c
#define kEHCIhard"EHCIhard"// usb.c - ????? internal
#define kUHCIreset"UHCIreset"// usb.c
#define kLegacyOff"USBLegacyOff"// usb.c
#define kWaitForKeypressKey "Wait" // boot.c
#define kTestConfigKey "config" // stringTable.c
#define kCanOverrideKey "CanOverride" // stringTable.c
#define kRootDeviceKey "rd" // options.c
#define kBootDeviceKey "Boot Device" // options.c - ????? internal
#define kBootUUIDKey "boot-uuid" // options.c
#define kHelperRootUUIDKey "Root UUID" // options.c
#define kKernelNameKey "Kernel" // options.c
#define kKernelCacheKey "Kernel Cache" // boot.c
#define kKernelFlagsKey "Kernel Flags" // options.c
#define kKPatcherKey "PatchKernel" // kernel_patcher.c
#define kExtensionsKey "kext" // drivers.c
#define kMKextCacheKey "MKext Cache" // options.c
#define kMD0ImageKey "md0" // ramdisk.c
#define kWakeKey "Wake" // boot.c
#define kForceWakeKey "ForceWake" // boot.c
#define kWakeKeyImageKey "WakeImage" // boot.c
#define kUseAtiROMKey "UseAtiROM" // ati.c
#define kUseNvidiaROMKey "UseNvidiaROM" // nvidia.c
#define kVBIOSKey "VBIOS" // nvidia.c
#define kGraphicsModeKey "Graphics Mode" // graphics.c - here because of AutoResolution patch, which uses it + F2!!
#define kAutoResolutionKey "AutoResolution" // boot.c
#define kGraphicsEnablerKey "GraphicsEnabler" // pci_setup.c
#define kLegacyLogoKey "Legacy Logo" // gui.c
#define kDSDTKey "DSDT" // acpi_patcher.c
#define kDropSSDTKey "DropSSDT" // acpi_patcher.c
#define kRestartFixKey "RestartFix" // acpi_patcher.c
#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.c
#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.c
#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.c
#define kUseMemDetectKey "UseMemDetect" // platform.c
#define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.c
#define kSMBIOSKey "SMBIOS" // fake_efi.c
#define kSystemIDKey "SystemId" // fake_efi.c
#define kSystemTypeKey "SystemType" // fake_efi.c
#define kPCIRootUIDKey "PciRoot" // pci_root.c
#define kEthernetBuiltInKey "EthernetBuiltIn" // pci_setup.c
#define kForceHPETKey "ForceHPET" // pci_setup.c
#define kUSBBusFixKey "USBBusFix" // usb.c
#define kEHCIacquireKey "EHCIacquire" // usb.c
#define kEHCIhardKey "EHCIhard" // usb.c - ????? internal
#define kUHCIresetKey "UHCIreset" // usb.c
#define kLegacyOffKey "USBLegacyOff" // usb.c
/*
* Flags to the booter and/or kernel - these end with "Flag".
*/
#define kVerboseModeFlag"-v"// options.c
#define kSafeModeFlag"-x"// options.c
#define kIgnoreCachesFlag"-f"// options.c
#define kIgnoreBootFileFlag"-F"// options.c
#define kSingleUserModeFlag"-s"// options.c
#define kLegacyModeFlag"-legacy"// boot.c
#define kArchI386Flag"32"// boot.c - to be reverted!?
#define kArchX86_64Flag"64"// boot.c - to be reverted!?
#define kVerboseModeFlag "-v" // options.c
#define kSafeModeFlag "-x" // options.c
#define kIgnoreCachesFlag "-f" // options.c
#define kIgnoreBootFileFlag "-F" // options.c
#define kSingleUserModeFlag "-s" // options.c
#define kLegacyModeFlag "-legacy" // boot.c
#define kArchI386Flag "32" // boot.c - to be reverted!?
#define kArchX86_64Flag "64" // boot.c - to be reverted!?
/*
* Booter behavior control
*/
#define kBootTimeout -1
#define kCDBootTimeout 8
#define kBootTimeout -1
#define kCDBootTimeout 8
/*
* A global set by boot() to record the device that the booter
branches/azimutz/Chazi/i386/boot2/ramdisk.c
2525
2626
2727
28
28
2929
3030
3131
int fh = -1;
int len;
if(getValueForKey(kMD0Image, &override_filename, &len,
if(getValueForKey(kMD0ImageKey, &override_filename, &len,
&bootInfo->bootConfig))
{
// Use user specified md0 file

Archive Download the corresponding diff file

Revision: 512