tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

4byte aligned com(4) and PCI_MAPREG_TYPE_MEM



Hello, all.

 I'm now working to support Intel Quark X1000.
This chip's internal com is MMIO(PCI_MAPREG_TYPE_MEM).
Our com and puc don't support such type of device, yet.
To solve the problem, I wrote a patch.

 Registers of Quark X1000's com are 4byte aligned.
Some other machines have such type of device, so
I modified COM_INIT_REGS() macro to support both
byte aligned and 4byte aligned. This change reduce
special modifications done in atheros, rmi and
marvell drivers.

 One of problem is serial console on i386 and amd64.
These archs calls consinit() three times. The function
is called in the following order:

        1) machdep.c::init386() or init_x86_64()
        2) init_main.c::main()
        *) (call uvm_init())
        *) (call extent_init())
        3) machdep.c::cpu_startup()

When consinit() called in init386(), it calls

  comcnattach()
    ->comcnattach1()
      ->comcninit()
        -> bus_space_map() with x86_bus_space_mem tag.
          ->bus_space_reservation_map()
            ->x86_mem_add_mapping()
              ->uvm_km_alloc()
                panic in KASSERT(vm_map_pmap(map) == pmap_kernel());

What should I do?
One of the solution is to check whether extent_init() was called
or not. There is no easy way to know it, so I added a global
variable "extent_initted". Is it acceptable?

Index: kern/subr_extent.c
===================================================================
RCS file: /cvsroot/src/sys/kern/subr_extent.c,v
retrieving revision 1.75
diff -u -p -r1.75 subr_extent.c
--- kern/subr_extent.c  29 Jan 2012 11:14:49 -0000      1.75
+++ kern/subr_extent.c  9 Feb 2014 17:43:25 -0000
@@ -93,6 +93,7 @@ panic(a)                      printf(a)
 #endif

 static struct pool expool;
+int extent_initted;

 /*
  * Macro to align to an arbitrary power-of-two boundary.
@@ -113,6 +114,7 @@ extent_init(void)
 #else
        expool.pr_size = sizeof(struct extent_region);
 #endif
+       extent_initted = 1;
 }

 /*
Index: sys/extent.h
===================================================================
RCS file: /cvsroot/src/sys/sys/extent.h,v
retrieving revision 1.19
diff -u -p -r1.19 extent.h
--- sys/extent.h        27 Jan 2012 18:53:10 -0000      1.19
+++ sys/extent.h        9 Feb 2014 17:43:26 -0000
@@ -109,7 +109,7 @@ int extent_alloc(struct extent *, u_long
 int    extent_free(struct extent *, u_long, u_long, int);
 void   extent_print(struct extent *);
 void   extent_init(void);
-
+extern int extent_initted;
 #endif /* _KERNEL || _EXTENT_TESTING */

 #endif /* ! _SYS_EXTENT_H_ */
Index: arch/x86/x86/consinit.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/consinit.c,v
retrieving revision 1.26
diff -u -p -r1.26 consinit.c
--- arch/x86/x86/consinit.c     26 Jan 2014 15:49:25 -0000      1.26
+++ arch/x86/x86/consinit.c     9 Feb 2014 17:43:23 -0000
@@ -35,6 +35,7 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
+#include <sys/extent.h>
 #include <sys/bus.h>
 #include <machine/bootinfo.h>
 #include <arch/x86/include/genfb_machdep.h>
@@ -211,12 +212,22 @@ dokbd:
        if (!strcmp(consinfo->devname, "com")) {
                int addr = consinfo->addr;
                int speed = consinfo->speed;
+               int ismmio = 0;
+               bus_space_tag_t tag;

 #if (NCOM_PUC > 0) && defined(PUC_CNAUTO)
-               puc_cnprobe(NULL);
-               rv = puc_cninit(NULL);
-               if (rv == 0)
-                       return;
+               rv = puc_cnprobe(NULL, &ismmio);
+               if (rv > 0) {
+                       if ((ismmio != 0) && (extent_initted == 0)) {
+                               initted = 0;
+                               return;
+                       }
+                       rv = puc_cninit(NULL);
+                       if (rv == 0) {
+                               initted = 0;
+                               return;
+                       }
+               }
 #endif

                if (addr == 0)
@@ -224,8 +235,12 @@ dokbd:
                if (speed == 0)
                        speed = CONSPEED;

-               rv = comcnattach(x86_bus_space_io, addr, speed,
-                                COM_FREQ, COM_TYPE_NORMAL, comcnmode);
+               if (ismmio)
+                       tag = x86_bus_space_mem;
+               else
+                       tag = x86_bus_space_io;
+               rv = comcnattach(tag, addr, speed, COM_FREQ, sizeof(uint8_t),
+                   COM_TYPE_NORMAL, comcnmode);
                if (rv != 0)
                        panic("can't init serial console @%x", consinfo->addr);
                return;
@@ -241,7 +256,7 @@ kgdb_port_init(void)
 #if (NCOM > 0)
        if(!strcmp(kgdb_devname, "com")) {
                com_kgdb_attach(x86_bus_space_io, comkgdbaddr, comkgdbrate,
-                   COM_FREQ, COM_TYPE_NORMAL, comkgdbmode);
+                   COM_FREQ, sizeof(uint8_t), COM_TYPE_NORMAL, comkgdbmode);
        }
 #endif
 }
Index: dev/ic/comvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/comvar.h,v
retrieving revision 1.78
diff -u -p -r1.78 comvar.h
--- dev/ic/comvar.h     3 Oct 2013 13:23:03 -0000       1.78
+++ dev/ic/comvar.h     9 Feb 2014 17:43:24 -0000
@@ -44,16 +44,17 @@
 #include <sys/timepps.h>
 #include <sys/mutex.h>
 #include <sys/device.h>
+#include <machine/endian.h>

 #include <dev/ic/comreg.h>     /* for COM_NPORTS */

 struct com_regs;

-int comcnattach(bus_space_tag_t, bus_addr_t, int, int, int, tcflag_t);
+int comcnattach(bus_space_tag_t, bus_addr_t, int, int, int, int, tcflag_t);
 int comcnattach1(struct com_regs *, int, int, int, tcflag_t);

 #ifdef KGDB
-int com_kgdb_attach(bus_space_tag_t, bus_addr_t, int, int, int, tcflag_t);
+int com_kgdb_attach(bus_space_tag_t, bus_addr_t, int, int, int, int, tcflag_t);
 int com_kgdb_attach1(struct com_regs *, int, int, int, tcflag_t);
 #endif

@@ -76,7 +77,7 @@ int com_is_console(bus_space_tag_t, bus_
 #define        COM_RING_SIZE   2048
 #endif

-#ifdef COM_REGMAP
+#ifndef        COM_NO_REGMAP
 #define        COM_REG_RXDATA          0
 #define        COM_REG_TXDATA          1
 #define        COM_REG_DLBL            2
@@ -101,6 +102,8 @@ struct com_regs {
        bus_space_handle_t      cr_ioh;
        bus_addr_t              cr_iobase;
        bus_size_t              cr_nports;
+       uint32_t                cr_flags;
+#define COM_REGS_ALIGN4        0x01    
 #ifdef COM_16750
        bus_size_t              cr_map[32];
 #else
@@ -114,16 +117,25 @@ extern const bus_size_t com_std_map[32];
 extern const bus_size_t com_std_map[16];
 #endif

-#define        COM_INIT_REGS(regs, tag, hdl, addr)                             
\
+#if BYTE_ORDER == BIG_ENDIAN
+#define COM_INIT_REGS_OFFSET 3
+#else
+#define COM_INIT_REGS_OFFSET 0
+#endif
+
+#define        COM_INIT_REGS(regs, tag, hdl, addr, align)                      
\
        do {                                                            \
+               memset(&regs, 0, sizeof(regs));                         \
                regs.cr_iot = tag;                                      \
                regs.cr_ioh = hdl;                                      \
                regs.cr_iobase = addr;                                  \
-               regs.cr_nports = COM_NPORTS;                            \
-               memcpy(regs.cr_map, com_std_map, sizeof (regs.cr_map)); \
+               regs.cr_nports = COM_NPORTS * (align);                  \
+               for (int i = 0; i < __arraycount(regs.cr_map); i++)     \
+                       regs.cr_map[i] = com_std_map[i] * (align)       \
+                           + COM_INIT_REGS_OFFSET;                     \
        } while (0)

-#else
+#else /* COM_NO_REGMAP */
 #define        COM_REG_RXDATA          com_data
 #define        COM_REG_TXDATA          com_data
 #define        COM_REG_DLBL            com_dlbl
@@ -150,15 +162,15 @@ struct com_regs {
        bus_size_t              cr_nports;
 };

-#define        COM_INIT_REGS(regs, tag, hdl, addr)             \
+#define        COM_INIT_REGS(regs, tag, hdl, addr, align)      \
        do {                                            \
                regs.cr_iot = tag;                      \
                regs.cr_ioh = hdl;                      \
                regs.cr_iobase = addr;                  \
-               regs.cr_nports = COM_NPORTS;            \
+               regs.cr_nports = COM_NPORTS);           \
        } while (0)

-#endif
+#endif /* COM_NO_REGMAP */

 struct comcons_info {
        struct com_regs regs;
@@ -251,7 +263,7 @@ struct com_softc {
        kmutex_t                sc_lock;
 };

-int comprobe1(bus_space_tag_t, bus_space_handle_t);
+int comprobe1(bus_space_tag_t, bus_space_handle_t, int);
 int comintr(void *);
 void com_attach_subr(struct com_softc *);
 int com_probe_subr(struct com_regs *);
Index: dev/ic/com.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/com.c,v
retrieving revision 1.322
diff -u -p -r1.322 com.c
--- dev/ic/com.c        22 Dec 2013 18:20:46 -0000      1.322
+++ dev/ic/com.c        9 Feb 2014 17:43:24 -0000
@@ -130,7 +130,7 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.32
 #define        com_lcr com_cfcr
 #include <dev/cons.h>

-#ifdef COM_REGMAP
+#ifndef        COM_NO_REGMAP
 #define        CSR_WRITE_1(r, o, v)    \
        bus_space_write_1((r)->cr_iot, (r)->cr_ioh, (r)->cr_map[o], v)
 #define        CSR_READ_1(r, o)        \
@@ -141,7 +141,7 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.32
        bus_space_read_2((r)->cr_iot, (r)->cr_ioh, (r)->cr_map[o])
 #define        CSR_WRITE_MULTI(r, o, p, n)     \
        bus_space_write_multi_1((r)->cr_iot, (r)->cr_ioh, (r)->cr_map[o], p, n)
-#else
+#else /* COM_NO_REGMAP */
 #define        CSR_WRITE_1(r, o, v)    \
        bus_space_write_1((r)->cr_iot, (r)->cr_ioh, o, v)
 #define        CSR_READ_1(r, o)        \
@@ -152,7 +152,7 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.32
        bus_space_read_2((r)->cr_iot, (r)->cr_ioh, o)
 #define        CSR_WRITE_MULTI(r, o, p, n)     \
        bus_space_write_multi_1((r)->cr_iot, (r)->cr_ioh, o, p, n)
-#endif
+#endif /* COM_NO_REGMAP */


 static void com_enable_debugport(struct com_softc *);
@@ -242,7 +242,7 @@ int com_kgdb_getc(void *);
 void   com_kgdb_putc(void *, int);
 #endif /* KGDB */

-#ifdef COM_REGMAP
+#ifndef COM_NO_REGMAP
 /* initializer for typical 16550-ish hardware */
 #define        COM_REG_16550   { \
        com_data, com_data, com_dlbl, com_dlbh, com_ier, com_iir, com_fifo, \
@@ -258,7 +258,7 @@ const bus_size_t com_std_map[32] = COM_R
 #else
 const bus_size_t com_std_map[16] = COM_REG_16550;
 #endif /* COM_16750 */
-#endif /* COM_REGMAP */
+#endif /* COM_NO_REGMAP */

 #define        COMUNIT_MASK    0x7ffff
 #define        COMDIALOUT_MASK 0x80000
@@ -350,15 +350,11 @@ com_probe_subr(struct com_regs *regs)
 }

 int
-comprobe1(bus_space_tag_t iot, bus_space_handle_t ioh)
+comprobe1(bus_space_tag_t iot, bus_space_handle_t ioh, int align)
 {
        struct com_regs regs;

-       regs.cr_iot = iot;
-       regs.cr_ioh = ioh;
-#ifdef COM_REGMAP
-       memcpy(regs.cr_map, com_std_map, sizeof (regs.cr_map));
-#endif
+       COM_INIT_REGS(regs, iot, ioh, (bus_size_t)0, align);

        return com_probe_subr(&regs);
 }
@@ -2365,17 +2361,11 @@ comcnattach1(struct com_regs *regsp, int

 int
 comcnattach(bus_space_tag_t iot, bus_addr_t iobase, int rate, int frequency,
-    int type, tcflag_t cflag)
+    int align, int type, tcflag_t cflag)
 {
        struct com_regs regs;

-       memset(&regs, 0, sizeof regs);
-       regs.cr_iot = iot;
-       regs.cr_iobase = iobase;
-       regs.cr_nports = COM_NPORTS;
-#ifdef COM_REGMAP
-       memcpy(regs.cr_map, com_std_map, sizeof (regs.cr_map));
-#endif
+       COM_INIT_REGS(regs, iot, (bus_space_handle_t)0, iobase, align);

        return comcnattach1(&regs, rate, frequency, type, cflag);
 }
@@ -2448,16 +2438,11 @@ com_kgdb_attach1(struct com_regs *regsp,

 int
 com_kgdb_attach(bus_space_tag_t iot, bus_addr_t iobase, int rate,
-    int frequency, int type, tcflag_t cflag)
+    int frequency, int align, int type, tcflag_t cflag)
 {
        struct com_regs regs;

-       regs.cr_iot = iot;
-       regs.cr_nports = COM_NPORTS;
-       regs.cr_iobase = iobase;
-#ifdef COM_REGMAP
-       memcpy(regs.cr_map, com_std_map, sizeof (regs.cr_map));
-#endif
+       COM_INIT_REGS(regs, iot, (bus_space_handle_t)0, iobase, align);

        return com_kgdb_attach1(&regs, rate, frequency, type, cflag);
 }
Index: dev/pci/com_puc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/com_puc.c,v
retrieving revision 1.21
diff -u -p -r1.21 com_puc.c
--- dev/pci/com_puc.c   31 Jul 2013 14:31:01 -0000      1.21
+++ dev/pci/com_puc.c   9 Feb 2014 17:43:24 -0000
@@ -71,6 +71,11 @@ com_puc_probe(device_t parent, cfdata_t
        if (aa->type != PUC_PORT_TYPE_COM)
                return (0);

+#ifdef COM_NO_REGMAP
+       if ((aa->flags & PUC_COM_ALIGN4) != 0)
+               return (0);
+#endif
+
        return (1);
 }

@@ -81,13 +86,16 @@ com_puc_attach(device_t parent, device_t
        struct com_softc *sc = &psc->sc_com;
        struct puc_attach_args *aa = aux;
        const char *intrstr;
+       int align;

        sc->sc_dev = self;

        aprint_naive(": Serial port");
        aprint_normal(": ");

-       COM_INIT_REGS(sc->sc_regs, aa->t, aa->h, aa->a);
+       align = ((aa->flags & PUC_COM_ALIGN4) != 0) ? 4 : 1;
+
+       COM_INIT_REGS(sc->sc_regs, aa->t, aa->h, aa->a, align);
        sc->sc_frequency = aa->flags & PUC_COM_CLOCKMASK;

        intrstr = pci_intr_string(aa->pc, aa->intrhandle);
Index: dev/pci/puc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/puc.c,v
retrieving revision 1.37
diff -u -p -r1.37 puc.c
--- dev/pci/puc.c       7 Feb 2014 11:51:00 -0000       1.37
+++ dev/pci/puc.c       9 Feb 2014 17:43:24 -0000
@@ -206,8 +206,13 @@ puc_attach(device_t parent, device_t sel
                    &sc->sc_bar_mappings[i].t, &sc->sc_bar_mappings[i].h,
                    &sc->sc_bar_mappings[i].a, &sc->sc_bar_mappings[i].s)
                      == 0);
-               if (sc->sc_bar_mappings[i].mapped)
+               if (sc->sc_bar_mappings[i].mapped) {
+                 if (type == PCI_MAPREG_TYPE_IO)
+                   aprint_normal_dev(self, "I/O\n");
+                 else
+                   aprint_normal_dev(self, "MEM\n");
                        continue;
+               }

                aprint_debug_dev(self, "couldn't map BAR at offset 0x%lx\n",
                    (long)(PCI_MAPREG_START + 4 * i));
Index: dev/pci/puccn.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/puccn.c,v
retrieving revision 1.13
diff -u -p -r1.13 puccn.c
--- dev/pci/puccn.c     26 Jan 2014 10:54:24 -0000      1.13
+++ dev/pci/puccn.c     9 Feb 2014 17:43:24 -0000
@@ -44,6 +44,7 @@
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD: puccn.c,v 1.13 2014/01/26 10:54:24 msaitoh Exp $");

+#include "opt_com.h"
 #include "opt_kgdb.h"

 #include <sys/param.h>
@@ -86,8 +87,9 @@ static bus_addr_t pucgdbbase;
  * resuming the search where it left off, never retrying the same adaptor.
  */

+#include <machine/pio.h>
 static bus_addr_t
-pucprobe_doit(struct consdev *cn)
+pucprobe_doit(struct consdev *cn, int *ismmiop)
 {
        struct pci_attach_args pa;
        int bus;
@@ -175,13 +177,11 @@ resume_scan:
                if (PCI_MAPREG_TYPE(base) == PCI_MAPREG_TYPE_IO) {
                        puctag = pa.pa_iot;
                        base = PCI_MAPREG_IO_ADDR(base);
-               }
-#if 0 /* For MMIO device */
-               else {
+               } else {
+                       /* PCI_MAPREG_TYPE_MEM */
                        puctag = pa.pa_memt;
                        base = PCI_MAPREG_MEM_ADDR(base);
                }
-#endif

                if (com_is_console(puctag, base, NULL))
                        continue;
@@ -200,37 +200,47 @@ resume_scan:
        if (cn)
                cn->cn_pri = CN_REMOTE;
 #endif
+
+       if (puctag == pa.pa_memt)
+               *ismmiop = 1;
+
        return base;
 }

 #ifdef KGDB
-void comgdbprobe(struct consdev *);
-void comgdbinit(struct consdev *);
+void puc_gdbprobe(struct consdev *, int *);
+void puc_gdbinit(struct consdev *);

 void
-comgdbprobe(struct consdev *cn)
+puc_gdbprobe(struct consdev *cn, int *ismmiop)
 {

-       pucgdbbase = pucprobe_doit(cn);
+       pucgdbbase = pucprobe_doit(cn, ismmiop);
 }

 void
-comgdbinit(struct consdev *cn)
+puc_gdbinit(struct consdev *cn)
 {

        if (pucgdbbase == 0)
                return;

-       com_kgdb_attach(puctag, pucgdbbase, CONSPEED, COM_FREQ,
-           COM_TYPE_NORMAL, CONMODE);
+       com_kgdb_attach(puctag, pucgdbbase, CONSPEED,
+           puccnflags & PUC_COM_CLOCKMASK,
+           (puccnflags & PUC_COM_ALIGN4) ? 4 : 0, COM_TYPE_NORMAL, CONMODE);
 }
 #endif

-void
-puc_cnprobe(struct consdev *cn)
+int
+puc_cnprobe(struct consdev *cn, int *ismmiop)
 {

-       puccnbase = pucprobe_doit(cn);
+       puccnbase = pucprobe_doit(cn, ismmiop);
+
+       if (puccnbase == 0)
+               return 0;
+       else
+               return 1;
 }

 int
@@ -241,8 +251,8 @@ puc_cninit(struct consdev *cn)
                return -1;

        return comcnattach(puctag, puccnbase, CONSPEED,
-           puccnflags & PUC_COM_CLOCKMASK, COM_TYPE_NORMAL,
-           CONMODE);
+           puccnflags & PUC_COM_CLOCKMASK,
+           (puccnflags & PUC_COM_ALIGN4) ? 4 : 0, COM_TYPE_NORMAL, CONMODE);
 }

 /* comcngetc, comcnputc, comcnpollc provided by dev/ic/com.c */
Index: dev/pci/puccn.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/puccn.h,v
retrieving revision 1.6
diff -u -p -r1.6 puccn.h
--- dev/pci/puccn.h     26 Jan 2014 10:54:24 -0000      1.6
+++ dev/pci/puccn.h     9 Feb 2014 17:43:24 -0000
@@ -40,11 +40,11 @@
 /*
  * Machine independent support for PCI serial console support.
  *
- * Platform code should provide cpu_comcnprobe() that fills
+ * Platform code should provide cpu_puc_cnprobe() that fills
  * in the pci_attach_args.  This allows the console can be
  * used before the normal PCI bus initialization.
  */

-void puc_cnprobe(struct consdev *);
+int puc_cnprobe(struct consdev *, int *);
 int puc_cninit(struct consdev *);
 int cpu_puc_cnprobe(struct consdev *, struct pci_attach_args *);
Index: dev/pci/pucdata.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pucdata.c,v
retrieving revision 1.93
diff -u -p -r1.93 pucdata.c
--- dev/pci/pucdata.c   6 Feb 2014 15:51:02 -0000       1.93
+++ dev/pci/pucdata.c   9 Feb 2014 17:43:25 -0000
@@ -1952,7 +1952,7 @@ const struct puc_device_description puc_
            {   PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_X1000_HS_UART, 0, 0 },
            {   0xffff, 0xffff, 0,      0       },
            {
-               { PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, 44236800 },
+               { PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, 44236800|PUC_COM_ALIGN4 },
            },
        },

Index: dev/pci/pucvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pucvar.h,v
retrieving revision 1.10
diff -u -p -r1.10 pucvar.h
--- dev/pci/pucvar.h    17 Jul 2013 19:49:11 -0000      1.10
+++ dev/pci/pucvar.h    9 Feb 2014 17:43:25 -0000
@@ -80,6 +80,7 @@ struct puc_device_description {
 /* Flags for SIIG Cyberserial options */
 #define PUC_COM_SIIG10x        PUC_COM_FLAG7
 #define PUC_COM_SIIG20x        PUC_COM_FLAG6
+#define PUC_COM_ALIGN4 PUC_COM_FLAG5
 #define PUC_PORT_USR0  PUC_COM_FLAG0
 #define PUC_PORT_USR1  PUC_COM_FLAG1
 #define PUC_PORT_USR2  PUC_COM_FLAG2
Index: conf/files
===================================================================
RCS file: /cvsroot/src/sys/conf/files,v
retrieving revision 1.1082
diff -u -p -r1.1082 files
--- conf/files  9 Dec 2013 16:45:23 -0000       1.1082
+++ conf/files  9 Feb 2014 17:43:23 -0000
@@ -850,7 +850,7 @@ defflag     opt_com.h               COM_DEBUG
 # XXX In a perfect world, this would be done with attributes
 defflag        opt_com.h               COM_16650 COM_16750
                                COM_HAYESP COM_PXA2X0 COM_AU1X00
-                               COM_REGMAP COM_FUNCMAP
+                               COM_NO_REGMAP COM_FUNCMAP
 defparam opt_com.h             COM_TOLERANCE
 device com { } : tty
 file   dev/ic/com.c                    com                     needs-flag
Index: arch/mips/atheros/dev/com_arbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/atheros/dev/com_arbus.c,v
retrieving revision 1.10
diff -u -p -r1.10 com_arbus.c
--- arch/mips/atheros/dev/com_arbus.c   7 Jul 2011 05:06:44 -0000       1.10
+++ arch/mips/atheros/dev/com_arbus.c   9 Feb 2014 17:43:22 -0000
@@ -126,7 +126,6 @@ struct com_arbus_softc {
        struct com_softc sc_com;
 };

-static void com_arbus_initmap(struct com_regs *);
 //static bus_space_tag_t com_arbus_get_bus_space_tag(void);
 static int com_arbus_match(device_t, cfdata_t , void *);
 static void com_arbus_attach(device_t, device_t, void *);
@@ -150,8 +149,8 @@ int com_arbus_baud = COM_ARBUS_BAUD;

 #define CONMODE        ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 
8N1 */

-#ifndef        COM_REGMAP
-#error COM_REGMAP not defined!
+#ifndef        COM_NO_REGMAP
+#error COM_NO_REGMAP not supported!
 #endif

 int
@@ -171,10 +170,9 @@ com_arbus_match(device_t parent, cfdata_
                0, &regs.cr_ioh))
                return 0;

-       regs.cr_iot = aa->aa_bst;
-       regs.cr_iobase = aa->aa_addr;
+       COM_INIT_REGS(regs, aa->aa_bst, (bus_space_handle_t)0, aa->aa_addr,
+           sizeof(uint32_t));
        regs.cr_nports = aa->aa_size;
-       com_arbus_initmap(&regs);

        rv = com_probe_subr(&regs);

@@ -211,9 +209,9 @@ com_arbus_attach(device_t parent, device
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, aa->aa_bst, ioh, aa->aa_addr);
+       COM_INIT_REGS(sc->sc_regs, aa->aa_bst, ioh, aa->aa_addr,
+           sizeof(uint32_t));
        sc->sc_regs.cr_nports = aa->aa_size;
-       com_arbus_initmap(&sc->sc_regs);

        com_attach_subr(sc);

@@ -221,24 +219,13 @@ com_arbus_attach(device_t parent, device
 }

 void
-com_arbus_initmap(struct com_regs *regsp)
-{
-
-       /* rewrite the map to shift for alignment */
-       for (size_t i = 0; i < __arraycount(regsp->cr_map); i++) {
-               regsp->cr_map[i] = (com_std_map[i] * 4) + 3;
-       }
-}
-
-void
 com_arbus_cnattach(bus_addr_t addr, uint32_t freq)
 {
        struct com_regs         regs;

-       regs.cr_iot = arbus_get_bus_space_tag();
-       regs.cr_iobase = addr;
+       COM_INIT_REGS(regs, arbus_get_bus_space_tag(), (bus_space_handle_t)0,
+           addr, sizeof(uint32_t));
        regs.cr_nports = 0x1000;
-       com_arbus_initmap(&regs);

        if (bus_space_map(regs.cr_iot, regs.cr_iobase, regs.cr_nports, 0,
                &regs.cr_ioh))
Index: arch/mips/rmi/rmixl_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/rmi/rmixl_com.c,v
retrieving revision 1.5
diff -u -p -r1.5 rmixl_com.c
--- arch/mips/rmi/rmixl_com.c   1 Jul 2011 19:01:30 -0000       1.5
+++ arch/mips/rmi/rmixl_com.c   9 Feb 2014 17:43:22 -0000
@@ -126,31 +126,18 @@ __KERNEL_RCSID(0, "$NetBSD: rmixl_com.c,

 #include "opt_com.h"

-/* span of UART regs in bytes */
-#define RMIXL_IO_DEV_UART_SIZE (COM_NPORTS * sizeof(uint32_t))
-
-#define RMIXL_COM_INIT_REGS(regs, bst, ioh, addr)              \
-       do {                                                    \
-               memset(&regs, 0, sizeof(regs));                 \
-               COM_INIT_REGS(regs, bst, ioh, addr);            \
-               regs.cr_nports = RMIXL_IO_DEV_UART_SIZE;        \
-               rmixl_com_initmap(&regs);                       \
-       } while (0)
-
-
 struct rmixl_com_softc {
        struct com_softc sc_com;
 };

-static void rmixl_com_initmap(struct com_regs *);
 static int rmixl_com_match(device_t, cfdata_t , void *);
 static void rmixl_com_attach(device_t, device_t, void *);

 CFATTACH_DECL_NEW(com_rmixl, sizeof(struct rmixl_com_softc),
     rmixl_com_match, rmixl_com_attach, NULL, NULL);

-#ifndef        COM_REGMAP
-#error COM_REGMAP not defined!
+#ifndef        COM_NO_REGMAP
+#error COM_NO_REGMAP not supported!
 #endif

 volatile int32_t *com0addr = (int32_t *)
@@ -254,7 +241,7 @@ rmixl_com_match(device_t parent, cfdata_
        if (bus_space_map(bst, addr, size, 0, &ioh))
                return 0;               /* FAIL */

-       RMIXL_COM_INIT_REGS(regs, bst, ioh, addr);
+       COM_INIT_REGS(regs, bst, ioh, addr, sizeof(uint32_t));

        rv = com_probe_subr(&regs);

@@ -287,7 +274,7 @@ rmixl_com_attach(device_t parent, device
                return;
        }

-       RMIXL_COM_INIT_REGS(sc->sc_regs, bst, ioh, addr);
+       COM_INIT_REGS(sc->sc_regs, bst, ioh, addr, sizeof(uint32_t));

        com_attach_subr(sc);

@@ -316,7 +303,7 @@ rmixl_com_cnattach(bus_addr_t addr, int

        bst = (bus_space_tag_t)&rmixl_configuration.rc_obio_eb_memt;

-       RMIXL_COM_INIT_REGS(regs, bst, 0, addr);
+       COM_INIT_REGS(regs, bst, 0, addr, sizeof(uint32_t));

        comcnattach1(&regs, speed, freq, type, mode);
 }
Index: dev/marvell/com_mv.c
===================================================================
RCS file: /cvsroot/src/sys/dev/marvell/com_mv.c,v
retrieving revision 1.7
diff -u -p -r1.7 com_mv.c
--- dev/marvell/com_mv.c        3 Oct 2013 13:23:03 -0000       1.7
+++ dev/marvell/com_mv.c        9 Feb 2014 17:43:24 -0000
@@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: com_mv.c,v 1

 #include <prop/proplib.h>

-#define MVUART_SIZE            0x20
+#define MVUART_ALIGN           4


 static int mvuart_match(device_t, struct cfdata *, void *);
@@ -55,24 +55,6 @@ CFATTACH_DECL_NEW(mvuart_gt, sizeof(stru
 CFATTACH_DECL_NEW(mvuart_mbus, sizeof(struct com_softc),
     mvuart_match, mvuart_attach, NULL, NULL);

-#ifdef COM_REGMAP
-#define MVUART_INIT_REGS(regs, tag, hdl, addr, size)           \
-       do {                                                    \
-               int i;                                          \
-                                                               \
-               regs.cr_iot = tag;                              \
-               regs.cr_ioh = hdl;                              \
-               regs.cr_iobase = addr;                          \
-               regs.cr_nports = size;                          \
-               for (i = 0; i < __arraycount(regs.cr_map); i++) \
-                       regs.cr_map[i] = com_std_map[i] << 2;   \
-       } while (0)
-#else
-#define MVUART_INIT_REGS(regs, tag, hdl, addr, size) \
-       COM_INIT_REGS(regs, tag, hdl, addr)
-#endif
-
-
 /* ARGSUSED */
 static int
 mvuart_match(device_t parent, struct cfdata *match, void *aux)
@@ -91,14 +73,14 @@ mvuart_match(device_t parent, struct cfd
                goto console;

        if (bus_space_subregion(mva->mva_iot, mva->mva_ioh, mva->mva_offset,
-           MVUART_SIZE, &ioh))
+           COM_NPORTS * MVUART_ALIGN, &ioh))
                return 0;
-       MVUART_INIT_REGS(regs, mva->mva_iot, ioh, mva->mva_offset, MVUART_SIZE);
+       COM_INIT_REGS(regs, mva->mva_iot, ioh, mva->mva_offset, MVUART_ALIGN);
        if (!com_probe_subr(&regs))
                return 0;

 console:
-       mva->mva_size = MVUART_SIZE;
+       mva->mva_size = COM_NPORTS * MVUART_ALIGN;
        return 1;
 }

@@ -127,15 +109,14 @@ mvuart_attach(device_t parent, device_t
                        return;
                }
        }
-       MVUART_INIT_REGS(sc->sc_regs,
-           iot, ioh, mva->mva_addr + mva->mva_offset, mva->mva_size);
+       COM_INIT_REGS(sc->sc_regs,
+           iot, ioh, mva->mva_addr + mva->mva_offset, MVUART_ALIGN);

        com_attach_subr(sc);

        marvell_intr_establish(mva->mva_irq, IPL_SERIAL, comintr, sc);
 }

-#ifdef COM_REGMAP
 int mvuart_cnattach(bus_space_tag_t, bus_addr_t, int, uint32_t, int);

 int
@@ -144,8 +125,7 @@ mvuart_cnattach(bus_space_tag_t iot, bus
 {
        struct com_regs regs;

-       MVUART_INIT_REGS(regs, iot, 0x0, addr, MVUART_SIZE);
+       COM_INIT_REGS(regs, iot, 0x0, addr, MVUART_ALIGN);

        return comcnattach1(&regs, baud, sysfreq, COM_TYPE_16550_NOERS, mode);
 }
-#endif /* COM_REGMAP */
Index: arch/acorn32/mainbus/com_pioc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/mainbus/com_pioc.c,v
retrieving revision 1.16
diff -u -p -r1.16 com_pioc.c
--- arch/acorn32/mainbus/com_pioc.c     19 Jul 2011 15:59:53 -0000      1.16
+++ arch/acorn32/mainbus/com_pioc.c     9 Feb 2014 17:43:18 -0000
@@ -130,7 +130,7 @@ com_pioc_probe(device_t parent, cfdata_t
                if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) {
                        return 0;
                }
-               rv = comprobe1(iot, ioh);
+               rv = comprobe1(iot, ioh, sizeof(uint8_t));
                bus_space_unmap(iot, ioh, COM_NPORTS);
        }

@@ -167,7 +167,7 @@ com_pioc_attach(device_t parent, device_
        if (!com_is_console(iot, iobase, &ioh)
            && bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh))
                panic("comattach: io mapping failed");
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        sc->sc_frequency = COM_FREQ;

Index: arch/acorn32/podulebus/amps.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/podulebus/amps.c,v
retrieving revision 1.20
diff -u -p -r1.20 amps.c
--- arch/acorn32/podulebus/amps.c       27 Oct 2012 17:17:23 -0000      1.20
+++ arch/acorn32/podulebus/amps.c       9 Feb 2014 17:43:18 -0000
@@ -293,7 +293,7 @@ com_amps_attach(device_t parent, device_
        if (!com_is_console(iot, iobase, &ioh)
            && bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh))
                panic("comattach: io mapping failed");
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        sc->sc_frequency = AMPS_FREQ;
        com_attach_subr(sc);
Index: arch/algor/dev/com_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/algor/dev/com_mainbus.c,v
retrieving revision 1.14
diff -u -p -r1.14 com_mainbus.c
--- arch/algor/dev/com_mainbus.c        9 Jul 2011 16:03:01 -0000       1.14
+++ arch/algor/dev/com_mainbus.c        9 Feb 2014 17:43:18 -0000
@@ -94,7 +94,8 @@ com_mainbus_attach(device_t parent, devi
                aprint_error(": can't map i/o space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, ma->ma_st, ioh, ma->ma_addr);
+       COM_INIT_REGS(sc->sc_regs, ma->ma_st, ioh, ma->ma_addr,
+           sizeof(uint8_t)));
        sc->sc_frequency = COM_FREQ;

        com_attach_subr(sc);
Index: arch/alpha/jensenio/com_jensenio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/jensenio/com_jensenio.c,v
retrieving revision 1.13
diff -u -p -r1.13 com_jensenio.c
--- arch/alpha/jensenio/com_jensenio.c  1 Jul 2011 19:22:35 -0000       1.13
+++ arch/alpha/jensenio/com_jensenio.c  9 Feb 2014 17:43:18 -0000
@@ -102,7 +102,8 @@ com_jensenio_attach(device_t parent, dev
                aprint_error(": can't map i/o space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, ja->ja_iot, ioh, ja->ja_ioaddr);
+       COM_INIT_REGS(sc->sc_regs, ja->ja_iot, ioh, ja->ja_ioaddr,
+           sizeof(uint8_t));

        sc->sc_frequency = COM_FREQ;

Index: arch/alpha/sableio/com_sableio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/sableio/com_sableio.c,v
retrieving revision 1.11
diff -u -p -r1.11 com_sableio.c
--- arch/alpha/sableio/com_sableio.c    1 Jul 2011 19:19:50 -0000       1.11
+++ arch/alpha/sableio/com_sableio.c    9 Feb 2014 17:43:18 -0000
@@ -99,7 +99,8 @@ com_sableio_attach(device_t parent, devi
                aprint_error(": can't map i/o space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, sa->sa_iot, ioh, sa->sa_ioaddr);
+       COM_INIT_REGS(sc->sc_regs, sa->sa_iot, ioh, sa->sa_ioaddr,
+           sizeof(uint8_t));

        sc->sc_frequency = COM_FREQ;

Index: arch/amiga/clockport/com_ss.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/clockport/com_ss.c,v
retrieving revision 1.1
diff -u -p -r1.1 com_ss.c
--- arch/amiga/clockport/com_ss.c       17 Apr 2012 09:59:03 -0000      1.1
+++ arch/amiga/clockport/com_ss.c       9 Feb 2014 17:43:19 -0000
@@ -72,7 +72,8 @@ com_ss_attach(device_t parent, device_t

        bus_space_map(caa->cp_iot, 0, COM_SS_REGS, 0, &ioh);

-       COM_INIT_REGS(sc->sc_regs, caa->cp_iot, ioh, 0 /* off */);
+       COM_INIT_REGS(sc->sc_regs, caa->cp_iot, ioh, 0 /* off */,
+           sizeof(uint8_t));

        com_attach_subr(sc);

Index: arch/amiga/dev/com_supio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/dev/com_supio.c,v
retrieving revision 1.30
diff -u -p -r1.30 com_supio.c
--- arch/amiga/dev/com_supio.c  19 Jul 2011 15:55:26 -0000      1.30
+++ arch/amiga/dev/com_supio.c  9 Feb 2014 17:43:19 -0000
@@ -133,7 +133,7 @@ com_supio_attach(device_t parent, device

        if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh))
                panic("comattach: io mapping failed");
-       COM_INIT_REGS(csc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(csc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        csc->sc_frequency = supa->supio_arg;
        csc->sc_frequency /= 4; /* XXX IOBlix firmware sets MCR_PRESCALE? */
Index: arch/arc/jazz/com_jazzio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arc/jazz/com_jazzio.c,v
retrieving revision 1.12
diff -u -p -r1.12 com_jazzio.c
--- arch/arc/jazz/com_jazzio.c  1 Jul 2011 19:25:41 -0000       1.12
+++ arch/arc/jazz/com_jazzio.c  9 Feb 2014 17:43:19 -0000
@@ -111,7 +111,7 @@ com_jazzio_probe(device_t parent, cfdata
                if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) {
                        return 0;
                }
-               rv = comprobe1(iot, ioh);
+               rv = comprobe1(iot, ioh, sizeof(uint8_t));
                bus_space_unmap(iot, ioh, COM_NPORTS);
        }
        return rv;
@@ -135,7 +135,7 @@ com_jazzio_attach(device_t parent, devic
                aprint_error(": can't map i/o space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));
        sc->sc_frequency = com_freq;
        SET(sc->sc_hwflags, COM_HW_TXFIFO_DISABLE); /* XXX - NEC M403 */
        jazzio_intr_establish(ja->ja_intr, comintr, sc);
Index: arch/arm/allwinner/awin_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/allwinner/awin_com.c,v
retrieving revision 1.3
diff -u -p -r1.3 awin_com.c
--- arch/arm/allwinner/awin_com.c       7 Sep 2013 01:50:12 -0000       1.3
+++ arch/arm/allwinner/awin_com.c       9 Feb 2014 17:43:19 -0000
@@ -110,7 +110,7 @@ awin_com_match(device_t parent, cfdata_t
        bus_space_subregion(iot, aio->aio_core_bsh,
            loc->loc_offset, loc->loc_size, &bsh);

-       const int rv = comprobe1(iot, bsh);
+       const int rv = comprobe1(iot, bsh, sizeof(uint8_t));

        awin_gpio_pinset_release(pinset);

@@ -144,7 +144,7 @@ awin_com_attach(device_t parent, device_
                loc->loc_offset / 4, loc->loc_size, &ioh)) {
                panic(": can't map registers");
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);
        aprint_naive("\n");
Index: arch/arm/broadcom/bcm53xx_cca.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/broadcom/bcm53xx_cca.c,v
retrieving revision 1.1
diff -u -p -r1.1 bcm53xx_cca.c
--- arch/arm/broadcom/bcm53xx_cca.c     1 Sep 2012 00:04:44 -0000       1.1
+++ arch/arm/broadcom/bcm53xx_cca.c     9 Feb 2014 17:43:20 -0000
@@ -267,7 +267,7 @@ com_cca_match(device_t parent, cfdata_t
        bus_space_subregion(ccaaa->ccaaa_bst, ccaaa->ccaaa_bsh,
            ccaaa->ccaaa_offset, ccaaa->ccaaa_size, &bsh);

-       return comprobe1(ccaaa->ccaaa_bst, bsh);
+       return comprobe1(ccaaa->ccaaa_bst, bsh, sizeof(uint8_t));
 }

 static void
@@ -288,7 +288,8 @@ com_cca_attach(device_t parent, device_t
                panic(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, ccaaa->ccaaa_bst, bsh, addr);
+       COM_INIT_REGS(sc->sc_regs, ccaaa->ccaaa_bst, bsh, addr,
+           sizeof(uint8_t));

        com_attach_subr(sc);
 }
Index: arch/arm/gemini/gemini_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/gemini/gemini_com.c,v
retrieving revision 1.3
diff -u -p -r1.3 gemini_com.c
--- arch/arm/gemini/gemini_com.c        1 Jul 2011 19:32:28 -0000       1.3
+++ arch/arm/gemini/gemini_com.c        9 Feb 2014 17:43:20 -0000
@@ -92,7 +92,7 @@ gemini_com_match(device_t parent, cfdata
                          0, &bh))
                return (0);

-       rv = comprobe1(obio->obio_iot, bh);
+       rv = comprobe1(obio->obio_iot, bh, sizeof(uint8_t));

        bus_space_unmap(obio->obio_iot, bh, obio->obio_size);

@@ -119,7 +119,7 @@ gemini_com_attach(device_t parent, devic
                panic(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);
        aprint_naive("\n");
Index: arch/arm/gemini/lpc_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/gemini/lpc_com.c,v
retrieving revision 1.4
diff -u -p -r1.4 lpc_com.c
--- arch/arm/gemini/lpc_com.c   1 Jul 2011 19:32:28 -0000       1.4
+++ arch/arm/gemini/lpc_com.c   9 Feb 2014 17:43:20 -0000
@@ -142,7 +142,7 @@ lpc_com_match(device_t parent, cfdata_t
        if (bus_space_map(iot, iobase, lpc->lpc_size, 0, &ioh))
                return 0;

-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));

        bus_space_unmap(iot, ioh, lpc->lpc_size);

@@ -170,7 +170,7 @@ lpc_com_attach(device_t parent, device_t
                return;
        }

-       COM_INIT_REGS(sc->sc_com.sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_com.sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(&sc->sc_com);
        aprint_naive("\n");
Index: arch/arm/omap/obio_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/omap/obio_com.c,v
retrieving revision 1.4
diff -u -p -r1.4 obio_com.c
--- arch/arm/omap/obio_com.c    1 Jul 2011 20:30:21 -0000       1.4
+++ arch/arm/omap/obio_com.c    9 Feb 2014 17:43:20 -0000
@@ -106,7 +106,7 @@ obiouart_match(device_t parent, cfdata_t
                          0, &bh))
                return 1;

-       rv = comprobe1(obio->obio_iot, bh);
+       rv = comprobe1(obio->obio_iot, bh, sizeof(uint8_t));

        bus_space_unmap(obio->obio_iot, bh, obio->obio_size);

@@ -135,7 +135,7 @@ obiouart_attach(device_t parent, device_
                panic(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);
        aprint_naive("\n");
Index: arch/arm/omap/omap_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/omap/omap_com.c,v
retrieving revision 1.4
diff -u -p -r1.4 omap_com.c
--- arch/arm/omap/omap_com.c    1 Jul 2011 20:30:21 -0000       1.4
+++ arch/arm/omap/omap_com.c    9 Feb 2014 17:43:20 -0000
@@ -92,7 +92,7 @@ omapuart_match(device_t parent, cfdata_t
        bus_space_write_1(tipb->tipb_iot, bh,
                          OMAP_COM_MDR1, OMAP_COM_MDR1_MODE_DISABLE);

-       rv = comprobe1(tipb->tipb_iot, bh);
+       rv = comprobe1(tipb->tipb_iot, bh, sizeof(uint8_t));

        bus_space_write_1(tipb->tipb_iot, bh,
                          OMAP_COM_MDR1, OMAP_COM_MDR1_MODE_UART_16X);
@@ -122,7 +122,7 @@ omapuart_attach(device_t parent, device_
                panic(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);
        aprint_naive("\n");
Index: arch/arm/omap/omapl1x_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/omap/omapl1x_com.c,v
retrieving revision 1.1
diff -u -p -r1.1 omapl1x_com.c
--- arch/arm/omap/omapl1x_com.c 2 Oct 2013 16:48:26 -0000       1.1
+++ arch/arm/omap/omapl1x_com.c 9 Feb 2014 17:43:20 -0000
@@ -84,7 +84,7 @@ omapl1xcom_match(device_t parent, cfdata
                          0, &bh))
                return (0);

-       rv = comprobe1(tipb->tipb_iot, bh);
+       rv = comprobe1(tipb->tipb_iot, bh, sizeof(uint8_t));

        bus_space_unmap(tipb->tipb_iot, bh, tipb->tipb_size);

@@ -111,7 +111,7 @@ omapl1xcom_attach(device_t parent, devic
                panic(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);
        aprint_naive("\n");
Index: arch/arm/xscale/ixp425_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/xscale/ixp425_com.c,v
retrieving revision 1.18
diff -u -p -r1.18 ixp425_com.c
--- arch/arm/xscale/ixp425_com.c        1 Jul 2011 20:32:51 -0000       1.18
+++ arch/arm/xscale/ixp425_com.c        9 Feb 2014 17:43:20 -0000
@@ -86,7 +86,7 @@ ixsipcom_match(device_t parent, cfdata_t
        /* Make sure the UART is enabled */
        bus_space_write_1(bt, bh, com_ier, IER_EUART);

-       rv = comprobe1(bt, bh);
+       rv = comprobe1(bt, bh, sizeof(uint8_t));
        bus_space_unmap(bt, bh, sa->sa_size);

        return (rv);
@@ -112,7 +112,7 @@ ixsipcom_attach(device_t parent, device_
                aprint_error(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);

Index: arch/arm/xscale/pxa2x0_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/xscale/pxa2x0_com.c,v
retrieving revision 1.13
diff -u -p -r1.13 pxa2x0_com.c
--- arch/arm/xscale/pxa2x0_com.c        1 Jul 2011 20:32:51 -0000       1.13
+++ arch/arm/xscale/pxa2x0_com.c        9 Feb 2014 17:43:20 -0000
@@ -129,7 +129,7 @@ pxauart_match(device_t parent, cfdata_t
        /* Make sure the UART is enabled */
        bus_space_write_1(bt, bh, com_ier, IER_EUART);

-       rv = comprobe1(bt, bh);
+       rv = comprobe1(bt, bh, sizeof(uint8_t));
        bus_space_unmap(bt, bh, pxa->pxa_size);

        return (rv);
@@ -156,7 +156,7 @@ pxauart_attach(device_t parent, device_t
                aprint_error(": can't map registers\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        switch (pxa->pxa_addr) {
        case PXA2X0_FFUART_BASE: cken = CKEN_FFUART; break;
Index: arch/cobalt/dev/com_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/dev/com_mainbus.c,v
retrieving revision 1.19
diff -u -p -r1.19 com_mainbus.c
--- arch/cobalt/dev/com_mainbus.c       9 Jul 2011 16:09:01 -0000       1.19
+++ arch/cobalt/dev/com_mainbus.c       9 Feb 2014 17:43:20 -0000
@@ -85,7 +85,8 @@ com_mainbus_attach(device_t parent, devi
                aprint_error(": can't map i/o space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, maa->ma_iot, ioh, maa->ma_addr);
+       COM_INIT_REGS(sc->sc_regs, maa->ma_iot, ioh, maa->ma_addr,
+           sizeof(uint8_t));

        sc->sc_frequency = COM_MAINBUS_FREQ;

Index: arch/evbarm/adi_brh/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/adi_brh/com_obio.c,v
retrieving revision 1.7
diff -u -p -r1.7 com_obio.c
--- arch/evbarm/adi_brh/com_obio.c      1 Jul 2011 20:38:16 -0000       1.7
+++ arch/evbarm/adi_brh/com_obio.c      9 Feb 2014 17:43:21 -0000
@@ -86,7 +86,8 @@ com_obio_attach(device_t parent, device_
                aprint_error(": failed to map registers: %d\n", error);
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr);
+       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr,
+           sizeof(uint8_t));

        com_attach_subr(sc);

Index: arch/evbarm/conf/std.armadaxp
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/conf/std.armadaxp,v
retrieving revision 1.2
diff -u -p -r1.2 std.armadaxp
--- arch/evbarm/conf/std.armadaxp       14 Jun 2013 20:02:44 -0000      1.2
+++ arch/evbarm/conf/std.armadaxp       9 Feb 2014 17:43:21 -0000
@@ -30,6 +30,5 @@ makeoptions   BOARDMKFRAG="${THISARM}/conf
 options        EVBARM_BOARDTYPE="Armada XP"
 options                ARM_HAS_VBAR
 options        ARM_INTR_IMPL="<arch/arm/marvell/mvsoc_intr.h>"
-options        COM_REGMAP
 options        COM_16750
 options        PIC_MAXSOURCES=128
Index: arch/evbarm/conf/std.marvell
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/conf/std.marvell,v
retrieving revision 1.3
diff -u -p -r1.3 std.marvell
--- arch/evbarm/conf/std.marvell        16 Dec 2012 23:47:56 -0000      1.3
+++ arch/evbarm/conf/std.marvell        9 Feb 2014 17:43:21 -0000
@@ -10,8 +10,6 @@ include       "arch/evbarm/conf/files.marvell
 options        __HAVE_PCI_CONF_HOOK            # should be in types.h
 options        __HAVE_CPU_UAREA_ALLOC_IDLELWP

-options        COM_REGMAP
-
 options        KERNEL_BASE_EXT=0xc0000000
 makeoptions    LOADADDRESS="0xc0008000"
 makeoptions    BOARDMKFRAG="${THISARM}/conf/mk.marvell"
Index: arch/evbarm/conf/std.mv2120
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/conf/std.mv2120,v
retrieving revision 1.2
diff -u -p -r1.2 std.mv2120
--- arch/evbarm/conf/std.mv2120 16 Dec 2012 23:47:56 -0000      1.2
+++ arch/evbarm/conf/std.mv2120 9 Feb 2014 17:43:21 -0000
@@ -9,8 +9,6 @@ include         "arch/evbarm/conf/files.marvell

 options        __HAVE_PCI_CONF_HOOK            # should be in types.h

-options        COM_REGMAP
-
 options        KERNEL_BASE_EXT=0xc0000000
 makeoptions    LOADADDRESS="0xc0400000"
 makeoptions    BOARDMKFRAG="${THISARM}/conf/mk.mv2120"
Index: arch/evbarm/hdl_g/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/hdl_g/com_obio.c,v
retrieving revision 1.5
diff -u -p -r1.5 com_obio.c
--- arch/evbarm/hdl_g/com_obio.c        1 Jul 2011 20:39:34 -0000       1.5
+++ arch/evbarm/hdl_g/com_obio.c        9 Feb 2014 17:43:21 -0000
@@ -79,7 +79,8 @@ com_obio_attach(device_t parent, device_
        sc->sc_frequency = COM_FREQ;
        sc->sc_hwflags = COM_HW_NO_TXPRELOAD;
        error = bus_space_map(oba->oba_st, oba->oba_addr, 8, 0, &ioh);
-       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr);
+       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr,
+           sizeof(uint8_t));

        if (error) {
                aprint_error(": failed to map registers: %d\n", error);
Index: arch/evbarm/iq80310/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/iq80310/com_obio.c,v
retrieving revision 1.14
diff -u -p -r1.14 com_obio.c
--- arch/evbarm/iq80310/com_obio.c      1 Jul 2011 20:41:16 -0000       1.14
+++ arch/evbarm/iq80310/com_obio.c      9 Feb 2014 17:43:21 -0000
@@ -83,7 +83,8 @@ com_obio_attach(device_t parent, device_
                aprint_error(": failed to map registers: %d\n", error);
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr);
+       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr,
+           sizeof(uint8_t));
        com_attach_subr(sc);

        osc->sc_ih = iq80310_intr_establish(oba->oba_irq, IPL_SERIAL,
Index: arch/evbarm/iq80321/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/iq80321/com_obio.c,v
retrieving revision 1.13
diff -u -p -r1.13 com_obio.c
--- arch/evbarm/iq80321/com_obio.c      1 Jul 2011 20:41:16 -0000       1.13
+++ arch/evbarm/iq80321/com_obio.c      9 Feb 2014 17:43:21 -0000
@@ -84,7 +84,8 @@ com_obio_attach(device_t parent, device_
                aprint_error(": failed to map registers: %d\n", error);
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr);
+       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr,
+           sizeof(uint8_t));

        com_attach_subr(sc);

Index: arch/evbarm/npwr_fc/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/npwr_fc/com_obio.c,v
retrieving revision 1.5
diff -u -p -r1.5 com_obio.c
--- arch/evbarm/npwr_fc/com_obio.c      1 Jul 2011 20:44:20 -0000       1.5
+++ arch/evbarm/npwr_fc/com_obio.c      9 Feb 2014 17:43:21 -0000
@@ -79,7 +79,8 @@ com_obio_attach(device_t parent, device_
        sc->sc_frequency = COM_FREQ;
        sc->sc_hwflags = COM_HW_NO_TXPRELOAD;
        error = bus_space_map(oba->oba_st, oba->oba_addr, 8, 0, &ioh);
-       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr);
+       COM_INIT_REGS(sc->sc_regs, oba->oba_st, ioh, oba->oba_addr,
+           sizeof(uint8_t));

        if (error) {
                aprint_error(": failed to map registers: %d\n", error);
Index: arch/evbmips/conf/XLSATX
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/conf/XLSATX,v
retrieving revision 1.18
diff -u -p -r1.18 XLSATX
--- arch/evbmips/conf/XLSATX    30 Jun 2013 21:38:56 -0000      1.18
+++ arch/evbmips/conf/XLSATX    9 Feb 2014 17:43:21 -0000
@@ -140,7 +140,6 @@ cpu*                at cpucore? thread ?
 obio0          at cpunode?
 com0           at obio0        addr 0x14000 intr 9
 com1           at obio0        addr 0x15000 intr 10
-options        COM_REGMAP
 rmixl_gpio0    at obio0        addr 0x18000 intr 14
 gpio*          at rmixl_gpio?
 rmixl_iobus0   at obio0        addr 0x19000
Index: arch/evbppc/ev64260/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/ev64260/com_obio.c,v
retrieving revision 1.11
diff -u -p -r1.11 com_obio.c
--- arch/evbppc/ev64260/com_obio.c      1 Jul 2011 20:46:39 -0000       1.11
+++ arch/evbppc/ev64260/com_obio.c      9 Feb 2014 17:43:21 -0000
@@ -117,7 +117,7 @@ com_obio_match(device_t parent, cfdata_t
                if (bus_space_map(oa->oa_memt, oa->oa_offset,
                    oa->oa_size, 0, &ioh))
                        return (0);
-               rv = comprobe1(oa->oa_memt, ioh);
+               rv = comprobe1(oa->oa_memt, ioh, sizeof(uint8_t));
                bus_space_unmap(oa->oa_memt, ioh, oa->oa_size);
        }

@@ -142,7 +142,8 @@ com_obio_attach(device_t parent, device_
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, oa->oa_memt, ioh, oa->oa_offset);
+       COM_INIT_REGS(sc->sc_regs, oa->oa_memt, ioh, oa->oa_offset,
+           sizeof(uint8_t));
        sc->sc_regs.cr_nports = oa->oa_size;
        com_attach_subr(sc);

Index: arch/evbppc/explora/dev/com_elb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/explora/dev/com_elb.c,v
retrieving revision 1.9
diff -u -p -r1.9 com_elb.c
--- arch/evbppc/explora/dev/com_elb.c   1 Jul 2011 19:02:32 -0000       1.9
+++ arch/evbppc/explora/dev/com_elb.c   9 Feb 2014 17:43:21 -0000
@@ -81,7 +81,7 @@ com_elb_attach(device_t parent, device_t
            _BUS_SPACE_UNSTRIDE(eaa->elb_bt, eaa->elb_base),
            COM_NPORTS, 0, &ioh);
        COM_INIT_REGS(sc->sc_regs, eaa->elb_bt, ioh,
-           _BUS_SPACE_UNSTRIDE(eaa->elb_bt, eaa->elb_base));
+           _BUS_SPACE_UNSTRIDE(eaa->elb_bt, eaa->elb_base), sizeof(uint8_t));

        sc->sc_frequency = COM_FREQ;

Index: arch/hp300/dev/com_dio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/dev/com_dio.c,v
retrieving revision 1.8
diff -u -p -r1.8 com_dio.c
--- arch/hp300/dev/com_dio.c    28 Apr 2008 20:23:19 -0000      1.8
+++ arch/hp300/dev/com_dio.c    9 Feb 2014 17:43:21 -0000
@@ -150,7 +150,7 @@ com_dio_attach(device_t parent, device_t
        }

        COM_INIT_REGS(sc->sc_regs, iot, iohcom,
-           da->da_addr + DCA_COM_OFFSET);
+           da->da_addr + DCA_COM_OFFSET, sizeof(uint8_t));

        sc->sc_frequency = COM_DIO_FREQ;

Index: arch/hp700/dev/com_dino.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/dev/com_dino.c,v
retrieving revision 1.9
diff -u -p -r1.9 com_dino.c
--- arch/hp700/dev/com_dino.c   1 Jul 2011 18:33:09 -0000       1.9
+++ arch/hp700/dev/com_dino.c   9 Feb 2014 17:43:21 -0000
@@ -80,7 +80,10 @@ com_dino_match(device_t parent, cfdata_t
                return (0);

        return (1);
-       /* HOZER comprobe1(ca->ca_iot, ca->ca_hpa + IOMOD_DEVOFFSET); */
+       /*
+        * HOZER comprobe1(ca->ca_iot, ca->ca_hpa + IOMOD_DEVOFFSET,
+        * sizeof(uint8_t));
+        */
 }

 void
@@ -131,7 +134,7 @@ com_dino_attach(device_t parent, device_
                aprint_error(": can't map I/O space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, ca->ca_iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, ca->ca_iot, ioh, iobase, sizeof(uint8_t));

        /* select clock freq */
        regs->test = COM_DINO_CLK_SEL;
Index: arch/hp700/gsc/com_gsc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/gsc/com_gsc.c,v
retrieving revision 1.17
diff -u -p -r1.17 com_gsc.c
--- arch/hp700/gsc/com_gsc.c    1 Jul 2011 18:33:09 -0000       1.17
+++ arch/hp700/gsc/com_gsc.c    9 Feb 2014 17:43:21 -0000
@@ -135,7 +135,7 @@ com_gsc_attach(device_t parent, device_t
                aprint_error(": can't map I/O space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);
        gsc->sc_ih = hp700_intr_establish(IPL_TTY, comintr, sc, ga->ga_ir,
Index: arch/hpcmips/dev/com_hpcio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/dev/com_hpcio.c,v
retrieving revision 1.11
diff -u -p -r1.11 com_hpcio.c
--- arch/hpcmips/dev/com_hpcio.c        14 Mar 2008 15:09:10 -0000      1.11
+++ arch/hpcmips/dev/com_hpcio.c        9 Feb 2014 17:43:21 -0000
@@ -251,7 +251,7 @@ com_hpcio_common_probe(bus_space_tag_t i
        *alignment = COM_HPCIO_BYTE_ALIGNMENT;
        if (bus_space_map(iot, iobase, 1, 0, &ioh))
                return 0;
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, 1);

        if (rv != 0)
@@ -264,7 +264,7 @@ com_hpcio_common_probe(bus_space_tag_t i
        com_hpcio_iot_init(&tmpiot, iot);
        if (bus_space_map(&tmpiot, iobase, 1, 0, &ioh))
                return 0;
-       rv = comprobe1(&tmpiot, ioh);
+       rv = comprobe1(&tmpiot, ioh, sizeof(uint8_t)); /* XXX */
        bus_space_unmap(&tmpiot, ioh, 1);

        return (rv);
@@ -327,7 +327,7 @@ com_hpcio_attach(device_t parent, device
                aprint_error(": can't map bus space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, addr);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, addr, sizeof(uint8_t)); /* XXX */

        sc->enable = NULL;
        sc->disable = NULL;
Index: arch/hpcmips/vr/com_vrip.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/vr/com_vrip.c,v
retrieving revision 1.22
diff -u -p -r1.22 com_vrip.c
--- arch/hpcmips/vr/com_vrip.c  27 Oct 2012 17:17:55 -0000      1.22
+++ arch/hpcmips/vr/com_vrip.c  9 Feb 2014 17:43:21 -0000
@@ -121,7 +121,7 @@ com_vrip_common_probe(bus_space_tag_t io
                aprint_error(": can't map i/o space\n");
                return 0;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, 1);
        return (rv);
 }
@@ -181,7 +181,7 @@ com_vrip_attach(device_t parent, device_
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, iot, ioh, va->va_addr);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, va->va_addr, sizeof(uint8_t));

        sc->enable = NULL; /* XXX: CMU control */
        sc->disable = NULL;
Index: arch/hpcsh/conf/std.hpcsh
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcsh/conf/std.hpcsh,v
retrieving revision 1.10
diff -u -p -r1.10 std.hpcsh
--- arch/hpcsh/conf/std.hpcsh   13 May 2010 18:21:32 -0000      1.10
+++ arch/hpcsh/conf/std.hpcsh   9 Feb 2014 17:43:21 -0000
@@ -9,5 +9,3 @@ include         "arch/sh3/conf/std.sh3el"       # arc
 options        IOM_RAM_BEGIN=0x0c000000

 makeoptions    DEFTEXTADDR="0x8c001000"
-
-options        COM_REGMAP
Index: arch/i386/pnpbios/com_pnpbios.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/pnpbios/com_pnpbios.c,v
retrieving revision 1.15
diff -u -p -r1.15 com_pnpbios.c
--- arch/i386/pnpbios/com_pnpbios.c     1 Jul 2011 18:14:15 -0000       1.15
+++ arch/i386/pnpbios/com_pnpbios.c     9 Feb 2014 17:43:22 -0000
@@ -94,7 +94,7 @@ com_pnpbios_attach(device_t parent, devi
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        aprint_normal("\n");
        pnpbios_print_devres(self, aa);
Index: arch/macppc/dev/com_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/dev/com_mainbus.c,v
retrieving revision 1.5
diff -u -p -r1.5 com_mainbus.c
--- arch/macppc/dev/com_mainbus.c       27 Oct 2012 17:18:00 -0000      1.5
+++ arch/macppc/dev/com_mainbus.c       9 Feb 2014 17:43:22 -0000
@@ -102,7 +102,7 @@ com_mainbus_attach(device_t parent, devi
     iobase = 0x3f8;
     comcnattach(iot, iobase, 9600, 1843200, COM_TYPE_NORMAL, (CREAD | CS8));
     bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh);
-    COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+    COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

     sc->sc_frequency = 1843200;

Index: arch/mips/alchemy/dev/com_aubus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/alchemy/dev/com_aubus.c,v
retrieving revision 1.6
diff -u -p -r1.6 com_aubus.c
--- arch/mips/alchemy/dev/com_aubus.c   1 Jul 2011 18:39:29 -0000       1.6
+++ arch/mips/alchemy/dev/com_aubus.c   9 Feb 2014 17:43:22 -0000
@@ -69,8 +69,8 @@ CFATTACH_DECL_NEW(com_aubus, sizeof(stru

 #define CONMODE        ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 
8N1 */

-#ifndef        COM_REGMAP
-#error COM_REGMAP not defined!
+#ifndef        COM_NO_REGMAP
+#error COM_NO_REGMAP not supported!
 #endif

 int
Index: arch/mips/conf/files.alchemy
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/conf/files.alchemy,v
retrieving revision 1.13
diff -u -p -r1.13 files.alchemy
--- arch/mips/conf/files.alchemy        2 Oct 2006 08:00:07 -0000       1.13
+++ arch/mips/conf/files.alchemy        9 Feb 2014 17:43:22 -0000
@@ -30,7 +30,6 @@ file  arch/mips/alchemy/dev/aurtc.c           aurt
 attach com at aubus with com_aubus
 file   arch/mips/alchemy/dev/com_aubus.c       com_aubus
 options                COM_AU1x00      # Au1x00 support in com driver
-options                COM_REGMAP

 # On-chip ethernet device(s)
 device aumac: ether, ifnet, arp, mii
Index: arch/mips/conf/files.atheros
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/conf/files.atheros,v
retrieving revision 1.10
diff -u -p -r1.10 files.atheros
--- arch/mips/conf/files.atheros        10 Jul 2011 23:13:22 -0000      1.10
+++ arch/mips/conf/files.atheros        9 Feb 2014 17:43:22 -0000
@@ -24,7 +24,6 @@ file  arch/mips/atheros/arbusle.c             arbus
 # On-chip UART device
 attach com at arbus with com_arbus
 file   arch/mips/atheros/dev/com_arbus.c       com_arbus
-options        COM_REGMAP

 # On-chip ethernet device(s)
 device ae: ether, ifnet, arp, mii
Index: arch/mips/conf/files.ralink
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/conf/files.ralink,v
retrieving revision 1.3
diff -u -p -r1.3 files.ralink
--- arch/mips/conf/files.ralink 2 Aug 2011 03:40:00 -0000       1.3
+++ arch/mips/conf/files.ralink 9 Feb 2014 17:43:22 -0000
@@ -13,7 +13,6 @@ file  arch/mips/ralink/ralink_wdog.c          rwd
 # On-chip UART device as generic com
 attach com at mainbus with ralink_com
 file   arch/mips/ralink/ralink_com.c           ralink_com
-options COM_REGMAP

 # Ralink GPIO Controller
 device rgpio: gpiobus
Index: arch/mips/ralink/ralink_com.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/ralink/ralink_com.c,v
retrieving revision 1.3
diff -u -p -r1.3 ralink_com.c
--- arch/mips/ralink/ralink_com.c       1 Feb 2012 02:05:14 -0000       1.3
+++ arch/mips/ralink/ralink_com.c       9 Feb 2014 17:43:22 -0000
@@ -167,8 +167,8 @@ CFATTACH_DECL_NEW(ralink_com, sizeof(str
 #define CONMODE        \
        ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */

-#ifndef COM_REGMAP
-#error  COM_REGMAP not defined!
+#ifdef COM_NO_REGMAP
+#error  COM_NO_REGMAP not supported!
 #endif

 static inline uint32_t
@@ -268,7 +268,8 @@ ralink_com_attach(device_t parent, devic
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, ma->ma_memt, ioh, RA_UART_LITE_BASE);
+       COM_INIT_REGS(sc->sc_regs, ma->ma_memt, ioh, RA_UART_LITE_BASE,
+           sizeof(uint8_t));
        sc->sc_dev = self;
        sc->sc_frequency = RA_UART_FREQ;
        sc->sc_regs.cr_nports = 0x1000;
Index: arch/mmeye/dev/com_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mmeye/dev/com_mainbus.c,v
retrieving revision 1.12
diff -u -p -r1.12 com_mainbus.c
--- arch/mmeye/dev/com_mainbus.c        19 Jul 2011 15:17:20 -0000      1.12
+++ arch/mmeye/dev/com_mainbus.c        9 Feb 2014 17:43:22 -0000
@@ -98,10 +98,10 @@ com_mainbus_attach(device_t parent, devi
                }
        csc->sc_dev = self;
        csc->sc_frequency = COM_FREQ;
-       COM_INIT_REGS(csc->sc_regs, iot, ioh, ma->ma_addr1);
+       COM_INIT_REGS(csc->sc_regs, iot, ioh, ma->ma_addr1, sizeof(uint8_t));

        /* sanity check */
-       if (!comprobe1(iot, ioh)) {
+       if (!comprobe1(iot, ioh, sizeof(uint8_t))) {
                aprint_error(": device problem. don't attach.\n");
                return;
        }
Index: arch/powerpc/booke/dev/pq3duart.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/booke/dev/pq3duart.c,v
retrieving revision 1.3
diff -u -p -r1.3 pq3duart.c
--- arch/powerpc/booke/dev/pq3duart.c   1 Aug 2011 17:05:17 -0000       1.3
+++ arch/powerpc/booke/dev/pq3duart.c   9 Feb 2014 17:43:23 -0000
@@ -114,7 +114,7 @@ com_pq3duart_match(device_t parent, cfda
        if (bus_space_map(memt, addr, size, 0, &memh))
                return 0;

-       COM_INIT_REGS(regs, memt, memh, addr);
+       COM_INIT_REGS(regs, memt, memh, addr, sizeof(uint8_t));

        int rv = com_probe_subr(&regs);

@@ -212,7 +212,7 @@ com_pq3duart_attach(device_t parent, dev
                }
        }

-       COM_INIT_REGS(sc->sc_regs, memt, memh, addr);
+       COM_INIT_REGS(sc->sc_regs, memt, memh, addr, sizeof(uint8_t));
        sc->sc_regs.cr_nports = size;

        com_attach_subr(sc);
Index: arch/powerpc/ibm4xx/dev/com_opb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/dev/com_opb.c,v
retrieving revision 1.21
diff -u -p -r1.21 com_opb.c
--- arch/powerpc/ibm4xx/dev/com_opb.c   18 Jun 2011 06:41:42 -0000      1.21
+++ arch/powerpc/ibm4xx/dev/com_opb.c   9 Feb 2014 17:43:23 -0000
@@ -119,7 +119,8 @@ com_opb_attach(device_t parent, device_t
        /* XXX console check */

        bus_space_map(oaa->opb_bt, oaa->opb_addr, COM_NPORTS, 0, &ioh);
-       COM_INIT_REGS(sc->sc_regs, oaa->opb_bt, ioh, oaa->opb_addr);
+       COM_INIT_REGS(sc->sc_regs, oaa->opb_bt, ioh, oaa->opb_addr,
+           sizeof(uint8_t));

        freq = prop_dictionary_get(device_properties(sc->sc_dev),
            "clock-frequency");
Index: arch/rs6000/ioplanar/com_iop.c
===================================================================
RCS file: /cvsroot/src/sys/arch/rs6000/ioplanar/com_iop.c,v
retrieving revision 1.4
diff -u -p -r1.4 com_iop.c
--- arch/rs6000/ioplanar/com_iop.c      18 Jul 2011 17:26:55 -0000      1.4
+++ arch/rs6000/ioplanar/com_iop.c      9 Feb 2014 17:43:23 -0000
@@ -116,7 +116,8 @@ com_iop_attach(device_t parent, device_t
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, idaa->idaa_iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, idaa->idaa_iot, ioh, iobase,
+           sizeof(uint8_t));

        aprint_normal("i/o %#x-%#x irq %d", iobase, iobase + COM_NPORTS - 1,
            irq);
Index: arch/sandpoint/sandpoint/com_eumb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sandpoint/sandpoint/com_eumb.c,v
retrieving revision 1.8
diff -u -p -r1.8 com_eumb.c
--- arch/sandpoint/sandpoint/com_eumb.c 29 Dec 2011 10:27:36 -0000      1.8
+++ arch/sandpoint/sandpoint/com_eumb.c 9 Feb 2014 17:43:23 -0000
@@ -94,7 +94,8 @@ com_eumb_attach(device_t parent, device_
                sc->sc_regs = cnregs;
        } else {
                bus_space_map(eaa->eumb_bt, comaddr, COM_NPORTS, 0, &ioh);
-               COM_INIT_REGS(sc->sc_regs, eaa->eumb_bt, ioh, comaddr);
+               COM_INIT_REGS(sc->sc_regs, eaa->eumb_bt, ioh, comaddr,
+                   sizeof(uint8_t));
        }
        sc->sc_frequency = 4 * ticks_per_sec;
        epicirq = (eaa->eumb_unit == 1) ? 25 : 24;
Index: arch/sgimips/mace/com_mace.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/mace/com_mace.c,v
retrieving revision 1.9
diff -u -p -r1.9 com_mace.c
--- arch/sgimips/mace/com_mace.c        1 Jul 2011 18:53:47 -0000       1.9
+++ arch/sgimips/mace/com_mace.c        9 Feb 2014 17:43:23 -0000
@@ -96,7 +96,7 @@ com_mace_attach(device_t parent, device_
         */
        ioh = maa->maa_sh + maa->maa_offset;
        /* note that ioh on mac is *also* the iobase address */
-       COM_INIT_REGS(sc->sc_regs, maa->maa_st, ioh, ioh);
+       COM_INIT_REGS(sc->sc_regs, maa->maa_st, ioh, ioh, sizeof(uint8_t));

        sc->sc_frequency = COM_FREQ;

Index: arch/sparc/dev/com_ebus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/dev/com_ebus.c,v
retrieving revision 1.16
diff -u -p -r1.16 com_ebus.c
--- arch/sparc/dev/com_ebus.c   1 Jul 2011 18:50:41 -0000       1.16
+++ arch/sparc/dev/com_ebus.c   9 Feb 2014 17:43:23 -0000
@@ -73,7 +73,7 @@ com_ebus_match(device_t parent, cfdata_t
        if (bus_space_map(ea->ea_bustag, EBUS_ADDR_FROM_REG(&ea->ea_reg[0]),
                          ea->ea_reg[0].size, 0, &ioh) == 0)
        {
-               match = comprobe1(ea->ea_bustag, ioh);
+               match = comprobe1(ea->ea_bustag, ioh, sizeof(uint8_t));
                bus_space_unmap(ea->ea_bustag, ioh, ea->ea_reg[0].size);
        }

@@ -113,7 +113,7 @@ com_ebus_attach(device_t parent, device_
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        com_attach_subr(sc);

Index: arch/sparc/dev/com_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/dev/com_obio.c,v
retrieving revision 1.24
diff -u -p -r1.24 com_obio.c
--- arch/sparc/dev/com_obio.c   1 Jul 2011 18:50:41 -0000       1.24
+++ arch/sparc/dev/com_obio.c   9 Feb 2014 17:43:23 -0000
@@ -140,7 +140,7 @@ com_obio_match(device_t parent, cfdata_t
                if (sbus_bus_map(sa->sa_bustag,
                                 sa->sa_slot, sa->sa_offset, sa->sa_size,
                                 BUS_SPACE_MAP_LINEAR, &ioh) == 0) {
-                       rv = comprobe1(sa->sa_bustag, ioh);
+                       rv = comprobe1(sa->sa_bustag, ioh, sizeof(uint8_t));
 #if 0
                        printf("modem: probe: lcr=0x%02x iir=0x%02x\n",
                                bus_space_read_1(sa->sa_bustag, ioh, 3),
@@ -197,7 +197,7 @@ com_obio_attach(device_t parent, device_
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        if (osc->osc_tadpole) {
                *AUXIO4M_REG |= (AUXIO4M_LED|AUXIO4M_LTE);
Index: arch/sparc64/dev/com_ebus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/com_ebus.c,v
retrieving revision 1.33
diff -u -p -r1.33 com_ebus.c
--- arch/sparc64/dev/com_ebus.c 1 Jul 2011 18:48:36 -0000       1.33
+++ arch/sparc64/dev/com_ebus.c 9 Feb 2014 17:43:23 -0000
@@ -137,7 +137,7 @@ com_ebus_attach(device_t parent, device_
                aprint_error(": can't map register space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        sc->sc_hwflags = 0;
        sc->sc_frequency = BAUD_BASE;
Index: arch/x68k/dev/com_intio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x68k/dev/com_intio.c,v
retrieving revision 1.1
diff -u -p -r1.1 com_intio.c
--- arch/x68k/dev/com_intio.c   29 Apr 2012 07:17:12 -0000      1.1
+++ arch/x68k/dev/com_intio.c   9 Feb 2014 17:43:23 -0000
@@ -83,7 +83,7 @@ com_intio_match(device_t parent, cfdata_
            BUS_SPACE_MAP_SHIFTED_ODD, &ioh))
                return 0;

-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, ia->ia_size);

        return rv;
@@ -117,7 +117,7 @@ com_intio_attach(device_t parent, device
        bus_space_write_1(iot, ioh, COM_PSX16550_REG_VECT, ia->ia_intr);

        sc->sc_frequency = COM_PSX16550_FREQ;
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        /* PSX16550 uses MCR_DRS to switch interrupt priority level */
        SET(sc->sc_mcr, MCR_DRS);       /* 0: ipl2 / 1: ipl4 */
Index: dev/acpi/com_acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/com_acpi.c,v
retrieving revision 1.32
diff -u -p -r1.32 com_acpi.c
--- dev/acpi/com_acpi.c 22 Jul 2010 16:35:24 -0000      1.32
+++ dev/acpi/com_acpi.c 9 Feb 2014 17:43:23 -0000
@@ -138,7 +138,7 @@ com_acpi_attach(device_t parent, device_
                        aprint_error_dev(self, "can't map i/o space\n");
                        goto out;
                }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, base);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, base, sizeof(uint8_t));

        aprint_normal("%s", device_xname(self));

Index: dev/cardbus/com_cardbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/com_cardbus.c,v
retrieving revision 1.30
diff -u -p -r1.30 com_cardbus.c
--- dev/cardbus/com_cardbus.c   1 Aug 2011 11:20:27 -0000       1.30
+++ dev/cardbus/com_cardbus.c   9 Feb 2014 17:43:23 -0000
@@ -228,7 +228,7 @@ com_cardbus_attach (device_t parent, dev
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, iot, ioh, csc->cc_addr);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, csc->cc_addr, sizeof(uint8_t));

        csc->cc_base = csc->cc_addr;
        csc->cc_csr = PCI_COMMAND_MASTER_ENABLE;
Index: dev/ic/com_cpcbus.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/com_cpcbus.c,v
retrieving revision 1.11
diff -u -p -r1.11 com_cpcbus.c
--- dev/ic/com_cpcbus.c 28 Apr 2008 20:23:49 -0000      1.11
+++ dev/ic/com_cpcbus.c 9 Feb 2014 17:43:24 -0000
@@ -80,7 +80,8 @@ com_cpc_attach(device_t parent, device_t
                aprint_error_dev(self, "can't map i/o space\n");
                return;
        }
-       COM_INIT_REGS(sc->sc_com.sc_regs, caa->cpca_tag, ioh, iobase);
+       COM_INIT_REGS(sc->sc_com.sc_regs, caa->cpca_tag, ioh, iobase,
+           sizeof(uint8_t));

        sc->sc_com.sc_frequency = CPC_COM_SPEED(caa->cpca_freq);

Index: dev/ic/com_upc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/com_upc.c,v
retrieving revision 1.11
diff -u -p -r1.11 com_upc.c
--- dev/ic/com_upc.c    25 Jan 2009 14:34:14 -0000      1.11
+++ dev/ic/com_upc.c    9 Feb 2014 17:43:24 -0000
@@ -64,7 +64,8 @@ com_upc_attach(device_t parent, device_t
        sc->sc_dev = self;
        sc->sc_frequency = COM_FREQ;

-       COM_INIT_REGS(sc->sc_regs, ua->ua_iot, ua->ua_ioh, ua->ua_offset);
+       COM_INIT_REGS(sc->sc_regs, ua->ua_iot, ua->ua_ioh, ua->ua_offset,
+           sizeof(uint8_t));
        com_attach_subr(sc);
        upc_intr_establish(ua->ua_irqhandle, IPL_SERIAL, comintr, sc);
 }
Index: dev/isa/addcom_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/addcom_isa.c,v
retrieving revision 1.20
diff -u -p -r1.20 addcom_isa.c
--- dev/isa/addcom_isa.c        27 Oct 2012 17:18:23 -0000      1.20
+++ dev/isa/addcom_isa.c        9 Feb 2014 17:43:24 -0000
@@ -150,7 +150,7 @@ addcomprobe(device_t parent, cfdata_t se
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isa/ast.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/ast.c,v
retrieving revision 1.65
diff -u -p -r1.65 ast.c
--- dev/isa/ast.c       27 Oct 2012 17:18:23 -0000      1.65
+++ dev/isa/ast.c       9 Feb 2014 17:43:24 -0000
@@ -108,7 +108,7 @@ astprobe(device_t parent, cfdata_t self,
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isa/boca.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/boca.c,v
retrieving revision 1.54
diff -u -p -r1.54 boca.c
--- dev/isa/boca.c      27 Oct 2012 17:18:24 -0000      1.54
+++ dev/isa/boca.c      9 Feb 2014 17:43:24 -0000
@@ -114,7 +114,7 @@ bocaprobe(device_t parent, cfdata_t self
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isa/com_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/com_isa.c,v
retrieving revision 1.39
diff -u -p -r1.39 com_isa.c
--- dev/isa/com_isa.c   24 Feb 2010 22:37:58 -0000      1.39
+++ dev/isa/com_isa.c   9 Feb 2014 17:43:24 -0000
@@ -143,7 +143,7 @@ com_isa_probe(device_t parent, cfdata_t
                if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) {
                        return 0;
                }
-               rv = comprobe1(iot, ioh);
+               rv = comprobe1(iot, ioh, sizeof(uint8_t));
                bus_space_unmap(iot, ioh, COM_NPORTS);
        }

@@ -187,7 +187,7 @@ com_isa_attach(device_t parent, device_t

        sc->sc_dev = self;

-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        sc->sc_frequency = COM_FREQ;
        irq = ia->ia_irq[0].ir_irq;
Index: dev/isa/com_multi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/com_multi.c,v
retrieving revision 1.29
diff -u -p -r1.29 com_multi.c
--- dev/isa/com_multi.c 23 Nov 2009 02:13:47 -0000      1.29
+++ dev/isa/com_multi.c 9 Feb 2014 17:43:24 -0000
@@ -114,7 +114,7 @@ com_multi_probe(device_t parent, cfdata_
        if (com_is_console(ca->ca_iot, iobase, 0))
                return 1;

-       return comprobe1(ca->ca_iot, ca->ca_ioh);
+       return comprobe1(ca->ca_iot, ca->ca_ioh, sizeof(uint8_t));
 }

 void
@@ -128,7 +128,8 @@ com_multi_attach(device_t parent, device
        /*
         * We're living on a commulti.
         */
-       COM_INIT_REGS(sc->sc_regs, ca->ca_iot, ca->ca_ioh, ca->ca_iobase);
+       COM_INIT_REGS(sc->sc_regs, ca->ca_iot, ca->ca_ioh, ca->ca_iobase,
+           sizeof(uint8_t));
        sc->sc_frequency = 115200 * 16;

        if (ca->ca_noien)
Index: dev/isa/ioat66.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/ioat66.c,v
retrieving revision 1.21
diff -u -p -r1.21 ioat66.c
--- dev/isa/ioat66.c    27 Oct 2012 17:18:24 -0000      1.21
+++ dev/isa/ioat66.c    9 Feb 2014 17:43:24 -0000
@@ -110,7 +110,7 @@ ioat66probe(device_t parent, cfdata_t se
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isa/moxa_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/moxa_isa.c,v
retrieving revision 1.20
diff -u -p -r1.20 moxa_isa.c
--- dev/isa/moxa_isa.c  27 Oct 2012 17:18:25 -0000      1.20
+++ dev/isa/moxa_isa.c  9 Feb 2014 17:43:24 -0000
@@ -107,7 +107,7 @@ moxa_isaprobe(device_t parent, cfdata_t
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isa/rtfps.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/rtfps.c,v
retrieving revision 1.58
diff -u -p -r1.58 rtfps.c
--- dev/isa/rtfps.c     27 Oct 2012 17:18:25 -0000      1.58
+++ dev/isa/rtfps.c     9 Feb 2014 17:43:24 -0000
@@ -106,7 +106,7 @@ rtfpsprobe(device_t parent, cfdata_t sel
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isa/tcom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/tcom.c,v
retrieving revision 1.19
diff -u -p -r1.19 tcom.c
--- dev/isa/tcom.c      12 May 2009 09:10:16 -0000      1.19
+++ dev/isa/tcom.c      9 Feb 2014 17:43:24 -0000
@@ -147,7 +147,7 @@ tcomprobe(device_t parent, cfdata_t self
                rv = 0;
                goto out;
        }
-       rv = comprobe1(iot, ioh);
+       rv = comprobe1(iot, ioh, sizeof(uint8_t));
        bus_space_unmap(iot, ioh, COM_NPORTS);
        if (rv == 0)
                goto out;
Index: dev/isapnp/com_isapnp.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isapnp/com_isapnp.c,v
retrieving revision 1.29
diff -u -p -r1.29 com_isapnp.c
--- dev/isapnp/com_isapnp.c     28 Apr 2008 20:23:52 -0000      1.29
+++ dev/isapnp/com_isapnp.c     9 Feb 2014 17:43:24 -0000
@@ -92,7 +92,7 @@ com_isapnp_attach(device_t parent, devic
        }

        COM_INIT_REGS(sc->sc_regs, ipa->ipa_iot, ipa->ipa_io[0].h,
-           ipa->ipa_io[0].base);
+           ipa->ipa_io[0].base, sizeof(uint8_t));

        /*
         * if the chip isn't something we recognise skip it.
Index: dev/mca/com_mca.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mca/com_mca.c,v
retrieving revision 1.22
diff -u -p -r1.22 com_mca.c
--- dev/mca/com_mca.c   23 Nov 2009 02:13:47 -0000      1.22
+++ dev/mca/com_mca.c   9 Feb 2014 17:43:24 -0000
@@ -166,7 +166,7 @@ com_mca_attach(device_t parent, device_t
                return;
        }

-       COM_INIT_REGS(sc->sc_regs, ma->ma_iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, ma->ma_iot, ioh, iobase, sizeof(uint8_t));
        sc->sc_frequency = COM_FREQ;

        aprint_normal(" slot %d i/o %#x-%#x irq %d", ma->ma_slot + 1,
Index: dev/ofisa/com_ofisa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ofisa/com_ofisa.c,v
retrieving revision 1.15
diff -u -p -r1.15 com_ofisa.c
--- dev/ofisa/com_ofisa.c       27 Oct 2012 17:18:27 -0000      1.15
+++ dev/ofisa/com_ofisa.c       9 Feb 2014 17:43:24 -0000
@@ -147,7 +147,7 @@ com_ofisa_attach(device_t parent, device
                aprint_error(": can't map register space\n");
                 return;
         }
-       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(sc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        osc->sc_ih = isa_intr_establish(aa->ic, intr.irq, intr.share,
            IPL_SERIAL, comintr, sc);
Index: dev/pcmcia/com_pcmcia.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/com_pcmcia.c,v
retrieving revision 1.61
diff -u -p -r1.61 com_pcmcia.c
--- dev/pcmcia/com_pcmcia.c     23 Nov 2009 02:13:47 -0000      1.61
+++ dev/pcmcia/com_pcmcia.c     9 Feb 2014 17:43:25 -0000
@@ -189,7 +189,7 @@ com_pcmcia_attach(device_t parent, devic

        cfe = pa->pf->cfe;
        COM_INIT_REGS(sc->sc_regs, cfe->iospace[0].handle.iot,
-           cfe->iospace[0].handle.ioh, -1);
+           cfe->iospace[0].handle.ioh, -1, sizeof(uint8_t));

        error = com_pcmcia_enable(sc);
        if (error)
Index: dev/pcmcia/mhzc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/mhzc.c,v
retrieving revision 1.50
diff -u -p -r1.50 mhzc.c
--- dev/pcmcia/mhzc.c   27 Oct 2012 17:18:37 -0000      1.50
+++ dev/pcmcia/mhzc.c   9 Feb 2014 17:43:25 -0000
@@ -625,7 +625,7 @@ com_mhzc_attach(device_t parent, device_
        COM_INIT_REGS(sc->sc_regs,
            msc->sc_modem_pcioh.iot,
            msc->sc_modem_pcioh.ioh,
-           -1);
+           -1, sizeof(uint8_t));

        sc->enabled = 1;

Index: dev/pcmcia/pcmcom.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/pcmcom.c,v
retrieving revision 1.40
diff -u -p -r1.40 pcmcom.c
--- dev/pcmcia/pcmcom.c 27 Oct 2012 17:18:37 -0000      1.40
+++ dev/pcmcia/pcmcom.c 9 Feb 2014 17:43:25 -0000
@@ -319,7 +319,8 @@ com_pcmcom_attach(device_t parent, devic
        struct pcmcom_attach_args *pca = aux;

        sc->sc_dev = self;
-       COM_INIT_REGS(sc->sc_regs, pca->pca_iot, pca->pca_ioh, -1);
+       COM_INIT_REGS(sc->sc_regs, pca->pca_iot, pca->pca_ioh, -1,
+           sizeof(uint8_t));
        sc->enabled = 1;

        sc->sc_frequency = COM_FREQ;
Index: dev/pcmcia/xirc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pcmcia/xirc.c,v
retrieving revision 1.33
diff -u -p -r1.33 xirc.c
--- dev/pcmcia/xirc.c   14 Feb 2012 13:51:19 -0000      1.33
+++ dev/pcmcia/xirc.c   9 Feb 2014 17:43:25 -0000
@@ -559,7 +559,7 @@ com_xirc_attach(device_t parent, device_
        COM_INIT_REGS(sc->sc_regs,
            msc->sc_modem_pcioh.iot,
            msc->sc_modem_pcioh.ioh,
-           -1);
+           -1, sizeof(uint8_t));

        sc->enabled = 1;

Index: dev/podulebus/acemidi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/podulebus/acemidi.c,v
retrieving revision 1.14
diff -u -p -r1.14 acemidi.c
--- dev/podulebus/acemidi.c     14 Mar 2008 15:09:11 -0000      1.14
+++ dev/podulebus/acemidi.c     9 Feb 2014 17:43:25 -0000
@@ -102,7 +102,7 @@ com_acemidi_attach(device_t parent, devi
        iobase = pa->pa_fast_base + ACEMIDI_16550_BASE;

        bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh);
-       COM_INIT_REGS(csc->sc_regs, iot, ioh, iobase);
+       COM_INIT_REGS(csc->sc_regs, iot, ioh, iobase, sizeof(uint8_t));

        csc->sc_frequency = ACEMIDI_16550_FREQ;



-- 
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)



Home | Main Index | Thread Index | Old Index