Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Change old-stlye-defintions to C89 prototypes.
details: https://anonhg.NetBSD.org/src/rev/da4cfa0dbd1e
branches: trunk
changeset: 773671:da4cfa0dbd1e
user: matt <matt%NetBSD.org@localhost>
date: Sun Feb 12 16:31:01 2012 +0000
description:
Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.
Approved by releng.
diffstat:
sys/arch/arm/xscale/becc_button.c | 30 ++++++++++++++++--------------
sys/arch/arm/xscale/i80321.c | 10 +++++-----
sys/arch/arm/xscale/i80321_aau.c | 24 +++++++++++++-----------
sys/arch/arm/xscale/i80321_icu.c | 18 +++++++++++++-----
sys/arch/arm/xscale/i80321_pci.c | 6 +++---
sys/arch/arm/xscale/i80321_wdog.c | 22 ++++++++++++----------
sys/arch/arm/xscale/i80321var.h | 5 +++--
sys/arch/arm/xscale/iopaau.c | 22 +++++++++++-----------
sys/arch/arm/xscale/iopaauvar.h | 4 ++--
sys/arch/evbarm/hdl_g/i80321_mainbus.c | 23 +++++++++++++----------
sys/arch/evbarm/iq80321/i80321_mainbus.c | 26 ++++++++++++++------------
sys/arch/evbarm/ixm1200/ixpcom_ixm.c | 23 +++++++++--------------
sys/arch/iyonix/iyonix/i80321_mainbus.c | 23 +++++++++++++----------
13 files changed, 127 insertions(+), 109 deletions(-)
diffs (truncated from 807 to 300 lines):
diff -r 64522e4eba64 -r da4cfa0dbd1e sys/arch/arm/xscale/becc_button.c
--- a/sys/arch/arm/xscale/becc_button.c Sun Feb 12 14:38:18 2012 +0000
+++ b/sys/arch/arm/xscale/becc_button.c Sun Feb 12 16:31:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: becc_button.c,v 1.3 2005/12/11 12:16:51 christos Exp $ */
+/* $NetBSD: becc_button.c,v 1.4 2012/02/12 16:31:01 matt Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc_button.c,v 1.3 2005/12/11 12:16:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc_button.c,v 1.4 2012/02/12 16:31:01 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -60,7 +60,7 @@
static int beccbut_attached; /* there can be only one */
struct beccbut_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct sysmon_pswitch sc_smpsw;
void *sc_ih;
};
@@ -82,44 +82,46 @@
rv = sysmon_task_queue_sched(0, beccbut_pressed_event, sc);
if (rv != 0)
printf("%s: WARNING: unable to queue button pressed "
- "callback: %d\n", sc->sc_dev.dv_xname, rv);
+ "callback: %d\n", device_xname(sc->sc_dev), rv);
return (1);
}
static int
-beccbut_match(struct device *parent, struct cfdata *match, void *aux)
+beccbut_match(device_t parent, cfdata_t match, void *aux)
{
return (beccbut_attached == 0);
}
static void
-beccbut_attach(struct device *parent, struct device *self, void *aux)
+beccbut_attach(device_t parent, device_t self, void *aux)
{
- struct beccbut_softc *sc = (void *) self;
+ struct beccbut_softc *sc = device_private(self);
- printf(": Reset button\n");
+ aprint_normal(": Reset button\n");
+ aprint_naive(": Reset button\n");
beccbut_attached = 1;
+ sc->sc_dev = self;
sysmon_task_queue_init();
- sc->sc_smpsw.smpsw_name = sc->sc_dev.dv_xname;
+ sc->sc_smpsw.smpsw_name = device_xname(sc->sc_dev);
sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_RESET;
if (sysmon_pswitch_register(&sc->sc_smpsw) != 0) {
- printf("%s: unable to register with sysmon\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(sc->sc_dev,
+ "unable to register with sysmon\n");
return;
}
sc->sc_ih = becc_intr_establish(ICU_PUSHBUTTON, IPL_TTY,
beccbut_intr, sc);
if (sc->sc_ih == NULL)
- printf("%s: unable to establish interrupt handler\n",
- sc->sc_dev.dv_xname);
+ aprint_error_dev(sc->sc_dev,
+ "unable to establish interrupt handler\n");
}
-CFATTACH_DECL(beccbut, sizeof(struct beccbut_softc),
+CFATTACH_DECL_NEW(beccbut, sizeof(struct beccbut_softc),
beccbut_match, beccbut_attach, NULL, NULL);
diff -r 64522e4eba64 -r da4cfa0dbd1e sys/arch/arm/xscale/i80321.c
--- a/sys/arch/arm/xscale/i80321.c Sun Feb 12 14:38:18 2012 +0000
+++ b/sys/arch/arm/xscale/i80321.c Sun Feb 12 16:31:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i80321.c,v 1.22 2011/07/01 20:32:51 dyoung Exp $ */
+/* $NetBSD: i80321.c,v 1.23 2012/02/12 16:31:01 matt Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321.c,v 1.22 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321.c,v 1.23 2012/02/12 16:31:01 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -110,7 +110,7 @@
if (bus_space_subregion(sc->sc_st, sc->sc_sh, VERDE_ATU_BASE,
VERDE_ATU_SIZE, &sc->sc_atu_sh))
panic("%s: unable to subregion ATU registers",
- sc->sc_dev.dv_xname);
+ device_xname(sc->sc_dev));
/* We expect the Memory Controller to be already sliced off. */
@@ -266,7 +266,7 @@
ia.ia_offset = id->id_offset;
ia.ia_size = id->id_size;
- (void) config_found_ia(&sc->sc_dev, "iopxs", &ia,
+ (void) config_found_ia(sc->sc_dev, "iopxs", &ia,
i80321_iopxs_print);
}
@@ -288,7 +288,7 @@
pba.pba_intrtag = 0;
pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
- (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
+ (void) config_found_ia(sc->sc_dev, "pcibus", &pba, pcibusprint);
}
/*
diff -r 64522e4eba64 -r da4cfa0dbd1e sys/arch/arm/xscale/i80321_aau.c
--- a/sys/arch/arm/xscale/i80321_aau.c Sun Feb 12 14:38:18 2012 +0000
+++ b/sys/arch/arm/xscale/i80321_aau.c Sun Feb 12 16:31:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i80321_aau.c,v 1.14 2009/01/05 04:39:32 briggs Exp $ */
+/* $NetBSD: i80321_aau.c,v 1.15 2012/02/12 16:31:01 matt Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321_aau.c,v 1.14 2009/01/05 04:39:32 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_aau.c,v 1.15 2012/02/12 16:31:01 matt Exp $");
#include <sys/param.h>
#include <sys/pool.h>
@@ -139,7 +139,7 @@
#define AAU321_ALGDESC_COUNT __arraycount(aau321_algdescs)
static int
-aau321_match(struct device *parent, struct cfdata *match, void *aux)
+aau321_match(device_t parent, cfdata_t match, void *aux)
{
struct iopxs_attach_args *ia = aux;
@@ -150,22 +150,24 @@
}
static void
-aau321_attach(struct device *parent, struct device *self, void *aux)
+aau321_attach(device_t parent, device_t self, void *aux)
{
- struct aau321_softc *sc321 = (void *) self;
+ struct aau321_softc *sc321 = device_private(self);
struct iopaau_softc *sc = &sc321->sc_iopaau;
struct iopxs_attach_args *ia = aux;
+ const char *xname = device_xname(self);
int error;
aprint_naive("\n");
aprint_normal("\n");
+ sc->sc_dev = self;
sc->sc_st = ia->ia_st;
error = bus_space_subregion(sc->sc_st, ia->ia_sh,
ia->ia_offset, ia->ia_size, &sc->sc_sh);
if (error) {
aprint_error("%s: unable to subregion registers, error = %d\n",
- sc->sc_dev.dv_xname, error);
+ xname, error);
return;
}
@@ -175,7 +177,7 @@
iopaau_intr, sc);
if (sc321->sc_error_ih == NULL) {
aprint_error("%s: unable to register error interrupt handler\n",
- sc->sc_dev.dv_xname);
+ xname);
return;
}
@@ -183,7 +185,7 @@
iopaau_intr, sc);
if (sc321->sc_eoc_ih == NULL) {
aprint_error("%s: unable to register EOC interrupt handler\n",
- sc->sc_dev.dv_xname);
+ xname);
return;
}
@@ -191,11 +193,11 @@
iopaau_intr, sc);
if (sc321->sc_eoc_ih == NULL) {
aprint_error("%s: unable to register EOT interrupt handler\n",
- sc->sc_dev.dv_xname);
+ xname);
return;
}
- sc->sc_dmb.dmb_name = sc->sc_dev.dv_xname;
+ sc->sc_dmb.dmb_name = xname;
sc->sc_dmb.dmb_speed = 1638400; /* XXX */
sc->sc_dmb.dmb_cookie = sc;
sc->sc_dmb.dmb_algdescs = aau321_algdescs;
@@ -217,5 +219,5 @@
aau321_func_xor_5_8.af_desc_cache = iopaau_desc_8_cache;
}
-CFATTACH_DECL(iopaau, sizeof(struct aau321_softc),
+CFATTACH_DECL_NEW(iopaau, sizeof(struct aau321_softc),
aau321_match, aau321_attach, NULL, NULL);
diff -r 64522e4eba64 -r da4cfa0dbd1e sys/arch/arm/xscale/i80321_icu.c
--- a/sys/arch/arm/xscale/i80321_icu.c Sun Feb 12 14:38:18 2012 +0000
+++ b/sys/arch/arm/xscale/i80321_icu.c Sun Feb 12 16:31:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i80321_icu.c,v 1.22 2011/07/01 20:32:51 dyoung Exp $ */
+/* $NetBSD: i80321_icu.c,v 1.23 2012/02/12 16:31:01 matt Exp $ */
/*
* Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.22 2011/07/01 20:32:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.23 2012/02/12 16:31:01 matt Exp $");
#ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE
@@ -280,9 +280,6 @@
for (i = 0; i < NIRQ; i++) {
iq = &intrq[i];
TAILQ_INIT(&iq->iq_list);
-
- evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
- NULL, "iop321", i80321_irqnames[i]);
}
i80321_intr_calculate_masks();
@@ -291,6 +288,17 @@
enable_interrupts(I32_bit);
}
+void
+i80321_intr_evcnt_attach(void)
+{
+ for (u_int i = 0; i < NIRQ; i++) {
+ struct intrq *iq = &intrq[i];
+ evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
+ NULL, "iop321", i80321_irqnames[i]);
+ }
+
+}
+
void *
i80321_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
{
diff -r 64522e4eba64 -r da4cfa0dbd1e sys/arch/arm/xscale/i80321_pci.c
--- a/sys/arch/arm/xscale/i80321_pci.c Sun Feb 12 14:38:18 2012 +0000
+++ b/sys/arch/arm/xscale/i80321_pci.c Sun Feb 12 16:31:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i80321_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $ */
+/* $NetBSD: i80321_pci.c,v 1.12 2012/02/12 16:31:01 matt Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_pci.c,v 1.12 2012/02/12 16:31:01 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -122,7 +122,7 @@
NULL, 0, EX_NOWAIT);
#endif
- aprint_normal("%s: configuring PCI bus\n", sc->sc_dev.dv_xname);
+ aprint_normal_dev(sc->sc_dev, "configuring PCI bus\n");
pci_configure_bus(pc, ioext, memext, NULL, busno, arm_dcache_align);
extent_destroy(ioext);
diff -r 64522e4eba64 -r da4cfa0dbd1e sys/arch/arm/xscale/i80321_wdog.c
--- a/sys/arch/arm/xscale/i80321_wdog.c Sun Feb 12 14:38:18 2012 +0000
+++ b/sys/arch/arm/xscale/i80321_wdog.c Sun Feb 12 16:31:01 2012 +0000
Home |
Main Index |
Thread Index |
Old Index