From owner-p4-projects@FreeBSD.ORG Sun Sep 16 12:58:45 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 630CD16A41B; Sun, 16 Sep 2007 12:58:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23CF316A418 for ; Sun, 16 Sep 2007 12:58:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0B94013C465 for ; Sun, 16 Sep 2007 12:58:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l8GCwiFH019811 for ; Sun, 16 Sep 2007 12:58:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l8GCwivm019807 for perforce@freebsd.org; Sun, 16 Sep 2007 12:58:44 GMT (envelope-from gonzo@FreeBSD.org) Date: Sun, 16 Sep 2007 12:58:44 GMT Message-Id: <200709161258.l8GCwivm019807@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 126471 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Sep 2007 12:58:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=126471 Change 126471 by gonzo@gonzo_jeeves on 2007/09/16 12:58:04 o get rid of mips_init function and merge it's functionality to platform_init. o Reorder some function calls: - init_param1 should be called first to initialize hz variable - tick_init_params should be called before cninit because uart code may use DELAY. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips32/idt/idt_machdep.c#4 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips32/idt/idt_machdep.c#4 (text+ko) ==== @@ -73,46 +73,6 @@ extern int *end; void -mips_init(void) -{ - int i; - - printf("entry: mips_init()\n"); - - bootverbose = 1; - realmem = btoc(32 << 20); - - for (i = 0; i < 10; i++) { - phys_avail[i] = 0; - } - - /* phys_avail regions are in bytes */ - phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); - phys_avail[1] = ctob(realmem); - - physmem = realmem; - - init_param1(); - init_param2(physmem); - - mips_cpu_init(); - pmap_bootstrap(); - - proc_linkup(&proc0, &thread0); - thread0.td_kstack = kstack0; - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - pcpup->pc_curthread = &thread0; - cpu_thread_setup(curthread); - pcpup->pc_curpcb = curthread->td_pcb; - - mutex_init(); - -#ifdef DDB - kdb_init(); -#endif -} - -void platform_halt(void) { @@ -151,17 +111,53 @@ void platform_start(int argc, char **argv) { + uint64_t platform_counter_freq; vm_offset_t kernend; - uint64_t platform_counter_freq; + int i; /* clear the BSS and SBSS segments */ kernend = round_page((vm_offset_t)&end); memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + bootverbose = 1; + realmem = btoc(32 << 20); + + for (i = 0; i < 10; i++) { + phys_avail[i] = 0; + } + + /* phys_avail regions are in bytes */ + phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end); + phys_avail[1] = ctob(realmem); + + physmem = realmem; + + /* + * ns8250 uart code uses DELAY so ticker should be inititalized + * before cninit. And tick_init_params refers to hz, so * init_param1 + * should be called first. + */ + init_param1(); + /* TODO: parse argc,argv */ + platform_counter_freq = 330000000UL; + tick_init_params(platform_counter_freq, 1); cninit(); - mips_init(); - /* Set counter_freq for tick_init_params() */ - platform_counter_freq = 330000000UL; + + init_param2(physmem); + + mips_cpu_init(); + pmap_bootstrap(); + + proc_linkup(&proc0, &thread0); + thread0.td_kstack = kstack0; + pcpu_init(pcpup, 0, sizeof(struct pcpu)); + pcpup->pc_curthread = &thread0; + cpu_thread_setup(curthread); + pcpup->pc_curpcb = curthread->td_pcb; + + mutex_init(); - tick_init_params(platform_counter_freq, 1); +#ifdef DDB + kdb_init(); +#endif }