int port_init(kernel_args *ka) { int i; int sz; sz = sizeof(struct port_entry) * MAX_PORTS; // create and initialize semaphore table port_region = vm_create_anonymous_region(vm_get_kernel_aspace_id(), "port_table", (void **)&ports, REGION_ADDR_ANY_ADDRESS, sz, REGION_WIRING_WIRED, LOCK_RW|LOCK_KERNEL); if(port_region < 0) { panic("unable to allocate kernel port table!\n"); } memset(ports, 0, sz); for(i=0; i<MAX_PORTS; i++) ports[i].id = -1; // add debugger commands dbg_add_command(&dump_port_list, "ports", "Dump a list of all active ports"); dbg_add_command(&dump_port_info, "port", "Dump info about a particular port"); ports_active = true; return 0; }
static void phantom_init_stat_counters2(void) { dbg_add_command(&stat_dump_all, "stats", "dump kernel event statistics"); #if COMPILE_PERSISTENT_STATS stat_update_persistent_storage(0); #endif }
static void profiler_init(void) { physaddr_t pa; hal_pv_alloc( &pa, (void **)&map, PROFILER_MAP_SIZE*sizeof(profiler_entry_t) ); profiler_inited = 1; dbg_add_command(&profiler_dump_map_cmd, "profile", "Display current profiler output"); }
void phantom_unix_proc_init(void) { int i; hal_mutex_init(&proc_lock, "process"); for( i = 0; i < MAX_UU_PROC; i++ ) proc[i].pid = -1; // add the debug command dbg_add_command(&dbg_ps, "ps", "Process list"); }
static void phantom_init_stat_counters2(void) { dbg_add_command(&stat_dump_all, "stats", "dump kernel event statistics"); }