void* wait_thread(void* args) { int status; while(running_flag) { //Start server pthread_mutex_lock(&fd_mutex); server_pid = run_server(); if(server_pid == -1) { pthread_mutex_unlock(&fd_mutex); printlog(LOG_SERVER, "Failed to run server!\n"); continue; } pthread_mutex_unlock(&fd_mutex); printlog(LOG_SERVER, "Server started.\n"); //Wait waitpid(server_pid, &status, 0); } UNREFERRED_PARAMETER(args); return NULL; }
void paging_init_arch(plist_t p_kernel_free_page_list, plist_t p_kernel_using_page_list, void* heap) { *p_kernel_free_page_list = NULL; *p_kernel_using_page_list = NULL; dbg_kprint("%P\n%P\n%P\n%P\n", mm_mgr_page_addr, mm_init_pt_addr, kernel_address_offset, init_page_num); while(1); UNREFERRED_PARAMETER(heap); }
void phymem_init() { dbg_kprint("Initialize physical memory...\n"); //phymem_heap = mm_hp_create_on_buf(phymem_heap_buf, PHYMEM_HEAP_SIZE, // HEAP_EXTENDABLE | HEAP_MULTITHREAD // | HEAP_PREALLOC); phymem_heap = mm_hp_create_on_buf(phymem_heap_buf, PHYMEM_HEAP_SIZE, HEAP_MULTITHREAD | HEAP_PREALLOC); phymem_init_arch(&phymem_list, phymem_heap); print_phymem(); pm_init_spn_lock(&alloc_lock); //Create initialize bitmap create_init_bitmap(); UNREFERRED_PARAMETER(create_init_bitmap); return; }