Date: Sun, 25 Nov 2007 09:35:39 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 129486 for review Message-ID: <200711250935.lAP9Zdn2075223@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129486 Change 129486 by hselasky@hselasky_laptop001 on 2007/11/25 09:35:02 Give the CPU cache flush and invalidate functions more sensible names so that we don't get confused. The change was scripted by: [ -f src/$F ] && (cat src/$F | sed -e "s/usbd_page_dma_enter/usbd_page_cpu_flush/g" | sed -e "s/usbd_page_dma_exit/usbd_page_cpu_invalidate/g" > temp ) && ((diff temp src/$F > /dev/null) || (cat temp > src/$F)) Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ehci.c#50 edit .. //depot/projects/usb/src/sys/dev/usb/ohci.c#40 edit .. //depot/projects/usb/src/sys/dev/usb/uhci.c#42 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#51 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#57 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ehci.c#50 (text+ko) ==== @@ -211,7 +211,7 @@ sc->sc_eintrs = EHCI_NORMAL_INTRS; - usbd_page_dma_exit(&(sc->sc_hw_page)); + usbd_page_cpu_invalidate(&(sc->sc_hw_page)); for (i = 0; i < EHCI_VIRTUAL_FRAMELIST_COUNT; i++) { hw_ptr->intr_start[i].qh_self = @@ -332,7 +332,7 @@ sc->sc_async_p_last = &(hw_ptr->async_start); - usbd_page_dma_enter(&(sc->sc_hw_page)); + usbd_page_cpu_flush(&(sc->sc_hw_page)); #ifdef USB_DEBUG if (ehcidebug) { @@ -684,11 +684,11 @@ { uint8_t temp; - usbd_page_dma_exit(sqtd->page); + usbd_page_cpu_invalidate(sqtd->page); printf("QTD(%p) at 0x%08x:\n", sqtd, le32toh(sqtd->qtd_self)); ehci_dump_qtd(sqtd); temp = (sqtd->qtd_next & htole32(EHCI_LINK_TERMINATE)) ? 1 : 0; - usbd_page_dma_enter(sqtd->page); + usbd_page_cpu_flush(sqtd->page); return (temp); } @@ -713,7 +713,7 @@ { uint32_t endp, endphub; - usbd_page_dma_exit(qh->page); + usbd_page_cpu_invalidate(qh->page); printf("QH(%p) at 0x%08x:\n", qh, le32toh(qh->qh_self) & ~0x1F); printf(" link="); ehci_dump_link(qh->qh_link, 1); @@ -738,14 +738,14 @@ printf("\n"); printf("Overlay qTD:\n"); ehci_dump_qtd((void *)&qh->qh_qtd); - usbd_page_dma_enter(qh->page); + usbd_page_cpu_flush(qh->page); return; } static void ehci_dump_sitd(ehci_sitd_t *sitd) { - usbd_page_dma_exit(sitd->page); + usbd_page_cpu_invalidate(sitd->page); printf("SITD(%p) at 0x%08x\n", sitd, le32toh(sitd->sitd_self) & ~0x1F); printf(" next=0x%08x\n", le32toh(sitd->sitd_next)); printf(" portaddr=0x%08x dir=%s addr=%d endpt=0x%x port=0x%x huba=0x%x\n", @@ -766,14 +766,14 @@ le32toh(sitd->sitd_bp[1]), le32toh(sitd->sitd_bp_hi[0]), le32toh(sitd->sitd_bp_hi[1])); - usbd_page_dma_enter(sitd->page); + usbd_page_cpu_flush(sitd->page); return; } static void ehci_dump_itd(ehci_itd_t *itd) { - usbd_page_dma_exit(itd->page); + usbd_page_cpu_invalidate(itd->page); printf("ITD(%p) at 0x%08x\n", itd, le32toh(itd->itd_self) & ~0x1F); printf(" next=0x%08x\n", le32toh(itd->itd_next)); printf(" status[0]=0x%08x; <%s>\n", le32toh(itd->itd_status[0]), @@ -815,7 +815,7 @@ le32toh(itd->itd_bp_hi[4]), le32toh(itd->itd_bp_hi[5]), le32toh(itd->itd_bp_hi[6])); - usbd_page_dma_enter(itd->page); + usbd_page_cpu_flush(itd->page); return; } @@ -858,15 +858,15 @@ /* (sc->sc_bus.mtx) must be locked */ - usbd_page_dma_exit(std->page); + usbd_page_cpu_invalidate(std->page); std->next = last->next; std->sitd_next = last->sitd_next; std->prev = last; - usbd_page_dma_enter(std->page); - usbd_page_dma_exit(last->page); + usbd_page_cpu_flush(std->page); + usbd_page_cpu_invalidate(last->page); /* * the last->next->prev is never followed: std->next->prev = std; @@ -874,7 +874,7 @@ last->next = std; last->sitd_next = std->sitd_self; - usbd_page_dma_enter(last->page); + usbd_page_cpu_flush(last->page); return (std); } @@ -887,15 +887,15 @@ /* (sc->sc_bus.mtx) must be locked */ - usbd_page_dma_exit(std->page); + usbd_page_cpu_invalidate(std->page); std->next = last->next; std->itd_next = last->itd_next; std->prev = last; - usbd_page_dma_enter(std->page); - usbd_page_dma_exit(last->page); + usbd_page_cpu_flush(std->page); + usbd_page_cpu_invalidate(last->page); /* * the last->next->prev is never followed: std->next->prev = std; @@ -903,7 +903,7 @@ last->next = std; last->itd_next = std->itd_self; - usbd_page_dma_enter(last->page); + usbd_page_cpu_flush(last->page); return (std); } @@ -916,15 +916,15 @@ /* (sc->sc_bus.mtx) must be locked */ - usbd_page_dma_exit(sqh->page); + usbd_page_cpu_invalidate(sqh->page); sqh->next = last->next; sqh->qh_link = last->qh_link; sqh->prev = last; - usbd_page_dma_enter(sqh->page); - usbd_page_dma_exit(last->page); + usbd_page_cpu_flush(sqh->page); + usbd_page_cpu_invalidate(last->page); /* * the last->next->prev is never followed: sqh->next->prev = sqh; @@ -933,7 +933,7 @@ last->next = sqh; last->qh_link = sqh->qh_self; - usbd_page_dma_enter(last->page); + usbd_page_cpu_flush(last->page); #ifdef USB_DEBUG if (ehcidebug > 5) { @@ -952,17 +952,17 @@ /* (sc->sc_bus.mtx) must be locked */ - usbd_page_dma_exit(std->prev->page); + usbd_page_cpu_invalidate(std->prev->page); std->prev->next = std->next; std->prev->sitd_next = std->sitd_next; - usbd_page_dma_enter(std->prev->page); + usbd_page_cpu_flush(std->prev->page); if (std->next) { - usbd_page_dma_exit(std->next->page); + usbd_page_cpu_invalidate(std->next->page); std->next->prev = std->prev; - usbd_page_dma_enter(std->next->page); + usbd_page_cpu_flush(std->next->page); } return ((last == std) ? std->prev : last); } @@ -975,17 +975,17 @@ /* (sc->sc_bus.mtx) must be locked */ - usbd_page_dma_exit(std->prev->page); + usbd_page_cpu_invalidate(std->prev->page); std->prev->next = std->next; std->prev->itd_next = std->itd_next; - usbd_page_dma_enter(std->prev->page); + usbd_page_cpu_flush(std->prev->page); if (std->next) { - usbd_page_dma_exit(std->next->page); + usbd_page_cpu_invalidate(std->next->page); std->next->prev = std->prev; - usbd_page_dma_enter(std->next->page); + usbd_page_cpu_flush(std->next->page); } return ((last == std) ? std->prev : last); } @@ -1000,19 +1000,19 @@ /* only remove if not removed from a queue */ if (sqh->prev) { - usbd_page_dma_exit(sqh->prev->page); + usbd_page_cpu_invalidate(sqh->prev->page); sqh->prev->next = sqh->next; sqh->prev->qh_link = sqh->qh_link; - usbd_page_dma_enter(sqh->prev->page); + usbd_page_cpu_flush(sqh->prev->page); if (sqh->next) { - usbd_page_dma_exit(sqh->next->page); + usbd_page_cpu_invalidate(sqh->next->page); sqh->next->prev = sqh->prev; - usbd_page_dma_enter(sqh->next->page); + usbd_page_cpu_flush(sqh->next->page); } - usbd_page_dma_exit(sqh->page); + usbd_page_cpu_invalidate(sqh->page); /* * set the Terminate-bit in the e_next of the QH, in case @@ -1022,7 +1022,7 @@ sqh->qh_qtd.qtd_next = htole32(EHCI_LINK_TERMINATE); - usbd_page_dma_enter(sqh->page); + usbd_page_cpu_flush(sqh->page); last = ((last == sqh) ? sqh->prev : last); @@ -1044,9 +1044,9 @@ while (1) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); status = le32toh(td->qtd_status); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); len = EHCI_QTD_GET_BYTES(status); @@ -1211,11 +1211,11 @@ /* isochronous full speed transfer */ - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); status = le32toh(td->sitd_status); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); if (!(status & EHCI_SITD_ACTIVE)) { ehci_device_done(xfer, USBD_NORMAL_COMPLETION); @@ -1226,7 +1226,7 @@ /* isochronous high speed transfer */ - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); status = ((!(td->itd_status[0] & htole32(EHCI_ITD_ACTIVE))) && (!(td->itd_status[1] & htole32(EHCI_ITD_ACTIVE))) && @@ -1237,7 +1237,7 @@ (!(td->itd_status[6] & htole32(EHCI_ITD_ACTIVE))) && (!(td->itd_status[7] & htole32(EHCI_ITD_ACTIVE)))); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); if (status) { ehci_device_done(xfer, USBD_NORMAL_COMPLETION); @@ -1255,9 +1255,9 @@ td = xfer->td_transfer_cache; while (1) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); status = le32toh(td->qtd_status); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); /* * if there is an active TD the transfer isn't done @@ -1598,7 +1598,7 @@ continue; } - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); /* fill out current TD */ @@ -1678,7 +1678,7 @@ td->qtd_altnext = qtd_altnext; td->alt_next = td_alt_next; - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); } if (precompute) { @@ -1838,14 +1838,14 @@ } td = temp.td; - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); /* the last TD terminates the transfer: */ td->qtd_next = htole32(EHCI_LINK_TERMINATE); td->qtd_altnext = htole32(EHCI_LINK_TERMINATE); td->qtd_status |= htole32(EHCI_QTD_IOC); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); /* must have at least one frame! */ @@ -1863,7 +1863,7 @@ qh = xfer->qh_start; - usbd_page_dma_exit(qh->page); + usbd_page_cpu_invalidate(qh->page); /* the "qh_link" field is filled when the QH is added */ @@ -1925,7 +1925,7 @@ qh->qh_qtd.qtd_next = td->qtd_self; qh->qh_qtd.qtd_altnext = htole32(EHCI_LINK_TERMINATE); - usbd_page_dma_enter(qh->page); + usbd_page_cpu_flush(qh->page); EHCI_APPEND_QH(qh, *qh_last); return; @@ -1999,9 +1999,9 @@ ehci_dump_sitd(td); } #endif - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); status = le32toh(td->sitd_status); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); /* check for active transfers */ if (status & EHCI_SITD_ACTIVE) { @@ -2060,9 +2060,9 @@ } #endif - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); status = le32toh(td->itd_status[td_no]); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); if (status & EHCI_ITD_ACTIVE) { need_delay = 1; @@ -2453,7 +2453,7 @@ /* initialize all TD's */ for (td = xfer->td_start; td; td = td->obj_next) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); td->sitd_portaddr = sitd_portaddr; @@ -2465,7 +2465,7 @@ */ td->sitd_back = htole32(EHCI_LINK_TERMINATE); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); } return; } @@ -2593,7 +2593,7 @@ */ sa = usbd_fs_isoc_schedule_alloc(fss, *plen); - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); td->sitd_bp[0] = htole32(buf_res.physaddr); @@ -2647,7 +2647,7 @@ (EHCI_SITD_ACTIVE | EHCI_SITD_SET_LEN(*plen)); } - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); #ifdef USB_DEBUG if (ehcidebug > 15) { @@ -2712,7 +2712,7 @@ /* initialize all TD's */ for (td = xfer->td_start; td; td = td->obj_next) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); /* set TD inactive */ td->itd_status[0] = 0; @@ -2741,7 +2741,7 @@ /* set transfer multiplier */ td->itd_bp[2] = htole32(xfer->max_packet_count & 3); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); } return; } @@ -2856,7 +2856,7 @@ *plen = xfer->max_frame_size; } if (td_no == 0) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); /* update page address */ td->itd_bp[page_no] &= htole32(0xFFF); @@ -2928,7 +2928,7 @@ td_no++; if ((td_no == 8) || (nframes == 0)) { - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); #ifdef USB_DEBUG if (ehcidebug > 15) { DPRINTFN(15, ("HS-TD %d\n", nframes)); @@ -3744,7 +3744,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); td = page_info.buffer; @@ -3755,7 +3755,7 @@ last_obj = td; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ehci_itd_t); } @@ -3770,7 +3770,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); td = page_info.buffer; @@ -3781,7 +3781,7 @@ last_obj = td; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ehci_sitd_t); } @@ -3796,7 +3796,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); qtd = page_info.buffer; @@ -3807,7 +3807,7 @@ last_obj = qtd; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ehci_qtd_t); } @@ -3830,7 +3830,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); qh = page_info.buffer; @@ -3841,7 +3841,7 @@ last_obj = qh; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ehci_qh_t); } ==== //depot/projects/usb/src/sys/dev/usb/ohci.c#40 (text+ko) ==== @@ -282,7 +282,7 @@ sc->sc_eintrs = OHCI_NORMAL_INTRS; - usbd_page_dma_exit(&(sc->sc_hw_page)); + usbd_page_cpu_invalidate(&(sc->sc_hw_page)); /* * setup self pointers @@ -346,7 +346,7 @@ hw_ptr->intr_start[i | (OHCI_NO_EDS / 2)].ed_self; } - usbd_page_dma_enter(&(sc->sc_hw_page)); + usbd_page_cpu_flush(&(sc->sc_hw_page)); LIST_INIT(&sc->sc_interrupt_list_head); @@ -518,11 +518,11 @@ hw_ptr = sc->sc_hw_ptr; - usbd_page_dma_exit(&(sc->sc_hw_page)); + usbd_page_cpu_invalidate(&(sc->sc_hw_page)); DPRINTF((" HCCA: frame_number=0x%04x done_head=0x%08x\n", le32toh(hw_ptr->hcca.hcca_frame_number), le32toh(hw_ptr->hcca.hcca_done_head))); - usbd_page_dma_enter(&(sc->sc_hw_page)); + usbd_page_cpu_flush(&(sc->sc_hw_page)); return; } static void @@ -542,7 +542,7 @@ uint32_t td_flags; uint8_t temp; - usbd_page_dma_exit(std->page); + usbd_page_cpu_invalidate(std->page); td_flags = le32toh(std->td_flags); temp = (std->td_next == 0); @@ -562,7 +562,7 @@ le32toh(std->td_next), le32toh(std->td_be)); - usbd_page_dma_enter(std->page); + usbd_page_cpu_flush(std->page); return (temp); } @@ -573,7 +573,7 @@ uint16_t i; uint8_t temp; - usbd_page_dma_exit(sitd->page); + usbd_page_cpu_invalidate(sitd->page); itd_flags = le32toh(sitd->itd_flags); temp = (sitd->itd_next == 0); @@ -594,7 +594,7 @@ } printf("\n"); - usbd_page_dma_enter(sitd->page); + usbd_page_cpu_flush(sitd->page); return (temp); } @@ -615,7 +615,7 @@ uint32_t ed_flags; uint32_t ed_headp; - usbd_page_dma_exit(sed->page); + usbd_page_cpu_invalidate(sed->page); ed_flags = le32toh(sed->ed_flags); ed_headp = le32toh(sed->ed_headp); @@ -637,7 +637,7 @@ le32toh(sed->ed_headp), le32toh(sed->ed_next)); - usbd_page_dma_enter(sed->page); + usbd_page_cpu_flush(sed->page); return; } @@ -652,7 +652,7 @@ /* (sc->sc_bus.mtx) must be locked */ - usbd_page_dma_exit(sed->page); + usbd_page_cpu_invalidate(sed->page); sed->next = last->next; sed->ed_next = last->ed_next; @@ -661,8 +661,8 @@ sed->prev = last; - usbd_page_dma_enter(sed->page); - usbd_page_dma_exit(last->page); + usbd_page_cpu_flush(sed->page); + usbd_page_cpu_invalidate(last->page); /* * the last->next->prev is never followed: sed->next->prev = sed; @@ -671,7 +671,7 @@ last->next = sed; last->ed_next = sed->ed_self; - usbd_page_dma_enter(last->page); + usbd_page_cpu_flush(last->page); return (sed); } @@ -686,19 +686,19 @@ /* only remove if not removed from a queue */ if (sed->prev) { - usbd_page_dma_exit(sed->prev->page); + usbd_page_cpu_invalidate(sed->prev->page); sed->prev->next = sed->next; sed->prev->ed_next = sed->ed_next; - usbd_page_dma_enter(sed->prev->page); + usbd_page_cpu_flush(sed->prev->page); if (sed->next) { - usbd_page_dma_exit(sed->next->page); + usbd_page_cpu_invalidate(sed->next->page); sed->next->prev = sed->prev; - usbd_page_dma_enter(sed->next->page); + usbd_page_cpu_flush(sed->next->page); } - usbd_page_dma_exit(sed->page); + usbd_page_cpu_invalidate(sed->page); /* * terminate transfer in case the transferred packet was @@ -707,7 +707,7 @@ sed->ed_flags |= htole32(OHCI_ED_SKIP); sed->ed_headp = sed->ed_tailp; - usbd_page_dma_enter(sed->page); + usbd_page_cpu_flush(sed->page); last = ((last == sed) ? sed->prev : last); @@ -739,7 +739,7 @@ ohci_dump_itd(td); } #endif - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); nframes = td->frames; olen = &td->itd_offset[0]; @@ -764,7 +764,7 @@ olen++; } - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); if (((void *)td) == xfer->td_transfer_last) { break; @@ -821,7 +821,7 @@ while (1) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); phy_start = le32toh(td->td_cbp); td_flags = le32toh(td->td_flags); cc = OHCI_TD_GET_CC(td_flags); @@ -848,7 +848,7 @@ xfer->frlengths[xfer->aframes] -= temp; } } - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); /* Check for last transfer */ if (((void *)td) == xfer->td_transfer_last) { @@ -961,11 +961,11 @@ while (1) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); phy_start = le32toh(td->td_cbp); td_flags = le32toh(td->td_flags); td_next = le32toh(td->td_next); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); /* Check for last transfer */ if (((void *)td) == xfer->td_transfer_last) { @@ -1001,9 +1001,9 @@ ed = xfer->qh_start; - usbd_page_dma_exit(ed->page); + usbd_page_cpu_invalidate(ed->page); ed->ed_headp = td->td_self; - usbd_page_dma_enter(ed->page); + usbd_page_cpu_flush(ed->page); DPRINTFN(12, ("xfer=%p following alt next\n", xfer)); } @@ -1033,11 +1033,11 @@ } DPRINTFN(12, ("xfer=%p checking transfer\n", xfer)); - usbd_page_dma_exit(ed->page); + usbd_page_cpu_invalidate(ed->page); ed_flags = le32toh(ed->ed_flags); ed_headp = le32toh(ed->ed_headp); ed_tailp = le32toh(ed->ed_tailp); - usbd_page_dma_enter(ed->page); + usbd_page_cpu_flush(ed->page); if ((ed_flags & OHCI_ED_SKIP) || (ed_headp & OHCI_HALTED) || @@ -1135,7 +1135,7 @@ status = 0; - usbd_page_dma_exit(&(sc->sc_hw_page)); + usbd_page_cpu_invalidate(&(sc->sc_hw_page)); done = le32toh(hw_ptr->hcca.hcca_done_head); /* @@ -1163,7 +1163,7 @@ status = OREAD4(sc, OHCI_INTERRUPT_STATUS) & ~OHCI_WDH; } - usbd_page_dma_enter(&(sc->sc_hw_page)); + usbd_page_cpu_flush(&(sc->sc_hw_page)); if (status == 0) { /* nothing to be done (PCI shared * interrupt) */ @@ -1400,7 +1400,7 @@ continue; } - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); /* fill out current TD */ td->td_flags = temp->td_flags; @@ -1445,7 +1445,7 @@ td->alt_next = td_alt_next; - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); } if (precompute) { @@ -1593,13 +1593,13 @@ } td = temp.td; - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); td->td_next = htole32(OHCI_TD_NEXT_END); td->td_flags &= ~htole32(OHCI_TD_INTR_MASK); td->td_flags |= htole32(OHCI_TD_SET_DI(1)); - usbd_page_dma_enter(td->page); + usbd_page_cpu_flush(td->page); /* must have at least one frame! */ @@ -1615,7 +1615,7 @@ ed = xfer->qh_start; - usbd_page_dma_exit(ed->page); + usbd_page_cpu_invalidate(ed->page); ed_flags = (OHCI_ED_SET_FA(xfer->address) | OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpoint)) | @@ -1628,7 +1628,7 @@ } ed->ed_flags = htole32(ed_flags); - usbd_page_dma_enter(ed->page); + usbd_page_cpu_flush(ed->page); td = xfer->td_transfer_first; @@ -1711,14 +1711,14 @@ xfer, xfer->pipe, error)); for (ed = xfer->qh_start; ed; ed = ed->obj_next) { - usbd_page_dma_exit(ed->page); + usbd_page_cpu_invalidate(ed->page); if ((!(ed->ed_flags & htole32(OHCI_ED_SKIP))) && (!(ed->ed_headp & htole32(OHCI_HALTED))) && ((ed->ed_headp ^ ed->ed_tailp) & htole32(-0x10))) { need_delay = 1; } - usbd_page_dma_enter(ed->page); + usbd_page_cpu_flush(ed->page); } if (methods == &ohci_device_bulk_methods) { @@ -1979,9 +1979,9 @@ DPRINTFN(5, ("xfer=%p next=%d nframes=%d\n", xfer, xfer->pipe->isoc_next, xfer->nframes)); - usbd_page_dma_exit(&(sc->sc_hw_page)); + usbd_page_cpu_invalidate(&(sc->sc_hw_page)); nframes = le32toh(hw_ptr->hcca.hcca_frame_number); - usbd_page_dma_enter(&(sc->sc_hw_page)); + usbd_page_cpu_flush(&(sc->sc_hw_page)); if ((LIST_FIRST(&(xfer->pipe->list_head)) == NULL) || (((nframes - xfer->pipe->isoc_next) & 0xFFFF) < xfer->nframes) || @@ -2049,7 +2049,7 @@ if ((ncur == OHCI_ITD_NOFFSET) || (OHCI_PAGE(buf_res.physaddr) != bp0) || (nframes == 0)) { - usbd_page_dma_exit(td->page); + usbd_page_cpu_invalidate(td->page); /* fill current ITD */ td->itd_flags = htole32( @@ -2081,18 +2081,18 @@ /* link the last TD with the next one */ td_last->itd_next = td->itd_self; } - usbd_page_dma_enter(td_last->page); + usbd_page_cpu_flush(td_last->page); } } - usbd_page_dma_exit(td_last->page); + usbd_page_cpu_invalidate(td_last->page); /* update the last TD */ td_last->itd_flags &= ~htole32(OHCI_ITD_NOINTR); td_last->itd_flags |= htole32(OHCI_ITD_SET_DI(0)); td_last->itd_next = 0; - usbd_page_dma_enter(td_last->page); + usbd_page_cpu_flush(td_last->page); xfer->td_transfer_last = td_last; @@ -2104,7 +2104,7 @@ #endif ed = xfer->qh_start; - usbd_page_dma_exit(ed->page); + usbd_page_cpu_invalidate(ed->page); if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) ed_flags = (OHCI_ED_DIR_IN | OHCI_ED_FORMAT_ISO); @@ -2120,7 +2120,7 @@ } ed->ed_flags = htole32(ed_flags); - usbd_page_dma_enter(ed->page); + usbd_page_cpu_flush(ed->page); td = xfer->td_transfer_first; @@ -2719,7 +2719,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); td = page_info.buffer; @@ -2730,7 +2730,7 @@ last_obj = td; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ohci_td_t); } @@ -2745,7 +2745,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); itd = page_info.buffer; @@ -2756,7 +2756,7 @@ last_obj = itd; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ohci_itd_t); } @@ -2778,7 +2778,7 @@ usbd_get_page(&(parm->pc), parm->size[1], &page_info); - usbd_page_dma_exit(page_info.page); + usbd_page_cpu_invalidate(page_info.page); ed = page_info.buffer; @@ -2789,7 +2789,7 @@ last_obj = ed; - usbd_page_dma_enter(page_info.page); + usbd_page_cpu_flush(page_info.page); } parm->size[1] += sizeof(ohci_ed_t); } ==== //depot/projects/usb/src/sys/dev/usb/uhci.c#42 (text+ko) ==== @@ -230,12 +230,12 @@ /* copy data to fixup location */ - usbd_page_dma_exit(ml->fix_res.page); + usbd_page_cpu_invalidate(ml->fix_res.page); usbd_copy_out(ml->buf_pc, ml->buf_offset, ml->fix_res.buffer, td->len); - usbd_page_dma_enter(ml->fix_res.page); + usbd_page_cpu_flush(ml->fix_res.page); } /* prepare next fixup */ @@ -388,7 +388,7 @@ sc->sc_saved_sof = 0x40; /* default value */ sc->sc_saved_frnum = 0; /* default frame number */ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711250935.lAP9Zdn2075223>