Index: branches/azimutz/Chazi/i386/libsaio/platform.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/platform.c (revision 879) +++ branches/azimutz/Chazi/i386/libsaio/platform.c (revision 880) @@ -38,18 +38,12 @@ /** scan mem for memory autodection purpose */ void scan_mem() { - static bool done = false; - if (done) return; - - bool useAutodetection = true; - getBoolForKey(kUseMemDetectKey, &useAutodetection, &bootInfo->bootConfig); - - if (useAutodetection) - { - execute_hook("ScanMemory", NULL, NULL, NULL, NULL); - //getc(); - } - done = true; + static bool done = false; + if (done) return; + + execute_hook("ScanMemory", NULL, NULL, NULL, NULL); + + done = true; } /** Index: branches/azimutz/Chazi/i386/boot2/boot.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.h (revision 879) +++ branches/azimutz/Chazi/i386/boot2/boot.h (revision 880) @@ -128,7 +128,7 @@ #define kEnableC2StatesKey "EnableC2State" // acpi_patcher.c getBoolFK #define kEnableC3StatesKey "EnableC3State" // acpi_patcher.c getBoolFK #define kEnableC4StatesKey "EnableC4State" // acpi_patcher.c getBoolFK -#define kUseMemDetectKey "UseMemDetect" // platform.c getBoolFK +//#define kUseMemDetectKey "UseMemDetect" // platform.c getBoolFK #define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.c getBoolFK #define kSMBIOSKey "SMBIOS" // fake_efi.c getValFK //Azi: should this be changed to "SystemID"? BootHelp.txt matches SystemId Index: branches/azimutz/Chazi/i386/modules/Memory/Memory.c =================================================================== --- branches/azimutz/Chazi/i386/modules/Memory/Memory.c (revision 879) +++ branches/azimutz/Chazi/i386/modules/Memory/Memory.c (revision 880) @@ -1,11 +1,12 @@ /* - * DRAM Controller Module - * Scans the dram controller and notifies OS X of the memory modules. + * Memory Module + * Scans the dram controller and(/or spd), and notifies OS X of the memory modules. * This was converted from boot2 code to a boot2 module. * */ -#include "libsaio.h" +//#include "libsaio.h" +#include "boot.h" #include "pci.h" #include "platform.h" #include "dram_controllers.h" @@ -13,6 +14,8 @@ //#include "mem.h" #include "modules.h" +#define kUseMemDetectKey "UseMemDetect" + pci_dt_t *dram_controller_dev; @@ -32,56 +35,28 @@ pci_dt_t* current = arg1; if (current->class_id == PCI_CLASS_BRIDGE_HOST - && (current->dev.addr == PCIADDR(0, 0, 0)) + && (current->dev.addr == PCIADDR(0, 0, 0))) { dram_controller_dev = current; } } void Memory_hook(void* arg1, void* arg2, void* arg3, void* arg4) -{ - if (dram_controller_dev!=NULL) { - scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ... - } - //Azi: gone on Kabyl's...??? -// scan_memory(&Platform); // unfortunately still necesary for some comp where spd cant read correct speed - scan_spd(&Platform); -} - - - -/* Nedded to devide 64bit numbers correctly. TODO: look into why the module needs this - * And why it isn't needed when compiled into boot2 - */ - -uint64_t __udivdi3(uint64_t numerator, uint64_t denominator) -{ - uint64_t quotient = 0, qbit = 1; +{ + bool useAutodetection = true; + getBoolForKey(kUseMemDetectKey, &useAutodetection, &bootInfo->bootConfig); - if (denominator) + if (useAutodetection) { - while ((int64_t) denominator >= 0) + if (dram_controller_dev != NULL) { - denominator <<= 1; - qbit <<= 1; + // Rek: pci dev ram controller direct and fully informative scan ... + scan_dram_controller(dram_controller_dev); } - - while (denominator) - { - if (denominator <= numerator) - { - numerator -= denominator; - quotient += qbit; - } - denominator >>= 1; - qbit >>= 1; - } - - return quotient; } - else { - stop("Divide by 0"); - return 0; - } + //Azi: gone on Kabyl's smbios update...??? + // unfortunately still necesary for some comp where spd cant read correct speed +// scan_memory(&Platform); + scan_spd(&Platform); // check Mek's implementation! }