version 1.314, 2007/09/07 18:56:08 |
version 1.314.2.3, 2007/10/18 08:33:10 |
Line 211 struct vnode *rootvp, *swapdev_vp; |
|
Line 211 struct vnode *rootvp, *swapdev_vp; |
|
int boothowto; |
int boothowto; |
int cold = 1; /* still working on startup */ |
int cold = 1; /* still working on startup */ |
struct timeval boottime; /* time at system startup - will only follow settime deltas */ |
struct timeval boottime; /* time at system startup - will only follow settime deltas */ |
int ncpu = 0; /* number of CPUs configured, assume 1 */ |
|
|
|
volatile int start_init_exec; /* semaphore for start_init() */ |
volatile int start_init_exec; /* semaphore for start_init() */ |
|
|
|
|
CPU_INFO_ITERATOR cii; |
CPU_INFO_ITERATOR cii; |
struct cpu_info *ci; |
struct cpu_info *ci; |
|
|
/* |
|
* Initialize the current LWP pointer (curlwp) before |
|
* any possible traps/probes to simplify trap processing. |
|
*/ |
|
l = &lwp0; |
l = &lwp0; |
curlwp = l; |
|
l->l_cpu = curcpu(); |
l->l_cpu = curcpu(); |
l->l_proc = &proc0; |
l->l_proc = &proc0; |
l->l_lid = 1; |
l->l_lid = 1; |
|
|
/* |
/* |
|
* XXX This is a temporary check to be removed before |
|
* NetBSD 5.0 is released. |
|
*/ |
|
#if !defined(__i386__ ) && !defined(__x86_64__) |
|
if (curlwp != l) { |
|
printf("NOTICE: curlwp should be set before main()\n"); |
|
DELAY(250000); |
|
curlwp = l; |
|
} |
|
#endif |
|
|
|
/* |
* Attempt to find console and initialize |
* Attempt to find console and initialize |
* in case of early panic or other messages. |
* in case of early panic or other messages. |
*/ |
*/ |
consinit(); |
consinit(); |
|
|
KERNEL_LOCK_INIT(); |
kernel_lock_init(); |
|
|
uvm_init(); |
uvm_init(); |
|
|
|
|
/* Initialize fstrans. */ |
/* Initialize fstrans. */ |
fstrans_init(); |
fstrans_init(); |
|
|
|
/* Initialize the file descriptor system. */ |
|
filedesc_init(); |
|
|
/* Initialize the select()/poll() system calls. */ |
/* Initialize the select()/poll() system calls. */ |
selsysinit(); |
selsysinit(); |
|
|
|
|
p->p_stats->p_start = time; |
p->p_stats->p_start = time; |
LIST_FOREACH(l, &p->p_lwps, l_sibling) { |
LIST_FOREACH(l, &p->p_lwps, l_sibling) { |
lwp_lock(l); |
lwp_lock(l); |
l->l_cpu->ci_schedstate.spc_runtime = time; |
|
l->l_rtime.tv_sec = l->l_rtime.tv_usec = 0; |
l->l_rtime.tv_sec = l->l_rtime.tv_usec = 0; |
lwp_unlock(l); |
lwp_unlock(l); |
} |
} |
mutex_exit(&p->p_smutex); |
mutex_exit(&p->p_smutex); |
} |
} |
mutex_exit(&proclist_lock); |
mutex_exit(&proclist_lock); |
|
curlwp->l_stime = time; |
|
|
for (CPU_INFO_FOREACH(cii, ci)) { |
for (CPU_INFO_FOREACH(cii, ci)) { |
ci->ci_schedstate.spc_lastmod = time_second; |
ci->ci_schedstate.spc_lastmod = time_second; |