From owner-p4-projects@FreeBSD.ORG Wed Jan 16 03:09:36 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0881916A41A; Wed, 16 Jan 2008 03:09:36 +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 91A2F16A417 for ; Wed, 16 Jan 2008 03:09:35 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7393113C4E9 for ; Wed, 16 Jan 2008 03:09:35 +0000 (UTC) (envelope-from imp@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 m0G39ZQb022643 for ; Wed, 16 Jan 2008 03:09:35 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0G39ZMb022640 for perforce@freebsd.org; Wed, 16 Jan 2008 03:09:35 GMT (envelope-from imp@freebsd.org) Date: Wed, 16 Jan 2008 03:09:35 GMT Message-Id: <200801160309.m0G39ZMb022640@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 133393 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: Wed, 16 Jan 2008 03:09:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=133393 Change 133393 by imp@imp_lighthouse on 2008/01/16 03:08:29 We can finally get rid of mips_init and getbootinfo(). We'll keep a commented out copy of getmemory() because we don't yet know about the mips tlb wiring stuff that was omitted yet. This gets us down to one undefined function, but it is a biggie: mips_cpu_init(). That's going to take some time to sort out. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips/machdep.c#14 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/machdep.c#14 (text+ko) ==== @@ -107,8 +107,9 @@ void mips_init(int, int, u_int32_t, struct bootinfo *); void mips_vector_init(void); void hardware_basic_init(void); +#if 0 /* see comment below */ static void getmemsize(void); -static void getbootinfo(int, int, u_int32_t, struct bootinfo *); +#endif #ifdef DEBUG_UART_POLLED void init_bootstrap_console(void); #endif @@ -282,39 +283,6 @@ PCPU_SET(curpcb, thread0.td_pcb); } -static void -getbootinfo(int bootinfo_magic, int boothowto_arg, u_int32_t bootdev_arg, - struct bootinfo *bootinfop) -{ - if (bootinfo_magic == MIPS_BOOTINFO_MAGIC && - bootinfop && bootinfop->bi_version == BOOTINFO_VERSION) { - - bootinfo = *bootinfop; - boothowto = boothowto_arg; - bootdev = bootdev_arg; - - if (bootinfo.bi_modulep) - preload_metadata = (caddr_t)bootinfo.bi_modulep; - - /* set up kern_envp */ - if (bootinfo.bi_envp) - kern_envp = (caddr_t)bootinfo.bi_envp; - } - - /* - * Look at arguments passed to us and compute boothowto. - * Default to SINGLE and ASKNAME if no args or - * SINGLE and DFLTROOT if this is a ramdisk kernel. - */ -#ifdef MD_ROOT - boothowto |= RB_DFLTROOT; -#else - boothowto |= RB_ASKNAME; -#endif /* RAMDISK_HOOKS */ - -} - - #ifdef DEBUG_UART_POLLED void init_bootstrap_console() @@ -329,6 +297,15 @@ #endif struct msgbuf *msgbufp=0; + +#if 0 +/* + * This code has been moved to the platform_init code. The only + * thing that's beign done here that hasn't been moved is the wired tlb + * pool stuff. I'm still trying to understand that feature..., since + * it maps from the end the kernel to 0x08000000 somehow. But the stuff + * was stripped out, so it is hard to say what's going on.... + */ u_int32_t freemem_start; static void @@ -429,7 +406,7 @@ msgbufinit(msgbufp, sz); printf("%s: msgbufp[size=%d] = 0x%p\n", __FUNCTION__, sz, msgbufp); } - +#endif /* * Initialize the hardware exception vectors, and the jump table used to @@ -508,92 +485,6 @@ pcpu->pc_asid_generation = 1; } -#include -/* - * Do all the stuff that locore normally does before calling mi_start(). - * - * We need to migrate to the mips2 way of doing things. There's code in - * locore.S which preserves environment parameters and passes them to - * platform start... - * - * XXXimp - */ -void -mips_init(int bootinfo_magic, int boothowto_arg, u_int32_t bootdev_arg, - struct bootinfo *bootinfop) -{ - char systype[30]; - - /* clear the BSS segment */ - bzero(edata, (vm_offset_t)mips_round_page(end) - (vm_offset_t)edata); - - getbootinfo(bootinfo_magic, boothowto_arg, bootdev_arg, bootinfop); - boothowto = 0x00001820; - - /* - * Identify the processor type by reading the Processor Id register - */ - mfc0_macro(cpu_id, 15); - - switch (mips_proc_type()) { - case MIPS_RM7000: - strcpy(systype, "rm7000"); - need_wired_tlb_page_pool = 0; - break; - - case MIPS_RM9000: - strcpy(systype, "rm9220"); - need_wired_tlb_page_pool = 1; - break; - - default: - break; - } -#ifdef UNIMPLEMENTED - if (cputype >= ncpuinit) { - platform_not_supported(cputype); - /* NOTREACHED */ - } - cpuinit[cputype].init(cputype); -#endif - /* Do basic tuning, hz etc */ - init_param1(); - - hardware_basic_init(); - -#ifdef UNIMPLEMENTED - snprintf(cpu_model, sizeof(cpu_model), "%s", platform.model); -#endif - -#if BOOTINFO_DEBUG - printf("boothowto = %x, bootdev = %x\n", boothowto, bootdev); - printf("bootinfo: version = %x, kernelname = %x, size = %x, memsize_valid = %x, basemem = %x, extmem = %x, symtab = %x, esymtab = %x, modulep = %x, kernend = %x, envp = %x\n", - bootinfo.bi_version, bootinfo.bi_kernelname, bootinfo.bi_size, - bootinfo.bi_memsizes_valid, bootinfo.bi_basemem, - bootinfo.bi_extmem, bootinfo.bi_symtab, bootinfo.bi_esymtab, - bootinfo.bi_modulep, bootinfo.bi_kernend, bootinfo.bi_envp); -#endif - - getmemsize(); - -#if 0 - /* depend on phys_avail being initialized first */ - mips_proc0_init(); - mutex_init(); - -#ifdef DDB - kdb_init(); - if ((boothowto & RB_KDB) || (boothowto & RB_GDB)) - kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); -#endif - pmap_bootstrap(); -#else - /* XXXimp need to call platform start */ -#endif - init_param2(physmem); -} - - int sysarch(struct thread *td, register struct sysarch_args *uap) {