From: Tomas Hruby Date: Wed, 15 Sep 2010 14:10:24 +0000 (+0000) Subject: SMP - proc_ptr and bill_ptr initialization X-Git-Tag: v3.2.0~857 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=67f039540cfff1407eb27cfa119b51fec33eeb32;p=minix.git SMP - proc_ptr and bill_ptr initialization - they should point somewhere --- diff --git a/kernel/arch/i386/arch_smp.c b/kernel/arch/i386/arch_smp.c index 7c72ca124..88b20a7cc 100644 --- a/kernel/arch/i386/arch_smp.c +++ b/kernel/arch/i386/arch_smp.c @@ -216,10 +216,8 @@ PRIVATE void ap_finish_booting(void) printf("CPU %d local APIC timer is ticking\n", cpu); /* FIXME assign CPU local idle structure */ - get_cpulocal_var(proc_ptr) = proc_addr(IDLE); - get_cpulocal_var(bill_ptr) = proc_addr(IDLE); - - BKL_UNLOCK(); + get_cpulocal_var(proc_ptr) = get_cpulocal_var_ptr(idle_proc); + get_cpulocal_var(bill_ptr) = get_cpulocal_var_ptr(idle_proc); ap_boot_finished(cpu); spinlock_unlock(&boot_lock); @@ -227,6 +225,9 @@ PRIVATE void ap_finish_booting(void) /* finish processor initialisation. */ lapic_enable(cpu); + BKL_UNLOCK(); + for(;;); + switch_to_user(); NOT_REACHABLE; } diff --git a/kernel/main.c b/kernel/main.c index 730cc30aa..d4dde5180 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -48,7 +48,10 @@ PUBLIC void bsp_finish_booting(void) /* MINIX is now ready. All boot image processes are on the ready queue. * Return to the assembly code to start running the current process. */ - get_cpulocal_var(bill_ptr) = proc_addr(IDLE); /* it has to point somewhere */ + + /* it should point somewhere */ + get_cpulocal_var(bill_ptr) = get_cpulocal_var_ptr(idle_proc); + get_cpulocal_var(proc_ptr) = get_cpulocal_var_ptr(idle_proc); announce(); /* print MINIX startup banner */ /* diff --git a/kernel/proc.c b/kernel/proc.c index 3ded1a331..3b934506f 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -150,6 +150,8 @@ PUBLIC void proc_init(void) for (i = 0; i < CONFIG_MAX_CPUS; i++) { struct proc * ip = get_cpu_var_ptr(i, idle_proc); ip->p_priv = &idle_priv; + /* must not let idle ever get scheduled */ + ip->p_rts_flags |= RTS_PROC_STOP; set_idle_name(ip->p_name, i); } }