Module Name: src Committed By: matt Date: Fri Apr 29 22:00:03 UTC 2011
Modified Files: src/sys/arch/mips/rmi: rmixl_cpu.c rmixl_cpucore.c rmixl_cpucorevar.h Log Message: minor cleanups. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/rmi/rmixl_cpu.c \ src/sys/arch/mips/rmi/rmixl_cpucorevar.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/rmi/rmixl_cpucore.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/rmi/rmixl_cpu.c diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.3 src/sys/arch/mips/rmi/rmixl_cpu.c:1.4 --- src/sys/arch/mips/rmi/rmixl_cpu.c:1.3 Thu Apr 14 05:12:58 2011 +++ src/sys/arch/mips/rmi/rmixl_cpu.c Fri Apr 29 22:00:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_cpu.c,v 1.3 2011/04/14 05:12:58 cliff Exp $ */ +/* $NetBSD: rmixl_cpu.c,v 1.4 2011/04/29 22:00:03 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -38,13 +38,11 @@ #include "locators.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.3 2011/04/14 05:12:58 cliff Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.4 2011/04/29 22:00:03 matt Exp $"); #include "opt_multiprocessor.h" #include "opt_ddb.h" -#include "opt_multiprocessor.h" - #include <sys/param.h> #include <sys/device.h> #include <sys/systm.h> @@ -100,7 +98,7 @@ #endif /* - * cpu_rmixl_db_watch_init - initialize COP0 watchpoint stuff + * cpu_rmixl_watchpoint_init - initialize COP0 watchpoint stuff * * clear IEU_DEFEATURE[DBE] to ensure T_WATCH on watchpoint exception * set COP0 watchhi and watchlo @@ -108,7 +106,7 @@ * disable all watchpoints */ static void -cpu_rmixl_db_watch_init(void) +cpu_rmixl_watchpoint_init(void) { uint32_t r; @@ -195,7 +193,7 @@ mips_locoresw.lsw_cpu_init = cpu_rmixl_hatch; mips_locoresw.lsw_cpu_run = cpu_rmixl_run; } else { - struct cpucore_attach_args *ca = aux; + struct cpucore_attach_args * const ca = aux; struct cpucore_softc * const ccsc = device_private(parent); rmixlfw_psb_type_t psb_type = rmixl_configuration.rc_psb_type; cpuid_t cpuid; @@ -263,7 +261,7 @@ asm volatile("dmfc0 %0, $15, 1;" : "=r"(ebase)); ci->ci_cpuid = ebase & __BITS(9,0); - cpu_rmixl_db_watch_init(); + cpu_rmixl_watchpoint_init(); rmixl_fmn_init(); @@ -280,7 +278,6 @@ __func__); sc->sc_ih_fmn = ih; #endif - } #ifdef NOTYET @@ -336,7 +333,7 @@ cpucore_rmixl_hatch(device_parent(sc->sc_dev)); - cpu_rmixl_db_watch_init(); + cpu_rmixl_watchpoint_init(); } static int Index: src/sys/arch/mips/rmi/rmixl_cpucorevar.h diff -u src/sys/arch/mips/rmi/rmixl_cpucorevar.h:1.3 src/sys/arch/mips/rmi/rmixl_cpucorevar.h:1.4 --- src/sys/arch/mips/rmi/rmixl_cpucorevar.h:1.3 Thu Apr 14 05:15:22 2011 +++ src/sys/arch/mips/rmi/rmixl_cpucorevar.h Fri Apr 29 22:00:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_cpucorevar.h,v 1.3 2011/04/14 05:15:22 cliff Exp $ */ +/* $NetBSD: rmixl_cpucorevar.h,v 1.4 2011/04/29 22:00:03 matt Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. * All rights reserved. @@ -37,11 +37,11 @@ struct cpucore_softc { device_t sc_dev; - bool sc_attached; - bool sc_running; u_int sc_core; u_int sc_threads_enb; u_int sc_threads_dis; + bool sc_attached; + bool sc_running; bool sc_hatched; #ifdef MULTIPROCESSOR struct pmap_tlb_info *sc_tlbinfo; @@ -54,7 +54,9 @@ int ca_thread; }; -extern void cpucore_rmixl_hatch(device_t); -extern void cpucore_rmixl_run(device_t); +#ifdef _KERNEL +void cpucore_rmixl_hatch(device_t); +void cpucore_rmixl_run(device_t); +#endif #endif /* _ARCH_MIPS_RMI_RMIXL_CPUCOREVAR_H_ */ Index: src/sys/arch/mips/rmi/rmixl_cpucore.c diff -u src/sys/arch/mips/rmi/rmixl_cpucore.c:1.4 src/sys/arch/mips/rmi/rmixl_cpucore.c:1.5 --- src/sys/arch/mips/rmi/rmixl_cpucore.c:1.4 Thu Apr 14 06:12:21 2011 +++ src/sys/arch/mips/rmi/rmixl_cpucore.c Fri Apr 29 22:00:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_cpucore.c,v 1.4 2011/04/14 06:12:21 cliff Exp $ */ +/* $NetBSD: rmixl_cpucore.c,v 1.5 2011/04/29 22:00:03 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -38,9 +38,7 @@ #include "locators.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rmixl_cpucore.c,v 1.4 2011/04/14 06:12:21 cliff Exp $"); - -#include "opt_multiprocessor.h" +__KERNEL_RCSID(0, "$NetBSD: rmixl_cpucore.c,v 1.5 2011/04/29 22:00:03 matt Exp $"); #include "opt_multiprocessor.h" @@ -93,7 +91,7 @@ sc->sc_dev = self; sc->sc_core = na->na_core; - sc->sc_hatched = false; + KASSERT(sc->sc_hatched == false); #if 0 #ifdef MULTIPROCESSOR @@ -150,7 +148,7 @@ aprint_normal_dev(self, "threads"); u_int d = threads_dis; while (d != 0) { - u_int t = ffs(d) - 1; + const u_int t = ffs(d) - 1; d ^= (1 << t); aprint_normal(" %d%s", t, (d==0) ? "" : ","); } @@ -159,8 +157,9 @@ u_int threads_try_attach = threads_enb; while (threads_try_attach != 0) { - u_int t = ffs(threads_try_attach) - 1; - threads_try_attach ^= (1 << t); + const u_int t = ffs(threads_try_attach) - 1; + const u_int bit = 1 << t; + threads_try_attach ^= bit; ca.ca_name = "cpu"; ca.ca_thread = t; ca.ca_core = sc->sc_core; @@ -169,11 +168,11 @@ * thread did not attach, e.g. not configured * arrange to have it disabled in THREADEN PCR */ - u_int bit = 1 << t; threads_enb ^= bit; threads_dis |= bit; } } + sc->sc_threads_enb = threads_enb; sc->sc_threads_dis = threads_dis;