Date: Sun, 12 Aug 2007 01:26:39 GMT From: Christopher Davis <loafier@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 125073 for review Message-ID: <200708120126.l7C1QdMv083413@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125073 Change 125073 by loafier@chrisdsoc on 2007/08/12 01:26:37 Remove bus_space_tags and handles. Affected files ... .. //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_sr.c#2 edit .. //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_sr_isa.c#2 edit .. //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_sr_pci.c#2 edit .. //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_srregs.h#2 edit Differences ... ==== //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_sr.c#2 (text+ko) ==== @@ -495,8 +495,6 @@ if (hc->res_ioport == NULL) { goto errexit; } - hc->bt_ioport = rman_get_bustag(hc->res_ioport); - hc->bh_ioport = rman_get_bushandle(hc->res_ioport); return (0); @@ -534,8 +532,6 @@ if (hc->res_memory == NULL) { goto errexit; } - hc->bt_memory = rman_get_bustag(hc->res_memory); - hc->bh_memory = rman_get_bushandle(hc->res_memory); return (0); ==== //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_sr_isa.c#2 (text+ko) ==== @@ -323,25 +323,25 @@ static u_int src_get8_io(struct sr_hardc *hc, u_int off) { - return bus_space_read_1(hc->bt_ioport, hc->bh_ioport, SRC_REG(off)); + return bus_read_1(hc->res_ioport, SRC_REG(off)); } static u_int src_get16_io(struct sr_hardc *hc, u_int off) { - return bus_space_read_2(hc->bt_ioport, hc->bh_ioport, SRC_REG(off)); + return bus_read_2(hc->res_ioport, SRC_REG(off)); } static void src_put8_io(struct sr_hardc *hc, u_int off, u_int val) { - bus_space_write_1(hc->bt_ioport, hc->bh_ioport, SRC_REG(off), val); + bus_write_1(hc->res_ioport, SRC_REG(off), val); } static void src_put16_io(struct sr_hardc *hc, u_int off, u_int val) { - bus_space_write_2(hc->bt_ioport, hc->bh_ioport, SRC_REG(off), val); + bus_write_2(hc->res_ioport, SRC_REG(off), val); } static u_int ==== //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_sr_pci.c#2 (text+ko) ==== @@ -106,16 +106,12 @@ int numports; u_int fecr; struct sr_hardc *hc; - bus_space_tag_t bt_plx; - bus_space_handle_t bh_plx; hc = (struct sr_hardc *)device_get_softc(device); bzero(hc, sizeof(struct sr_hardc)); if (sr_allocate_plx_memory(device, 0x10, 1)) goto errexit; - bt_plx = rman_get_bustag(hc->res_plx_memory); - bh_plx = rman_get_bushandle(hc->res_plx_memory); if (sr_allocate_memory(device, 0x18, 1)) goto errexit; @@ -140,13 +136,13 @@ * * Note: This is "cargo cult" stuff. - jrc */ - bus_space_write_4(bt_plx, bh_plx, 0x00, 0xfffff000); - bus_space_write_4(bt_plx, bh_plx, 0x04, 0x00000001); - bus_space_write_4(bt_plx, bh_plx, 0x18, 0x40030043); - bus_space_write_4(bt_plx, bh_plx, 0x1c, 0xff000000); - bus_space_write_4(bt_plx, bh_plx, 0x20, 0x00000000); - bus_space_write_4(bt_plx, bh_plx, 0x28, 0x000000e9); - bus_space_write_4(bt_plx, bh_plx, 0x68, 0x00010900); + bus_write_4(hc->res_plx_memory, 0x00, 0xfffff000); + bus_write_4(hc->res_plx_memory, 0x04, 0x00000001); + bus_write_4(hc->res_plx_memory, 0x18, 0x40030043); + bus_write_4(hc->res_plx_memory, 0x1c, 0xff000000); + bus_write_4(hc->res_plx_memory, 0x20, 0x00000000); + bus_write_4(hc->res_plx_memory, 0x28, 0x000000e9); + bus_write_4(hc->res_plx_memory, 0x68, 0x00010900); /* * Get info from card. @@ -223,27 +219,23 @@ static u_int src_get8_mem(struct sr_hardc *hc, u_int off) { - return bus_space_read_1(hc->bt_memory, hc->bh_memory, - SRC_PCI_SCA_REG(off)); + return bus_read_1(hc->res_memory, SRC_PCI_SCA_REG(off)); } static u_int src_get16_mem(struct sr_hardc *hc, u_int off) { - return bus_space_read_2(hc->bt_memory, hc->bh_memory, - SRC_PCI_SCA_REG(off)); + return bus_read_2(hc->res_memory, SRC_PCI_SCA_REG(off)); } static void src_put8_mem(struct sr_hardc *hc, u_int off, u_int val) { - bus_space_write_1(hc->bt_memory, hc->bh_memory, - SRC_PCI_SCA_REG(off), val); + bus_write_1(hc->res_memory, SRC_PCI_SCA_REG(off), val); } static void src_put16_mem(struct sr_hardc *hc, u_int off, u_int val) { - bus_space_write_2(hc->bt_memory, hc->bh_memory, - SRC_PCI_SCA_REG(off), val); + bus_write_2(hc->res_memory, SRC_PCI_SCA_REG(off), val); } ==== //depot/projects/soc2007/loafier_busalloc/src/sys/dev/sr/if_srregs.h#2 (text+ko) ==== @@ -162,10 +162,6 @@ sca_regs *sca; /* register array */ - bus_space_tag_t bt_ioport; - bus_space_tag_t bt_memory; - bus_space_handle_t bh_ioport; - bus_space_handle_t bh_memory; int rid_ioport; int rid_memory; int rid_plx_memory; @@ -197,15 +193,15 @@ int sr_detach(device_t device); #define sr_inb(hc, port) \ - bus_space_read_1((hc)->bt_ioport, (hc)->bh_ioport, (port)) + bus_read_1((hc)->res_ioport, (port)) #define sr_outb(hc, port, value) \ - bus_space_write_1((hc)->bt_ioport, (hc)->bh_ioport, (port), (value)) + bus_write_1((hc)->res_ioport, (port), (value)) #define sr_read_fecr(hc) \ - bus_space_read_4((hc)->bt_memory, (hc)->bh_memory, SR_FECR) + bus_read_4((hc)->res_memory, SR_FECR) #define sr_write_fecr(hc, value) \ - bus_space_write_4((hc)->bt_memory, (hc)->bh_memory, SR_FECR, (value)) + bus_write_4((hc)->res_memory, SR_FECR, (value)) #endif /* _IF_SRREGS_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708120126.l7C1QdMv083413>