CVS commit: src/sys/arch/emips/include
Module Name:src Committed By: skrll Date: Fri May 28 05:42:07 UTC 2021 Modified Files: src/sys/arch/emips/include: types.h Log Message: G/C To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/include/types.h 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/emips/include/types.h diff -u src/sys/arch/emips/include/types.h:1.3 src/sys/arch/emips/include/types.h:1.4 --- src/sys/arch/emips/include/types.h:1.3 Thu Apr 1 04:35:45 2021 +++ src/sys/arch/emips/include/types.h Fri May 28 05:42:06 2021 @@ -1,11 +1,9 @@ -/* $NetBSD: types.h,v 1.3 2021/04/01 04:35:45 simonb Exp $ */ +/* $NetBSD: types.h,v 1.4 2021/05/28 05:42:06 skrll Exp $ */ #include #define __HAVE_DEVICE_REGISTER #define __HAVE_GENERIC_SOFT_INTERRUPTS -/* We'll use the FreeRunning counter everywhere */ -#define __HAVE_TIMECOUNTER /* MIPS specific options */ #define __HAVE_BOOTINFO_H
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: thorpej Date: Sat Nov 21 19:24:17 UTC 2020 Modified Files: src/sys/arch/emips/emips: bus_dma.c Log Message: malloc(9) -> kmem(9) To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/emips/bus_dma.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/emips/emips/bus_dma.c diff -u src/sys/arch/emips/emips/bus_dma.c:1.4 src/sys/arch/emips/emips/bus_dma.c:1.5 --- src/sys/arch/emips/emips/bus_dma.c:1.4 Thu Jun 11 08:22:08 2015 +++ src/sys/arch/emips/emips/bus_dma.c Sat Nov 21 19:24:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.4 2015/06/11 08:22:08 matt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.5 2020/11/21 19:24:17 thorpej Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.4 2015/06/11 08:22:08 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.5 2020/11/21 19:24:17 thorpej Exp $"); #include "opt_cputype.h" @@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v #include #include #include +#include #include @@ -87,6 +88,14 @@ emips_bus_dma_init(void) #endif } +static size_t +_bus_dmamap_mapsize(int const nsegments) +{ + KASSERT(nsegments > 0); + return sizeof(struct emips_bus_dmamap) + + (sizeof(bus_dma_segment_t) * (nsegments - 1)); +} + /* * Common function for DMA map creation. May be called by bus-specific * DMA map creation functions. @@ -97,7 +106,6 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_ { struct emips_bus_dmamap *map; void *mapstore; - size_t mapsize; /* * Allocate and initialize the DMA map. The end of the map @@ -111,13 +119,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_ * The bus_dmamap_t includes one bus_dma_segment_t, hence * the (nsegments - 1). */ - mapsize = sizeof(struct emips_bus_dmamap) + - (sizeof(bus_dma_segment_t) * (nsegments - 1)); - if ((mapstore = malloc(mapsize, M_DMAMAP, - (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) + if ((mapstore = kmem_zalloc(_bus_dmamap_mapsize(nsegments), + (flags & BUS_DMA_NOWAIT) ? KM_NOSLEEP : KM_SLEEP)) == NULL) return (ENOMEM); - memset(mapstore, 0, mapsize); map = (struct emips_bus_dmamap *)mapstore; map->_dm_size = size; map->_dm_segcnt = nsegments; @@ -141,7 +146,7 @@ void _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DMAMAP); + kmem_free(map, _bus_dmamap_mapsize(map->_dm_segcnt)); } /*
CVS commit: src/sys/arch/emips/include
Module Name:src Committed By: tsutsui Date: Fri Jun 12 11:21:36 UTC 2020 Modified Files: src/sys/arch/emips/include: disklabel.h Log Message: Remove unused OPENBSD_RAW_PART. (copied from arc?) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/include/disklabel.h 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/emips/include/disklabel.h diff -u src/sys/arch/emips/include/disklabel.h:1.5 src/sys/arch/emips/include/disklabel.h:1.6 --- src/sys/arch/emips/include/disklabel.h:1.5 Thu May 16 19:06:44 2013 +++ src/sys/arch/emips/include/disklabel.h Fri Jun 12 11:21:36 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.h,v 1.5 2013/05/16 19:06:44 christos Exp $ */ +/* $NetBSD: disklabel.h,v 1.6 2020/06/12 11:21:36 tsutsui Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -37,8 +37,7 @@ #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ #define MAXPARTITIONS 16 /* number of partitions */ -#define RAW_PART 2 /* raw partition: ie. XX?c (XXX) */ -#define OPENBSD_RAW_PART 2 /* raw partition: XX?c */ +#define RAW_PART 2 /* raw partition: ie. XX?c */ /* Pull in MBR partition definitions. */ #if HAVE_NBTOOL_CONFIG_H
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: martin Date: Tue Feb 4 13:53:07 UTC 2020 Modified Files: src/sys/arch/emips/ebus: if_le_ebus.c Log Message: Fix oversight To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/emips/ebus/if_le_ebus.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/emips/ebus/if_le_ebus.c diff -u src/sys/arch/emips/ebus/if_le_ebus.c:1.22 src/sys/arch/emips/ebus/if_le_ebus.c:1.23 --- src/sys/arch/emips/ebus/if_le_ebus.c:1.22 Tue Feb 4 07:35:45 2020 +++ src/sys/arch/emips/ebus/if_le_ebus.c Tue Feb 4 13:53:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ebus.c,v 1.22 2020/02/04 07:35:45 skrll Exp $ */ +/* $NetBSD: if_le_ebus.c,v 1.23 2020/02/04 13:53:07 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.22 2020/02/04 07:35:45 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.23 2020/02/04 13:53:07 martin Exp $"); #include "opt_inet.h" @@ -554,7 +554,7 @@ enic_watchdog(struct ifnet *ifp) printf("enic_watch ctl=%x\n", sc->sc_regs->Control); #endif log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev)); - ++ifp->if_oerrors; + if_statinc(ifp, if_oerrors); enic_reset(ifp); }
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: skrll Date: Tue Feb 4 07:35:45 UTC 2020 Modified Files: src/sys/arch/emips/ebus: if_le_ebus.c Log Message: Adopt To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/emips/ebus/if_le_ebus.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/emips/ebus/if_le_ebus.c diff -u src/sys/arch/emips/ebus/if_le_ebus.c:1.21 src/sys/arch/emips/ebus/if_le_ebus.c:1.22 --- src/sys/arch/emips/ebus/if_le_ebus.c:1.21 Thu Dec 5 05:28:09 2019 +++ src/sys/arch/emips/ebus/if_le_ebus.c Tue Feb 4 07:35:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ebus.c,v 1.21 2019/12/05 05:28:09 msaitoh Exp $ */ +/* $NetBSD: if_le_ebus.c,v 1.22 2020/02/04 07:35:45 skrll Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.21 2019/12/05 05:28:09 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.22 2020/02/04 07:35:45 skrll Exp $"); #include "opt_inet.h" @@ -693,7 +693,7 @@ enic_rint(struct enic_softc *sc, uint32_ /* uhu?? */ printf("%s: bad recv phys %llx\n", device_xname(sc->sc_dev), (long long)phys); - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); return; /* got it, pop it */ @@ -714,7 +714,7 @@ enic_rint(struct enic_softc *sc, uint32_ len > ((sc->sc_ethercom.ec_capenable & ETHERCAP_VLAN_MTU) ? ETHER_VLAN_ENCAP_LEN + ETHERMTU + sizeof(struct ether_header) : ETHERMTU + sizeof(struct ether_header))) { - ifp->if_ierrors++; + if_statinc(ifp, if_ierrors); /* reuse it */ enic_post_recv(sc, m); @@ -755,7 +755,7 @@ void enic_tint(struct enic_softc *sc, ui /* uhu?? */ printf("%s: bad xmit phys %llx\n", device_xname(sc->sc_dev), (long long)phys); - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); return; /* got it, pop it */ @@ -771,7 +771,7 @@ void enic_tint(struct enic_softc *sc, ui sc->bxh++; #endif m_freem(m); - ifp->if_opackets++; + if_statinc(ifp, if_opackets); if (--sc->sc_no_td == 0) ifp->if_timer = 0;
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Sun Jan 12 13:15:10 UTC 2020 Modified Files: src/sys/arch/emips/emips: locore_machdep.S machdep.c Log Message: KNF and misc whitespace cleanup. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/emips/locore_machdep.S cvs rdiff -u -r1.15 -r1.16 src/sys/arch/emips/emips/machdep.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/emips/emips/locore_machdep.S diff -u src/sys/arch/emips/emips/locore_machdep.S:1.1 src/sys/arch/emips/emips/locore_machdep.S:1.2 --- src/sys/arch/emips/emips/locore_machdep.S:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/emips/locore_machdep.S Sun Jan 12 13:15:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: locore_machdep.S,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: locore_machdep.S,v 1.2 2020/01/12 13:15:10 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -47,52 +47,72 @@ /* * Extension control register bits, definitions and semantics */ -/* The Opcode field holds the opcode assigned to the given Extension slot (Z). - * When this field is written to, the CAM used for decoding the Extension Instructions is updated - * (in CAM Decoding mode). The value can be one of the eight Extension Opcodes, or any other opcode - * iff the Extension has priority and is meant to mask an existing instruction. +/* + * The Opcode field holds the opcode assigned to the given Extension slot (Z). + * When this field is written to, the CAM used for decoding the Extension + * Instructions is updated (in CAM Decoding mode). The value can be one + * of the eight Extension Opcodes, or any other opcode iff the Extension + * has priority and is meant to mask an existing instruction. */ #define EXTCTL_OP 0xfc00 -/* The Kernel/User flag denotes that Extension Z is a Kernel[0] or User[1] mode Extension. +/* + * The Kernel/User flag denotes that Extension Z is a Kernel[0] or User[1] + * mode Extension. */ #define EXTCTL_KU 0x0200 -/* The Scope flag denotes that Extension Z is a Local[0] (per process) or Global[1] (shared) Extension. +/* + * The Scope flag denotes that Extension Z is a Local[0] (per process) or + * Global[1] (shared) Extension. */ #define EXTCTL_SC 0x0100 -/* The Peripheral flag denotes that Extension Z is a Peripheral Extension. +/* + * The Peripheral flag denotes that Extension Z is a Peripheral Extension. */ #define EXTCTL_PER 0x0008 -/* The Interrupt flag denotes that Extension Z has an interrupt. +/* + * The Interrupt flag denotes that Extension Z has an interrupt. */ #define EXTCTL_INT 0x0004 -/* The Virtual/Physical flag denotes that Extension Z uses Virtual[0] or Physical[0] addresses - * when accessing the memory bus. +/* + * The Virtual/Physical flag denotes that Extension Z uses Virtual[0] or + * Physical[0] addresses when accessing the memory bus. */ #define EXTCTL_VP 0x0002 -/* The State field denotes the state of Extension Z. (Loaded, Config, Running, Suspend, etc) +/* + * The State field denotes the state of Extension Z. (Loaded, Config, + * Running, Suspend, etc) */ #define EXTCTL_ST 0xf000 -/* The Priority field denotes the execution priority for Extension Z during arbitration. +/* + * The Priority field denotes the execution priority for Extension Z + * during arbitration. */ #define EXTCTL_PR 0x0f00 -/* The Privileged flag denotes that Extension Z has access to security sensitive system resources. +/* + * The Privileged flag denotes that Extension Z has access to security + * sensitive system resources. */ #define EXTCTL_PRV 0x0080 -/* The Trap flag denotes whether an RI exception will be generated for an Extension Z's instruction - * if Extension Z is disabled. +/* + * The Trap flag denotes whether an RI exception will be generated for + * an Extension Z's instruction if Extension Z is disabled. */ #define EXTCTL_TR 0x0010 -/* The Trapped flag denotes that a trap occurred during Extension Z's last execution and it was unable - * to complete. +/* + * The Trapped flag denotes that a trap occurred during Extension Z's + * last execution and it was unable to complete. */ #define EXTCTL_TD 0x0008 -/* The Clock Enable flag denotes that the clock for Extension Z is active. +/* + * The Clock Enable flag denotes that the clock for Extension Z is active. */ #define EXTCTL_CE 0x0004 -/* The Enable flag denotes that Extension Z is enabled for execution. +/* + * The Enable flag denotes that Extension Z is enabled for execution. */ #define EXTCTL_EN 0x0002 -/* The Loaded flag denotes that Extension Z has been loaded +/* + * The Loaded flag denotes that Extension Z has been loaded */ #define EXTCTL_LD 0x0001 @@ -103,61 +123,62 @@ * nb: clears the counter too */ LEAF(acc_
CVS commit: src/sys/arch/emips
Module Name:src Committed By: tsutsui Date: Sat Dec 14 02:58:20 UTC 2019 Modified Files: src/sys/arch/emips/ebus: ace_ebus.c flash_ebus.c src/sys/arch/emips/emips: bus_space.c src/sys/arch/emips/include: loadfile_machdep.h src/sys/arch/emips/stand/common: bootinfo.c bootinfo.h bootxx.c prom_iface.c Log Message: Remove clause 3 and 4 from TNF licenses. Ok'ed by martin@ in PR/54760. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/emips/ebus/ace_ebus.c \ src/sys/arch/emips/ebus/flash_ebus.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/bus_space.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/loadfile_machdep.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/bootinfo.c \ src/sys/arch/emips/stand/common/bootinfo.h \ src/sys/arch/emips/stand/common/bootxx.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/stand/common/prom_iface.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/emips/ebus/ace_ebus.c diff -u src/sys/arch/emips/ebus/ace_ebus.c:1.21 src/sys/arch/emips/ebus/ace_ebus.c:1.22 --- src/sys/arch/emips/ebus/ace_ebus.c:1.21 Mon Dec 2 19:40:19 2019 +++ src/sys/arch/emips/ebus/ace_ebus.c Sat Dec 14 02:58:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ace_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $ */ +/* $NetBSD: ace_ebus.c,v 1.22 2019/12/14 02:58:19 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.22 2019/12/14 02:58:19 tsutsui Exp $"); #include #include @@ -1501,13 +1501,6 @@ sysace_send_config(struct ace_softc *sc, * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - *This product includes software developed by the NetBSD - *Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - *contributors may be used to endorse or promote products derived - *from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Index: src/sys/arch/emips/ebus/flash_ebus.c diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.21 src/sys/arch/emips/ebus/flash_ebus.c:1.22 --- src/sys/arch/emips/ebus/flash_ebus.c:1.21 Mon Dec 2 19:40:19 2019 +++ src/sys/arch/emips/ebus/flash_ebus.c Sat Dec 14 02:58:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.22 2019/12/14 02:58:19 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.22 2019/12/14 02:58:19 tsutsui Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -1341,13 +1341,6 @@ static int eflash_write_at (struct eflas * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - *This product includes software developed by the NetBSD - *Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - *contributors may be used to endorse or promote products derived - *from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Index: src/sys/arch/emips/emips/bus_space.c diff -u src/sys/arch/emips/emips/bus_space.c:1.2 src/sys/arch/emips/emips/bus_space.c:1.3 --- src/sys/arch/emips/emips/bus_space.c:1.2 Sun Feb 12 16:34:07 2012 +++ src/sys/arch/emips/emips/bus_space.c Sat Dec 14 02:58:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.2 2012/02/12 16:34:07 matt Exp $ */ +/* $NetBSD: bus_space.c,v 1.3 2019/12/14 02:58:20 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reprodu
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Wed Dec 11 16:16:13 UTC 2019 Modified Files: src/sys/arch/emips/emips: interrupt.c Log Message: Fix a longstanding "freeze right after enabling interrupt" problem. With this fix, finally NetBSD/emips on Giano is fully functional. See PR/45080 for more details. Should be pulled up to netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/emips/emips/interrupt.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/emips/emips/interrupt.c diff -u src/sys/arch/emips/emips/interrupt.c:1.7 src/sys/arch/emips/emips/interrupt.c:1.8 --- src/sys/arch/emips/emips/interrupt.c:1.7 Mon Dec 9 16:19:11 2019 +++ src/sys/arch/emips/emips/interrupt.c Wed Dec 11 16:16:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: interrupt.c,v 1.7 2019/12/09 16:19:11 tsutsui Exp $ */ +/* $NetBSD: interrupt.c,v 1.8 2019/12/11 16:16:13 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.7 2019/12/09 16:19:11 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.8 2019/12/11 16:16:13 tsutsui Exp $"); #include #include @@ -102,6 +102,19 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s curcpu()->ci_data.cpu_nintr++; +#if 0 + /* + * According to Giano simulator sources (Cpus/mips_cpu.cpp), + * interrupt register bits in CAUSE register are updated + * only when the exception is triggered. This means checking + * CAUSE register via splintr() in a while loop in this + * interrupt handler doesn't work as expected on Giano. + * + * I don't know whether the real FPGA eMIPS has the same + * design as the Giano simulator, but for now I'd like to + * choose 'call only one handler per each interrupt' strategy, + * as the original NetBSD/emips implementation. + */ while (ppl < (ipl = splintr(&ipending))) { splx(ipl); /* device interrupts */ @@ -110,6 +123,14 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s } (void)splhigh(); } +#else + ipl = splintr(&ipending); + __USE(ipl); + /* device interrupts */ + if (ipending & MIPS_INT_MASK_5) { + (*platform.iointr)(status, pc, ipending); + } +#endif } /*
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Mon Dec 9 16:19:11 UTC 2019 Modified Files: src/sys/arch/emips/emips: interrupt.c Log Message: Fix incorrect argument order of cpu_intr(), slipped in rev 1.2. Pointed out by maya@ in PR/45080. Should be pulled up to netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/emips/interrupt.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/emips/emips/interrupt.c diff -u src/sys/arch/emips/emips/interrupt.c:1.6 src/sys/arch/emips/emips/interrupt.c:1.7 --- src/sys/arch/emips/emips/interrupt.c:1.6 Mon Jul 11 16:18:56 2016 +++ src/sys/arch/emips/emips/interrupt.c Mon Dec 9 16:19:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: interrupt.c,v 1.6 2016/07/11 16:18:56 matt Exp $ */ +/* $NetBSD: interrupt.c,v 1.7 2019/12/09 16:19:11 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.6 2016/07/11 16:18:56 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.7 2019/12/09 16:19:11 tsutsui Exp $"); #include #include @@ -95,7 +95,7 @@ intr_init(void) * emips uses one line for all I/O interrupts (0x8000). */ void -cpu_intr(int ppl, uint32_t status, vaddr_t pc) +cpu_intr(int ppl, vaddr_t pc, uint32_t status) { uint32_t ipending; int ipl;
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: msaitoh Date: Thu Dec 5 05:28:09 UTC 2019 Modified Files: src/sys/arch/emips/ebus: if_le_ebus.c Log Message: Remove SIOC[SIFMEDIA because ifmedia_ioctl() does the same thing. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/emips/ebus/if_le_ebus.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/emips/ebus/if_le_ebus.c diff -u src/sys/arch/emips/ebus/if_le_ebus.c:1.20 src/sys/arch/emips/ebus/if_le_ebus.c:1.21 --- src/sys/arch/emips/ebus/if_le_ebus.c:1.20 Wed May 29 10:07:28 2019 +++ src/sys/arch/emips/ebus/if_le_ebus.c Thu Dec 5 05:28:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ebus.c,v 1.20 2019/05/29 10:07:28 msaitoh Exp $ */ +/* $NetBSD: if_le_ebus.c,v 1.21 2019/12/05 05:28:09 msaitoh Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.20 2019/05/29 10:07:28 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.21 2019/12/05 05:28:09 msaitoh Exp $"); #include "opt_inet.h" @@ -591,42 +591,11 @@ enic_mediastatus(struct ifnet *ifp, stru int enic_ioctl(struct ifnet *ifp, u_long cmd, void *data) { - struct enic_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; s = splnet(); switch (cmd) { - case SIOCSIFMEDIA: -#if 0 /*DEBUG*/ - { - extern int ei_drops[]; - static int flip = 0; - if (flip++ == 2) { - int i; - flip = 0; - printf("enic_ioctl(%x) %qd/%qd %qd/%qd %d/%d %d:%d " - "%d+%d %d/%d/%d\n", ifp->if_flags, - ifp->if_ierrors, ifp->if_oerrors, - ifp->if_ipackets, ifp->if_opackets, - sc->sc_no_rd, sc->sc_no_td, - sc->xhit, sc->xmiss, - sc->tfull, sc->tfull2, - sc->brh, sc->rf, sc->bxh); - printf(" Ctl %x lt %x tim %d\n", - sc->sc_regs->Control, sc->it, ifp->if_timer); - - for (i = 0; i < 64; i++) -if (ei_drops[i]) - printf(" %d.%d", i, ei_drops[i]); - printf("\n"); - } - } -#endif - error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); - break; - default: error = ether_ioctl(ifp, cmd, data); if (cmd == SIOCSIFADDR) {
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: bouyer Date: Mon Dec 2 19:40:19 UTC 2019 Modified Files: src/sys/arch/emips/ebus: ace_ebus.c flash_ebus.c Log Message: Drop advertisement clause from my licenses To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/emips/ebus/ace_ebus.c \ src/sys/arch/emips/ebus/flash_ebus.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/emips/ebus/ace_ebus.c diff -u src/sys/arch/emips/ebus/ace_ebus.c:1.20 src/sys/arch/emips/ebus/ace_ebus.c:1.21 --- src/sys/arch/emips/ebus/ace_ebus.c:1.20 Sun Nov 20 03:30:11 2016 +++ src/sys/arch/emips/ebus/ace_ebus.c Mon Dec 2 19:40:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ace_ebus.c,v 1.20 2016/11/20 03:30:11 pgoyette Exp $ */ +/* $NetBSD: ace_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.20 2016/11/20 03:30:11 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $"); #include #include @@ -1473,11 +1473,6 @@ sysace_send_config(struct ace_softc *sc, * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Manuel Bouyer. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Index: src/sys/arch/emips/ebus/flash_ebus.c diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.20 src/sys/arch/emips/ebus/flash_ebus.c:1.21 --- src/sys/arch/emips/ebus/flash_ebus.c:1.20 Sun Mar 4 21:41:48 2018 +++ src/sys/arch/emips/ebus/flash_ebus.c Mon Dec 2 19:40:19 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.20 2018/03/04 21:41:48 mrg Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.20 2018/03/04 21:41:48 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.21 2019/12/02 19:40:19 bouyer Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -1313,11 +1313,6 @@ static int eflash_write_at (struct eflas * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Manuel Bouyer. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
CVS commit: src/sys/arch/emips/conf
Module Name:src Committed By: christos Date: Sun Mar 31 16:10:27 UTC 2019 Modified Files: src/sys/arch/emips/conf: RAMDISK Log Message: bump To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/conf/RAMDISK 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/emips/conf/RAMDISK diff -u src/sys/arch/emips/conf/RAMDISK:1.3 src/sys/arch/emips/conf/RAMDISK:1.4 --- src/sys/arch/emips/conf/RAMDISK:1.3 Thu Aug 20 21:52:07 2015 +++ src/sys/arch/emips/conf/RAMDISK Sun Mar 31 12:10:27 2019 @@ -1,4 +1,4 @@ -# $NetBSD: RAMDISK,v 1.3 2015/08/21 01:52:07 uebayasi Exp $ +# $NetBSD: RAMDISK,v 1.4 2019/03/31 16:10:27 christos Exp $ # # Install kernel with ramdisk added. # The ramdisk is be too big to netboot directly via ECOFF on some machines, @@ -15,7 +15,7 @@ pseudo-device ksyms options MEMORY_DISK_HOOKS options MEMORY_DISK_IS_ROOT # force root on memory disk options MEMORY_DISK_SERVER=0 # no userspace memory disk support -options MEMORY_DISK_ROOT_SIZE=7000 # size of memory disk, in blocks (3500kB) +options MEMORY_DISK_ROOT_SIZE=7600 # size of memory disk, in blocks (3800kB) #options MEMORY_DISK_ROOT_SIZE=2880 # 1.44M, same as a floppy # File systems: need MFS
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Wed Mar 7 14:59:14 UTC 2018 Modified Files: src/sys/arch/emips/stand/common: ace.c Log Message: cleanup debugging code so that it compiles again. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/ace.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/emips/stand/common/ace.c diff -u src/sys/arch/emips/stand/common/ace.c:1.3 src/sys/arch/emips/stand/common/ace.c:1.4 --- src/sys/arch/emips/stand/common/ace.c:1.3 Wed Feb 5 14:07:16 2014 +++ src/sys/arch/emips/stand/common/ace.c Wed Mar 7 09:59:14 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ace.c,v 1.3 2014/02/05 19:07:16 christos Exp $ */ +/* $NetBSD: ace.c,v 1.4 2018/03/07 14:59:14 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -88,7 +88,12 @@ */ #if defined(DEBUG) int acedebug = 2; -#define DBGME(lev,x) if (lev >= acedebug) x +#define DBGME(lev,x) \ + do \ + if (lev >= acedebug) { \ + x; \ + } \ + while (/*CONSTCOND*/0) #else #define DBGME(lev,x) #endif @@ -537,9 +542,9 @@ static int SysAce_read(struct _Sac * Int Data32 = Interface->DATABUFREG[0]; Data32 = le32toh(Data32); -DBGME(0,printf(" %x", Data32)); -if (0 == (0xf & (i+4) )) DBGME(0,printf("\n")); -memcpy(Buffer+i,&Data32,4); + DBGME(0,printf(" %x", Data32)); + if (0 == (0xf & (i+4))) DBGME(0,printf("\n")); +memcpy(Buffer+i, &Data32, 4); } else {
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Tue Mar 6 22:13:14 UTC 2018 Modified Files: src/sys/arch/emips/stand/common: devopen.c Log Message: fix build, KNF, simplify. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/devopen.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/emips/stand/common/devopen.c diff -u src/sys/arch/emips/stand/common/devopen.c:1.1 src/sys/arch/emips/stand/common/devopen.c:1.2 --- src/sys/arch/emips/stand/common/devopen.c:1.1 Tue Jan 25 20:18:54 2011 +++ src/sys/arch/emips/stand/common/devopen.c Tue Mar 6 17:13:14 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: devopen.c,v 1.2 2018/03/06 22:13:14 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -59,54 +59,53 @@ devopen(struct open_file *f, cp = fname; ncp = device_name; -/* Require the form CTRL/DEVNAME(UNIT,PART)/FILENAME e.g. '0/ace(0,0)/netbsd' '0/tftp(0,0)/netbsd' - */ - -/* get controller number */ -if ((c = *cp) >= '0' && c <= '9') { -ctlr = c - '0'; -c = *++cp; -} else -return (ENXIO); - -if (c != '/') -return (ENXIO); -c = *++cp; - -/* get device name */ -while ((c = *cp) != '\0') { -if ((c == '(') || (c == '/')) { -cp++; -break; -} -if (ncp < device_name + sizeof(device_name) - 1) -*ncp++ = c; -cp++; -} -if (ncp == device_name) -return (ENXIO); - -/* get device number */ -if ((c = *cp) >= '0' && c <= '9') { -unit = c - '0'; -c = *++cp; -} else -return (ENXIO); - -if (c == ',') { -/* get partition number */ -if ((c = *++cp) >= '0' && c <= '9') { -part = c - '0'; -c = *++cp; -} else -return (ENXIO); -} else -return (ENXIO); - -if (c == ')') -cp++; -else -return (ENXIO); + /* + * Require the form CTRL/DEVNAME(UNIT,PART)/FILENAME + * e.g. '0/ace(0,0)/netbsd' '0/tftp(0,0)/netbsd' + */ + + /* get controller number */ + c = *cp++; + if (c < '0' || c > '9') + return ENXIO; + ctlr = c - '0'; + + c = *cp++; + if (c != '/') + return ENXIO; + + /* get device name */ + while ((c = *cp) != '\0') { + if ((c == '(') || (c == '/')) { + cp++; + break; + } + if (ncp < device_name + sizeof(device_name) - 1) + *ncp++ = c; + cp++; + } + if (ncp == device_name) + return ENXIO; + + /* get device number */ + c = *cp++; + if (c < '0' || c > '9') + return ENXIO; + unit = c - '0'; + + c = *cp++; + if (c != ',') + return (ENXIO); + + /* get partition number */ + c = *cp++; + if (c < '0' || c > '9') + return ENXIO; + part = c - '0'; + + c = *cp++; + if (c != ')') + return ENXIO; *ncp = '\0'; @@ -121,7 +120,7 @@ devopen(struct open_file *f, if (dp->dv_name) printf(" %s", dp->dv_name); printf("\n"); - return (ENXIO); + return ENXIO; fnd: #ifdef BOOTNET @@ -132,12 +131,12 @@ fnd: rc = (dp->dv_open)(f, ctlr, unit, part, cp); #endif /* !LIBSA_SINGLE_DEVICE */ if (rc) - return (rc); + return rc; #ifndef LIBSA_SINGLE_DEVICE f->f_dev = dp; #endif if (file && *cp != '\0') *file = (char *)cp; /* XXX */ - return (0); + return 0; }
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: he Date: Sun Jul 30 11:38:57 UTC 2017 Modified Files: src/sys/arch/emips/emips: machdep.c Log Message: Initialize iospace_size instead of iospace (will be overwritten) to 64k. Brings boot of emips on giano a bit closer, but now it's stuck (hangs). To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/emips/emips/machdep.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/emips/emips/machdep.c diff -u src/sys/arch/emips/emips/machdep.c:1.12 src/sys/arch/emips/emips/machdep.c:1.13 --- src/sys/arch/emips/emips/machdep.c:1.12 Thu Dec 22 14:47:54 2016 +++ src/sys/arch/emips/emips/machdep.c Sun Jul 30 11:38:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.12 2016/12/22 14:47:54 cherry Exp $ */ +/* $NetBSD: machdep.c,v 1.13 2017/07/30 11:38:57 he Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2016/12/22 14:47:54 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2017/07/30 11:38:57 he Exp $"); #include "opt_ddb.h" @@ -82,8 +82,8 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include #endif -vaddr_t iospace = 64 * 1024; /* BUGBUG make it an option? */ -vsize_t iospace_size; +vaddr_t iospace; +vsize_t iospace_size = 64 * 1024; /* BUGBUG make it an option? */ #include "ksyms.h"
CVS commit: src/sys/arch/emips/conf
Module Name:src Committed By: nat Date: Fri Dec 9 22:50:10 UTC 2016 Modified Files: src/sys/arch/emips/conf: GENERIC Log Message: No audio speaker on emips. Fixes build. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/emips/conf/GENERIC 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/emips/conf/GENERIC diff -u src/sys/arch/emips/conf/GENERIC:1.16 src/sys/arch/emips/conf/GENERIC:1.17 --- src/sys/arch/emips/conf/GENERIC:1.16 Thu Dec 8 11:31:10 2016 +++ src/sys/arch/emips/conf/GENERIC Fri Dec 9 22:50:10 2016 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.16 2016/12/08 11:31:10 nat Exp $ +# $NetBSD: GENERIC,v 1.17 2016/12/09 22:50:10 nat Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/emips/conf/std.emips" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.16 $" +#ident "GENERIC-$Revision: 1.17 $" maxusers 64 @@ -181,9 +181,6 @@ epio* at ebus0 addr ?# GPIO interf gpio* at epio? lcd*at ebus0 addr ?# lcd display -options VAUDIOSPEAKER -spkr0 at audio0 # PC speaker (synthesized) - # # Pseudo-devices # #
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: pgoyette Date: Sun Nov 20 03:30:12 UTC 2016 Modified Files: src/sys/arch/emips/ebus: ace_ebus.c Log Message: One more move of bufq_free() to outside of critical section. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/emips/ebus/ace_ebus.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/emips/ebus/ace_ebus.c diff -u src/sys/arch/emips/ebus/ace_ebus.c:1.19 src/sys/arch/emips/ebus/ace_ebus.c:1.20 --- src/sys/arch/emips/ebus/ace_ebus.c:1.19 Sun Apr 26 15:15:19 2015 +++ src/sys/arch/emips/ebus/ace_ebus.c Sun Nov 20 03:30:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ace_ebus.c,v 1.19 2015/04/26 15:15:19 mlelstv Exp $ */ +/* $NetBSD: ace_ebus.c,v 1.20 2016/11/20 03:30:11 pgoyette Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.19 2015/04/26 15:15:19 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.20 2016/11/20 03:30:11 pgoyette Exp $"); #include #include @@ -1704,12 +1704,12 @@ acedetach(device_t self, int flags) /* Kill off any queued buffers. */ bufq_drain(sc->sc_q); - bufq_free(sc->sc_q); #if 0 sc->atabus->ata_killpending(sc->drvp); #endif splx(s); + bufq_free(sc->sc_q); /* Detach disk. */ disk_detach(&sc->sc_dk);
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: pgoyette Date: Sun Nov 20 02:34:27 UTC 2016 Modified Files: src/sys/arch/emips/ebus: flash_ebus.c Log Message: Avoid calling bufq_free() from critical section. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/emips/ebus/flash_ebus.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/emips/ebus/flash_ebus.c diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.18 src/sys/arch/emips/ebus/flash_ebus.c:1.19 --- src/sys/arch/emips/ebus/flash_ebus.c:1.18 Sun Dec 13 19:36:40 2015 +++ src/sys/arch/emips/ebus/flash_ebus.c Sun Nov 20 02:34:27 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.19 2016/11/20 02:34:27 pgoyette Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.19 2016/11/20 02:34:27 pgoyette Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -1524,10 +1524,10 @@ eflashdetach(device_t self, int flags) /* Kill off any queued buffers. */ bufq_drain(sc->sc_q); - bufq_free(sc->sc_q); /*sc->atabus->ata_killpending(sc->drvp);*/ splx(s); + bufq_free(sc->sc_q); /* Detach disk. */ disk_detach(&sc->sc_dk);
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: maya Date: Mon Oct 3 17:35:38 UTC 2016 Modified Files: src/sys/arch/emips/ebus: if_le_ebus.c Log Message: correct misleading indentation in if 0'd code. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/emips/ebus/if_le_ebus.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/emips/ebus/if_le_ebus.c diff -u src/sys/arch/emips/ebus/if_le_ebus.c:1.10 src/sys/arch/emips/ebus/if_le_ebus.c:1.11 --- src/sys/arch/emips/ebus/if_le_ebus.c:1.10 Sun Oct 2 14:25:26 2016 +++ src/sys/arch/emips/ebus/if_le_ebus.c Mon Oct 3 17:35:38 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ebus.c,v 1.10 2016/10/02 14:25:26 christos Exp $ */ +/* $NetBSD: if_le_ebus.c,v 1.11 2016/10/03 17:35:38 maya Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.10 2016/10/02 14:25:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.11 2016/10/03 17:35:38 maya Exp $"); #include "opt_inet.h" @@ -938,8 +938,8 @@ int enic_put(struct enic_softc *sc, stru len = m->m_len; if (len == 0) { n = m_free(m); - if (m == *pm) - *pm = n; + if (m == *pm) +*pm = n; continue; } tlen -= len;
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: dholland Date: Sat Mar 12 02:13:35 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: prom_iface.c Log Message: Refine previous so the output is all hex again. followup to PR 50942 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/stand/common/prom_iface.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/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.5 src/sys/arch/emips/stand/common/prom_iface.c:1.6 --- src/sys/arch/emips/stand/common/prom_iface.c:1.5 Fri Mar 11 18:27:37 2016 +++ src/sys/arch/emips/stand/common/prom_iface.c Sat Mar 12 02:13:35 2016 @@ -287,7 +287,7 @@ int init_memory(void) base += Ours->Control & RAMST_SIZE; if (addr != base) { -printf("remapping %x+%zu to %x\n", addr, size, base); +printf("remapping %x+%zx to %x\n", addr, size, base); Ram->BaseAddressAndTag = base; } base += size;
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Fri Mar 11 18:27:37 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: prom_iface.c Log Message: PR/50942: David Binderman: fix printf format To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/stand/common/prom_iface.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/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.4 src/sys/arch/emips/stand/common/prom_iface.c:1.5 --- src/sys/arch/emips/stand/common/prom_iface.c:1.4 Mon Feb 24 17:34:08 2014 +++ src/sys/arch/emips/stand/common/prom_iface.c Fri Mar 11 13:27:37 2016 @@ -287,7 +287,7 @@ int init_memory(void) base += Ours->Control & RAMST_SIZE; if (addr != base) { -printf("remapping %x+%x to %x\n", addr, size, base); +printf("remapping %x+%zu to %x\n", addr, size, base); Ram->BaseAddressAndTag = base; } base += size;
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: dholland Date: Sun Feb 14 18:05:31 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Fix wrong indent. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/stand/common/printf.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/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.6 src/sys/arch/emips/stand/common/printf.c:1.7 --- src/sys/arch/emips/stand/common/printf.c:1.6 Sun Feb 14 18:04:47 2016 +++ src/sys/arch/emips/stand/common/printf.c Sun Feb 14 18:05:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.6 2016/02/14 18:04:47 dholland Exp $ */ +/* $NetBSD: printf.c,v 1.7 2016/02/14 18:05:31 dholland Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -73,9 +73,9 @@ printf(const char *fmt,...) *s++ = hex[u & 0xfu]; while (u >>= 4); goto dumpbuf; -case 0: - va_end(ap); -return; + case 0: +va_end(ap); +return; } } xputchar(c);
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: dholland Date: Sun Feb 14 18:04:47 UTC 2016 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Add missing va_end(). PR 50794 from David Binderman. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/stand/common/printf.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/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.5 src/sys/arch/emips/stand/common/printf.c:1.6 --- src/sys/arch/emips/stand/common/printf.c:1.5 Mon Feb 24 07:41:15 2014 +++ src/sys/arch/emips/stand/common/printf.c Sun Feb 14 18:04:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.5 2014/02/24 07:41:15 martin Exp $ */ +/* $NetBSD: printf.c,v 1.6 2016/02/14 18:04:47 dholland Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -74,6 +74,7 @@ printf(const char *fmt,...) while (u >>= 4); goto dumpbuf; case 0: + va_end(ap); return; } }
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: christos Date: Sun Dec 13 19:36:40 UTC 2015 Modified Files: src/sys/arch/emips/ebus: flash_ebus.c Log Message: PR/50525: David Binderman: Fix incorrect test. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/emips/ebus/flash_ebus.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/emips/ebus/flash_ebus.c diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.17 src/sys/arch/emips/ebus/flash_ebus.c:1.18 --- src/sys/arch/emips/ebus/flash_ebus.c:1.17 Sun Apr 26 11:15:19 2015 +++ src/sys/arch/emips/ebus/flash_ebus.c Sun Dec 13 14:36:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.17 2015/04/26 15:15:19 mlelstv Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.17 2015/04/26 15:15:19 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -603,7 +603,7 @@ static int IsIrresponsive(struct eflash if (Status & ST_READY) return FALSE; -if ((Status & ST_ERASE_MASK) == +if ((Status & ST_MASK) == (ST_LOCK_BIT_ERROR|ST_ERASE_SUSPENDED|ST_ERASE_ERROR)) { /* yes, looks that way */ return TRUE;
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Sun Dec 13 18:24:50 UTC 2015 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: PR/50537: David Binderman: fix bad sizeof To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/boot.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/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.3 src/sys/arch/emips/stand/common/boot.c:1.4 --- src/sys/arch/emips/stand/common/boot.c:1.3 Wed Mar 26 12:10:20 2014 +++ src/sys/arch/emips/stand/common/boot.c Sun Dec 13 13:24:50 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.3 2014/03/26 16:10:20 christos Exp $ */ +/* $NetBSD: boot.c,v 1.4 2015/12/13 18:24:50 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -64,10 +64,10 @@ static int devcanon(char *); #define OPT_MAX PATH_MAX /* way overkill */ -static int loadit(char *name, u_long marks[MARK_MAX]) +static int loadit(char *name, u_long *marks) { printf("Loading: %s\n", name); - memset(marks, 0, sizeof marks); + memset(marks, 0, sizeof(*marks) * MARK_MAX); return (loadfile(name, marks, LOAD_ALL)); }
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: matt Date: Tue Jun 9 22:48:54 UTC 2015 Modified Files: src/sys/arch/emips/emips: cpu.c Log Message: #include To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/cpu.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/emips/emips/cpu.c diff -u src/sys/arch/emips/emips/cpu.c:1.2 src/sys/arch/emips/emips/cpu.c:1.3 --- src/sys/arch/emips/emips/cpu.c:1.2 Tue Feb 22 08:20:20 2011 +++ src/sys/arch/emips/emips/cpu.c Tue Jun 9 22:48:54 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.2 2011/02/22 08:20:20 matt Exp $ */ +/* $NetBSD: cpu.c,v 1.3 2015/06/09 22:48:54 matt Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -28,11 +28,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.2 2011/02/22 08:20:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.3 2015/06/09 22:48:54 matt Exp $"); #include "ioconf.h" #include +#include #include #include
CVS commit: src/sys/arch/emips/conf
Module Name:src Committed By: uebayasi Date: Tue Oct 14 17:09:12 UTC 2014 Modified Files: src/sys/arch/emips/conf: INSTALL Log Message: Don't define wscons options without wscons devices. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/conf/INSTALL 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/emips/conf/INSTALL diff -u src/sys/arch/emips/conf/INSTALL:1.5 src/sys/arch/emips/conf/INSTALL:1.6 --- src/sys/arch/emips/conf/INSTALL:1.5 Sat Oct 11 07:18:43 2014 +++ src/sys/arch/emips/conf/INSTALL Tue Oct 14 17:09:12 2014 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.5 2014/10/11 07:18:43 uebayasi Exp $ +# $NetBSD: INSTALL,v 1.6 2014/10/14 17:09:12 uebayasi Exp $ # # Distribution install kernel (any model) #netbsd: cut-down kernel for miniroots. @@ -43,14 +43,14 @@ options FFS_NO_SNAPSHOT # No FFS snaps options INET # Internet protocols # Workstation console options -options FONT_BOLD8x16 # Font for fb devices -options FONT_GALLANT12x22 +#options FONT_BOLD8x16 # Font for fb devices +#options FONT_GALLANT12x22 -options WSEMUL_VT100 +#options WSEMUL_VT100 #options WSDISPLAY_DEFAULTSCREENS=1 #options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options WS_KERNEL_FG=WSCOL_GREEN -options WS_KERNEL_BG=WSCOL_BLACK +#options WS_KERNEL_FG=WSCOL_GREEN +#options WS_KERNEL_BG=WSCOL_BLACK # Disable kernel security levels. Needed for X with a PX or PXG. #options INSECURE
CVS commit: src/sys/arch/emips/conf
Module Name:src Committed By: uebayasi Date: Sat Oct 11 07:18:43 UTC 2014 Modified Files: src/sys/arch/emips/conf: INSTALL Log Message: Don't define WSDISPLAY_* without wsdisplay. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/conf/INSTALL 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/emips/conf/INSTALL diff -u src/sys/arch/emips/conf/INSTALL:1.4 src/sys/arch/emips/conf/INSTALL:1.5 --- src/sys/arch/emips/conf/INSTALL:1.4 Sat Apr 27 18:19:31 2013 +++ src/sys/arch/emips/conf/INSTALL Sat Oct 11 07:18:43 2014 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.4 2013/04/27 18:19:31 christos Exp $ +# $NetBSD: INSTALL,v 1.5 2014/10/11 07:18:43 uebayasi Exp $ # # Distribution install kernel (any model) #netbsd: cut-down kernel for miniroots. @@ -47,7 +47,7 @@ options FONT_BOLD8x16 # Font for fb de options FONT_GALLANT12x22 options WSEMUL_VT100 -options WSDISPLAY_DEFAULTSCREENS=1 +#options WSDISPLAY_DEFAULTSCREENS=1 #options WSDISPLAY_COMPAT_USL # wsconscfg VT handling options WS_KERNEL_FG=WSCOL_GREEN options WS_KERNEL_BG=WSCOL_BLACK
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Wed Mar 26 16:10:20 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: fix sprintf To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/boot.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/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.2 src/sys/arch/emips/stand/common/boot.c:1.3 --- src/sys/arch/emips/stand/common/boot.c:1.2 Mon Feb 24 02:46:33 2014 +++ src/sys/arch/emips/stand/common/boot.c Wed Mar 26 12:10:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.2 2014/02/24 07:46:33 martin Exp $ */ +/* $NetBSD: boot.c,v 1.3 2014/03/26 16:10:20 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -320,7 +320,7 @@ devcanon(char *fname) /* Copy kernel name before we overwrite, then do it */ strcpy(file_name, (*cp) ? cp : kernelnames[0]); - sprintf(fname,"%c/%s(%c,%c)/%s", + snprintf(fname, PATH_MAX, "%c/%s(%c,%c)/%s", ctlr + '0', device_name, unit + '0', part + '0', file_name); //printf("devcanon -> %s\n",fname);
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Mon Feb 24 22:34:08 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: enic.c prom_iface.c Log Message: make more things static, remove dup decls To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/enic.c \ src/sys/arch/emips/stand/common/prom_iface.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/emips/stand/common/enic.c diff -u src/sys/arch/emips/stand/common/enic.c:1.3 src/sys/arch/emips/stand/common/enic.c:1.4 --- src/sys/arch/emips/stand/common/enic.c:1.3 Mon Feb 24 17:31:56 2014 +++ src/sys/arch/emips/stand/common/enic.c Mon Feb 24 17:34:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: enic.c,v 1.3 2014/02/24 22:31:56 christos Exp $ */ +/* $NetBSD: enic.c,v 1.4 2014/02/24 22:34:08 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -66,7 +66,6 @@ #include #include -#include "start.h" #include @@ -82,8 +81,6 @@ static void enicinit (struct iodesc *, v static int enicget (struct iodesc *, void *, size_t, saseconds_t); static int enicput (struct iodesc *, void *, size_t); static void enicend (struct netif *); -int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo); -int enic_present(int unit); #ifdef NET_DEBUG static void dump_packet(void *, int); Index: src/sys/arch/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.3 src/sys/arch/emips/stand/common/prom_iface.c:1.4 --- src/sys/arch/emips/stand/common/prom_iface.c:1.3 Mon Feb 24 17:31:56 2014 +++ src/sys/arch/emips/stand/common/prom_iface.c Mon Feb 24 17:34:08 2014 @@ -58,9 +58,6 @@ void epmc_halt(void); void save_locore(void); void restore_locore(void); -void *nope(void); -void real_halt(void*); -void halt(int *unused, int howto); static void *nope(void) {return NULL;} int getchar(void){return GetChar();}
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Mon Feb 24 22:31:56 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: clock.c common.h enic.c prom_iface.c putchar.c Log Message: make this compile To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/clock.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/common.h \ src/sys/arch/emips/stand/common/enic.c \ src/sys/arch/emips/stand/common/prom_iface.c \ src/sys/arch/emips/stand/common/putchar.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/emips/stand/common/clock.c diff -u src/sys/arch/emips/stand/common/clock.c:1.1 src/sys/arch/emips/stand/common/clock.c:1.2 --- src/sys/arch/emips/stand/common/clock.c:1.1 Tue Jan 25 20:18:54 2011 +++ src/sys/arch/emips/stand/common/clock.c Mon Feb 24 17:31:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: clock.c,v 1.2 2014/02/24 22:31:56 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -33,11 +33,12 @@ #include #include +#include #include -long -getsecs() +satime_t +getsecs(void) { struct _Tc *Tc = (struct _Tc *)TIMER_DEFAULT_ADDRESS; uint64_t now; Index: src/sys/arch/emips/stand/common/common.h diff -u src/sys/arch/emips/stand/common/common.h:1.2 src/sys/arch/emips/stand/common/common.h:1.3 --- src/sys/arch/emips/stand/common/common.h:1.2 Thu Feb 6 13:43:41 2014 +++ src/sys/arch/emips/stand/common/common.h Mon Feb 24 17:31:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: common.h,v 1.2 2014/02/06 18:43:41 christos Exp $ */ +/* $NetBSD: common.h,v 1.3 2014/02/24 22:31:56 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -43,9 +43,6 @@ extern int debug; /* only used for netwo /* startprog.S */ extern void startprog (int, int, int, char **, int, const void *, int, int); -/* clock.c */ -extern long getsecs (void); - /* init_board.c */ #define BOARD_HAS_DISK0 0x01 #define BOARD_HAS_DISK1 0x02 @@ -69,5 +66,8 @@ extern int enic_present(int); /* print.c */ extern void xputchar(int); +/* putchar.c */ +extern void putchar(int); + /* vers.c (generated by newvers.sh) */ extern const char bootprog_rev[]; Index: src/sys/arch/emips/stand/common/enic.c diff -u src/sys/arch/emips/stand/common/enic.c:1.2 src/sys/arch/emips/stand/common/enic.c:1.3 --- src/sys/arch/emips/stand/common/enic.c:1.2 Mon Feb 24 03:00:52 2014 +++ src/sys/arch/emips/stand/common/enic.c Mon Feb 24 17:31:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: enic.c,v 1.2 2014/02/24 08:00:52 martin Exp $ */ +/* $NetBSD: enic.c,v 1.3 2014/02/24 22:31:56 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -69,6 +69,10 @@ #include "start.h" #include + +#include "start.h" +#include "common.h" + #define the_enic ((struct _Enic *)ETHERNET_DEFAULT_ADDRESS) /* forward declarations */ @@ -100,7 +104,8 @@ static void dump_packet(void *, int); /* Send a packet */ -static int enic_putpkt(struct _Enic *regs, void *buf, int bytes) +static int +enic_putpkt(struct _Enic *regs, void *buf, int bytes) { paddr_t phys = kvtophys(buf); @@ -113,7 +118,8 @@ static int enic_putpkt(struct _Enic *reg /* Get a packet */ -int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo) +static int +enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo) { paddr_t phys; unsigned int isr, saf, hi, lo, fl; @@ -143,8 +149,9 @@ int enic_getpkt(struct _Enic *regs, void /* beware, order matters */ saf = regs->SizeAndFlags; -hi = regs->BufferAddressHi32; /* BUGBUG 64bit */ -lo = regs->BufferAddressLo32; /* this pops the fifo */ +hi = regs->BufferAddressHi32; /* BUGBUG 64bit */ +lo = regs->BufferAddressLo32; /* this pops the fifo */ + __USE(hi); fl = saf & (ES_F_MASK &~ ES_F_DONE); @@ -182,7 +189,7 @@ static int enic_getmac(struct _Enic *reg regs->Control = EC_RESET; Delay(1); - regs->Control = regs->Control & (~EC_RXDIS); +regs->Control = regs->Control & (~EC_RXDIS); buffer[0] = ENIC_CMD_GET_ADDRESS; @@ -208,10 +215,11 @@ static int enic_getmac(struct _Enic *reg /* Exported interface */ -int enic_present(int unit) +int +enic_present(int unit) { - if ((unit != 0) || (the_enic->Tag != PMTTAG_ETHERNET)) -return 0; +if ((unit != 0) || (the_enic->Tag != PMTTAG_ETHERNET)) + return 0; return 1; } Index: src/sys/arch/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.2 src/sys/arch/emips/stand/common/prom_iface.c:1.3 --- src/sys/arch/emips/stand/common/prom_iface.c:1.2 Mon Feb 24 02:50:22 2014 +++ src/sys/arch/emips/stand/common/prom_iface.c Mon Feb 24 17:31:56 2014 @@ -62,10 +62,11 @@ void *nope(void); void real_halt(void
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: martin Date: Mon Feb 24 14:26:11 UTC 2014 Modified Files: src/sys/arch/emips/ebus: clock_ebus.c Log Message: Remove the only use of __qdivrem inside kernels To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.7 src/sys/arch/emips/ebus/clock_ebus.c:1.8 --- src/sys/arch/emips/ebus/clock_ebus.c:1.7 Sun Nov 10 18:27:15 2013 +++ src/sys/arch/emips/ebus/clock_ebus.c Mon Feb 24 14:26:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_ebus.c,v 1.7 2013/11/10 18:27:15 christos Exp $ */ +/* $NetBSD: clock_ebus.c,v 1.8 2014/02/24 14:26:11 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.7 2013/11/10 18:27:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.8 2014/02/24 14:26:11 martin Exp $"); #include #include @@ -117,8 +117,6 @@ __eclock_init(device_t dev) * NB: At 10MHz, our 64bits FreeRunning is worth 58,426 years. */ -extern u_quad_t __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq); - static int eclock_gettime(struct todr_chip_handle *todr, struct timeval *tv) @@ -140,14 +138,14 @@ eclock_gettime(struct todr_chip_handle * /* * Big fight with the compiler here, it gets very confused by 64bits. */ -#if 0 +#if 1 /* * This is in C: */ { uint64_t freeS, freeU; - freeS = free / (10 * 1000 * 1000); - freeU = free % (10 * 1000 * 1000); + freeS = free / 1000UL; + freeU = free % 1000UL; tv->tv_sec = freeS; tv->tv_usec = freeU / 10; #if 0
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 08:00:52 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: enic.c Log Message: Add missing prototypes/includes and remove unused variables To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/enic.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/emips/stand/common/enic.c diff -u src/sys/arch/emips/stand/common/enic.c:1.1 src/sys/arch/emips/stand/common/enic.c:1.2 --- src/sys/arch/emips/stand/common/enic.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/enic.c Mon Feb 24 08:00:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: enic.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: enic.c,v 1.2 2014/02/24 08:00:52 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -66,6 +66,8 @@ #include #include +#include "start.h" + #include #define the_enic ((struct _Enic *)ETHERNET_DEFAULT_ADDRESS) @@ -76,6 +78,8 @@ static void enicinit (struct iodesc *, v static int enicget (struct iodesc *, void *, size_t, saseconds_t); static int enicput (struct iodesc *, void *, size_t); static void enicend (struct netif *); +int enic_getpkt(struct _Enic *regs, void *buf, int bytes, int timeo); +int enic_present(int unit); #ifdef NET_DEBUG static void dump_packet(void *, int); @@ -154,7 +158,7 @@ int enic_getpkt(struct _Enic *regs, void ;/* nothing */ } else if (fl != ES_F_CMD) { -printf("enic: invalid saf=x%x (lo=%x)\n", saf, lo); +printf("enic: invalid saf=x%x (lo=%x, hi=%x)\n", saf, lo, hi); } }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 07:50:22 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: prom_iface.c Log Message: Add missing prototypes To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/prom_iface.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/emips/stand/common/prom_iface.c diff -u src/sys/arch/emips/stand/common/prom_iface.c:1.1 src/sys/arch/emips/stand/common/prom_iface.c:1.2 --- src/sys/arch/emips/stand/common/prom_iface.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/prom_iface.c Mon Feb 24 07:50:22 2014 @@ -58,7 +58,9 @@ void epmc_halt(void); void save_locore(void); void restore_locore(void); - +void *nope(void); +void real_halt(void*); +void halt(int *unused, int howto); void *nope(void) {return NULL;} int getchar(void){return GetChar();} @@ -247,7 +249,7 @@ int init_memory(void) /* Make sure we know */ DoneFirst: if ((First == NULL) || (Ours == NULL)) { -printf("Bad memory layout (%x,%x), wont work.\n", First, Ours); +printf("Bad memory layout (%p,%p), wont work.\n", First, Ours); return 0; }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 07:46:33 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: Remove unused variables To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/boot.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/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.1 src/sys/arch/emips/stand/common/boot.c:1.2 --- src/sys/arch/emips/stand/common/boot.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/boot.c Mon Feb 24 07:46:33 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: boot.c,v 1.2 2014/02/24 07:46:33 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ char *kernelnames[] = { "netbsd.old", "onetbsd", "gennetbsd", -"nfsnetbsd", + "nfsnetbsd", NULL }; @@ -66,9 +66,9 @@ static int devcanon(char *); static int loadit(char *name, u_long marks[MARK_MAX]) { -printf("Loading: %s\n", name); -memset(marks, 0, sizeof marks); -return (loadfile(name, marks, LOAD_ALL)); + printf("Loading: %s\n", name); + memset(marks, 0, sizeof marks); + return (loadfile(name, marks, LOAD_ALL)); } /* @@ -78,31 +78,30 @@ static int loadit(char *name, u_long mar void main(char *stack_top) { - int argc; -int autoboot = 1, win; + int autoboot = 1, win; char *name, **namep, *dev, *kernel; - char bootname[PATH_MAX], bootpath[PATH_MAX], options[OPT_MAX]; + char bootpath[PATH_MAX], options[OPT_MAX]; uint32_t entry; u_long marks[MARK_MAX]; struct btinfo_symtab bi_syms; struct btinfo_bootpath bi_bpath; -/* Init all peripherals, esp USART for printf and memory */ -init_board(); + /* Init all peripherals, esp USART for printf and memory */ + init_board(); -/* On account of compression, we need a fairly large heap. - * To keep things simple, take one meg just below the 16 meg mark. - * That allows for a large kernel, and a 16MB configuration still works. - */ -setheap((void *)(0x8100-(1024*1024)), (void *)0x8100); - -/* On the BEE3 and the Giano simulator, we need a sec between the serial-line download complete - * and switching the serial line to PuTTY as console. Get a char to pause. - * This delay is also the practice on PCs so. - */ -Delay(20); -printf("Hit any char to boot.."); -argc = GetChar(); + /* On account of compression, we need a fairly large heap. + * To keep things simple, take one meg just below the 16 meg mark. + * That allows for a large kernel, and a 16MB configuration still works. + */ + setheap((void *)(0x8100-(1024*1024)), (void *)0x8100); + + /* On the BEE3 and the Giano simulator, we need a sec between the serial-line download complete + * and switching the serial line to PuTTY as console. Get a char to pause. + * This delay is also the practice on PCs so. + */ + Delay(20); + printf("Hit any char to boot.."); + (void)GetChar(); /* print a banner */ printf("\n"); @@ -112,25 +111,25 @@ main(char *stack_top) /* initialise bootinfo structure early */ bi_init(BOOTINFO_ADDR); -/* Default is to auto-boot from the first disk */ -dev = "0/ace(0,0)/"; + /* Default is to auto-boot from the first disk */ + dev = "0/ace(0,0)/"; kernel = kernelnames[0]; -options[0] = 0; + options[0] = 0; -win = 0; -for (;!win;) { -strcpy(bootpath, dev); -strcat(bootpath, kernel); -name = getboot(bootpath,options); - -if (name != NULL) { -win = (loadit(name, marks) == 0); -} else if (autoboot) -break; -autoboot = 0; -} + win = 0; + for (;!win;) { + strcpy(bootpath, dev); + strcat(bootpath, kernel); + name = getboot(bootpath,options); + + if (name != NULL) { + win = (loadit(name, marks) == 0); + } else if (autoboot) + break; + autoboot = 0; + } -if (!win) { + if (!win) { for (namep = kernelnames, win = 0; *namep != NULL && !win; namep++) { kernel = *namep; @@ -155,7 +154,7 @@ main(char *stack_top) bi_add(&bi_syms, BTINFO_SYMTAB, sizeof(bi_syms)); printf("Starting at 0x%x\n\n", entry); -call_kernel(entry, name, options, BOOTINFO_MAGIC, bootinfo); + call_kernel(entry, name, options, BOOTINFO_MAGIC, bootinfo); (void)printf("KERNEL RETURNED!\n"); fail: @@ -165,90 +164,90 @@ fail: static inline int parse(char *cmd, char *kname, char *optarg) { -char *arg = cmd; -char *ep, *p; -int c, i; - -while ((c = *arg++)) { -/* skip leading blanks */ -if (c == ' ' || c == '\t' || c == '\n') -continue; -/* find separator, or eol */ -for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); -ep = p; -/* trim if separat
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Mon Feb 24 07:41:15 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: printf.c putchar.c Log Message: Fix missing prototypes/includes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/stand/common/printf.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/putchar.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/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.4 src/sys/arch/emips/stand/common/printf.c:1.5 --- src/sys/arch/emips/stand/common/printf.c:1.4 Sun Feb 23 07:49:04 2014 +++ src/sys/arch/emips/stand/common/printf.c Mon Feb 24 07:41:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.4 2014/02/23 07:49:04 martin Exp $ */ +/* $NetBSD: printf.c,v 1.5 2014/02/24 07:41:15 martin Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -19,8 +19,7 @@ */ #include - -void xputchar(int); +#include "common.h" void xputchar(int ch) Index: src/sys/arch/emips/stand/common/putchar.c diff -u src/sys/arch/emips/stand/common/putchar.c:1.1 src/sys/arch/emips/stand/common/putchar.c:1.2 --- src/sys/arch/emips/stand/common/putchar.c:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/putchar.c Mon Feb 24 07:41:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: putchar.c,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: putchar.c,v 1.2 2014/02/24 07:41:15 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,6 +31,10 @@ */ #include +#include "start.h" +#include "common.h" + +void putchar(int); /* Write a character to the USART */
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: martin Date: Sun Feb 23 07:49:04 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Provide a prototype for xputchar To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/printf.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/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.3 src/sys/arch/emips/stand/common/printf.c:1.4 --- src/sys/arch/emips/stand/common/printf.c:1.3 Thu Jul 21 11:04:24 2011 +++ src/sys/arch/emips/stand/common/printf.c Sun Feb 23 07:49:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.3 2011/07/21 11:04:24 joerg Exp $ */ +/* $NetBSD: printf.c,v 1.4 2014/02/23 07:49:04 martin Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -20,6 +20,8 @@ #include +void xputchar(int); + void xputchar(int ch) {
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: matt Date: Thu Feb 6 19:20:12 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: start.S Log Message: If we just want _end, load it directly and skip the gp To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/start.S 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/emips/stand/common/start.S diff -u src/sys/arch/emips/stand/common/start.S:1.2 src/sys/arch/emips/stand/common/start.S:1.3 --- src/sys/arch/emips/stand/common/start.S:1.2 Thu Mar 10 18:18:00 2011 +++ src/sys/arch/emips/stand/common/start.S Thu Feb 6 19:20:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: start.S,v 1.2 2011/03/10 18:18:00 pooka Exp $ */ +/* $NetBSD: start.S,v 1.3 2014/02/06 19:20:11 matt Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -522,10 +522,8 @@ END(PutChar) LEAF(switch_stack_and_call) /* Get a stack and jump. It would be a very bad idea to return but.. */ -#ifdef __GP_SUPPORT__ -la gp, _C_LABEL (_gp) -#endif -lasp,_end +lui sp,%hi(_end) +addiu sp,%lo(_end) jra1 addiu sp,sp,(2*1024) /* BUGBUG arbitrary */
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Thu Feb 6 18:43:41 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: common.h Log Message: add missing prototype; remove names from args To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/common.h 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/emips/stand/common/common.h diff -u src/sys/arch/emips/stand/common/common.h:1.1 src/sys/arch/emips/stand/common/common.h:1.2 --- src/sys/arch/emips/stand/common/common.h:1.1 Tue Jan 25 20:18:54 2011 +++ src/sys/arch/emips/stand/common/common.h Thu Feb 6 13:43:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: common.h,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: common.h,v 1.2 2014/02/06 18:43:41 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -58,15 +58,16 @@ extern int getsysid(void); /* prom_iface.c */ extern int init_usart(void); extern int init_memory(void); -extern void call_kernel(uint32_t addr, char *kname, char *kargs, u_int bim, char *bip); +extern void call_kernel(uint32_t, char *, char *, u_int, char *); /* ace.c */ -extern int aceprobe(int unit); +extern int aceprobe(int); /* enic.c */ -extern int enic_present(int unit); +extern int enic_present(int); -/* - * vers.c (generated by newvers.sh) - */ +/* print.c */ +extern void xputchar(int); + +/* vers.c (generated by newvers.sh) */ extern const char bootprog_rev[];
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Wed Feb 5 19:07:16 UTC 2014 Modified Files: src/sys/arch/emips/stand/common: ace.c Log Message: make this compile. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/ace.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/emips/stand/common/ace.c diff -u src/sys/arch/emips/stand/common/ace.c:1.2 src/sys/arch/emips/stand/common/ace.c:1.3 --- src/sys/arch/emips/stand/common/ace.c:1.2 Sun Jul 17 16:54:39 2011 +++ src/sys/arch/emips/stand/common/ace.c Wed Feb 5 14:07:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ace.c,v 1.2 2011/07/17 20:54:39 joerg Exp $ */ +/* $NetBSD: ace.c,v 1.3 2014/02/05 19:07:16 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -65,6 +65,7 @@ #include "common.h" #include "ace.h" +#include "start.h" #define NSAC 2 #define SAC0 ((struct _Sac *)IDE_DEFAULT_ADDRESS) @@ -618,7 +619,7 @@ aceopen(struct open_file *f, ...) int i; char *msg; char buf[DEV_BSIZE]; - int cnt; + size_t cnt; va_list ap; va_start(ap, f);
CVS commit: src/sys/arch/emips/stand
Module Name:src Committed By: christos Date: Wed Jan 22 15:16:14 UTC 2014 Modified Files: src/sys/arch/emips/stand: Makefile.booters Log Message: Add NOMAN To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/stand/Makefile.booters 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/emips/stand/Makefile.booters diff -u src/sys/arch/emips/stand/Makefile.booters:1.5 src/sys/arch/emips/stand/Makefile.booters:1.6 --- src/sys/arch/emips/stand/Makefile.booters:1.5 Wed Jan 15 20:15:33 2014 +++ src/sys/arch/emips/stand/Makefile.booters Wed Jan 22 10:16:14 2014 @@ -1,5 +1,6 @@ -# $NetBSD: Makefile.booters,v 1.5 2014/01/16 01:15:33 christos Exp $ +# $NetBSD: Makefile.booters,v 1.6 2014/01/22 15:16:14 christos Exp $ +NOMAN=1 .include # $S must correspond to the top of the 'sys' tree
CVS commit: src/sys/arch/emips/stand/bootxx_cd9660
Module Name:src Committed By: christos Date: Fri Oct 4 15:02:15 UTC 2013 Modified Files: src/sys/arch/emips/stand/bootxx_cd9660: Makefile Log Message: kill useless expr To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/bootxx_cd9660/Makefile 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/emips/stand/bootxx_cd9660/Makefile diff -u src/sys/arch/emips/stand/bootxx_cd9660/Makefile:1.1 src/sys/arch/emips/stand/bootxx_cd9660/Makefile:1.2 --- src/sys/arch/emips/stand/bootxx_cd9660/Makefile:1.1 Tue Jan 25 20:18:53 2011 +++ src/sys/arch/emips/stand/bootxx_cd9660/Makefile Fri Oct 4 11:02:14 2013 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.1 2011/01/26 01:18:53 pooka Exp $ +# $NetBSD: Makefile,v 1.2 2013/10/04 15:02:14 christos Exp $ PRIMARY_PROG= bootxx_cd9660 CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=cd9660 \ -DBOOTXX_FS_NAME='"ISO 9660"' # XXX the following could probably be increased -PRIMARY_MAX_LOAD!= expr 8192 +PRIMARY_MAX_LOAD= 8192 .include "../Makefile.booters"
CVS commit: src/sys/arch/emips/stand
Module Name:src Committed By: christos Date: Fri Oct 4 15:01:52 UTC 2013 Modified Files: src/sys/arch/emips/stand: Makefile.booters Log Message: remove -g To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/Makefile.booters 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/emips/stand/Makefile.booters diff -u src/sys/arch/emips/stand/Makefile.booters:1.2 src/sys/arch/emips/stand/Makefile.booters:1.3 --- src/sys/arch/emips/stand/Makefile.booters:1.2 Wed Aug 21 03:22:26 2013 +++ src/sys/arch/emips/stand/Makefile.booters Fri Oct 4 11:01:52 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.2 2013/08/21 07:22:26 matt Exp $ +# $NetBSD: Makefile.booters,v 1.3 2013/10/04 15:01:52 christos Exp $ .include # for HOST_SH @@ -19,7 +19,7 @@ AFLAGS+= -D_LOCORE -D_KERNEL -mno-abical CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES \ -I${.OBJDIR} -I${S} # compiler flags for smallest code size -CFLAGS= -ffreestanding -Os -g -mmemcpy -mno-abicalls -G 128 +CFLAGS= -ffreestanding -Os -mmemcpy -mno-abicalls -G 128 LDBUG= -T $S/arch/mips/conf/stand.ldscript NETBSD_VERS!= ${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
CVS commit: src/sys/arch/emips/stand
Module Name:src Committed By: matt Date: Wed Aug 21 07:22:27 UTC 2013 Modified Files: src/sys/arch/emips/stand: Makefile.booters Log Message: Use To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/Makefile.booters 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/emips/stand/Makefile.booters diff -u src/sys/arch/emips/stand/Makefile.booters:1.1 src/sys/arch/emips/stand/Makefile.booters:1.2 --- src/sys/arch/emips/stand/Makefile.booters:1.1 Wed Jan 26 01:18:53 2011 +++ src/sys/arch/emips/stand/Makefile.booters Wed Aug 21 07:22:26 2013 @@ -1,19 +1,10 @@ -# $NetBSD: Makefile.booters,v 1.1 2011/01/26 01:18:53 pooka Exp $ +# $NetBSD: Makefile.booters,v 1.2 2013/08/21 07:22:26 matt Exp $ .include # for HOST_SH # $S must correspond to the top of the 'sys' tree S= ${.CURDIR}/../../../.. -.if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: - @[ -h machine ] || ln -s $S/arch/${MACHINE}/include machine - @[ -h emips ] || ln -s $S/arch/${MACHINE}/include emips - @[ -h mips ] || ln -s $S/arch/mips/include mips -.NOPATH: machine emips mips -.endif -CLEANFILES+= machine emips mips - BINMODE?= 444 # XXX SHOULD NOT NEED TO DEFINE THESE! @@ -109,7 +100,8 @@ vers.c: ${.CURDIR}/version ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ -N ${.CURDIR}/version "emips" -${PROG}: machine mips emips ${OBJS} ${LIBS} +${PROG}: ${OBJS} ${LIBS} + ${_MKTARGET_LINK} ${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ ${LDBUG} -e start -o ${PROG}.elf ${OBJS} ${LIBS} @${SIZE} ${PROG}.elf @@ -121,6 +113,7 @@ ${PROG}: machine mips emips ${OBJS} ${LI dd if=${PROG}.bin of=${PROG} bs=512 conv=sync .include +.include CLEANFILES+= ${PROG}.map
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: christos Date: Mon Jun 3 20:26:31 UTC 2013 Modified Files: src/sys/arch/emips/ebus: ace_ebus.c Log Message: fix pasto To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/ebus/ace_ebus.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/emips/ebus/ace_ebus.c diff -u src/sys/arch/emips/ebus/ace_ebus.c:1.6 src/sys/arch/emips/ebus/ace_ebus.c:1.7 --- src/sys/arch/emips/ebus/ace_ebus.c:1.6 Tue May 28 20:47:48 2013 +++ src/sys/arch/emips/ebus/ace_ebus.c Mon Jun 3 16:26:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ace_ebus.c,v 1.6 2013/05/29 00:47:48 christos Exp $ */ +/* $NetBSD: ace_ebus.c,v 1.7 2013/06/03 20:26:31 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.6 2013/05/29 00:47:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.7 2013/06/03 20:26:31 christos Exp $"); #include #include @@ -1462,7 +1462,7 @@ sysace_send_config(struct ace_softc *sc, * Rest of code lifted with mods from the dev\ata\wd.c driver */ -/* $NetBSD: ace_ebus.c,v 1.6 2013/05/29 00:47:48 christos Exp $ */ +/* $NetBSD: ace_ebus.c,v 1.7 2013/06/03 20:26:31 christos Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -2475,5 +2475,5 @@ ace_set_geometry(struct ace_softc *ace) dg->dg_nsectors = ace->sc_params.CurrentSectorsPerTrack; dg->dg_ntracks = ace->sc_params.CurrentNumberOfHeads; - disk_set_info(sc->sc_dev, &sc->sc_dk, ST506); + disk_set_info(ace->sc_dev, &ace->sc_dk, ST506); }
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: joerg Date: Thu Jul 21 11:04:24 UTC 2011 Modified Files: src/sys/arch/emips/stand/common: printf.c Log Message: Try fixing stand.h include. Add RCS ID. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/stand/common/printf.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/emips/stand/common/printf.c diff -u src/sys/arch/emips/stand/common/printf.c:1.2 src/sys/arch/emips/stand/common/printf.c:1.3 --- src/sys/arch/emips/stand/common/printf.c:1.2 Sun Jul 17 20:54:39 2011 +++ src/sys/arch/emips/stand/common/printf.c Thu Jul 21 11:04:24 2011 @@ -1,3 +1,4 @@ +/* $NetBSD: printf.c,v 1.3 2011/07/21 11:04:24 joerg Exp $ */ /*- * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -17,7 +18,7 @@ * $FreeBSD: src/sys/boot/mips/emips/libemips/printf.c,v 1.2 2006/10/20 09:12:05 imp Exp $ */ -#include +#include void xputchar(int ch)
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Fri Jun 17 18:40:46 UTC 2011 Modified Files: src/sys/arch/emips/emips: cons.h Log Message: Sync with pmax/cons.h (i.e. remove clause 3 and 4). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/emips/cons.h 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/emips/emips/cons.h diff -u src/sys/arch/emips/emips/cons.h:1.1 src/sys/arch/emips/emips/cons.h:1.2 --- src/sys/arch/emips/emips/cons.h:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/emips/cons.h Fri Jun 17 18:40:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cons.h,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: cons.h,v 1.2 2011/06/17 18:40:46 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - *This product includes software developed by the NetBSD - *Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - *contributors may be used to endorse or promote products derived - *from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 14:31:31 UTC 2011 Modified Files: src/sys/arch/emips/ebus: if_le_ebus.c Log Message: - misc KNF - use device_t and cfdata_t To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/if_le_ebus.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/emips/ebus/if_le_ebus.c diff -u src/sys/arch/emips/ebus/if_le_ebus.c:1.1 src/sys/arch/emips/ebus/if_le_ebus.c:1.2 --- src/sys/arch/emips/ebus/if_le_ebus.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/if_le_ebus.c Sun Jun 12 14:31:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: if_le_ebus.c,v 1.2 2011/06/12 14:31:31 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.2 2011/06/12 14:31:31 tsutsui Exp $"); #include "opt_inet.h" @@ -71,8 +71,8 @@ extern paddr_t kvtophys(vaddr_t); struct bufmap { -struct mbuf *mbuf; -paddr_t phys; + struct mbuf *mbuf; + paddr_t phys; }; struct enic_softc { @@ -80,40 +80,40 @@ struct ethercom sc_ethercom; /* Ethernet common part */ struct ifmedia sc_media; /* our supported media */ -struct _Enic *sc_regs; /* hw registers */ + struct _Enic *sc_regs; /* hw registers */ - int sc_havecarrier; /* carrier status */ - void *sc_sh; /* shutdownhook cookie */ -int inited; - -int sc_no_rd; -int sc_n_recv; -int sc_recv_h; -/* BUGBUG really should be malloc-ed */ + int sc_havecarrier; /* carrier status */ + void *sc_sh; /* shutdownhook cookie */ + int inited; + + int sc_no_rd; + int sc_n_recv; + int sc_recv_h; + /* BUGBUG really should be malloc-ed */ #define SC_MAX_N_RECV 64 -struct bufmap sc_recv[SC_MAX_N_RECV]; + struct bufmap sc_recv[SC_MAX_N_RECV]; -int sc_no_td; -int sc_n_xmit; -int sc_xmit_h; -/* BUGBUG really should be malloc-ed */ + int sc_no_td; + int sc_n_xmit; + int sc_xmit_h; + /* BUGBUG really should be malloc-ed */ #define SC_MAX_N_XMIT 16 -struct bufmap sc_xmit[SC_MAX_N_XMIT]; + struct bufmap sc_xmit[SC_MAX_N_XMIT]; #if DEBUG -int xhit; -int xmiss; -int tfull; -int tfull2; -int brh; -int rf; -int bxh; + int xhit; + int xmiss; + int tfull; + int tfull2; + int brh; + int rf; + int bxh; -int it; + int it; #endif - u_int8_t sc_enaddr[ETHER_ADDR_LEN]; - u_int8_t sc_pad[2]; + uint8_t sc_enaddr[ETHER_ADDR_LEN]; + uint8_t sc_pad[2]; #if NRND > 0 rndsource_element_t rnd_source; #endif @@ -121,44 +121,44 @@ void enic_reset(struct ifnet *); int enic_init(struct ifnet *); -void enic_stop(struct ifnet *ifp, int suspend); -void enic_start(struct ifnet *ifp); +void enic_stop(struct ifnet *, int); +void enic_start(struct ifnet *); void enic_shutdown(void *); -void enic_watchdog(struct ifnet *ifp); -int enic_mediachange(struct ifnet *ifp); -void enic_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr); -int enic_ioctl(struct ifnet *ifp, u_long cmd, void *data); -int enic_intr(void *cookie, void *f); +void enic_watchdog(struct ifnet *); +int enic_mediachange(struct ifnet *); +void enic_mediastatus(struct ifnet *, struct ifmediareq *); +int enic_ioctl(struct ifnet *, u_long, void *); +int enic_intr(void *, void *); void enic_rint(struct enic_softc *, uint32_t, paddr_t); void enic_tint(struct enic_softc *, uint32_t, paddr_t); -void enic_kill_xmit(struct enic_softc *sc); -void enic_post_recv(struct enic_softc *sc, struct mbuf *m); -void enic_refill(struct enic_softc *sc); -static int enic_gethwinfo(struct enic_softc *sc); -int enic_put(struct enic_softc *sc, struct mbuf **pm); +void enic_kill_xmit(struct enic_softc *); +void enic_post_recv(struct enic_softc *, struct mbuf *); +void enic_refill(struct enic_softc *); +static int enic_gethwinfo(struct enic_softc *); +int enic_put(struct enic_softc *, struct mbuf **); -static int enic_match(struct device *, struct cfdata *, void *); -static void enic_attach(struct device *, struct device *, void *); +static int enic_match(device_t, cfdata_t, void *); +static void enic_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(enic_emips, sizeof(struct enic_softc), enic_match, enic_attach, NULL, NULL); int -enic_match(struct device *parent, struct cfdata *match, void *aux) +enic_match(device_t parent, cfdata_t cf, void *aux) { struct ebus_attach_args *d = aux; /* donno yet */ struct _Enic *et = (struct _Enic *)d->ia_vaddr; if (strcmp("enic", d->ia_name) != 0) - return (0); + return 0; if ((et == NULL) || (et->Tag != PMTTAG_ETHERNET)) return 0; - return (1); + return 1; } void -enic_attach(struct device *parent, struct device *self, void *aux) +enic_attach(device_t parent, device_t
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Sun Jun 12 13:40:14 UTC 2011 Modified Files: src/sys/arch/emips/emips: promcall.c Log Message: Some KNF. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/promcall.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/emips/emips/promcall.c diff -u src/sys/arch/emips/emips/promcall.c:1.2 src/sys/arch/emips/emips/promcall.c:1.3 --- src/sys/arch/emips/emips/promcall.c:1.2 Tue Feb 8 20:20:11 2011 +++ src/sys/arch/emips/emips/promcall.c Sun Jun 12 13:40:14 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: promcall.c,v 1.2 2011/02/08 20:20:11 rmind Exp $ */ +/* $NetBSD: promcall.c,v 1.3 2011/06/12 13:40:14 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: promcall.c,v 1.2 2011/02/08 20:20:11 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: promcall.c,v 1.3 2011/06/12 13:40:14 tsutsui Exp $"); #include #include @@ -60,16 +60,19 @@ static int nogetsysid(void); static void nohalt(int *, int); -/* Callback vector. We keep this fall-back copy jic the bootloader is broken. +/* + * Callback vector. We keep this fall-back copy jic the bootloader is broken. */ static void *nope(void) { -return NULL; + + return NULL; } static int nogetchar(void) { -return -1; + + return -1; } static void noprintf(const char *fmt, ...) @@ -78,56 +81,58 @@ static int nogetsysid(void) { -/* say its an eMIPS, ML board */ -return MAKESYSID(1,1,XS_ML40x,MIPS_eMIPS); + + /* say its an eMIPS, ML board */ + return MAKESYSID(1, 1, XS_ML40x, MIPS_eMIPS); } static void nohalt(int *unused, int howto) { - while(1) ; /* fool gcc */ + + while (1); /* fool gcc */ /*NOTREACHED*/ } const struct callback callvec = { -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, nogetchar, -nope, -nope, + nope, + nope, noprintf, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nope, -nogetsysid, -nope, -nope, -nope, -nope, -nope, -nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nope, + nogetsysid, + nope, + nope, + nope, + nope, + nope, + nope, nohalt }; @@ -166,8 +171,7 @@ * Print a character on PROM console. */ static void -romputc(dev_t dev, -int c) +romputc(dev_t dev, int c) { int s; @@ -186,7 +190,8 @@ int prom_systype(void) { -return (*callv->_getsysid)(); + + return (*callv->_getsysid)(); } /* @@ -195,8 +200,8 @@ void __attribute__((__noreturn__)) prom_halt(int howto) { + (*callv->_halt)((int *)0, howto); while(1) ; /* fool gcc */ /*NOTREACHED*/ } -
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 05:31:14 UTC 2011 Modified Files: src/sys/arch/emips/ebus: gpio_ebus.c Log Message: Split device_t/softc. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/gpio_ebus.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/emips/ebus/gpio_ebus.c diff -u src/sys/arch/emips/ebus/gpio_ebus.c:1.2 src/sys/arch/emips/ebus/gpio_ebus.c:1.3 --- src/sys/arch/emips/ebus/gpio_ebus.c:1.2 Sun Jun 12 05:27:56 2011 +++ src/sys/arch/emips/ebus/gpio_ebus.c Sun Jun 12 05:31:14 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $ */ +/* $NetBSD: gpio_ebus.c,v 1.3 2011/06/12 05:31:14 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpio_ebus.c,v 1.3 2011/06/12 05:31:14 tsutsui Exp $"); #include #include @@ -49,7 +49,7 @@ #define GPIO_NPINS 32 struct epio_softc { - struct device sc_dev; + device_t sc_dev; struct _Pio *sc_dp; struct gpio_chipset_tag sc_gpio_gc; gpio_pin_t sc_gpio_pins[GPIO_NPINS]; @@ -58,7 +58,7 @@ static int epio_ebus_match(device_t, cfdata_t, void *); static void epio_ebus_attach(device_t, device_t, void *); -CFATTACH_DECL(epio, sizeof (struct epio_softc), +CFATTACH_DECL_NEW(epio, sizeof (struct epio_softc), epio_ebus_match, epio_ebus_attach, NULL, NULL); static int epio_pin_read(void *, int); @@ -83,12 +83,13 @@ static void epio_ebus_attach(device_t parent, device_t self, void *aux) { - struct epio_softc *sc = (struct epio_softc *)self; + struct epio_softc *sc = device_private(self); struct ebus_attach_args *ia =aux; struct gpiobus_attach_args gba; int i; uint32_t data; + sc->sc_dev = self; sc->sc_dp = (struct _Pio *)ia->ia_vaddr; data = sc->sc_dp->PinData; @@ -123,7 +124,7 @@ gba.gba_npins = GPIO_NPINS; /* Attach GPIO framework */ - (void)config_found(&sc->sc_dev, &gba, gpiobus_print); + (void)config_found(self, &gba, gpiobus_print); } static int
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 05:27:57 UTC 2011 Modified Files: src/sys/arch/emips/ebus: gpio_ebus.c Log Message: - misc KNF - use device_t and cfdata_t To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/gpio_ebus.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/emips/ebus/gpio_ebus.c diff -u src/sys/arch/emips/ebus/gpio_ebus.c:1.1 src/sys/arch/emips/ebus/gpio_ebus.c:1.2 --- src/sys/arch/emips/ebus/gpio_ebus.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/gpio_ebus.c Sun Jun 12 05:27:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gpio_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: gpio_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpio_ebus.c,v 1.2 2011/06/12 05:27:56 tsutsui Exp $"); #include #include @@ -52,11 +52,11 @@ struct device sc_dev; struct _Pio *sc_dp; struct gpio_chipset_tag sc_gpio_gc; - gpio_pin_t sc_gpio_pins[GPIO_NPINS]; + gpio_pin_t sc_gpio_pins[GPIO_NPINS]; }; -static int epio_ebus_match (struct device *, struct cfdata *, void *); -static void epio_ebus_attach (struct device *, struct device *, void *); +static int epio_ebus_match(device_t, cfdata_t, void *); +static void epio_ebus_attach(device_t, device_t, void *); CFATTACH_DECL(epio, sizeof (struct epio_softc), epio_ebus_match, epio_ebus_attach, NULL, NULL); @@ -66,47 +66,49 @@ static void epio_pin_ctl(void *, int, int); static int -epio_ebus_match(struct device *parent, struct cfdata *match, void *aux) +epio_ebus_match(device_t parent, cfdata_t cf, void *aux) { struct ebus_attach_args *ia = aux; -struct _Pio *f = (struct _Pio *)ia->ia_vaddr; + struct _Pio *f = (struct _Pio *)ia->ia_vaddr; if (strcmp("gpio", ia->ia_name) != 0) - return (0); -if ((f == NULL) || -(f->Tag != PMTTAG_GPIO)) - return (0); + return 0; + if ((f == NULL) || + (f->Tag != PMTTAG_GPIO)) + return 0; - return (1); + return 1; } static void -epio_ebus_attach(struct device *parent, struct device *self, void *aux) +epio_ebus_attach(device_t parent, device_t self, void *aux) { - struct ebus_attach_args *ia =aux; struct epio_softc *sc = (struct epio_softc *)self; + struct ebus_attach_args *ia =aux; struct gpiobus_attach_args gba; -int i; + int i; uint32_t data; - sc->sc_dp = (struct _Pio*)ia->ia_vaddr; + sc->sc_dp = (struct _Pio *)ia->ia_vaddr; data = sc->sc_dp->PinData; #if DEBUG -printf(" virt=%p data=%zx", (void*)sc->sc_dp, data); + printf(" virt=%p data=%zx", (void*)sc->sc_dp, data); #endif printf(": GPIO controller\n"); /* BUGBUG Initialize pins properly */ for (i = 0 ; i < GPIO_NPINS ; i++) { sc->sc_gpio_pins[i].pin_num = i; - sc->sc_gpio_pins[i].pin_caps = GPIO_PIN_INOUT - | GPIO_PIN_OPENDRAIN - | GPIO_PIN_TRISTATE; + sc->sc_gpio_pins[i].pin_caps = + GPIO_PIN_INOUT | + GPIO_PIN_OPENDRAIN | + GPIO_PIN_TRISTATE; /* current defaults */ sc->sc_gpio_pins[i].pin_flags = GPIO_PIN_INOUT; - sc->sc_gpio_pins[i].pin_state = (data & (1 << i)) ? GPIO_PIN_HIGH : GPIO_PIN_LOW; + sc->sc_gpio_pins[i].pin_state = + (data & (1 << i)) ? GPIO_PIN_HIGH : GPIO_PIN_LOW; sc->sc_gpio_pins[i].pin_mapped = 0; } @@ -121,7 +123,7 @@ gba.gba_npins = GPIO_NPINS; /* Attach GPIO framework */ - (void) config_found(&sc->sc_dev, &gba, gpiobus_print); + (void)config_found(&sc->sc_dev, &gba, gpiobus_print); } static int @@ -143,11 +145,11 @@ int p; p = pin % GPIO_NPINS; -data = 1 << p; -if (value) -sc->sc_dp->PinData = data; -else -sc->sc_dp->ClearData = data; + data = 1 << p; + if (value) + sc->sc_dp->PinData = data; + else + sc->sc_dp->ClearData = data; } static void @@ -158,17 +160,17 @@ int p; p = pin % GPIO_NPINS; -data = (1 << p); + data = (1 << p); if (flags & GPIO_PIN_INOUT) { -sc->sc_dp->Direction = data; + sc->sc_dp->Direction = data; } if (flags & GPIO_PIN_TRISTATE) { -sc->sc_dp->OutDisable = data; + sc->sc_dp->OutDisable = data; } if (flags & GPIO_PIN_OPENDRAIN) { -sc->sc_dp->Enable = data; + sc->sc_dp->Enable = data; } }
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 05:22:30 UTC 2011 Modified Files: src/sys/arch/emips/ebus: dz_ebus.c Log Message: More nits. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/ebus/dz_ebus.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/emips/ebus/dz_ebus.c diff -u src/sys/arch/emips/ebus/dz_ebus.c:1.4 src/sys/arch/emips/ebus/dz_ebus.c:1.5 --- src/sys/arch/emips/ebus/dz_ebus.c:1.4 Sun Jun 12 05:20:54 2011 +++ src/sys/arch/emips/ebus/dz_ebus.c Sun Jun 12 05:22:30 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $ */ +/* $NetBSD: dz_ebus.c,v 1.5 2011/06/12 05:22:30 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.5 2011/06/12 05:22:30 tsutsui Exp $"); #include "opt_ddb.h" @@ -129,7 +129,7 @@ return ENXIO; line = DZ_PORT(minor(dev)); - if (line > 0) /* FIXME fo rmore than one line */ + if (line > 0) /* FIXME for more than one line */ return ENXIO; tp = sc->sc_dz.dz_tty; @@ -192,7 +192,7 @@ /* Do a hangup if so required. */ if ((tp->t_cflag & HUPCL) || tp->t_wopen || !(tp->t_state & TS_ISOPEN)) - (void) dzmctl(sc, line, 0, DMSET); + (void)dzmctl(sc, line, 0, DMSET); return ttyclose(tp); }
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 05:20:54 UTC 2011 Modified Files: src/sys/arch/emips/ebus: dz_ebus.c Log Message: Split device_t/softc. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/ebus/dz_ebus.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/emips/ebus/dz_ebus.c diff -u src/sys/arch/emips/ebus/dz_ebus.c:1.3 src/sys/arch/emips/ebus/dz_ebus.c:1.4 --- src/sys/arch/emips/ebus/dz_ebus.c:1.3 Sun Jun 12 05:06:23 2011 +++ src/sys/arch/emips/ebus/dz_ebus.c Sun Jun 12 05:20:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $ */ +/* $NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.4 2011/06/12 05:20:54 tsutsui Exp $"); #include "opt_ddb.h" @@ -69,7 +69,7 @@ #define DZ_PORT(u) ((u) & 07) /* extract the port # */ struct dz_softc { - struct device sc_dev; /* Autoconf blaha */ + device_t sc_dev; /* Autoconf blaha */ struct evcnt sc_rintrcnt; /* recevive interrupt counts */ struct evcnt sc_tintrcnt; /* transmit interrupt counts */ struct _Usart *sc_dr; /* reg pointers */ @@ -124,12 +124,11 @@ int s, error = 0; unit = DZ_I2C(minor(dev)); - line = DZ_PORT(minor(dev)); - if (unit >= dz_cd.cd_ndevs || dz_cd.cd_devs[unit] == NULL) - return (ENXIO); - - sc = (void *)dz_cd.cd_devs[unit]; + sc = device_lookup_private(&dz_cd, unit); + if (sc == NULL) + return ENXIO; + line = DZ_PORT(minor(dev)); if (line > 0) /* FIXME fo rmore than one line */ return ENXIO; @@ -181,8 +180,8 @@ int unit, line; unit = DZ_I2C(minor(dev)); + sc = device_lookup_private(&dz_cd, unit); line = DZ_PORT(minor(dev)); - sc = (void *)dz_cd.cd_devs[unit]; tp = sc->sc_dz.dz_tty; @@ -204,7 +203,7 @@ struct tty *tp; struct dz_softc *sc; - sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))]; + sc = device_lookup_private(&dz_cd, DZ_I2C(minor(dev))); tp = sc->sc_dz.dz_tty; return (*tp->t_linesw->l_read)(tp, uio, flag); @@ -216,7 +215,7 @@ struct tty *tp; struct dz_softc *sc; - sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))]; + sc = device_lookup_private(&dz_cd, DZ_I2C(minor(dev))); tp = sc->sc_dz.dz_tty; return (*tp->t_linesw->l_write)(tp, uio, flag); @@ -233,7 +232,7 @@ unit = DZ_I2C(minor(dev)); line = 0; - sc = (void *)dz_cd.cd_devs[unit]; + sc = device_lookup_private(&dz_cd, unit); tp = sc->sc_dz.dz_tty; error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l); @@ -297,8 +296,11 @@ struct tty * dztty(dev_t dev) { - struct dz_softc *sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))]; - struct tty *tp = sc->sc_dz.dz_tty; + struct dz_softc *sc; + struct tty *tp; + + sc = device_lookup_private(&dz_cd, DZ_I2C(minor(dev))); + tp = sc->sc_dz.dz_tty; return tp; } @@ -309,7 +311,7 @@ struct dz_softc *sc; struct tty *tp; - sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))]; + sc = device_lookup_private(&dz_cd, DZ_I2C(minor(dev))); tp = sc->sc_dz.dz_tty; return (*tp->t_linesw->l_poll)(tp, events, l); @@ -323,7 +325,7 @@ int unit, s; unit = DZ_I2C(minor(tp->t_dev)); - sc = (void *)dz_cd.cd_devs[unit]; + sc = device_lookup_private(&dz_cd, unit); s = spltty(); if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) { @@ -384,7 +386,7 @@ unit = DZ_I2C(minor(tp->t_dev)); line = DZ_PORT(minor(tp->t_dev)); - sc = (void *)dz_cd.cd_devs[unit]; + sc = device_lookup_private(&dz_cd, unit); /* check requested parameters */ if (t->c_ispeed != t->c_ospeed) @@ -537,7 +539,7 @@ if (csr & USI_OVRE) { log(LOG_WARNING, "%s: silo overflow, line %d\n", - sc->sc_dev.dv_xname, 0); + device_xname(sc->sc_dev), 0); } if (csr & USI_FRAME) @@ -604,7 +606,7 @@ static int dz_ebus_getmajor(void); -CFATTACH_DECL(dz_ebus, sizeof(struct dz_softc), +CFATTACH_DECL_NEW(dz_ebus, sizeof(struct dz_softc), dz_ebus_match, dz_ebus_attach, NULL, NULL); struct consdev dz_ebus_consdev = { @@ -642,9 +644,10 @@ struct ebus_attach_args *iba; struct dz_softc *sc; + sc = device_private(self); iba = aux; - sc = (struct dz_softc *)self; + sc->sc_dev = self; sc->sc_dr = (struct _Usart *)iba->ia_vaddr; #if DEBUG printf(" virt=%p ", (void *)sc->sc_dr); @@ -664,9 +667,9 @@ sc->sc_dz.dz_tty = tty_alloc(); evcnt_attach_dynamic(&sc->sc_rintrcnt, EVCNT_TYPE_INTR, NULL, - sc->sc_dev.dv_xname, "rintr"); + device_xname(self), "rintr"); evcnt_attach_dynamic(&sc->sc_tintrcnt, EVCNT_TYPE_INTR, NULL, - sc->sc_dev.dv_xname, "tintr"); + device_xname(self), "tintr"); /* Initialize hw regs */ #if 0
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 05:06:23 UTC 2011 Modified Files: src/sys/arch/emips/ebus: dz_ebus.c Log Message: Misc KNF. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/dz_ebus.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/emips/ebus/dz_ebus.c diff -u src/sys/arch/emips/ebus/dz_ebus.c:1.2 src/sys/arch/emips/ebus/dz_ebus.c:1.3 --- src/sys/arch/emips/ebus/dz_ebus.c:1.2 Sun Apr 24 16:26:55 2011 +++ src/sys/arch/emips/ebus/dz_ebus.c Sun Jun 12 05:06:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dz_ebus.c,v 1.2 2011/04/24 16:26:55 rmind Exp $ */ +/* $NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.2 2011/04/24 16:26:55 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.3 2011/06/12 05:06:23 tsutsui Exp $"); #include "opt_ddb.h" @@ -58,13 +58,15 @@ #include #include -//#include +#if 0 +#include +#endif #include "ioconf.h" /* for dz_cd */ -#define DZ_C2I(c) ((c)<<3) /* convert controller # to index */ -#define DZ_I2C(c) ((c)>>3) /* convert minor to controller # */ -#define DZ_PORT(u) ((u)&07) /* extract the port # */ +#define DZ_C2I(c) ((c) << 3) /* convert controller # to index */ +#define DZ_I2C(c) ((c) >> 3) /* convert minor to controller # */ +#define DZ_PORT(u) ((u) & 07) /* extract the port # */ struct dz_softc { struct device sc_dev; /* Autoconf blaha */ @@ -80,7 +82,7 @@ struct dz_linestate { struct dz_softc *dz_sc; /* backpointer to softc */ int dz_line; /* channel number */ - struct tty * dz_tty; /* what we work on */ + struct tty *dz_tty; /* what we work on */ } sc_dz; }; @@ -118,7 +120,7 @@ { struct tty *tp; int unit, line; - struct dz_softc *sc; + struct dz_softc *sc; int s, error = 0; unit = DZ_I2C(minor(dev)); @@ -133,10 +135,10 @@ tp = sc->sc_dz.dz_tty; if (tp == NULL) - return (ENODEV); - tp->t_oproc = dzstart; - tp->t_param = dzparam; - tp->t_dev = dev; + return ENODEV; + tp->t_oproc = dzstart; + tp->t_param = dzparam; + tp->t_dev = dev; if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp)) return (EBUSY); @@ -150,34 +152,34 @@ tp->t_lflag = TTYDEF_LFLAG; tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; } - (void) dzparam(tp, &tp->t_termios); + (void)dzparam(tp, &tp->t_termios); ttsetwater(tp); } -/* we have no modem control but..*/ + /* we have no modem control but..*/ if (dzmctl(sc, line, TIOCM_DTR, DMBIS) & TIOCM_CD) -tp->t_state |= TS_CARR_ON; - s = spltty(); - while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) && - !(tp->t_state & TS_CARR_ON)) { - tp->t_wopen++; - error = ttysleep(tp, &tp->t_rawcv, true, 0); - tp->t_wopen--; - if (error) - break; - } - (void) splx(s); + tp->t_state |= TS_CARR_ON; + s = spltty(); + while (!(flag & O_NONBLOCK) && !(tp->t_cflag & CLOCAL) && + !(tp->t_state & TS_CARR_ON)) { + tp->t_wopen++; + error = ttysleep(tp, &tp->t_rawcv, true, 0); + tp->t_wopen--; + if (error) +break; + } + (void)splx(s); if (error) - return (error); - return ((*tp->t_linesw->l_open)(dev, tp)); + return error; + return (*tp->t_linesw->l_open)(dev, tp); } + int dzclose(dev_t dev, int flag, int mode, struct lwp *l) { - struct dz_softc *sc; + struct dz_softc *sc; struct tty *tp; int unit, line; - unit = DZ_I2C(minor(dev)); line = DZ_PORT(minor(dev)); sc = (void *)dz_cd.cd_devs[unit]; @@ -187,36 +189,37 @@ (*tp->t_linesw->l_close)(tp, flag); /* Make sure a BREAK state is not left enabled. */ - (void) dzmctl(sc, line, TIOCM_BRK, DMBIC); + (void)dzmctl(sc, line, TIOCM_BRK, DMBIC); /* Do a hangup if so required. */ if ((tp->t_cflag & HUPCL) || tp->t_wopen || !(tp->t_state & TS_ISOPEN)) (void) dzmctl(sc, line, 0, DMSET); - return (ttyclose(tp)); + return ttyclose(tp); } + int dzread(dev_t dev, struct uio *uio, int flag) { struct tty *tp; - struct dz_softc *sc; + struct dz_softc *sc; sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))]; tp = sc->sc_dz.dz_tty; - return ((*tp->t_linesw->l_read)(tp, uio, flag)); + return (*tp->t_linesw->l_read)(tp, uio, flag); } int dzwrite(dev_t dev, struct uio *uio, int flag) { struct tty *tp; - struct dz_softc *sc; + struct dz_softc *sc; sc = (void *)dz_cd.cd_devs[DZ_I2C(minor(dev))]; tp = sc->sc_dz.dz_tty; - return ((*tp->t_linesw->l_write)(tp, uio, flag)); + return (*tp->t_linesw->l_write)(tp, uio, flag); } /*ARGSUSED*/ @@ -235,56 +238,57 @@ error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l); if (error >= 0) - return (error); + return error; error = ttioctl(tp, cmd, data, flag, l); if (error >= 0) - return (error); + return error; switch (cmd) { case TIOCSBRK: - (void) dzmctl(sc,
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 04:44:27 UTC 2011 Modified Files: src/sys/arch/emips/ebus: clock_ebus.c Log Message: Split device_t/softc. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.5 src/sys/arch/emips/ebus/clock_ebus.c:1.6 --- src/sys/arch/emips/ebus/clock_ebus.c:1.5 Sun Jun 12 04:40:44 2011 +++ src/sys/arch/emips/ebus/clock_ebus.c Sun Jun 12 04:44:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $ */ +/* $NetBSD: clock_ebus.c,v 1.6 2011/06/12 04:44:27 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.6 2011/06/12 04:44:27 tsutsui Exp $"); #include #include @@ -49,7 +49,7 @@ * Device softc */ struct eclock_softc { - struct device sc_dev; + device_t sc_dev; struct _Tc *sc_dp; uint32_t sc_reload; struct timecounter sc_tc; @@ -59,7 +59,7 @@ static int eclock_ebus_match(device_t, cfdata_t, void *); static void eclock_ebus_attach(device_t, device_t, void *); -CFATTACH_DECL(eclock_ebus, sizeof (struct eclock_softc), +CFATTACH_DECL_NEW(eclock_ebus, sizeof (struct eclock_softc), eclock_ebus_match, eclock_ebus_attach, NULL, NULL); void eclock_init(device_t); @@ -87,7 +87,7 @@ static void __eclock_init(device_t dev) { - struct eclock_softc *sc = (struct eclock_softc *)dev; + struct eclock_softc *sc = device_private(dev); struct _Tc *tc = sc->sc_dp; uint32_t reload = 10 * 100; /* 1sec in 100ns units (10MHz clock) */ @@ -100,7 +100,7 @@ if ((r * hz) != reload) printf("%s: %d Hz clock will cause roundoffs" " with 10MHz xtal (%d)\n", - sc->sc_dev.dv_xname, hz, reload - (r * hz)); + device_xname(sc->sc_dev), hz, reload - (r * hz)); reload = r; } @@ -300,9 +300,10 @@ static void eclock_ebus_attach(device_t parent, device_t self, void *aux) { + struct eclock_softc *sc = device_private(self); struct ebus_attach_args *ia = aux; - struct eclock_softc *sc = (struct eclock_softc *)self; + sc->sc_dev = self; sc->sc_dp = (struct _Tc *)ia->ia_vaddr; /* NB: We are chopping our 64bit free-running down to 32bits */ @@ -328,7 +329,7 @@ #ifdef EVCNT_COUNTERS evcnt_attach_dynamic(&clock_intr_evcnt, EVCNT_TYPE_INTR, NULL, - sc->sc_dev->dv_xname, "intr"); + device_xname(self), "intr"); #endif clockdev = self;
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 04:40:44 UTC 2011 Modified Files: src/sys/arch/emips/ebus: clock_ebus.c Log Message: More KNF. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.4 src/sys/arch/emips/ebus/clock_ebus.c:1.5 --- src/sys/arch/emips/ebus/clock_ebus.c:1.4 Sun Jun 12 04:33:29 2011 +++ src/sys/arch/emips/ebus/clock_ebus.c Sun Jun 12 04:40:44 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $ */ +/* $NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.5 2011/06/12 04:40:44 tsutsui Exp $"); #include #include @@ -309,7 +309,7 @@ sc->sc_tc.tc_get_timecount = eclock_counter; sc->sc_tc.tc_poll_pps = 0; sc->sc_tc.tc_counter_mask = 0x; - sc->sc_tc.tc_frequency = 10*1000*1000; /* 10 MHz */ + sc->sc_tc.tc_frequency = 10 * 1000 * 1000; /* 10 MHz */ sc->sc_tc.tc_name = "eclock"; /* BUGBUG is it unique per instance?? */ sc->sc_tc.tc_quality = 2000; /* uhu? */ sc->sc_tc.tc_priv = sc; @@ -332,7 +332,7 @@ #endif clockdev = self; - memset(&sc->sc_todr,0,sizeof sc->sc_todr); + memset(&sc->sc_todr, 0, sizeof sc->sc_todr); sc->sc_todr.cookie = sc; sc->sc_todr.todr_gettime = eclock_gettime; sc->sc_todr.todr_settime = eclock_settime;
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 04:33:30 UTC 2011 Modified Files: src/sys/arch/emips/ebus: clock_ebus.c Log Message: - don't truncate tv_sec to uint32_t in eclock_settime() (I guess this has no longer been critical since timecounter(9) support) - add prefix to reload member in softc To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.3 src/sys/arch/emips/ebus/clock_ebus.c:1.4 --- src/sys/arch/emips/ebus/clock_ebus.c:1.3 Sun Jun 12 04:22:18 2011 +++ src/sys/arch/emips/ebus/clock_ebus.c Sun Jun 12 04:33:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $ */ +/* $NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.4 2011/06/12 04:33:29 tsutsui Exp $"); #include #include @@ -51,7 +51,7 @@ struct eclock_softc { struct device sc_dev; struct _Tc *sc_dp; - uint32_t reload; + uint32_t sc_reload; struct timecounter sc_tc; struct todr_chip_handle sc_todr; }; @@ -89,7 +89,7 @@ { struct eclock_softc *sc = (struct eclock_softc *)dev; struct _Tc *tc = sc->sc_dp; - uint32_t reload = 10*100; /* 1sec in 100ns units (10MHz clock) */ + uint32_t reload = 10 * 100; /* 1sec in 100ns units (10MHz clock) */ /* * Compute reload according to whatever value passed in, @@ -104,11 +104,11 @@ reload = r; } - sc->reload = reload; + sc->sc_reload = reload; /* Start the counter */ tc->DownCounterHigh = 0; - tc->DownCounter = sc->reload; + tc->DownCounter = sc->sc_reload; tc->Control = TCCT_ENABLE | TCCT_INT_ENABLE; } @@ -188,18 +188,18 @@ { struct eclock_softc *sc = todr->cookie; struct _Tc *tc = sc->sc_dp; - uint64_t free; - uint32_t su, uu; + uint64_t free, su; + uint32_t uu; int s; /* Careful with what we do here, else the compilerbugs hit hard */ s = splhigh(); - su = (uint32_t)tv->tv_sec; /* 0(tv) */ - uu = (uint32_t)tv->tv_usec; /* 4(tv) */ + su = (uint64_t)tv->tv_sec; /* 0(tv) */ + uu = (uint32_t)tv->tv_usec; /* 8(tv) */ - free = 10 * 1000 * 1000 * (uint64_t)su; + free = su * 10 * 1000 * 1000; free += uu * 10; tc->FreeRunning = free; @@ -264,7 +264,7 @@ x = tc->Control; tc->DownCounterHigh = 0; - tc->DownCounter = sc->reload; + tc->DownCounter = sc->sc_reload; hardclock(cf); emips_clock_evcnt.ev_count++;
CVS commit: src/sys/arch/emips
Module Name:src Committed By: tsutsui Date: Sun Jun 12 04:22:18 UTC 2011 Modified Files: src/sys/arch/emips/ebus: clock_ebus.c src/sys/arch/emips/include: types.h Log Message: Remove __HAVE_GENERIC_TODR, which has been mandatory since 2008. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/clock_ebus.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/include/types.h 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/emips/ebus/clock_ebus.c diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.2 src/sys/arch/emips/ebus/clock_ebus.c:1.3 --- src/sys/arch/emips/ebus/clock_ebus.c:1.2 Sun Jun 12 04:17:30 2011 +++ src/sys/arch/emips/ebus/clock_ebus.c Sun Jun 12 04:22:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $ */ +/* $NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.3 2011/06/12 04:22:18 tsutsui Exp $"); #include #include @@ -53,9 +53,7 @@ struct _Tc *sc_dp; uint32_t reload; struct timecounter sc_tc; -#ifdef __HAVE_GENERIC_TODR struct todr_chip_handle sc_todr; -#endif }; static int eclock_ebus_match(device_t, cfdata_t, void *); @@ -333,14 +331,12 @@ sc->sc_dev->dv_xname, "intr"); #endif -#ifdef __HAVE_GENERIC_TODR clockdev = self; memset(&sc->sc_todr,0,sizeof sc->sc_todr); sc->sc_todr.cookie = sc; sc->sc_todr.todr_gettime = eclock_gettime; sc->sc_todr.todr_settime = eclock_settime; todr_attach(&sc->sc_todr); -#endif tc_init(&sc->sc_tc); } Index: src/sys/arch/emips/include/types.h diff -u src/sys/arch/emips/include/types.h:1.1 src/sys/arch/emips/include/types.h:1.2 --- src/sys/arch/emips/include/types.h:1.1 Wed Jan 26 01:18:52 2011 +++ src/sys/arch/emips/include/types.h Sun Jun 12 04:22:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.1 2011/01/26 01:18:52 pooka Exp $ */ +/* $NetBSD: types.h,v 1.2 2011/06/12 04:22:18 tsutsui Exp $ */ #include @@ -6,8 +6,6 @@ #define __HAVE_GENERIC_SOFT_INTERRUPTS /* We'll use the FreeRunning counter everywhere */ #define __HAVE_TIMECOUNTER -/* ..and that's good enough for a 58k year TODR as well */ -#define __HAVE_GENERIC_TODR /* MIPS specific options */ #define __HAVE_BOOTINFO_H
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 04:17:30 UTC 2011 Modified Files: src/sys/arch/emips/ebus: clock_ebus.c Log Message: - misc KNF - use device_t and cfdata_t To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/clock_ebus.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/emips/ebus/clock_ebus.c diff -u src/sys/arch/emips/ebus/clock_ebus.c:1.1 src/sys/arch/emips/ebus/clock_ebus.c:1.2 --- src/sys/arch/emips/ebus/clock_ebus.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/clock_ebus.c Sun Jun 12 04:17:30 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock_ebus.c,v 1.2 2011/06/12 04:17:30 tsutsui Exp $"); #include #include @@ -51,62 +51,67 @@ struct eclock_softc { struct device sc_dev; struct _Tc *sc_dp; -uint32_t reload; -struct timecounter sc_tc; + uint32_t reload; + struct timecounter sc_tc; #ifdef __HAVE_GENERIC_TODR -struct todr_chip_handle sc_todr; + struct todr_chip_handle sc_todr; #endif }; -static int eclock_ebus_match (struct device *, struct cfdata *, void *); -static void eclock_ebus_attach (struct device *, struct device *, void *); +static int eclock_ebus_match(device_t, cfdata_t, void *); +static void eclock_ebus_attach(device_t, device_t, void *); CFATTACH_DECL(eclock_ebus, sizeof (struct eclock_softc), eclock_ebus_match, eclock_ebus_attach, NULL, NULL); - void eclock_init(struct device *); -static void __eclock_init(struct device *); -static int eclock_gettime(struct todr_chip_handle *, - struct timeval *); -static int eclock_settime(struct todr_chip_handle *, - struct timeval *); -static int eclock_ebus_intr(void *cookie, void *f); -static u_int eclock_counter(struct timecounter *tc); +void eclock_init(device_t); -struct device *clockdev = NULL; /* BUGBUG resolve the gap between cpu_initclocks() and eclock_init(x) */ +static void __eclock_init(device_t); +static int eclock_gettime(struct todr_chip_handle *, struct timeval *); +static int eclock_settime(struct todr_chip_handle *, struct timeval *); +static int eclock_ebus_intr(void *, void *); +static u_int eclock_counter(struct timecounter *); + +/* BUGBUG resolve the gap between cpu_initclocks() and eclock_init(x) */ +device_t clockdev = NULL; void -eclock_init(struct device *dev) +eclock_init(device_t dev) { -if (dev == NULL) -dev = clockdev; -if (dev == NULL) -panic("eclock_init"); -__eclock_init(dev); + + if (dev == NULL) + dev = clockdev; + if (dev == NULL) + panic("eclock_init"); + __eclock_init(dev); } static void -__eclock_init(struct device *dev) +__eclock_init(device_t dev) { struct eclock_softc *sc = (struct eclock_softc *)dev; -struct _Tc *tc = sc->sc_dp; -uint32_t reload = 10*100; /* 1sec in 100ns units (10MHz clock) */ + struct _Tc *tc = sc->sc_dp; + uint32_t reload = 10*100; /* 1sec in 100ns units (10MHz clock) */ -/* Compute reload according to whatever value passed in, Warn if fractional */ -if (hz > 1) { -uint32_t r = reload / hz; -if ((r * hz) != reload) -printf("%s: %d Hz clock will cause roundoffs with 10MHz xtal (%d)\n", - sc->sc_dev.dv_xname, hz, reload - (r * hz)); + /* + * Compute reload according to whatever value passed in, + * Warn if fractional + */ + if (hz > 1) { + uint32_t r = reload / hz; + if ((r * hz) != reload) + printf("%s: %d Hz clock will cause roundoffs" + " with 10MHz xtal (%d)\n", + sc->sc_dev.dv_xname, hz, reload - (r * hz)); reload = r; } -sc->reload = reload; + sc->reload = reload; -/* Start the counter */ -tc->DownCounterHigh = 0; -tc->DownCounter = sc->reload; -tc->Control = TCCT_ENABLE | TCCT_INT_ENABLE; + /* Start the counter */ + tc->DownCounterHigh = 0; + tc->DownCounter = sc->reload; + tc->Control = TCCT_ENABLE | TCCT_INT_ENABLE; } /* @@ -120,48 +125,61 @@ static int eclock_gettime(struct todr_chip_handle *todr, struct timeval *tv) { - struct eclock_softc *sc = (struct eclock_softc *) todr->cookie; -struct _Tc *tc = sc->sc_dp; -uint64_t free; -int s; - -/* 32bit processor, guard against interrupts in the middle of reading this 64bit entity - * BUGBUG Should read it "twice" to guard against rollover too. - */ + struct eclock_softc *sc = todr->cookie; + struct _Tc *tc = sc->sc_dp; + uint64_t free; + int s; + + /* + * 32bit processor, guard against interrupts in the midd
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 04:00:33 UTC 2011 Modified Files: src/sys/arch/emips/ebus: ebus_emips.c ebusvar.h Log Message: Remove unused ebus_softc and use CFATTACH_DECL_NEW(). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/ebus/ebus_emips.c \ src/sys/arch/emips/ebus/ebusvar.h 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/emips/ebus/ebus_emips.c diff -u src/sys/arch/emips/ebus/ebus_emips.c:1.2 src/sys/arch/emips/ebus/ebus_emips.c:1.3 --- src/sys/arch/emips/ebus/ebus_emips.c:1.2 Sun Jun 12 03:52:13 2011 +++ src/sys/arch/emips/ebus/ebus_emips.c Sun Jun 12 04:00:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $ */ +/* $NetBSD: ebus_emips.c,v 1.3 2011/06/12 04:00:33 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ebus_emips.c,v 1.3 2011/06/12 04:00:33 tsutsui Exp $"); #include "opt_xilinx_ml40x.h" #include "opt_xs_bee3.h" @@ -51,7 +51,7 @@ static int ebus_emips_match(device_t, cfdata_t, void *); static void ebus_emips_attach(device_t, device_t, void *); -CFATTACH_DECL(ebus_emips, sizeof(struct ebus_softc), +CFATTACH_DECL_NEW(ebus_emips, 0, ebus_emips_match, ebus_emips_attach, NULL, NULL); #if defined(XILINX_ML40x) || defined(XS_BEE3) Index: src/sys/arch/emips/ebus/ebusvar.h diff -u src/sys/arch/emips/ebus/ebusvar.h:1.2 src/sys/arch/emips/ebus/ebusvar.h:1.3 --- src/sys/arch/emips/ebus/ebusvar.h:1.2 Sun Jun 12 03:57:09 2011 +++ src/sys/arch/emips/ebus/ebusvar.h Sun Jun 12 04:00:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ebusvar.h,v 1.2 2011/06/12 03:57:09 tsutsui Exp $ */ +/* $NetBSD: ebusvar.h,v 1.3 2011/06/12 04:00:33 tsutsui Exp $ */ #ifndef _EMIPS_EBUS_EBUSVAR_H_ #define _EMIPS_EBUS_EBUSVAR_H_ @@ -7,10 +7,6 @@ struct ebus_attach_args; -struct ebus_softc { - struct device sc_dev; -}; - /* * Arguments used to attach an ebus "device" to its parent */
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 03:57:09 UTC 2011 Modified Files: src/sys/arch/emips/ebus: ebusvar.h Log Message: - KNF, remove arg names in prototype decls - use device_t and cfdata_t - use uint32_t rather than u_int32_t (XXX should be paddr_t here?) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/ebusvar.h 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/emips/ebus/ebusvar.h diff -u src/sys/arch/emips/ebus/ebusvar.h:1.1 src/sys/arch/emips/ebus/ebusvar.h:1.2 --- src/sys/arch/emips/ebus/ebusvar.h:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/ebusvar.h Sun Jun 12 03:57:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ebusvar.h,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: ebusvar.h,v 1.2 2011/06/12 03:57:09 tsutsui Exp $ */ #ifndef _EMIPS_EBUS_EBUSVAR_H_ #define _EMIPS_EBUS_EBUSVAR_H_ @@ -26,16 +26,17 @@ * Arguments used to attach devices to an ebus */ struct ebus_attach_args { - const char *ia_name; /* device name */ - int ia_cookie; /* device cookie */ - u_int32_t ia_paddr;/* device address (PHYSICAL) */ -void *ia_vaddr;/* device address (VIRTUAL) */ - int ia_basz; /* device size (for min regset at probe, else 0) */ + const char *ia_name; /* device name */ + int ia_cookie; /* device cookie */ + uint32_t ia_paddr; /* device address (PHYSICAL) */ + void *ia_vaddr; /* device address (VIRTUAL) */ + int ia_basz; /* device size + (for min regset at probe, else 0) */ }; -void ebusattach (struct device *, struct device *, void *); -int ebusprint (void *, const char *); -void ebus_intr_establish (struct device *, void * cookie, int level, - int (*handler)(void *, void *), void *arg); +void ebusattach(device_t , device_t , void *); +int ebusprint(void *, const char *); +void ebus_intr_establish(device_t , void *, int, + int (*)(void *, void *), void *); #endif /* !_EMIPS_EBUS_EBUSVAR_H_ */
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 03:52:13 UTC 2011 Modified Files: src/sys/arch/emips/ebus: ebus.c ebus_emips.c Log Message: - ANSIfy, KNF, remove __P() - use device_t and cfdata_t To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/ebus.c \ src/sys/arch/emips/ebus/ebus_emips.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/emips/ebus/ebus.c diff -u src/sys/arch/emips/ebus/ebus.c:1.1 src/sys/arch/emips/ebus/ebus.c:1.2 --- src/sys/arch/emips/ebus/ebus.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/ebus.c Sun Jun 12 03:52:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: ebus.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $"); #include #include @@ -44,13 +44,11 @@ #include "locators.h" void -ebusattach(parent, self, aux) - struct device *parent, *self; - void *aux; +ebusattach(device_t parent, device_t self, void *aux) { struct ebus_dev_attach_args *ida = aux; struct ebus_attach_args *ia; -void *addr; + void *addr; int i; int locs[EBUSCF_NLOCS]; @@ -65,38 +63,38 @@ ia = &ida->ida_devs[i]; #if 0 // DEBUG -printf("PROBING %s %d@%x i=%d\n", ia->ia_name, ia->ia_basz, ia->ia_paddr, ia->ia_cookie); + printf("PROBING %s %d@%x i=%d\n", + ia->ia_name, ia->ia_basz, ia->ia_paddr, ia->ia_cookie); #endif if (ia->ia_basz != 0) { -addr = (void *) mips_map_physmem(ia->ia_paddr, ia->ia_basz); -if (addr == NULL){ -printf("Failed to map %s: phys %x size %d\n", - ia->ia_name, ia->ia_paddr, ia->ia_basz); -continue; -} -ia->ia_vaddr = addr; + addr = (void *)mips_map_physmem(ia->ia_paddr, + ia->ia_basz); + if (addr == NULL) { +printf("Failed to map %s: phys %x size %d\n", +ia->ia_name, ia->ia_paddr, ia->ia_basz); +continue; + } + ia->ia_vaddr = addr; #if 0 // DEBUG -printf("MAPPED at %p\n", ia->ia_vaddr); + printf("MAPPED at %p\n", ia->ia_vaddr); #endif -} - + } locs[EBUSCF_ADDR] = ia->ia_paddr; if (NULL == config_found_sm_loc(self, "ebus", locs, ia, -ebusprint, config_stdsubmatch)) { -/* do we need to say anything? */ -if (ia->ia_basz != 0) { -mips_unmap_physmem((vaddr_t)ia->ia_vaddr, ia->ia_basz); -} -} + ebusprint, config_stdsubmatch)) { + /* do we need to say anything? */ + if (ia->ia_basz != 0) { +mips_unmap_physmem((vaddr_t)ia->ia_vaddr, +ia->ia_basz); + } + } } } int -ebusprint(aux, pnp) - void *aux; - const char *pnp; +ebusprint(void *aux, const char *pnp) { struct ebus_attach_args *ia = aux; @@ -105,16 +103,13 @@ aprint_normal(" addr 0x%x", ia->ia_paddr); - return (UNCONF); + return UNCONF; } void -ebus_intr_establish(dev, cookie, level, handler, arg) - struct device *dev; - void *cookie; - int level; - int (*handler) (void *, void *); - void *arg; +ebus_intr_establish(device_t dev, void *cookie, int level, +int (*handler)(void *, void *), void *arg) { + (*platform.intr_establish)(dev, cookie, level, handler, arg); } Index: src/sys/arch/emips/ebus/ebus_emips.c diff -u src/sys/arch/emips/ebus/ebus_emips.c:1.1 src/sys/arch/emips/ebus/ebus_emips.c:1.2 --- src/sys/arch/emips/ebus/ebus_emips.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/ebus_emips.c Sun Jun 12 03:52:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ebus_emips.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: ebus_emips.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ebus_emips.c,v 1.2 2011/06/12 03:52:13 tsutsui Exp $"); #include "opt_xilinx_ml40x.h" #include "opt_xs_bee3.h" @@ -48,8 +48,8 @@ #include #include -static int ebus_emips_match __P((struct device *, struct cfdata *, void *)); -static void ebus_emips_attach __P((struct device *, struct device *, void *)); +static int ebus_emips_match(device_t, cfdata_t, void *); +static void ebus_emips_attach(device_t, device_t, void *); CFATTACH_DECL(ebus_emips, sizeof(struct ebus_softc), ebus_emips_match, ebus_emips_attach, NULL, NULL); @@ -57,18 +57,18 @@ #if defined(XILINX_ML40x) || defined(XS_BEE3) struct ebus_attach_args ebus_emips_devs[] = { /* NAME
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: tsutsui Date: Sun Jun 12 03:29:34 UTC 2011 Modified Files: src/sys/arch/emips/ebus: flash_ebus.c icap_ebus.c Log Message: Fix printf formats in DEBUG case. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/ebus/flash_ebus.c \ src/sys/arch/emips/ebus/icap_ebus.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/emips/ebus/flash_ebus.c diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.1 src/sys/arch/emips/ebus/flash_ebus.c:1.2 --- src/sys/arch/emips/ebus/flash_ebus.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/flash_ebus.c Sun Jun 12 03:29:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -1209,7 +1209,7 @@ error = ioaccess((vaddr_t)sc->sc_sector, secstart + sc->sc_base, secsize); -DBGME(DEBUG_FUNCS,printf("%s: mapped %p %zx -> %lx %d\n", +DBGME(DEBUG_FUNCS,printf("%s: mapped %p %zx -> %zx %d\n", device_xname(sc->sc_dev), sc->sc_sector, secsize, secstart + sc->sc_base,error)); if (error) return error; @@ -1306,7 +1306,7 @@ /* Rest of code lifted with mods from the dev\ata\wd.c driver */ -/* $NetBSD: flash_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -1870,7 +1870,7 @@ struct eflash_softc *sc; int part, error; - DEBUG_PRINT(("eflashopen %zx\n", dev), DEBUG_FUNCS); + DEBUG_PRINT(("eflashopen %" PRIx64 "\n", dev), DEBUG_FUNCS); sc = device_lookup_private(&eflash_cd, EFLASHUNIT(dev)); if (sc == NULL) return (ENXIO); @@ -1945,7 +1945,7 @@ struct eflash_softc *sc = device_lookup_private(&eflash_cd, EFLASHUNIT(dev)); int part = EFLASHPART(dev); - DEBUG_PRINT(("eflashclose %zx\n", dev), DEBUG_FUNCS); + DEBUG_PRINT(("eflashclose %" PRIx64 "\n", dev), DEBUG_FUNCS); mutex_enter(&sc->sc_dk.dk_openlock); Index: src/sys/arch/emips/ebus/icap_ebus.c diff -u src/sys/arch/emips/ebus/icap_ebus.c:1.1 src/sys/arch/emips/ebus/icap_ebus.c:1.2 --- src/sys/arch/emips/ebus/icap_ebus.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/ebus/icap_ebus.c Sun Jun 12 03:29:33 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: icap_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: icap_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: icap_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icap_ebus.c,v 1.2 2011/06/12 03:29:33 tsutsui Exp $"); #include #include @@ -234,7 +234,7 @@ /* Do we know you. */ sc = device_lookup_private(&icap_cd, minor(bp->b_dev)); if (sc == NULL) { - DEBUG_PRINT(("icapstrategy: nodev %x\n",bp->b_dev), + DEBUG_PRINT(("icapstrategy: nodev %" PRIx64 "\n",bp->b_dev), DEBUG_ERRORS); bp->b_error = ENXIO; biodone(bp); @@ -335,7 +335,7 @@ /* Ship it */ -DEBUG_PRINT(("icapship %lx %d\n",phys,count), DEBUG_XFERS); +DEBUG_PRINT(("icapship %" PRIxPADDR " %d\n",phys,count), DEBUG_XFERS); sc->sc_dp->SizeAndFlags = fl | count; sc->sc_dp->BufferAddressHi32 = 0; /* BUGBUG 64bit */ sc->sc_dp->BufferAddressLo32 = phys; /* this pushes the fifo */
CVS commit: src/sys/arch/emips
Module Name:src Committed By: tsutsui Date: Sun Jun 12 03:21:21 UTC 2011 Modified Files: src/sys/arch/emips/emips: autoconf.c interrupt.c machdep.c mainbus.c src/sys/arch/emips/include: intr.h Log Message: No need to initialize interrupt evcnt(9) so earlier, so remove phase arg from intr_init() and initialize all stuff in cpu_configure(9) as other ports rather than in mach_init() and mbattach(). To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/emips/emips/autoconf.c \ src/sys/arch/emips/emips/machdep.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/interrupt.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/mainbus.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/intr.h 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/emips/emips/autoconf.c diff -u src/sys/arch/emips/emips/autoconf.c:1.4 src/sys/arch/emips/emips/autoconf.c:1.5 --- src/sys/arch/emips/emips/autoconf.c:1.4 Sun Jun 12 03:14:03 2011 +++ src/sys/arch/emips/emips/autoconf.c Sun Jun 12 03:21:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $"); #include #include @@ -64,6 +64,9 @@ /* Kick off autoconfiguration. */ (void)splhigh(); + /* Interrupt initialization. */ + intr_init(); + evcnt_attach_static(&emips_clock_evcnt); evcnt_attach_static(&emips_fpu_evcnt); evcnt_attach_static(&emips_memerr_evcnt); Index: src/sys/arch/emips/emips/machdep.c diff -u src/sys/arch/emips/emips/machdep.c:1.4 src/sys/arch/emips/emips/machdep.c:1.5 --- src/sys/arch/emips/emips/machdep.c:1.4 Tue Feb 22 08:20:20 2011 +++ src/sys/arch/emips/emips/machdep.c Sun Jun 12 03:21:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.4 2011/02/22 08:20:20 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.4 2011/02/22 08:20:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $"); #include "opt_ddb.h" @@ -288,9 +288,6 @@ /* Machine specific initialization. */ (*sysinit[systype].init)(); - /* Interrupt initialization, phase 0 */ - intr_init(0); - /* Find out how much memory is available. */ physmem = (*platform.memsize)(kernend); Index: src/sys/arch/emips/emips/interrupt.c diff -u src/sys/arch/emips/emips/interrupt.c:1.3 src/sys/arch/emips/emips/interrupt.c:1.4 --- src/sys/arch/emips/emips/interrupt.c:1.3 Thu Mar 10 17:22:51 2011 +++ src/sys/arch/emips/emips/interrupt.c Sun Jun 12 03:21:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $ */ +/* $NetBSD: interrupt.c,v 1.4 2011/06/12 03:21:21 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.4 2011/06/12 03:21:21 tsutsui Exp $"); #include #include @@ -67,33 +67,28 @@ }; void -intr_init(int phase) +intr_init(void) { int i; - if (phase == 0) { - for (i = 0; i < MAX_DEV_NCOOKIES; i++) { - evcnt_attach_dynamic(&intrtab[i].ih_count, - EVCNT_TYPE_INTR, NULL, "emips", intrnames[i]); - } - return; + for (i = 0; i < MAX_DEV_NCOOKIES; i++) { + evcnt_attach_dynamic(&intrtab[i].ih_count, + EVCNT_TYPE_INTR, NULL, "emips", intrnames[i]); } - if (phase == 1) { - /* I am trying to make this standard so its here. Bah. */ - struct tlbmask tlb; + /* I am trying to make this standard so its here. Bah. */ + struct tlbmask tlb; -/* This is ugly but efficient. Sigh. */ + /* This is ugly but efficient. Sigh. */ #define TheAic ((struct _Aic *)INTERRUPT_CONTROLLER_DEFAULT_ADDRESS) - tlb.tlb_hi = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS; - tlb.tlb_lo0 = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS | 0xf02; - tlb_write_indexed(4, &tlb); - - tlb.tlb_hi = TIMER_DEFAULT_ADDRESS; - tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02; - tlb_write_indexed(5, &tlb); - } + tlb.tlb_hi = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS; + tlb.tlb_lo0 = INTERRUPT_CONTROLLER_DEFAULT_ADDRESS | 0xf02; + tlb_write_indexed(4, &tlb); + + tlb.tlb_hi = TIMER_DEFAULT_ADDRESS; + tlb.tlb_lo0 = TIMER_DEFAULT_ADDRESS | 0xf02; + tlb_write_indexed(5, &tlb); } /* Index: src/sys/arch/emips/emips/mainbus.c diff -u src/sys/arch/emips/emips/mainbus.c:1.2 src/sys/arch/emips/emips/mainbus.c:1.3 --- src/sys/arch/emips/emips/mainbus.c:1.2 Sun Jun 5 17:03:16 2011 +++ src/sys/arch/emips/emips/mainbus.c
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Sun Jun 12 03:14:03 UTC 2011 Modified Files: src/sys/arch/emips/emips: autoconf.c Log Message: - misc KNF - use device_xname(), device_unit(), and device_class() To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/autoconf.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/emips/emips/autoconf.c diff -u src/sys/arch/emips/emips/autoconf.c:1.3 src/sys/arch/emips/emips/autoconf.c:1.4 --- src/sys/arch/emips/emips/autoconf.c:1.3 Tue Feb 22 08:20:20 2011 +++ src/sys/arch/emips/emips/autoconf.c Sun Jun 12 03:14:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.3 2011/02/22 08:20:20 matt Exp $ */ +/* $NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2011/02/22 08:20:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.4 2011/06/12 03:14:03 tsutsui Exp $"); #include #include @@ -60,6 +60,7 @@ void cpu_configure(void) { + /* Kick off autoconfiguration. */ (void)splhigh(); @@ -80,56 +81,63 @@ /* * Look at the string 'cp' and decode the boot device. * Boot names are something like '0/ace(0,0)/netbsd' or 'tftp()/nfsnetbsd' - * meaning: [BusNumber/]([, + * meaning: + * [BusNumber/]([, */ void makebootdev(char *cp) { -int i; -static char booted_controller_name[8]; + int i; + static char booted_controller_name[8]; booted_device = NULL; booted_bus = booted_unit = booted_partition = 0; booted_controller = NULL; -if (*cp >= '0' && *cp <= '9') { -booted_bus = *cp++ - '0'; -if (*cp == '/') cp++; -} + if (*cp >= '0' && *cp <= '9') { + booted_bus = *cp++ - '0'; + if (*cp == '/') + cp++; + } if (strncmp(cp, "tftp(", 5) == 0) { booted_controller = "BOOTP"; goto out; } -/* Stash away the controller name and use it later - */ -for (i = 0; i < 7 && *cp && *cp != '('; i++) -booted_controller_name[i] = *cp++; -booted_controller_name[7] = 0; /* sanity */ - -if (*cp == '(') cp++; -if (*cp >= '0' && *cp <= '9') -booted_unit = *cp++ - '0'; - -if (*cp == ',') cp++; -if (*cp >= '0' && *cp <= '9') -booted_partition = *cp - '0'; -booted_controller = booted_controller_name; + /* + * Stash away the controller name and use it later + */ + for (i = 0; i < 7 && *cp && *cp != '('; i++) + booted_controller_name[i] = *cp++; + booted_controller_name[7] = 0; /* sanity */ + + if (*cp == '(') + cp++; + if (*cp >= '0' && *cp <= '9') + booted_unit = *cp++ - '0'; + + if (*cp == ',') + cp++; + if (*cp >= '0' && *cp <= '9') + booted_partition = *cp - '0'; + booted_controller = booted_controller_name; out: #if DEBUG -printf("bootdev: %d/%s(%d,%d)\n",booted_bus,booted_controller,booted_unit,booted_partition); + printf("bootdev: %d/%s(%d,%d)\n", + booted_bus, booted_controller, booted_unit, booted_partition); #endif -return; + return; } void cpu_rootconf(void) { + printf("boot device: %s part%d\n", - booted_device ? booted_device->dv_xname : "", - booted_partition); + booted_device ? device_xname(booted_device) : "", + booted_partition); setroot(booted_device, booted_partition); } @@ -138,18 +146,18 @@ * Try to determine the boot device. */ void -device_register(struct device *dev, -void *aux) +device_register(device_t dev, void *aux) { static int found, initted, netboot; - static struct device *ebusdev; - struct device *parent = device_parent(dev); + static device_t ebusdev; + device_t parent = device_parent(dev); if (found) return; #if 0 -printf("\n[device_register(%s,%d) class %d]\n", dev->dv_xname, dev->dv_unit, dev->dv_class); + printf("\n[device_register(%s,%d) class %d]\n", + device_xname(dev), device_unit(dev), device_class(dev)); #endif if (!initted) { @@ -161,7 +169,7 @@ * Remember the EBUS */ if (device_is_a(dev, "ebus")) { -ebusdev = dev; + ebusdev = dev; return; } @@ -170,9 +178,9 @@ */ if (netboot) { -/* Only one Ethernet interface (on ebus). */ - if ((parent == ebusdev) - && device_is_a(dev, "enic")) { + /* Only one Ethernet interface (on ebus). */ + if ((parent == ebusdev) && + device_is_a(dev, "enic")) { booted_device = dev; found = 1; return; @@ -186,15 +194,15 @@ return; } -/* The NIC might be found after the disk, so bail out here */ -return; + /* The NIC might be found after the disk, so bail out here */ + return; } -/* BUGBUG How would I get to the bus */ -if (device_is_a(dev,booted_controller) && (dev->dv_unit == booted_unit)) { -booted_device = dev; -found = 1; -return; -} - + /* BUGBUG How would I g
CVS commit: src/sys/arch/emips/include
Module Name:src Committed By: tsutsui Date: Fri Mar 18 16:39:58 UTC 2011 Modified Files: src/sys/arch/emips/include: param.h Log Message: - include after MACHINE is defined - remove MACHINE_ARCH and MID_MACHINE that are defined in - remove redundant comment To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/param.h 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/emips/include/param.h diff -u src/sys/arch/emips/include/param.h:1.2 src/sys/arch/emips/include/param.h:1.3 --- src/sys/arch/emips/include/param.h:1.2 Tue Feb 8 20:20:11 2011 +++ src/sys/arch/emips/include/param.h Fri Mar 18 16:39:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.2 2011/02/08 20:20:11 rmind Exp $ */ +/* $NetBSD: param.h,v 1.3 2011/03/18 16:39:58 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -42,20 +42,13 @@ #define _EMIPS_PARAM_H_ /* - * Machine-dependent constants (VM, etc) common across MIPS cpus - */ - -#include - -/* * Machine dependent constants for mips-based DECstations. */ -#define _MACHINE_ARCH mipseb -#define MACHINE_ARCH "mipseb" #define _MACHINE emips #define MACHINE "emips" -#define MID_MACHINE MID_MIPS + +#include #define DEV_BSIZE 512 #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: pooka Date: Thu Mar 10 18:18:01 UTC 2011 Modified Files: src/sys/arch/emips/stand/common: start.S Log Message: Use NESTED_NOPROFILE instead of VECTOR, since VECTOR grew a .org directive for some reason. from sandrof (i didn't test booting, will wait for autobuild to do the work for me) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/stand/common/start.S 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/emips/stand/common/start.S diff -u src/sys/arch/emips/stand/common/start.S:1.1 src/sys/arch/emips/stand/common/start.S:1.2 --- src/sys/arch/emips/stand/common/start.S:1.1 Wed Jan 26 01:18:54 2011 +++ src/sys/arch/emips/stand/common/start.S Thu Mar 10 18:18:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: start.S,v 1.1 2011/01/26 01:18:54 pooka Exp $ */ +/* $NetBSD: start.S,v 1.2 2011/03/10 18:18:00 pooka Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -99,8 +99,7 @@ * But to test interrupts should be enough */ .org 0x0080 -VECTOR(ExceptionHandler,0) - .frame sp,SIZEOF_CXTINFO,$31 +NESTED_NOPROFILE(ExceptionHandler,SIZEOF_CXTINFO,$31) la k1, UserInterruptHandler lw k1,0(k1) bnek1,zero,Dispatch @@ -216,7 +215,7 @@ rfe .set at -VECTOR_END(ExceptionHandler) +END(ExceptionHandler) .org 0x0200 EXPORT(real_start)
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: tsutsui Date: Thu Mar 10 17:22:51 UTC 2011 Modified Files: src/sys/arch/emips/emips: interrupt.c Log Message: Set correct struct clockframe .intr value for hardclock(9). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/interrupt.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/emips/emips/interrupt.c diff -u src/sys/arch/emips/emips/interrupt.c:1.2 src/sys/arch/emips/emips/interrupt.c:1.3 --- src/sys/arch/emips/emips/interrupt.c:1.2 Tue Feb 22 08:20:20 2011 +++ src/sys/arch/emips/emips/interrupt.c Thu Mar 10 17:22:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: interrupt.c,v 1.2 2011/02/22 08:20:20 matt Exp $ */ +/* $NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.2 2011/02/22 08:20:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.3 2011/03/10 17:22:51 tsutsui Exp $"); #include #include @@ -127,6 +127,7 @@ cf.pc = pc; cf.sr = status; + cf.intr = (curcpu()->ci_idepth > 1); ipending = TheAic->IrqStatus;
CVS commit: src/sys/arch/emips
Module Name:src Committed By: matt Date: Tue Feb 22 08:20:20 UTC 2011 Modified Files: src/sys/arch/emips/conf: files.emips src/sys/arch/emips/emips: autoconf.c bus_dma.c cpu.c interrupt.c machdep.c xilinx_ml40x.c xs_bee3.c src/sys/arch/emips/include: intr.h sysconf.h Log Message: Bring emips forward to the new mips world order. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/conf/files.emips cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/autoconf.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/emips/bus_dma.c \ src/sys/arch/emips/emips/cpu.c src/sys/arch/emips/emips/interrupt.c \ src/sys/arch/emips/emips/xilinx_ml40x.c \ src/sys/arch/emips/emips/xs_bee3.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/emips/machdep.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/emips/include/intr.h \ src/sys/arch/emips/include/sysconf.h 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/emips/conf/files.emips diff -u src/sys/arch/emips/conf/files.emips:1.1 src/sys/arch/emips/conf/files.emips:1.2 --- src/sys/arch/emips/conf/files.emips:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/conf/files.emips Tue Feb 22 08:20:20 2011 @@ -1,4 +1,4 @@ -# $NetBSD: files.emips,v 1.1 2011/01/26 01:18:50 pooka Exp $ +# $NetBSD: files.emips,v 1.2 2011/02/22 08:20:20 matt Exp $ # eMIPS-specific configuration info # maxpartitions must be first item in files.${ARCH}. @@ -98,8 +98,6 @@ file common/bus_dma/bus_dmamem_common.c -file arch/mips/mips/softintr.c - # # Workstation console devices # Index: src/sys/arch/emips/emips/autoconf.c diff -u src/sys/arch/emips/emips/autoconf.c:1.2 src/sys/arch/emips/emips/autoconf.c:1.3 --- src/sys/arch/emips/emips/autoconf.c:1.2 Tue Feb 8 20:20:11 2011 +++ src/sys/arch/emips/emips/autoconf.c Tue Feb 22 08:20:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.2 2011/02/08 20:20:11 rmind Exp $ */ +/* $NetBSD: autoconf.c,v 1.3 2011/02/22 08:20:20 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2011/02/08 20:20:11 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2011/02/22 08:20:20 matt Exp $"); #include #include @@ -74,7 +74,7 @@ (*platform.bus_reset)(); /* Configuration is finished, turn on interrupts. */ - _splnone(); /* enable all source forcing SOFT_INTs cleared */ + spl0(); /* enable all source forcing SOFT_INTs cleared */ } /* Index: src/sys/arch/emips/emips/bus_dma.c diff -u src/sys/arch/emips/emips/bus_dma.c:1.1 src/sys/arch/emips/emips/bus_dma.c:1.2 --- src/sys/arch/emips/emips/bus_dma.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/emips/bus_dma.c Tue Feb 22 08:20:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: bus_dma.c,v 1.2 2011/02/22 08:20:20 matt Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.2 2011/02/22 08:20:20 matt Exp $"); #include "opt_cputype.h" @@ -470,7 +470,7 @@ * NOTE: Even though this is `wbinv_all', since the cache is * write-though, it just invalidates it. */ - if (len >= mips_pdcache_size) { + if (len >= mips_cache_info.mci_pdcache_size) { mips_dcache_wbinv_all(); return; } @@ -658,12 +658,10 @@ bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags) { - extern paddr_t avail_start, avail_end; /* XXX */ - return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary, segs, nsegs, rsegs, flags, - avail_start /*low*/, - avail_end - PAGE_SIZE /*high*/)); + mips_avail_start /*low*/, + mips_avail_end - PAGE_SIZE /*high*/)); } /* Index: src/sys/arch/emips/emips/cpu.c diff -u src/sys/arch/emips/emips/cpu.c:1.1 src/sys/arch/emips/emips/cpu.c:1.2 --- src/sys/arch/emips/emips/cpu.c:1.1 Wed Jan 26 01:18:50 2011 +++ src/sys/arch/emips/emips/cpu.c Tue Feb 22 08:20:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: cpu.c,v 1.2 2011/02/22 08:20:20 matt Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -28,7 +28,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.2 2011/02/22 08:20:20 matt Exp $"); + +#include "ioconf.h" #include #include @@ -38,18 +40,14 @@ #include -static int cpumatch __P((struct device *, struct cfdata *, void *)); -static void cpuattach __P((struct device *, struct device *, void *)); +static int cpumatch(device_t, cfdata_t, void *); +static void cpuattach(device_t, device_t, void *); -CFATTACH_DECL(cpu, sizeof (st
CVS commit: src/sys/arch/emips/emips
Module Name:src Committed By: matt Date: Sun Feb 20 08:01:10 UTC 2011 Modified Files: src/sys/arch/emips/emips: machdep.c Log Message: Deal with mips_vector_init changes To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/emips/machdep.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/emips/emips/machdep.c diff -u src/sys/arch/emips/emips/machdep.c:1.2 src/sys/arch/emips/emips/machdep.c:1.3 --- src/sys/arch/emips/emips/machdep.c:1.2 Tue Feb 8 20:20:11 2011 +++ src/sys/arch/emips/emips/machdep.c Sun Feb 20 08:01:10 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.2 2011/02/08 20:20:11 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.3 2011/02/20 08:01:10 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.2 2011/02/08 20:20:11 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.3 2011/02/20 08:01:10 matt Exp $"); #include "opt_ddb.h" @@ -254,7 +254,7 @@ * Initialize locore-function vector. * Clear out the I and D caches. */ - mips_vector_init(); + mips_vector_init(NULL, false); /* * We know the CPU type now. Initialize our DMA tags (might