diff options
-rw-r--r-- | sys/amd64/amd64/legacy.c | 39 | ||||
-rw-r--r-- | sys/amd64/amd64/nexus.c | 39 | ||||
-rw-r--r-- | sys/amd64/isa/isa.c | 20 | ||||
-rw-r--r-- | sys/i386/i386/legacy.c | 39 | ||||
-rw-r--r-- | sys/i386/i386/nexus.c | 39 | ||||
-rw-r--r-- | sys/i386/include/bus_pc98.h | 200 | ||||
-rw-r--r-- | sys/i386/isa/isa.c | 20 |
7 files changed, 232 insertions, 164 deletions
diff --git a/sys/amd64/amd64/legacy.c b/sys/amd64/amd64/legacy.c index af50538..f012941 100644 --- a/sys/amd64/amd64/legacy.c +++ b/sys/amd64/amd64/legacy.c @@ -73,8 +73,10 @@ #include <i386/isa/intr_machdep.h> #include <sys/rtprio.h> +#ifdef PC98 +MALLOC_DEFINE(M_BUSSPACEHANDLE, "busspacehandle", "Bus space handle"); +#endif MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); - struct nexus_device { struct resource_list nx_resources; int nx_pcibus; @@ -434,6 +436,15 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) return 0; +#ifdef PC98 + /* Allocate bushandle. */ + rv->r_bushandle = + malloc(sizeof *rv->r_bushandle, M_BUSSPACEHANDLE, M_NOWAIT); + if (rv->r_bushandle == 0) { + rman_release_resource(rv); + return 0; + } +#endif if (type == SYS_RES_MEMORY) { rman_set_bustag(rv, I386_BUS_SPACE_MEM); @@ -441,11 +452,11 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_set_bustag(rv, I386_BUS_SPACE_IO); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - rv->r_bushandle.bsh_base = rv->r_start; - rv->r_bushandle.bsh_iat = NULL; - rv->r_bushandle.bsh_iatsz = 0; - rv->r_bushandle.bsh_res = NULL; - rv->r_bushandle.bsh_ressz = 0; + rv->r_bushandle->bsh_base = rv->r_start; + rv->r_bushandle->bsh_iat = NULL; + rv->r_bushandle->bsh_iatsz = 0; + rv->r_bushandle->bsh_res = NULL; + rv->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(rv, rv->r_start); @@ -454,6 +465,9 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, if (needactivate) { if (bus_activate_resource(child, type, *rid, rv)) { +#ifdef PC98 + free(rv->r_bushandle, M_BUSSPACEHANDLE); +#endif rman_release_resource(rv); return 0; } @@ -491,11 +505,11 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, rman_set_virtual(r, vaddr); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - r->r_bushandle.bsh_base = (bus_addr_t) vaddr; - r->r_bushandle.bsh_iat = NULL; - r->r_bushandle.bsh_iatsz = 0; - r->r_bushandle.bsh_res = NULL; - r->r_bushandle.bsh_ressz = 0; + r->r_bushandle->bsh_base = (bus_addr_t) vaddr; + r->r_bushandle->bsh_iat = NULL; + r->r_bushandle->bsh_iatsz = 0; + r->r_bushandle->bsh_res = NULL; + r->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(r, (bus_space_handle_t) vaddr); @@ -531,6 +545,9 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid, if (error) return error; } +#ifdef PC98 + free(r->r_bushandle, M_BUSSPACEHANDLE); +#endif return (rman_release_resource(r)); } diff --git a/sys/amd64/amd64/nexus.c b/sys/amd64/amd64/nexus.c index af50538..f012941 100644 --- a/sys/amd64/amd64/nexus.c +++ b/sys/amd64/amd64/nexus.c @@ -73,8 +73,10 @@ #include <i386/isa/intr_machdep.h> #include <sys/rtprio.h> +#ifdef PC98 +MALLOC_DEFINE(M_BUSSPACEHANDLE, "busspacehandle", "Bus space handle"); +#endif MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); - struct nexus_device { struct resource_list nx_resources; int nx_pcibus; @@ -434,6 +436,15 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) return 0; +#ifdef PC98 + /* Allocate bushandle. */ + rv->r_bushandle = + malloc(sizeof *rv->r_bushandle, M_BUSSPACEHANDLE, M_NOWAIT); + if (rv->r_bushandle == 0) { + rman_release_resource(rv); + return 0; + } +#endif if (type == SYS_RES_MEMORY) { rman_set_bustag(rv, I386_BUS_SPACE_MEM); @@ -441,11 +452,11 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_set_bustag(rv, I386_BUS_SPACE_IO); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - rv->r_bushandle.bsh_base = rv->r_start; - rv->r_bushandle.bsh_iat = NULL; - rv->r_bushandle.bsh_iatsz = 0; - rv->r_bushandle.bsh_res = NULL; - rv->r_bushandle.bsh_ressz = 0; + rv->r_bushandle->bsh_base = rv->r_start; + rv->r_bushandle->bsh_iat = NULL; + rv->r_bushandle->bsh_iatsz = 0; + rv->r_bushandle->bsh_res = NULL; + rv->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(rv, rv->r_start); @@ -454,6 +465,9 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, if (needactivate) { if (bus_activate_resource(child, type, *rid, rv)) { +#ifdef PC98 + free(rv->r_bushandle, M_BUSSPACEHANDLE); +#endif rman_release_resource(rv); return 0; } @@ -491,11 +505,11 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, rman_set_virtual(r, vaddr); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - r->r_bushandle.bsh_base = (bus_addr_t) vaddr; - r->r_bushandle.bsh_iat = NULL; - r->r_bushandle.bsh_iatsz = 0; - r->r_bushandle.bsh_res = NULL; - r->r_bushandle.bsh_ressz = 0; + r->r_bushandle->bsh_base = (bus_addr_t) vaddr; + r->r_bushandle->bsh_iat = NULL; + r->r_bushandle->bsh_iatsz = 0; + r->r_bushandle->bsh_res = NULL; + r->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(r, (bus_space_handle_t) vaddr); @@ -531,6 +545,9 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid, if (error) return error; } +#ifdef PC98 + free(r->r_bushandle, M_BUSSPACEHANDLE); +#endif return (rman_release_resource(r)); } diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c index ab9427d..3c7ecb9 100644 --- a/sys/amd64/isa/isa.c +++ b/sys/amd64/isa/isa.c @@ -187,8 +187,8 @@ isa_alloc_resourcev(device_t child, int type, int *rid, } } - re->r_bushandle.bsh_res = bsre; - re->r_bushandle.bsh_ressz = ressz; + re->r_bushandle->bsh_res = bsre; + re->r_bushandle->bsh_ressz = ressz; return re; } @@ -207,8 +207,8 @@ isa_load_resourcev(struct resource *re, bus_addr_t *res, bus_size_t count) addr[i] = rman_get_start(re) + res[i]; rman_set_bustag(re, I386_BUS_SPACE_IO_IND); - re->r_bushandle.bsh_iat = addr; - re->r_bushandle.bsh_iatsz = count; + re->r_bushandle->bsh_iat = addr; + re->r_bushandle->bsh_iatsz = count; return 0; } @@ -227,13 +227,13 @@ isa_release_resource(device_t bus, device_t child, int type, int rid, */ int i; - for (i = 1; i < r->r_bushandle.bsh_ressz; i++) + for (i = 1; i < r->r_bushandle->bsh_ressz; i++) resource_list_release(rl, bus, child, type, rid + i, - r->r_bushandle.bsh_res[i]); - if (r->r_bushandle.bsh_res != NULL) - free(r->r_bushandle.bsh_res, M_DEVBUF); - if (r->r_bushandle.bsh_iat != NULL) - free(r->r_bushandle.bsh_iat, M_DEVBUF); + r->r_bushandle->bsh_res[i]); + if (r->r_bushandle->bsh_res != NULL) + free(r->r_bushandle->bsh_res, M_DEVBUF); + if (r->r_bushandle->bsh_iat != NULL) + free(r->r_bushandle->bsh_iat, M_DEVBUF); #endif return resource_list_release(rl, bus, child, type, rid, r); } diff --git a/sys/i386/i386/legacy.c b/sys/i386/i386/legacy.c index af50538..f012941 100644 --- a/sys/i386/i386/legacy.c +++ b/sys/i386/i386/legacy.c @@ -73,8 +73,10 @@ #include <i386/isa/intr_machdep.h> #include <sys/rtprio.h> +#ifdef PC98 +MALLOC_DEFINE(M_BUSSPACEHANDLE, "busspacehandle", "Bus space handle"); +#endif MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); - struct nexus_device { struct resource_list nx_resources; int nx_pcibus; @@ -434,6 +436,15 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) return 0; +#ifdef PC98 + /* Allocate bushandle. */ + rv->r_bushandle = + malloc(sizeof *rv->r_bushandle, M_BUSSPACEHANDLE, M_NOWAIT); + if (rv->r_bushandle == 0) { + rman_release_resource(rv); + return 0; + } +#endif if (type == SYS_RES_MEMORY) { rman_set_bustag(rv, I386_BUS_SPACE_MEM); @@ -441,11 +452,11 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_set_bustag(rv, I386_BUS_SPACE_IO); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - rv->r_bushandle.bsh_base = rv->r_start; - rv->r_bushandle.bsh_iat = NULL; - rv->r_bushandle.bsh_iatsz = 0; - rv->r_bushandle.bsh_res = NULL; - rv->r_bushandle.bsh_ressz = 0; + rv->r_bushandle->bsh_base = rv->r_start; + rv->r_bushandle->bsh_iat = NULL; + rv->r_bushandle->bsh_iatsz = 0; + rv->r_bushandle->bsh_res = NULL; + rv->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(rv, rv->r_start); @@ -454,6 +465,9 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, if (needactivate) { if (bus_activate_resource(child, type, *rid, rv)) { +#ifdef PC98 + free(rv->r_bushandle, M_BUSSPACEHANDLE); +#endif rman_release_resource(rv); return 0; } @@ -491,11 +505,11 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, rman_set_virtual(r, vaddr); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - r->r_bushandle.bsh_base = (bus_addr_t) vaddr; - r->r_bushandle.bsh_iat = NULL; - r->r_bushandle.bsh_iatsz = 0; - r->r_bushandle.bsh_res = NULL; - r->r_bushandle.bsh_ressz = 0; + r->r_bushandle->bsh_base = (bus_addr_t) vaddr; + r->r_bushandle->bsh_iat = NULL; + r->r_bushandle->bsh_iatsz = 0; + r->r_bushandle->bsh_res = NULL; + r->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(r, (bus_space_handle_t) vaddr); @@ -531,6 +545,9 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid, if (error) return error; } +#ifdef PC98 + free(r->r_bushandle, M_BUSSPACEHANDLE); +#endif return (rman_release_resource(r)); } diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index af50538..f012941 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -73,8 +73,10 @@ #include <i386/isa/intr_machdep.h> #include <sys/rtprio.h> +#ifdef PC98 +MALLOC_DEFINE(M_BUSSPACEHANDLE, "busspacehandle", "Bus space handle"); +#endif MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); - struct nexus_device { struct resource_list nx_resources; int nx_pcibus; @@ -434,6 +436,15 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) return 0; +#ifdef PC98 + /* Allocate bushandle. */ + rv->r_bushandle = + malloc(sizeof *rv->r_bushandle, M_BUSSPACEHANDLE, M_NOWAIT); + if (rv->r_bushandle == 0) { + rman_release_resource(rv); + return 0; + } +#endif if (type == SYS_RES_MEMORY) { rman_set_bustag(rv, I386_BUS_SPACE_MEM); @@ -441,11 +452,11 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_set_bustag(rv, I386_BUS_SPACE_IO); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - rv->r_bushandle.bsh_base = rv->r_start; - rv->r_bushandle.bsh_iat = NULL; - rv->r_bushandle.bsh_iatsz = 0; - rv->r_bushandle.bsh_res = NULL; - rv->r_bushandle.bsh_ressz = 0; + rv->r_bushandle->bsh_base = rv->r_start; + rv->r_bushandle->bsh_iat = NULL; + rv->r_bushandle->bsh_iatsz = 0; + rv->r_bushandle->bsh_res = NULL; + rv->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(rv, rv->r_start); @@ -454,6 +465,9 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, if (needactivate) { if (bus_activate_resource(child, type, *rid, rv)) { +#ifdef PC98 + free(rv->r_bushandle, M_BUSSPACEHANDLE); +#endif rman_release_resource(rv); return 0; } @@ -491,11 +505,11 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, rman_set_virtual(r, vaddr); #ifdef PC98 /* PC-98: the type of bus_space_handle_t is the structure. */ - r->r_bushandle.bsh_base = (bus_addr_t) vaddr; - r->r_bushandle.bsh_iat = NULL; - r->r_bushandle.bsh_iatsz = 0; - r->r_bushandle.bsh_res = NULL; - r->r_bushandle.bsh_ressz = 0; + r->r_bushandle->bsh_base = (bus_addr_t) vaddr; + r->r_bushandle->bsh_iat = NULL; + r->r_bushandle->bsh_iatsz = 0; + r->r_bushandle->bsh_res = NULL; + r->r_bushandle->bsh_ressz = 0; #else /* IBM-PC: the type of bus_space_handle_t is u_int */ rman_set_bushandle(r, (bus_space_handle_t) vaddr); @@ -531,6 +545,9 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid, if (error) return error; } +#ifdef PC98 + free(r->r_bushandle, M_BUSSPACEHANDLE); +#endif return (rman_release_resource(r)); } diff --git a/sys/i386/include/bus_pc98.h b/sys/i386/include/bus_pc98.h index fef8b86..d1a5ca8 100644 --- a/sys/i386/include/bus_pc98.h +++ b/sys/i386/include/bus_pc98.h @@ -119,7 +119,7 @@ typedef struct { size_t bsh_iatsz; struct resource **bsh_res; size_t bsh_ressz; -} bus_space_handle_t; +}* bus_space_handle_t; /* * Allocate discontinuous resources for ISA bus. @@ -197,19 +197,19 @@ bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - return (inb(bsh.bsh_base + offset)); + return (inb(bsh->bsh_base + offset)); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - return (inb(bsh.bsh_iat[offset])); + return (inb(bsh->bsh_iat[offset])); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) else #endif - return (*(volatile u_int8_t *)(bsh.bsh_base + offset)); + return (*(volatile u_int8_t *)(bsh->bsh_base + offset)); #endif } @@ -221,19 +221,19 @@ bus_space_read_2(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - return (inw(bsh.bsh_base + offset)); + return (inw(bsh->bsh_base + offset)); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - return (inw(bsh.bsh_iat[offset])); + return (inw(bsh->bsh_iat[offset])); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) else #endif - return (*(volatile u_int16_t *)(bsh.bsh_base + offset)); + return (*(volatile u_int16_t *)(bsh->bsh_base + offset)); #endif } @@ -245,19 +245,19 @@ bus_space_read_4(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - return (inl(bsh.bsh_base + offset)); + return (inl(bsh->bsh_base + offset)); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - return (inl(bsh.bsh_iat[offset])); + return (inl(bsh->bsh_iat[offset])); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) else #endif - return (*(volatile u_int32_t *)(bsh.bsh_base + offset)); + return (*(volatile u_int32_t *)(bsh->bsh_base + offset)); #endif } @@ -292,13 +292,13 @@ bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - insb(bsh.bsh_base + offset, addr, count); + insb(bsh->bsh_base + offset, addr, count); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - insb(bsh.bsh_iat[offset], addr, count); + insb(bsh->bsh_iat[offset], addr, count); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) @@ -311,7 +311,7 @@ bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, stosb \n\ loop 1b" : "=D" (addr), "=c" (count) : - "r" (bsh.bsh_base + offset), "0" (addr), "1" (count) : + "r" (bsh->bsh_base + offset), "0" (addr), "1" (count) : "%eax", "memory"); } #endif @@ -325,13 +325,13 @@ bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - insw(bsh.bsh_base + offset, addr, count); + insw(bsh->bsh_base + offset, addr, count); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - insw(bsh.bsh_iat[offset], addr, count); + insw(bsh->bsh_iat[offset], addr, count); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) @@ -344,7 +344,7 @@ bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, stosw \n\ loop 1b" : "=D" (addr), "=c" (count) : - "r" (bsh.bsh_base + offset), "0" (addr), "1" (count) : + "r" (bsh->bsh_base + offset), "0" (addr), "1" (count) : "%eax", "memory"); } #endif @@ -358,13 +358,13 @@ bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - insl(bsh.bsh_base + offset, addr, count); + insl(bsh->bsh_base + offset, addr, count); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - insl(bsh.bsh_iat[offset], addr, count); + insl(bsh->bsh_iat[offset], addr, count); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) @@ -377,7 +377,7 @@ bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, stosl \n\ loop 1b" : "=D" (addr), "=c" (count) : - "r" (bsh.bsh_base + offset), "0" (addr), "1" (count) : + "r" (bsh->bsh_base + offset), "0" (addr), "1" (count) : "%eax", "memory"); } #endif @@ -417,7 +417,7 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ 1: inb %w2,%%al \n\ @@ -436,7 +436,7 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, { int i; for (i = 0; i < count; i++) - addr[i] = inb(bsh.bsh_iat[offset + i]); + addr[i] = inb(bsh->bsh_iat[offset + i]); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -444,7 +444,7 @@ bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -465,7 +465,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ 1: inw %w2,%%ax \n\ @@ -484,7 +484,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, { int i; for (i = 0; i < count; i += 2) - addr[i] = inw(bsh.bsh_iat[offset + i]); + addr[i] = inw(bsh->bsh_iat[offset + i]); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -492,7 +492,7 @@ bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -513,7 +513,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ 1: inl %w2,%%eax \n\ @@ -532,7 +532,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, { int i; for (i = 0; i < count; i += 4) - addr[i] = inl(bsh.bsh_iat[offset + i]); + addr[i] = inl(bsh->bsh_iat[offset + i]); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -540,7 +540,7 @@ bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -581,19 +581,19 @@ bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - outb(bsh.bsh_base + offset, value); + outb(bsh->bsh_base + offset, value); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - outb(bsh.bsh_iat[offset], value); + outb(bsh->bsh_iat[offset], value); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) if (tag == I386_BUS_SPACE_MEM) #endif - *(volatile u_int8_t *)(bsh.bsh_base + offset) = value; + *(volatile u_int8_t *)(bsh->bsh_base + offset) = value; #endif } @@ -605,19 +605,19 @@ bus_space_write_2(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - outw(bsh.bsh_base + offset, value); + outw(bsh->bsh_base + offset, value); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - outw(bsh.bsh_iat[offset], value); + outw(bsh->bsh_iat[offset], value); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) if (tag == I386_BUS_SPACE_MEM) #endif - *(volatile u_int16_t *)(bsh.bsh_base + offset) = value; + *(volatile u_int16_t *)(bsh->bsh_base + offset) = value; #endif } @@ -629,19 +629,19 @@ bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - outl(bsh.bsh_base + offset, value); + outl(bsh->bsh_base + offset, value); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - outl(bsh.bsh_iat[offset], value); + outl(bsh->bsh_iat[offset], value); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) if (tag == I386_BUS_SPACE_MEM) #endif - *(volatile u_int32_t *)(bsh.bsh_base + offset) = value; + *(volatile u_int32_t *)(bsh->bsh_base + offset) = value; #endif } @@ -679,13 +679,13 @@ bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - outsb(bsh.bsh_base + offset, addr, count); + outsb(bsh->bsh_base + offset, addr, count); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - outsb(bsh.bsh_iat[offset], addr, count); + outsb(bsh->bsh_iat[offset], addr, count); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) @@ -698,7 +698,7 @@ bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, movb %%al,(%2) \n\ loop 1b" : "=S" (addr), "=c" (count) : - "r" (bsh.bsh_base + offset), "0" (addr), "1" (count) : + "r" (bsh->bsh_base + offset), "0" (addr), "1" (count) : "%eax", "memory", "cc"); } #endif @@ -712,13 +712,13 @@ bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - outsw(bsh.bsh_base + offset, addr, count); + outsw(bsh->bsh_base + offset, addr, count); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - outsw(bsh.bsh_iat[offset], addr, count); + outsw(bsh->bsh_iat[offset], addr, count); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) @@ -732,7 +732,7 @@ bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, movw %%ax,(%2) \n\ loop 1b" : "=S" (addr), "=c" (count) : - "r" (bsh.bsh_base + offset), "0" (addr), "1" (count) : + "r" (bsh->bsh_base + offset), "0" (addr), "1" (count) : "%eax", "memory", "cc"); } #endif @@ -746,13 +746,13 @@ bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, #if defined(_I386_BUS_PIO_IND_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO) #endif - outsl(bsh.bsh_base + offset, addr, count); + outsl(bsh->bsh_base + offset, addr, count); #endif #if defined(_I386_BUS_PIO_IND_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) if (tag == I386_BUS_SPACE_IO_IND) #endif - outsl(bsh.bsh_iat[offset], addr, count); + outsl(bsh->bsh_iat[offset], addr, count); #endif #if defined(_I386_BUS_MEMIO_H_) #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIO_IND_H_) @@ -765,7 +765,7 @@ bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, movl %%eax,(%2) \n\ loop 1b" : "=S" (addr), "=c" (count) : - "r" (bsh.bsh_base + offset), "0" (addr), "1" (count) : + "r" (bsh->bsh_base + offset), "0" (addr), "1" (count) : "%eax", "memory", "cc"); } #endif @@ -806,7 +806,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ @@ -825,7 +825,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, { int i; for (i = 0; i < count; i++) - outb(bsh.bsh_iat[offset + i], addr[i]); + outb(bsh->bsh_iat[offset + i], addr[i]); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -833,7 +833,7 @@ bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -854,7 +854,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ @@ -873,7 +873,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, { int i; for (i = 0; i < count; i += 2) - outw(bsh.bsh_iat[offset + i], addr[i]); + outw(bsh->bsh_iat[offset + i], addr[i]); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -881,7 +881,7 @@ bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -902,7 +902,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ @@ -921,7 +921,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, { int i; for (i = 0; i < count; i += 4) - outl(bsh.bsh_iat[offset + i], addr[i]); + outl(bsh->bsh_iat[offset + i], addr[i]); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -929,7 +929,7 @@ bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - int _port_ = bsh.bsh_base + offset; \ + int _port_ = bsh->bsh_base + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ @@ -973,7 +973,7 @@ bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; while (count--) outb(addr, value); } @@ -983,7 +983,7 @@ bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO_IND) #endif { - bus_addr_t addr = bsh.bsh_iat[offset]; + bus_addr_t addr = bsh->bsh_iat[offset]; while (count--) outb(addr, value); } @@ -993,7 +993,7 @@ bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; while (count--) *(volatile u_int8_t *)(addr) = value; } @@ -1009,7 +1009,7 @@ bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; while (count--) outw(addr, value); } @@ -1019,7 +1019,7 @@ bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO_IND) #endif { - bus_addr_t addr = bsh.bsh_iat[offset]; + bus_addr_t addr = bsh->bsh_iat[offset]; while (count--) outw(addr, value); } @@ -1029,7 +1029,7 @@ bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; while (count--) *(volatile u_int16_t *)(addr) = value; } @@ -1045,7 +1045,7 @@ bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; while (count--) outl(addr, value); } @@ -1055,7 +1055,7 @@ bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO_IND) #endif { - bus_addr_t addr = bsh.bsh_iat[offset]; + bus_addr_t addr = bsh->bsh_iat[offset]; while (count--) outl(addr, value); } @@ -1065,7 +1065,7 @@ bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; while (count--) *(volatile u_int32_t *)(addr) = value; } @@ -1103,7 +1103,7 @@ bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; for (; count != 0; count--, addr++) outb(addr, value); } @@ -1114,7 +1114,7 @@ bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, #endif { for (; count != 0; count--, offset++) - outb(bsh.bsh_iat[offset], value); + outb(bsh->bsh_iat[offset], value); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -1122,7 +1122,7 @@ bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; for (; count != 0; count--, addr++) *(volatile u_int8_t *)(addr) = value; } @@ -1138,7 +1138,7 @@ bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; for (; count != 0; count--, addr += 2) outw(addr, value); } @@ -1149,7 +1149,7 @@ bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, #endif { for (; count != 0; count--, offset += 2) - outw(bsh.bsh_iat[offset], value); + outw(bsh->bsh_iat[offset], value); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -1157,7 +1157,7 @@ bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; for (; count != 0; count--, addr += 2) *(volatile u_int16_t *)(addr) = value; } @@ -1173,7 +1173,7 @@ bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; for (; count != 0; count--, addr += 4) outl(addr, value); } @@ -1184,7 +1184,7 @@ bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, #endif { for (; count != 0; count--, offset += 4) - outl(bsh.bsh_iat[offset], value); + outl(bsh->bsh_iat[offset], value); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -1192,7 +1192,7 @@ bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr = bsh.bsh_base + offset; + bus_addr_t addr = bsh->bsh_base + offset; for (; count != 0; count--, addr += 4) *(volatile u_int32_t *)(addr) = value; } @@ -1236,8 +1236,8 @@ bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr1 = bsh1.bsh_base + off1; - bus_addr_t addr2 = bsh2.bsh_base + off2; + bus_addr_t addr1 = bsh1->bsh_base + off1; + bus_addr_t addr2 = bsh2->bsh_base + off2; if (addr1 >= addr2) { /* src after dest: copy forward */ for (; count != 0; count--, addr1++, addr2++) @@ -1255,17 +1255,17 @@ bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_IO_IND) #endif { - if (bsh1.bsh_iat[off1] >= bsh2.bsh_iat[off2]) { + if (bsh1->bsh_iat[off1] >= bsh2->bsh_iat[off2]) { /* src after dest: copy forward */ for (; count != 0; count--, off1++, off2++) - outb(bsh2.bsh_iat[off2], - inb(bsh1.bsh_iat[off1])); + outb(bsh2->bsh_iat[off2], + inb(bsh1->bsh_iat[off1])); } else { /* dest after src: copy backwards */ for (off1 += (count - 1), off2 += (count - 1); count != 0; count--, off1--, off2--) - outb(bsh2.bsh_iat[off2], - inb(bsh1.bsh_iat[off1])); + outb(bsh2->bsh_iat[off2], + inb(bsh1->bsh_iat[off1])); } } #endif @@ -1274,8 +1274,8 @@ bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr1 = bsh1.bsh_base + off1; - bus_addr_t addr2 = bsh2.bsh_base + off2; + bus_addr_t addr1 = bsh1->bsh_base + off1; + bus_addr_t addr2 = bsh2->bsh_base + off2; if (addr1 >= addr2) { /* src after dest: copy forward */ for (; count != 0; count--, addr1++, addr2++) @@ -1302,8 +1302,8 @@ bus_space_copy_region_2(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr1 = bsh1.bsh_base + off1; - bus_addr_t addr2 = bsh2.bsh_base + off2; + bus_addr_t addr1 = bsh1->bsh_base + off1; + bus_addr_t addr2 = bsh2->bsh_base + off2; if (addr1 >= addr2) { /* src after dest: copy forward */ for (; count != 0; count--, addr1 += 2, addr2 += 2) @@ -1321,17 +1321,17 @@ bus_space_copy_region_2(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_IO_IND) #endif { - if (bsh1.bsh_iat[off1] >= bsh2.bsh_iat[off2]) { + if (bsh1->bsh_iat[off1] >= bsh2->bsh_iat[off2]) { /* src after dest: copy forward */ for (; count != 0; count--, off1 += 2, off2 += 2) - outw(bsh2.bsh_iat[off2], - inw(bsh1.bsh_iat[off1])); + outw(bsh2->bsh_iat[off2], + inw(bsh1->bsh_iat[off1])); } else { /* dest after src: copy backwards */ for (off1 += 2 * (count - 1), off2 += 2 * (count - 1); count != 0; count--, off1 -= 2, off2 -= 2) - outw(bsh2.bsh_iat[off2], - inw(bsh1.bsh_iat[off1])); + outw(bsh2->bsh_iat[off2], + inw(bsh1->bsh_iat[off1])); } } #endif @@ -1340,8 +1340,8 @@ bus_space_copy_region_2(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr1 = bsh1.bsh_base + off1; - bus_addr_t addr2 = bsh2.bsh_base + off2; + bus_addr_t addr1 = bsh1->bsh_base + off1; + bus_addr_t addr2 = bsh2->bsh_base + off2; if (addr1 >= addr2) { /* src after dest: copy forward */ for (; count != 0; count--, addr1 += 2, addr2 += 2) @@ -1368,8 +1368,8 @@ bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_IO) #endif { - bus_addr_t addr1 = bsh1.bsh_base + off1; - bus_addr_t addr2 = bsh2.bsh_base + off2; + bus_addr_t addr1 = bsh1->bsh_base + off1; + bus_addr_t addr2 = bsh2->bsh_base + off2; if (addr1 >= addr2) { /* src after dest: copy forward */ for (; count != 0; count--, addr1 += 4, addr2 += 4) @@ -1387,17 +1387,17 @@ bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_IO_IND) #endif { - if (bsh1.bsh_iat[off1] >= bsh2.bsh_iat[off2]) { + if (bsh1->bsh_iat[off1] >= bsh2->bsh_iat[off2]) { /* src after dest: copy forward */ for (; count != 0; count--, off1 += 4, off2 += 4) - outl(bsh2.bsh_iat[off2], - inl(bsh1.bsh_iat[off1])); + outl(bsh2->bsh_iat[off2], + inl(bsh1->bsh_iat[off1])); } else { /* dest after src: copy backwards */ for (off1 += 4 * (count - 1), off2 += 4 * (count - 1); count != 0; count--, off1 -= 4, off2 -= 4) - outl(bsh2.bsh_iat[off2], - inl(bsh1.bsh_iat[off1])); + outl(bsh2->bsh_iat[off2], + inl(bsh1->bsh_iat[off1])); } } #endif @@ -1406,8 +1406,8 @@ bus_space_copy_region_4(bus_space_tag_t tag, bus_space_handle_t bsh1, if (tag == I386_BUS_SPACE_MEM) #endif { - bus_addr_t addr1 = bsh1.bsh_base + off1; - bus_addr_t addr2 = bsh2.bsh_base + off2; + bus_addr_t addr1 = bsh1->bsh_base + off1; + bus_addr_t addr2 = bsh2->bsh_base + off2; if (addr1 >= addr2) { /* src after dest: copy forward */ for (; count != 0; count--, addr1 += 4, addr2 += 4) diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c index ab9427d..3c7ecb9 100644 --- a/sys/i386/isa/isa.c +++ b/sys/i386/isa/isa.c @@ -187,8 +187,8 @@ isa_alloc_resourcev(device_t child, int type, int *rid, } } - re->r_bushandle.bsh_res = bsre; - re->r_bushandle.bsh_ressz = ressz; + re->r_bushandle->bsh_res = bsre; + re->r_bushandle->bsh_ressz = ressz; return re; } @@ -207,8 +207,8 @@ isa_load_resourcev(struct resource *re, bus_addr_t *res, bus_size_t count) addr[i] = rman_get_start(re) + res[i]; rman_set_bustag(re, I386_BUS_SPACE_IO_IND); - re->r_bushandle.bsh_iat = addr; - re->r_bushandle.bsh_iatsz = count; + re->r_bushandle->bsh_iat = addr; + re->r_bushandle->bsh_iatsz = count; return 0; } @@ -227,13 +227,13 @@ isa_release_resource(device_t bus, device_t child, int type, int rid, */ int i; - for (i = 1; i < r->r_bushandle.bsh_ressz; i++) + for (i = 1; i < r->r_bushandle->bsh_ressz; i++) resource_list_release(rl, bus, child, type, rid + i, - r->r_bushandle.bsh_res[i]); - if (r->r_bushandle.bsh_res != NULL) - free(r->r_bushandle.bsh_res, M_DEVBUF); - if (r->r_bushandle.bsh_iat != NULL) - free(r->r_bushandle.bsh_iat, M_DEVBUF); + r->r_bushandle->bsh_res[i]); + if (r->r_bushandle->bsh_res != NULL) + free(r->r_bushandle->bsh_res, M_DEVBUF); + if (r->r_bushandle->bsh_iat != NULL) + free(r->r_bushandle->bsh_iat, M_DEVBUF); #endif return resource_list_release(rl, bus, child, type, rid, r); } |