Chameleon

Chameleon Commit Details

Date:2010-02-25 02:31:36 (10 years 9 months ago)
Author:Rekursor
Commit:118
Parents: 117
Message:Restored dyn. mem option, now working as before, but disabled by default. A side effect during scan_memory() exec prevented the smbios to patched after the mem detection.
Changes:
M/trunk/i386/libsaio/smbios_patcher.c
M/trunk/i386/libsaio/fake_efi.c

File differences

trunk/i386/libsaio/smbios_patcher.c
797797
798798
799799
800
801800
802801
803
804
805
802
803
806804
805
806
807
808
809
810
807811
808812
809813
......
814818
815819
816820
817
818821
819822
820
821
822823
823
824
825
826
827
824
828825
829826
830827
......
833830
834831
835832
836
833
837834
838835
839836
......
841838
842839
843840
844
841
845842
846843
847844
848845
849
846
850847
851848
852849
{
static struct SMBEntryPoint *orig = NULL; // cached
static struct SMBEntryPoint *patched = NULL; // cached
static bool first_time = true;
// whatever we are called with orig or new flag, initialize asap both structures
if (first_time) {
orig = getAddressOfSmbiosTable();
switch (which) {
case SMBIOS_ORIGINAL:
if (orig==NULL) {
orig = getAddressOfSmbiosTable();
getSmbiosTableStructure(orig); // generate tables entry list for fast table finding
}
return orig;
case SMBIOS_PATCHED:
if (orig==NULL && (orig = getAddressOfSmbiosTable())==NULL ) {
printf("Could not find original SMBIOS !!\n");
pause();
} else {
}
else {
smbios_real_run(orig, patched);
getSmbiosTableStructure(patched); // generate tables entry list for fast table finding
}
}
first_time = false;
}
switch (which) {
case SMBIOS_ORIGINAL:
return orig;
case SMBIOS_PATCHED:
return patched;
return patched;
default:
printf("ERROR: invalid option for getSmbios() !!\n");
break;
return NULL;
}
/** Find first new dmi Table with a particular type */
/** Find first original dmi Table with a particular type */
struct DMIHeader* FindFirstDmiTableOfType(int type, int minlength)
{
current_pos = 0;
return FindNextDmiTableOfType(type, minlength);
};
/** Find next new dmi Table with a particular type */
/** Find next original dmi Table with a particular type */
struct DMIHeader* FindNextDmiTableOfType(int type, int minlength)
{
int i;
if (ftTablePairInit) getSmbios(SMBIOS_PATCHED);
if (ftTablePairInit) getSmbios(SMBIOS_ORIGINAL);
for (i=current_pos; i < DmiTablePairCount; i++) {
if (type == DmiTablePair[i].type &&
trunk/i386/libsaio/fake_efi.c
484484
485485
486486
487
487488
488
489
490
491
489492
490493
491494
492495
493496
494
497
495498
496499
497500
......
503506
504507
505508
506
509
507510
508511
509512
if (loadConfigFile(value, &bootInfo->smbiosConfig) == -1) {
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()
// 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
getSmbios(SMBIOS_ORIGINAL);
scan_mem();
smbios_p = (EFI_PTR32) getSmbios(SMBIOS_PATCHED);// process smbios asap
}
/* Installs all the needed configuration table entries */
void setupEfiConfigurationTable()
static void setupEfiConfigurationTable()
{
smbios_p = (EFI_PTR32)getSmbios(SMBIOS_PATCHED);
addConfigurationTable(&gEfiSmbiosTableGuid, &smbios_p, NULL);
fixupEfiSystemTableCRC32(gST);
}
void setupEfiDevices(void)
static void setupEfiDevices(setup)
{
setup_pci_devs(root_pci_dev);
}

Archive Download the corresponding diff file

Revision: 118