--- Gnu-Mach/kern/startup.c 2020/09/02 04:45:14 1.1.1.4 +++ Gnu-Mach/kern/startup.c 2020/09/02 04:51:58 1.1.1.7 @@ -36,54 +36,45 @@ #include #include #include +#include #include #include #include -#include #include +#include #include #include #include #include #include #include +#include #include +#include #include #include #include #include +#include +#include #include #include #include #include #include +#include - - -extern void vm_mem_init(); -extern void vm_mem_bootstrap(); -extern void init_timeout(); -extern void machine_init(); - -extern void idle_thread(); -extern void vm_pageout(); -extern void reaper_thread(); -extern void swapin_thread(); -extern void sched_thread(); - -extern void bootstrap_create(); -extern void device_service_create(); - -void cpu_launch_first_thread(); /* forward */ -void start_kernel_threads(); /* forward */ +#if MACH_KDB +#include +#endif /* MACH_KDB */ #if ! MACH_KBD -boolean_t reboot_on_panic = 1; +boolean_t reboot_on_panic = TRUE; #endif #if NCPUS > 1 -extern void start_other_cpus(); -extern void action_thread(); +#include +#include #endif /* NCPUS > 1 */ /* XX */ @@ -96,7 +87,7 @@ extern char *kernel_cmdline; * * Assumes that master_cpu is set. */ -void setup_main() +void setup_main(void) { thread_t startup_thread; @@ -113,15 +104,15 @@ void setup_main() } #else /* MACH_KDB */ if (strstr (kernel_cmdline, "-H ")) { - reboot_on_panic = 0; + reboot_on_panic = FALSE; } #endif /* MACH_KDB */ panic_init(); - printf_init(); sched_init(); vm_mem_bootstrap(); + rdxtree_cache_init(); ipc_bootstrap(); vm_mem_init(); ipc_init(); @@ -146,7 +137,7 @@ void setup_main() mapable_time_init(); machine_info.max_cpus = NCPUS; - machine_info.memory_size = phys_last_addr - phys_first_addr; /* XXX mem_size */ + machine_info.memory_size = vm_page_mem_size(); /* XXX phys_addr_t -> vm_size_t */ machine_info.avail_cpus = 0; machine_info.major_version = KERNEL_MAJOR_VERSION; machine_info.minor_version = KERNEL_MINOR_VERSION; @@ -165,9 +156,11 @@ void setup_main() * Kick off the time-out driven routines by calling * them the first time. */ - recompute_priorities(); + recompute_priorities(NULL); compute_mach_factor(); + gsync_setup (); + /* * Create a kernel thread to start the other kernel * threads. Thread_resume (from kernel_thread) calls @@ -208,9 +201,9 @@ void setup_main() * Now running in a thread. Create the rest of the kernel threads * and the bootstrap task. */ -void start_kernel_threads() +void start_kernel_threads(void) { - register int i; + int i; /* * Create the idle threads and the other @@ -276,7 +269,7 @@ void start_kernel_threads() } #if NCPUS > 1 -void slave_main() +void slave_main(void) { cpu_launch_first_thread(THREAD_NULL); } @@ -286,10 +279,9 @@ void slave_main() * Start up the first thread on a CPU. * First thread is specified for the master CPU. */ -void cpu_launch_first_thread(th) - register thread_t th; +void cpu_launch_first_thread(thread_t th) { - register int mycpu; + int mycpu; mycpu = cpu_number();