diff --git a/sys/mips/adm5120/obio.c b/sys/mips/adm5120/obio.c index 7e61ff5de756..8d8392834b2d 100644 --- a/sys/mips/adm5120/obio.c +++ b/sys/mips/adm5120/obio.c @@ -269,7 +269,7 @@ obio_activate_resource(device_t bus, device_t child, int type, int rid, vaddr = (void *)MIPS_PHYS_TO_KSEG1((intptr_t)rman_get_start(r)); rman_set_virtual(r, vaddr); - rman_set_bustag(r, &mips_bus_space_generic); + rman_set_bustag(r, mips_bus_space_generic); rman_set_bushandle(r, (bus_space_handle_t)vaddr); } diff --git a/sys/mips/adm5120/uart_cpu_adm5120.c b/sys/mips/adm5120/uart_cpu_adm5120.c index 0828ea56bb23..935d109fe16f 100644 --- a/sys/mips/adm5120/uart_cpu_adm5120.c +++ b/sys/mips/adm5120/uart_cpu_adm5120.c @@ -67,7 +67,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->ops = uart_getops(&uart_adm5120_uart_class); di->bas.chan = 0; - di->bas.bst = &mips_bus_space_generic; + di->bas.bst = mips_bus_space_generic; di->bas.regshft = 0; di->bas.rclk = 0; di->baudrate = 115200; @@ -76,7 +76,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->parity = UART_PARITY_NONE; uart_bus_space_io = 0; - uart_bus_space_mem = &mips_bus_space_generic; + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(ADM5120_BASE_UART0); return (0); diff --git a/sys/mips/alchemy/obio.c b/sys/mips/alchemy/obio.c index 7e61ff5de756..8d8392834b2d 100644 --- a/sys/mips/alchemy/obio.c +++ b/sys/mips/alchemy/obio.c @@ -269,7 +269,7 @@ obio_activate_resource(device_t bus, device_t child, int type, int rid, vaddr = (void *)MIPS_PHYS_TO_KSEG1((intptr_t)rman_get_start(r)); rman_set_virtual(r, vaddr); - rman_set_bustag(r, &mips_bus_space_generic); + rman_set_bustag(r, mips_bus_space_generic); rman_set_bushandle(r, (bus_space_handle_t)vaddr); } diff --git a/sys/mips/alchemy/uart_cpu_alchemy.c b/sys/mips/alchemy/uart_cpu_alchemy.c index d38d4cd3ad9d..c995130ccd2c 100644 --- a/sys/mips/alchemy/uart_cpu_alchemy.c +++ b/sys/mips/alchemy/uart_cpu_alchemy.c @@ -63,7 +63,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = &mips_bus_space_generic; + di->bas.bst = mips_bus_space_generic; di->bas.regshft = 0; di->bas.rclk = 0; di->baudrate = 115200; @@ -72,7 +72,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->parity = UART_PARITY_NONE; uart_bus_space_io = 0; - uart_bus_space_mem = &mips_bus_space_generic; + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(UART0_BASE); return (0); diff --git a/sys/mips/idt/uart_bus_rc32434.c b/sys/mips/idt/uart_bus_rc32434.c index 78edf62c052a..40e47705fc07 100644 --- a/sys/mips/idt/uart_bus_rc32434.c +++ b/sys/mips/idt/uart_bus_rc32434.c @@ -88,10 +88,10 @@ uart_rc32434_probe(device_t dev) sc->sc_class = &uart_ns8250_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); sc->sc_sysdev->bas.regshft = 2; - sc->sc_sysdev->bas.bst = &mips_bus_space_generic; + sc->sc_sysdev->bas.bst = mips_bus_space_generic; sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(IDT_BASE_UART0); sc->sc_bas.regshft = 2; - sc->sc_bas.bst = &mips_bus_space_generic; + sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(IDT_BASE_UART0); return (uart_bus_probe(dev, 2, 330000000UL/2, 0, 0)); diff --git a/sys/mips/idt/uart_cpu_rc32434.c b/sys/mips/idt/uart_cpu_rc32434.c index 862c8bcd5472..51be944df7e3 100644 --- a/sys/mips/idt/uart_cpu_rc32434.c +++ b/sys/mips/idt/uart_cpu_rc32434.c @@ -71,7 +71,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) /* Got it. Fill in the instance and return it. */ di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = &mips_bus_space_generic; + di->bas.bst = mips_bus_space_generic; di->bas.regshft = 2; di->bas.rclk = 330000000UL/2; /* IPbus clock */ di->baudrate = 115200; @@ -79,7 +79,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->stopbits = 1; di->parity = UART_PARITY_NONE; uart_bus_space_io = 0; - uart_bus_space_mem = &mips_bus_space_generic; + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(maddr); return (0); } diff --git a/sys/mips/include/bus.h b/sys/mips/include/bus.h index 1136bced64a6..ecb50e5f6dfc 100644 --- a/sys/mips/include/bus.h +++ b/sys/mips/include/bus.h @@ -717,7 +717,7 @@ void __bs_c(f,_bs_c_8) (void *t, bus_space_handle_t bsh1, \ * declare generic bus space, it suits all needs in */ DECLARE_BUS_SPACE_PROTOTYPES(generic); -extern struct bus_space mips_bus_space_generic; +extern bus_space_tag_t mips_bus_space_generic; #include #endif /* _MACHINE_BUS_H_ */ diff --git a/sys/mips/malta/gt_pci.c b/sys/mips/malta/gt_pci.c index 61e39b847d38..b5bb5bd13bbc 100644 --- a/sys/mips/malta/gt_pci.c +++ b/sys/mips/malta/gt_pci.c @@ -206,7 +206,7 @@ gt_pci_attach(device_t dev) busno = 0; sc->sc_dev = dev; sc->sc_busno = busno; - sc->sc_st = &mips_bus_space_generic; + sc->sc_st = mips_bus_space_generic; /* Use KSEG1 to access IO ports for it is uncached */ sc->sc_io = MIPS_PHYS_TO_KSEG1(MALTA_PCI0_IO_BASE); diff --git a/sys/mips/malta/obio.c b/sys/mips/malta/obio.c index 1f0008096479..39025d5b7372 100644 --- a/sys/mips/malta/obio.c +++ b/sys/mips/malta/obio.c @@ -84,7 +84,7 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - sc->oba_st = &mips_bus_space_generic; + sc->oba_st = mips_bus_space_generic; sc->oba_addr = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); sc->oba_size = MALTA_PCIMEM3_SIZE; sc->oba_rman.rm_type = RMAN_ARRAY; diff --git a/sys/mips/malta/uart_bus_maltausart.c b/sys/mips/malta/uart_bus_maltausart.c index 57f8ce389c75..e82384f05588 100644 --- a/sys/mips/malta/uart_bus_maltausart.c +++ b/sys/mips/malta/uart_bus_maltausart.c @@ -88,9 +88,9 @@ uart_malta_probe(device_t dev) sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &uart_ns8250_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_sysdev->bas.bst = &mips_bus_space_generic; + sc->sc_sysdev->bas.bst = mips_bus_space_generic; sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); - sc->sc_bas.bst = &mips_bus_space_generic; + sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); return(uart_bus_probe(dev, 0, 0, 0, 0)); } diff --git a/sys/mips/malta/uart_cpu_maltausart.c b/sys/mips/malta/uart_cpu_maltausart.c index d25ce5cc9540..01ef8db332d3 100644 --- a/sys/mips/malta/uart_cpu_maltausart.c +++ b/sys/mips/malta/uart_cpu_maltausart.c @@ -67,7 +67,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) { di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = &mips_bus_space_generic; + di->bas.bst = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); di->bas.regshft = 0; di->bas.rclk = 0; @@ -77,6 +77,6 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->parity = UART_PARITY_NONE; uart_bus_space_io = NULL; - uart_bus_space_mem = &mips_bus_space_generic; + uart_bus_space_mem = mips_bus_space_generic; return (0); } diff --git a/sys/mips/mips/bus_space_generic.c b/sys/mips/mips/bus_space_generic.c index 981cc5269630..8f8ec6283e27 100644 --- a/sys/mips/mips/bus_space_generic.c +++ b/sys/mips/mips/bus_space_generic.c @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct bus_space mips_bus_space_generic = { +static struct bus_space generic_space = { /* cookie */ (void *) 0, @@ -196,7 +196,8 @@ struct bus_space mips_bus_space_generic = { NULL, }; - +/* generic bus_space tag */ +bus_space_tag_t mips_bus_space_generic = &generic_space; int generic_bs_map(void *t __unused, bus_addr_t addr, diff --git a/sys/mips/sentry5/obio.c b/sys/mips/sentry5/obio.c index 073035800ff6..65c76aba3829 100644 --- a/sys/mips/sentry5/obio.c +++ b/sys/mips/sentry5/obio.c @@ -119,7 +119,6 @@ obio_alloc_resource(device_t bus, device_t child, int type, int *rid, { struct resource *rv; struct rman *rm; - bus_space_tag_t bt = 0; bus_space_handle_t bh = 0; struct obio_softc *sc = device_get_softc(bus); @@ -131,7 +130,6 @@ obio_alloc_resource(device_t bus, device_t child, int type, int *rid, return (NULL); case SYS_RES_IOPORT: rm = &sc->oba_rman; - bt = sc->oba_st; bh = sc->oba_addr; start = bh; break; @@ -146,7 +144,7 @@ obio_alloc_resource(device_t bus, device_t child, int type, int *rid, if (type == SYS_RES_IRQ) return (rv); rman_set_rid(rv, *rid); - rman_set_bustag(rv, bt); + rman_set_bustag(rv, mips_bus_space_generic); rman_set_bushandle(rv, bh); if (0) { diff --git a/sys/mips/sentry5/uart_bus_sbusart.c b/sys/mips/sentry5/uart_bus_sbusart.c index 21a6f58c019e..c6c4c8d13a9a 100644 --- a/sys/mips/sentry5/uart_bus_sbusart.c +++ b/sys/mips/sentry5/uart_bus_sbusart.c @@ -85,9 +85,9 @@ uart_malta_probe(device_t dev) sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &uart_ns8250_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_sysdev->bas.bst = 0; + sc->sc_sysdev->bas.bst = mips_bus_space_generic; sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); - sc->sc_bas.bst = 0; + sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); return(uart_bus_probe(dev, 0, 0, 0, 0)); } diff --git a/sys/mips/sentry5/uart_cpu_sbusart.c b/sys/mips/sentry5/uart_cpu_sbusart.c index 10ee7be94462..68b761d9d745 100644 --- a/sys/mips/sentry5/uart_cpu_sbusart.c +++ b/sys/mips/sentry5/uart_cpu_sbusart.c @@ -76,7 +76,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->parity = UART_PARITY_NONE; uart_bus_space_io = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); - uart_bus_space_mem = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); return (0); }