/** scan mem for memory autodection purpose */ void scan_mem() { static bool done = false; if (done) return; bool useAutodetection = true; getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig); if (useAutodetection) { if (dram_controller_dev!=NULL) { scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ... } scan_memory(&Platform); // unfortunately still necesary for some comp where spd cant read correct speed scan_spd(&Platform); //getc(); } done = true; }
int main(int argc, const char *argv[]) { int i; for (i=1;i<argc;i++) { unsigned char *p; off_t size; printf("Scanning %s\n", argv[i]); p = map_file(argv[i], &size); if (p) { scan_memory(i, p, size); } } return 0; }
void Memory_hook(void* arg1, void* arg2, void* arg3, void* arg4) { bool useAutodetection = true; getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig); if (useAutodetection) { if (dram_controller_dev!=NULL) { scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ... } scan_memory(Platform); // unfortunately still necesary for some comp where spd cant read correct speed DBG("scan_memory \n"); if(smbus_controller_dev) { scan_spd(Platform, smbus_controller_dev); DBG("scan_spd \n"); } } }
void run(void) { #if DEBUG_RUNS int count = 0; #endif init_poller(); // Initialize binary image state initialize_binary(); // Initialize memory { TWOBYTES size; memory_init (); #if SEGMENTED_HEAP size = EXTRA_MEMORY_SIZE; region = (byte *) malloc (size * sizeof (TWOBYTES)); memory_add_region (region, region + size * sizeof (TWOBYTES)); #endif size = MEMORY_SIZE; region = (byte *) malloc (size * sizeof (TWOBYTES)); memory_add_region (region, region + size * sizeof (TWOBYTES)); } // Initialize exceptions init_exceptions(); // Create the boot thread (bootThread is a special global) bootThread = (Thread *) new_object_for_class (JAVA_LANG_THREAD); #if DEBUG_THREADS printf ("Created bootThread: %d. Initializing...\n", (int) bootThread); #endif #if DEBUG_RUNS for (count = 0; count < 100; count++) { #endif // DEBUG_RUNS #if DEBUG_RCX_MEMORY { TWOBYTES numNodes, biggest, freeMem; scan_memory (&numNodes, &biggest, &freeMem); printf ("nodes = %d\n", (int) numNodes); printf ("biggest = %d\n", (int) biggest); printf ("freeMem = %d\n", (int) freeMem); } #endif init_threads(); if (!init_thread (bootThread)) { printf ("Unable to initialize threading module.\n"); exit (1); } // Execute the bytecode interpreter set_program_number (0); #if DEBUG_STARTUP printf ("Engine starting.\n"); #endif engine(); // Engine returns when all non-daemon threads are dead #if DEBUG_STARTUP printf ("Engine finished.\n"); #endif #if DEBUG_RUNS } #endif // DEBUG_RUNS }
gchar *get_memory_total(void) { scan_memory(FALSE); return moreinfo_lookup ("DEV:Total Memory"); //hi_more_info(N_("Total Memory")); }