diff --git a/sys/dev/tc/cfb.c b/sys/dev/tc/cfb.c index c46ef83b55a4..a7073a7d951d 100644 --- a/sys/dev/tc/cfb.c +++ b/sys/dev/tc/cfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: cfb.c,v 1.54 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: cfb.c,v 1.55 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.54 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.55 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -116,7 +116,6 @@ struct hwcursor64 { }; struct cfb_softc { - struct device sc_dev; vaddr_t sc_vaddr; size_t sc_size; struct rasops_info *sc_ri; @@ -137,10 +136,10 @@ struct cfb_softc { #define CX_BT459_OFFSET 0x200000 #define CX_OFFSET_IREQ 0x300000 /* Interrupt req. control */ -static int cfbmatch(struct device *, struct cfdata *, void *); -static void cfbattach(struct device *, struct device *, void *); +static int cfbmatch(device_t, cfdata_t, void *); +static void cfbattach(device_t, device_t, void *); -CFATTACH_DECL(cfb, sizeof(struct cfb_softc), +CFATTACH_DECL_NEW(cfb, sizeof(struct cfb_softc), cfbmatch, cfbattach, NULL, NULL); static void cfb_common_init(struct rasops_info *); @@ -234,7 +233,7 @@ static const u_int8_t shuffle[256] = { }; static int -cfbmatch(struct device *parent, struct cfdata *match, void *aux) +cfbmatch(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta = aux; @@ -245,7 +244,7 @@ cfbmatch(struct device *parent, struct cfdata *match, void *aux) } static void -cfbattach(struct device *parent, struct device *self, void *aux) +cfbattach(device_t parent, device_t self, void *aux) { struct cfb_softc *sc = device_private(self); struct tc_attach_args *ta = aux; diff --git a/sys/dev/tc/mfb.c b/sys/dev/tc/mfb.c index 4c0de1112217..f30d376c2672 100644 --- a/sys/dev/tc/mfb.c +++ b/sys/dev/tc/mfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: mfb.c,v 1.51 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: mfb.c,v 1.52 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.51 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.52 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -104,7 +104,6 @@ struct hwcursor64 { }; struct mfb_softc { - struct device sc_dev; vaddr_t sc_vaddr; size_t sc_size; struct rasops_info *sc_ri; @@ -124,10 +123,10 @@ struct mfb_softc { #define MX_BT431_OFFSET 0x180000 #define MX_IREQ_OFFSET 0x080000 /* Interrupt req. control */ -static int mfbmatch(struct device *, struct cfdata *, void *); -static void mfbattach(struct device *, struct device *, void *); +static int mfbmatch(device_t, cfdata_t, void *); +static void mfbattach(device_t, device_t, void *); -CFATTACH_DECL(mfb, sizeof(struct mfb_softc), +CFATTACH_DECL_NEW(mfb, sizeof(struct mfb_softc), mfbmatch, mfbattach, NULL, NULL); static void mfb_common_init(struct rasops_info *); @@ -212,7 +211,7 @@ static const u_int8_t flip[256] = { }; static int -mfbmatch(struct device *parent, struct cfdata *match, void *aux) +mfbmatch(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta = aux; @@ -223,7 +222,7 @@ mfbmatch(struct device *parent, struct cfdata *match, void *aux) } static void -mfbattach(struct device *parent, struct device *self, void *aux) +mfbattach(device_t parent, device_t self, void *aux) { struct mfb_softc *sc = device_private(self); struct tc_attach_args *ta = aux; diff --git a/sys/dev/tc/px.c b/sys/dev/tc/px.c index 6dd9c17e66d6..37d20850e04f 100644 --- a/sys/dev/tc/px.c +++ b/sys/dev/tc/px.c @@ -1,4 +1,4 @@ -/* $NetBSD: px.c,v 1.33 2008/04/28 20:23:58 martin Exp $ */ +/* $NetBSD: px.c,v 1.34 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.33 2008/04/28 20:23:58 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.34 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -103,16 +103,16 @@ static int px_pbuf_post(struct stic_info *, u_int32_t *); void px_cnattach(tc_addr_t); struct px_softc { - struct device px_dv; + device_t px_dev; struct stic_info *px_si; volatile u_int32_t *px_qpoll[PX_BUF_COUNT]; }; -CFATTACH_DECL(px, sizeof(struct px_softc), +CFATTACH_DECL_NEW(px, sizeof(struct px_softc), px_match, px_attach, NULL, NULL); static int -px_match(struct device *parent, struct cfdata *match, void *aux) +px_match(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta; @@ -122,7 +122,7 @@ px_match(struct device *parent, struct cfdata *match, void *aux) } static void -px_attach(struct device *parent, struct device *self, void *aux) +px_attach(device_t parent, device_t self, void *aux) { struct stic_info *si; struct tc_attach_args *ta; @@ -133,6 +133,8 @@ px_attach(struct device *parent, struct device *self, void *aux) px = device_private(self); ta = (struct tc_attach_args *)aux; + px->px_dev = self; + if (ta->ta_addr == stic_consinfo.si_slotbase) { si = &stic_consinfo; console = 1; @@ -261,7 +263,7 @@ px_intr(void *cookie) * Simply clear the flag and report the error. */ if ((state & STIC_INT_E) != 0) { - aprint_error_dev(&px->px_dv, "error intr, %x %x %x %x %x", + aprint_error_dev(px->px_dev, "error intr, %x %x %x %x %x", sr->sr_ipdvint, sr->sr_sticsr, sr->sr_buscsr, sr->sr_busadr, sr->sr_busdat); sr->sr_ipdvint = STIC_INT_E_WE | STIC_INT_E_EN; diff --git a/sys/dev/tc/pxg.c b/sys/dev/tc/pxg.c index 5c747ffe925d..c3996f00595e 100644 --- a/sys/dev/tc/pxg.c +++ b/sys/dev/tc/pxg.c @@ -1,4 +1,4 @@ -/* $NetBSD: pxg.c,v 1.29 2008/04/28 20:23:58 martin Exp $ */ +/* $NetBSD: pxg.c,v 1.30 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.29 2008/04/28 20:23:58 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.30 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -94,11 +94,10 @@ static int pxg_probe_sram(struct stic_info *); void pxg_cnattach(tc_addr_t); struct pxg_softc { - struct device pxg_dv; struct stic_info *pxg_si; }; -CFATTACH_DECL(pxg, sizeof(struct pxg_softc), +CFATTACH_DECL_NEW(pxg, sizeof(struct pxg_softc), pxg_match, pxg_attach, NULL, NULL); static const char *pxg_types[] = { @@ -110,7 +109,7 @@ static const char *pxg_types[] = { }; static int -pxg_match(struct device *parent, struct cfdata *match, void *aux) +pxg_match(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta; int i; @@ -125,7 +124,7 @@ pxg_match(struct device *parent, struct cfdata *match, void *aux) } static void -pxg_attach(struct device *parent, struct device *self, void *aux) +pxg_attach(device_t parent, device_t self, void *aux) { struct stic_info *si; struct tc_attach_args *ta; diff --git a/sys/dev/tc/sfb.c b/sys/dev/tc/sfb.c index ff8134ade9f4..49898f894702 100644 --- a/sys/dev/tc/sfb.c +++ b/sys/dev/tc/sfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: sfb.c,v 1.76 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: sfb.c,v 1.77 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.76 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.77 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -124,7 +124,6 @@ struct hwcursor64 { }; struct sfb_softc { - struct device sc_dev; vaddr_t sc_vaddr; size_t sc_size; struct rasops_info *sc_ri; @@ -140,10 +139,10 @@ struct sfb_softc { #define HX_MAGIC_X 368 #define HX_MAGIC_Y 38 -static int sfbmatch(struct device *, struct cfdata *, void *); -static void sfbattach(struct device *, struct device *, void *); +static int sfbmatch(device_t, cfdata_t, void *); +static void sfbattach(device_t, device_t, void *); -CFATTACH_DECL(sfb, sizeof(struct sfb_softc), +CFATTACH_DECL_NEW(sfb, sizeof(struct sfb_softc), sfbmatch, sfbattach, NULL, NULL); static void sfb_common_init(struct rasops_info *); @@ -247,7 +246,7 @@ static const u_int8_t shuffle[256] = { }; static int -sfbmatch(struct device *parent, struct cfdata *match, void *aux) +sfbmatch(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta = aux; @@ -257,7 +256,7 @@ sfbmatch(struct device *parent, struct cfdata *match, void *aux) } static void -sfbattach(struct device *parent, struct device *self, void *aux) +sfbattach(device_t parent, device_t self, void *aux) { struct sfb_softc *sc = device_private(self); struct tc_attach_args *ta = aux; diff --git a/sys/dev/tc/sfbplus.c b/sys/dev/tc/sfbplus.c index fea0c8594842..bcc46ecb5742 100644 --- a/sys/dev/tc/sfbplus.c +++ b/sys/dev/tc/sfbplus.c @@ -1,4 +1,4 @@ -/* $NetBSD: sfbplus.c,v 1.30 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: sfbplus.c,v 1.31 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -30,12 +30,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sfbplus.c,v 1.30 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sfbplus.c,v 1.31 2008/07/09 13:19:33 joerg Exp $"); #include #include #include #include +#include #include #include #include @@ -106,7 +107,6 @@ struct hwops { }; struct sfbp_softc { - struct device sc_dev; vaddr_t sc_vaddr; size_t sc_size; struct rasops_info *sc_ri; @@ -123,10 +123,10 @@ struct sfbp_softc { #define HX_MAGIC_X 368 #define HX_MAGIC_Y 38 -static int sfbpmatch(struct device *, struct cfdata *, void *); -static void sfbpattach(struct device *, struct device *, void *); +static int sfbpmatch(device_t, cfdata_t, void *); +static void sfbpattach(device_t, device_t, void *); -CFATTACH_DECL(sfbp, sizeof(struct sfbp_softc), +CFATTACH_DECL_NEW(sfbp, sizeof(struct sfbp_softc), sfbpmatch, sfbpattach, NULL, NULL); static void sfbp_common_init(struct rasops_info *); @@ -148,7 +148,7 @@ static const struct wsscreen_list sfb_screenlist = { sizeof(_sfb_scrlist) / sizeof(struct wsscreen_descr *), _sfb_scrlist }; -static int sfbioctl(void *, void *, u_long, void *, int, struct proc *); +static int sfbioctl(void *, void *, u_long, void *, int, struct lwp *); static paddr_t sfbmmap(void *, void *, off_t, int); static int sfb_alloc_screen(void *, const struct wsscreen_descr *, @@ -187,7 +187,6 @@ static void noplut(void *, struct hwcmap256 *); /* EXPORT */ int sfbp_cnattach(tc_addr_t); static int sfbpintr(void *); static void sfbp_cmap_init(struct sfbp_softc *); -static void sfbp_screenblank(struct sfbp_softc *, int); static int get_cmap(struct sfbp_softc *, struct wsdisplay_cmap *); static int set_cmap(struct sfbp_softc *, struct wsdisplay_cmap *); @@ -238,7 +237,7 @@ static const u_int8_t shuffle[256] = { }; static int -sfbpmatch(struct device *parent, struct cfdata *match, void *aux) +sfbpmatch(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta = aux; @@ -249,13 +248,13 @@ sfbpmatch(struct device *parent, struct cfdata *match, void *aux) } static void -sfbpattach(struct device *parent, struct device *self, void *aux) +sfbpattach(device_t parent, device_t self, void *aux) { struct sfbp_softc *sc = device_private(self); struct tc_attach_args *ta = aux; struct rasops_info *ri; struct wsemuldisplaydev_attach_args waa; - void *asic; + char *asic; int console; console = (ta->ta_addr == sfbp_consaddr); @@ -303,7 +302,7 @@ sfbpattach(struct device *parent, struct device *self, void *aux) tc_intr_establish(parent, ta->ta_cookie, IPL_TTY, sfbpintr, sc); - asic = (void *)ri->ri_hw + SFB_ASIC_OFFSET; + asic = (char *)ri->ri_hw + SFB_ASIC_OFFSET; *(u_int32_t *)(asic + SFB_ASIC_CLEAR_INTR) = 0; *(u_int32_t *)(asic + SFB_ASIC_ENABLE_INTR) = 1; @@ -337,10 +336,10 @@ sfbp_cmap_init(struct sfbp_softc *sc) static void sfbp_common_init(struct rasops_info *ri) { - void *base, *asic; + char *base, *asic; int i, depth, hsetup, vsetup, vbase, cookie; - base = (void *)ri->ri_hw; + base = ri->ri_hw; asic = base + SFB_ASIC_OFFSET; hsetup = *(u_int32_t *)(asic + SFB_ASIC_VIDEO_HSETUP); vsetup = *(u_int32_t *)(asic + SFB_ASIC_VIDEO_VSETUP); @@ -427,7 +426,7 @@ sfbp_common_init(struct rasops_info *ri) } static int -sfbioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct proc *p) +sfbioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l) { struct sfbp_softc *sc = v; struct rasops_info *ri = sc->sc_ri; @@ -501,7 +500,6 @@ sfbioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct proc *p) } return (0); } - } return (EPASSTHROUGH); } @@ -574,11 +572,11 @@ sfbpintr(void *arg) { #define cc (&sc->sc_cursor) struct sfbp_softc *sc = arg; - void *base, *asic; + char *base, *asic; u_int32_t sisr; int v; - base = (void *)sc->sc_ri->ri_hw; + base = sc->sc_ri->ri_hw; asic = base + SFB_ASIC_OFFSET; sisr = *((u_int32_t *)asic + TGA_REG_SISR); *(u_int32_t *)(asic + SFB_ASIC_CLEAR_INTR) = 0; @@ -836,7 +834,7 @@ set_curpos(struct sfbp_softc *sc, struct wsdisplay_curpos *curpos) static void bt459visible(void *hw, int on) { - hw += SFB_RAMDAC_OFFSET; + hw = (char *)hw + SFB_RAMDAC_OFFSET; SELECT(hw, BT459_IREG_CCR); REG(hw, bt_reg) = (on) ? 0xc0 : 0x00; tc_wmb(); @@ -858,7 +856,7 @@ bt459locate(void *hw, struct hwcursor64 *cc) x += cc->cc_magic.x; y += cc->cc_magic.y; - hw += SFB_RAMDAC_OFFSET; + hw = (char *)hw + SFB_RAMDAC_OFFSET; s = spltty(); SELECT(hw, BT459_IREG_CURSOR_X_LOW); @@ -877,7 +875,7 @@ sfbplocate(void *hw, struct hwcursor64 *cc) x = cc->cc_pos.x - cc->cc_hot.x; y = cc->cc_pos.y - cc->cc_hot.y; - hw += SFB_ASIC_OFFSET; + hw = (char *)hw + SFB_ASIC_OFFSET; *((u_int32_t *)hw + TGA_REG_CXYR) = ((y & 0xfff) << 12) | (x & 0xfff); tc_wmb(); } @@ -886,7 +884,7 @@ static void bt459color(void *hw, u_int8_t *cp) { - hw += SFB_RAMDAC_OFFSET; + hw = (char *)hw + SFB_RAMDAC_OFFSET; SELECT(hw, BT459_IREG_CCOLOR_2); REG(hw, bt_reg) = cp[1]; tc_wmb(); @@ -910,7 +908,7 @@ bt459shape(void *hw, struct wsdisplay_curpos *size, u_int64_t *image) u_int8_t u; int bcnt; - hw += SFB_RAMDAC_OFFSET; + hw = (char *)hw + SFB_RAMDAC_OFFSET; ip = (u_int8_t *)image; mp = (u_int8_t *)(image + CURSOR_MAX_SIZE); @@ -949,11 +947,11 @@ sfbpshape(void *hw, struct wsdisplay_curpos *size, u_int64_t *image) } static void -bt459setlut(void *hw, struct hwcmap265 *cm) +bt459setlut(void *hw, struct hwcmap256 *cm) { int index; - hw += SFB_RAMDAC_OFFSET; + hw = (char *)hw + SFB_RAMDAC_OFFSET; SELECT(hw, 0); for (index = 0; index < CMAP_SIZE; index++) { REG(hw, bt_cmap) = cm->r[index]; tc_wmb(); @@ -963,7 +961,7 @@ bt459setlut(void *hw, struct hwcmap265 *cm) } static void -noplut(void *hw, struct hwcmap265 *cm) +noplut(void *hw, struct hwcmap256 *cm) { } @@ -1052,7 +1050,7 @@ static void sfbp_putchar(void *id, int row, int col, u_int uc, long attr) { struct rasops_info *ri = id; - void *sfb, *p; + char *sfb, *p; int scanspan, height, width, align, x, y; u_int32_t lmask, rmask, glyph; u_int8_t *g; @@ -1071,7 +1069,7 @@ sfbp_putchar(void *id, int row, int col, u_int uc, long attr) width = ri->ri_font->fontwidth + align; lmask = SFBSTIPPLEALL1 << align; rmask = SFBSTIPPLEALL1 >> (-width & SFBSTIPPLEBITMASK); - sfb = (void *)ri->ri_hw + SFB_ASIC_OFFSET; + sfb = (char *)ri->ri_hw + SFB_ASIC_OFFSET; SFBMODE(sfb, MODE_OPAQUESTIPPLE); SFBPLANEMASK(sfb, ~0); @@ -1106,7 +1104,7 @@ static void sfbp_erasecols(void *id, int row, int startcol, int ncols, long attr) { struct rasops_info *ri = id; - void *sfb, *p; + char *sfb, *p; int scanspan, startx, height, width, align, w, y; u_int32_t lmask, rmask; @@ -1123,7 +1121,7 @@ sfbp_erasecols(void *id, int row, int startcol, int ncols, long attr) width = w + align; lmask = SFBSTIPPLEALL1 << align; rmask = SFBSTIPPLEALL1 >> (-width & SFBSTIPPLEBITMASK); - sfb = (void *)ri->ri_hw + SFB_ASIC_OFFSET; + sfb = (char *)ri->ri_hw + SFB_ASIC_OFFSET; SFBMODE(sfb, MODE_TRANSPARENTSTIPPLE); SFBPLANEMASK(sfb, ~0); @@ -1137,7 +1135,7 @@ sfbp_erasecols(void *id, int row, int startcol, int ncols, long attr) } } else { - void *q = p; + char *q = p; while (height > 0) { *(u_int32_t *)p = lmask; WRITE_MB(); @@ -1168,7 +1166,7 @@ static void sfbp_copyrows(void *id, int srcrow, int dstrow, int nrows) { struct rasops_info *ri = id; - void *sfb, *p; + char *sfb, *p; int scanspan, offset, srcy, height, width, align, w; u_int32_t lmask, rmask; @@ -1189,7 +1187,7 @@ sfbp_copyrows(void *id, int srcrow, int dstrow, int nrows) width = w + align; lmask = SFBCOPYALL1 << align; rmask = SFBCOPYALL1 >> (-width & SFBCOPYBITMASK); - sfb = (void *)ri->ri_hw + SFB_ASIC_OFFSET; + sfb = (char *)ri->ri_hw + SFB_ASIC_OFFSET; SFBMODE(sfb, MODE_COPY); SFBPLANEMASK(sfb, ~0); @@ -1198,7 +1196,7 @@ sfbp_copyrows(void *id, int srcrow, int dstrow, int nrows) /* never happens */; } else { - void *q = p; + char *q = p; while (height > 0) { *(u_int32_t *)p = lmask; *(u_int32_t *)(p + offset) = lmask; @@ -1295,7 +1293,7 @@ static void sfbp_eraserows(void *id, int startrow, int nrows, long attr) { struct rasops_info *ri = id; - void *sfb, *p; + char *sfb, *p; int scanspan, starty, height, width, align, w; u_int32_t lmask, rmask; @@ -1311,7 +1309,7 @@ sfbp_eraserows(void *id, int startrow, int nrows, long attr) width = w + align; lmask = SFBSTIPPLEALL1 << align; rmask = SFBSTIPPLEALL1 >> (-width & SFBSTIPPLEBITMASK); - sfb = (void *)ri->ri_hw + SFB_ASIC_OFFSET; + sfb = (char *)ri->ri_hw + SFB_ASIC_OFFSET; SFBMODE(sfb, MODE_TRANSPARENTSTIPPLE); SFBPLANEMASK(sfb, ~0); @@ -1320,7 +1318,7 @@ sfbp_eraserows(void *id, int startrow, int nrows, long attr) /* never happens */; } else { - void *q = p; + char *q = p; while (height > 0) { *(u_int32_t *)p = lmask; WRITE_MB(); diff --git a/sys/dev/tc/stic.c b/sys/dev/tc/stic.c index 3219b1ec9bd4..fa4875a776f4 100644 --- a/sys/dev/tc/stic.c +++ b/sys/dev/tc/stic.c @@ -1,4 +1,4 @@ -/* $NetBSD: stic.c,v 1.44 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: stic.c,v 1.45 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.44 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.45 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -399,7 +399,7 @@ stic_reset(struct stic_info *si) } void -stic_attach(struct device *self, struct stic_info *si, int console) +stic_attach(device_t self, struct stic_info *si, int console) { struct wsemuldisplaydev_attach_args waa; diff --git a/sys/dev/tc/sticvar.h b/sys/dev/tc/sticvar.h index f972bc45a42d..d6c82552c852 100644 --- a/sys/dev/tc/sticvar.h +++ b/sys/dev/tc/sticvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: sticvar.h,v 1.17 2008/04/28 20:23:58 martin Exp $ */ +/* $NetBSD: sticvar.h,v 1.18 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -124,7 +124,7 @@ struct stic_info { #define SI_DVOPEN 0x0010 void stic_init(struct stic_info *); -void stic_attach(struct device *, struct stic_info *, int); +void stic_attach(device_t, struct stic_info *, int); void stic_cnattach(struct stic_info *); void stic_reset(struct stic_info *); void stic_flush(struct stic_info *); diff --git a/sys/dev/tc/tcds.c b/sys/dev/tc/tcds.c index e96aae027770..4754ca6a61be 100644 --- a/sys/dev/tc/tcds.c +++ b/sys/dev/tc/tcds.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcds.c,v 1.22 2008/04/28 20:23:58 martin Exp $ */ +/* $NetBSD: tcds.c,v 1.23 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.22 2008/04/28 20:23:58 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.23 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -85,7 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.22 2008/04/28 20:23:58 martin Exp $"); #include "locators.h" struct tcds_softc { - struct device sc_dv; + device_t sc_dev; bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; bus_dma_tag_t sc_dmat; @@ -99,11 +99,11 @@ struct tcds_softc { #define TCDSF_FASTSCSI 0x02 /* supports Fast SCSI */ /* Definition of the driver for autoconfig. */ -static int tcdsmatch(struct device *, struct cfdata *, void *); -static void tcdsattach(struct device *, struct device *, void *); +static int tcdsmatch(device_t, cfdata_t, void *); +static void tcdsattach(device_t, device_t, void *); static int tcdsprint(void *, const char *); -CFATTACH_DECL(tcds, sizeof(struct tcds_softc), +CFATTACH_DECL_NEW(tcds, sizeof(struct tcds_softc), tcdsmatch, tcdsattach, NULL, NULL); /*static*/ int tcds_intr(void *); @@ -137,7 +137,7 @@ tcds_lookup(const char *modname) } static int -tcdsmatch(struct device *parent, struct cfdata *cfdata, void *aux) +tcdsmatch(device_t parent, cfdata_t cfdata, void *aux) { struct tc_attach_args *ta = aux; @@ -145,7 +145,7 @@ tcdsmatch(struct device *parent, struct cfdata *cfdata, void *aux) } static void -tcdsattach(struct device *parent, struct device *self, void *aux) +tcdsattach(device_t parent, device_t self, void *aux) { struct tcds_softc *sc = device_private(self); struct tc_attach_args *ta = aux; @@ -157,6 +157,8 @@ tcdsattach(struct device *parent, struct device *self, void *aux) const struct evcnt *pevcnt; int locs[TCDSCF_NLOCS]; + sc->sc_dev = self; + td = tcds_lookup(ta->ta_modname); if (td == NULL) panic("\ntcdsattach: impossible"); @@ -176,7 +178,7 @@ tcdsattach(struct device *parent, struct device *self, void *aux) */ if (bus_space_map(sc->sc_bst, ta->ta_addr, (TCDS_SCSI1_OFFSET + 0x100), 0, &sc->sc_bsh)) { - aprint_error_dev(&sc->sc_dv, "unable to map device\n"); + aprint_error_dev(self, "unable to map device\n"); return; } @@ -187,7 +189,7 @@ tcdsattach(struct device *parent, struct device *self, void *aux) 0x100, &sbsh[0]) || bus_space_subregion(sc->sc_bst, sc->sc_bsh, TCDS_SCSI1_OFFSET, 0x100, &sbsh[1])) { - aprint_error_dev(&sc->sc_dv, "unable to subregion SCSI chip space\n"); + aprint_error_dev(self, "unable to subregion SCSI chip space\n"); return; } @@ -225,7 +227,7 @@ tcdsattach(struct device *parent, struct device *self, void *aux) cp = slotc->sc_name; snprintf(cp, sizeof(slotc->sc_name), "chip %d", i); evcnt_attach_dynamic(&slotc->sc_evcnt, EVCNT_TYPE_INTR, - pevcnt, device_xname(&sc->sc_dv), cp); + pevcnt, device_xname(self), cp); slotc->sc_slot = i; slotc->sc_bst = sc->sc_bst; @@ -321,7 +323,7 @@ tcdsprint(void *aux, const char *pnp) } void -tcds_intr_establish(struct device *tcds, int slot, int (*func)(void *), +tcds_intr_establish(device_t tcds, int slot, int (*func)(void *), void *arg) { struct tcds_softc *sc = device_private(tcds); @@ -335,7 +337,7 @@ tcds_intr_establish(struct device *tcds, int slot, int (*func)(void *), } void -tcds_intr_disestablish(struct device *tcds, int slot) +tcds_intr_disestablish(device_t tcds, int slot) { struct tcds_softc *sc = device_private(tcds); @@ -476,7 +478,7 @@ tcds_intr(void *arg) */ #define PRINTINTR(msg, bits) \ if (ir & bits) \ - printf("%s: %s", device_xname(&sc->sc_dv), msg); + printf("%s: %s", device_xname(sc->sc_dev), msg); PRINTINTR("SCSI0 DREQ interrupt.\n", TCDS_CIR_SCSI0_DREQ); PRINTINTR("SCSI1 DREQ interrupt.\n", TCDS_CIR_SCSI1_DREQ); PRINTINTR("SCSI0 prefetch interrupt.\n", TCDS_CIR_SCSI0_PREFETCH); @@ -534,13 +536,13 @@ tcds_params(struct tcds_softc *sc, int chip, int *idp, int *fastp) if (id < 0 || id > 7) { printf("%s: WARNING: bad SCSI ID %d for chip %d, using 7\n", - device_xname(&sc->sc_dv), id, chip); + device_xname(sc->sc_dev), id, chip); id = 7; } if (fast) printf("%s: fast mode set for chip %d\n", - device_xname(&sc->sc_dv), chip); + device_xname(sc->sc_dev), chip); *idp = id; *fastp = fast; diff --git a/sys/dev/tc/tfb.c b/sys/dev/tc/tfb.c index 15ac08e5dd01..8610762ff2f2 100644 --- a/sys/dev/tc/tfb.c +++ b/sys/dev/tc/tfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: tfb.c,v 1.54 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: tfb.c,v 1.55 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.54 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.55 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -141,7 +141,6 @@ struct hwcursor64 { }; struct tfb_softc { - struct device sc_dev; vaddr_t sc_vaddr; size_t sc_size; struct rasops_info *sc_ri; @@ -175,10 +174,10 @@ struct tfb_softc { #define TX_CTL_SEG_ENA 0x10 #define TX_CTL_SEG 0x0f -static int tfbmatch(struct device *, struct cfdata *, void *); -static void tfbattach(struct device *, struct device *, void *); +static int tfbmatch(device_t, cfdata_t, void *); +static void tfbattach(device_t, device_t, void *); -CFATTACH_DECL(tfb, sizeof(struct tfb_softc), +CFATTACH_DECL_NEW(tfb, sizeof(struct tfb_softc), tfbmatch, tfbattach, NULL, NULL); static void tfb_common_init(struct rasops_info *); @@ -266,7 +265,7 @@ static const u_int8_t flip[256] = { }; static int -tfbmatch(struct device *parent, struct cfdata *match, void *aux) +tfbmatch(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta = aux; @@ -279,7 +278,7 @@ tfbmatch(struct device *parent, struct cfdata *match, void *aux) static void -tfbattach(struct device *parent, struct device *self, void *aux) +tfbattach(device_t parent, device_t self, void *aux) { struct tfb_softc *sc = device_private(self); struct tc_attach_args *ta = aux; diff --git a/sys/dev/tc/xcfb.c b/sys/dev/tc/xcfb.c index 45b4e1e5aa56..6b5079c8cd12 100644 --- a/sys/dev/tc/xcfb.c +++ b/sys/dev/tc/xcfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: xcfb.c,v 1.46 2008/05/26 10:31:22 nisimura Exp $ */ +/* $NetBSD: xcfb.c,v 1.47 2008/07/09 13:19:33 joerg Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.46 2008/05/26 10:31:22 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.47 2008/07/09 13:19:33 joerg Exp $"); #include #include @@ -82,7 +82,6 @@ struct hwcursor64 { #define IMS332_WLOW (IOASIC_SLOT_7_START + 0x20000) struct xcfb_softc { - struct device sc_dev; vaddr_t sc_vaddr; size_t sc_size; struct rasops_info *sc_ri; @@ -98,7 +97,7 @@ struct xcfb_softc { static int xcfbmatch(struct device *, struct cfdata *, void *); static void xcfbattach(struct device *, struct device *, void *); -CFATTACH_DECL(xcfb, sizeof(struct xcfb_softc), +CFATTACH_DECL_NEW(xcfb, sizeof(struct xcfb_softc), xcfbmatch, xcfbattach, NULL, NULL); static tc_addr_t xcfb_consaddr; @@ -202,7 +201,7 @@ static const u_int8_t shuffle[256] = { }; static int -xcfbmatch(struct device *parent, struct cfdata *match, void *aux) +xcfbmatch(device_t parent, cfdata_t match, void *aux) { struct tc_attach_args *ta = aux; @@ -213,7 +212,7 @@ xcfbmatch(struct device *parent, struct cfdata *match, void *aux) } static void -xcfbattach(struct device *parent, struct device *self, void *aux) +xcfbattach(device_t parent, device_t self, void *aux) { struct xcfb_softc *sc = device_private(self); struct tc_attach_args *ta = aux;