Deleted Added
full compact
ppc.c (93021) ppc.c (111748)
1/*-
2 * Copyright (c) 1997-2000 Nicolas Souchu
3 * Copyright (c) 2001 Alcove - Nicolas Souchu
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 1997-2000 Nicolas Souchu
3 * Copyright (c) 2001 Alcove - Nicolas Souchu
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/ppc/ppc.c 93021 2002-03-23 15:36:13Z nsouch $
27 * $FreeBSD: head/sys/dev/ppc/ppc.c 111748 2003-03-02 16:54:40Z des $
28 *
29 */
30
31#include "opt_ppc.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>

--- 1573 unchanged lines hidden (view full) ---

1609 ppc->ppc_dmaflags,
1610 ppc->ppc_dmaddr,
1611 ppc->ppc_dmacnt,
1612 ppc->ppc_dmachan);
1613
1614 ppc->ppc_dmastat = PPC_DMA_COMPLETE;
1615
1616 /* wakeup the waiting process */
28 *
29 */
30
31#include "opt_ppc.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>

--- 1573 unchanged lines hidden (view full) ---

1609 ppc->ppc_dmaflags,
1610 ppc->ppc_dmaddr,
1611 ppc->ppc_dmacnt,
1612 ppc->ppc_dmachan);
1613
1614 ppc->ppc_dmastat = PPC_DMA_COMPLETE;
1615
1616 /* wakeup the waiting process */
1617 wakeup((caddr_t)ppc);
1617 wakeup(ppc);
1618 }
1619 }
1620 } else if (ppc->ppc_irqstat & PPC_IRQ_FIFO) {
1621
1622 /* classic interrupt I/O */
1623 ppc->ppc_irqstat &= ~PPC_IRQ_FIFO;
1624 }
1625

--- 89 unchanged lines hidden (view full) ---

1715 ppc->ppc_dmastat = PPC_DMA_STARTED;
1716
1717 /* Wait for the DMA completed interrupt. We hope we won't
1718 * miss it, otherwise a signal will be necessary to unlock the
1719 * process.
1720 */
1721 do {
1722 /* release CPU */
1618 }
1619 }
1620 } else if (ppc->ppc_irqstat & PPC_IRQ_FIFO) {
1621
1622 /* classic interrupt I/O */
1623 ppc->ppc_irqstat &= ~PPC_IRQ_FIFO;
1624 }
1625

--- 89 unchanged lines hidden (view full) ---

1715 ppc->ppc_dmastat = PPC_DMA_STARTED;
1716
1717 /* Wait for the DMA completed interrupt. We hope we won't
1718 * miss it, otherwise a signal will be necessary to unlock the
1719 * process.
1720 */
1721 do {
1722 /* release CPU */
1723 error = tsleep((caddr_t)ppc,
1723 error = tsleep(ppc,
1724 PPBPRI | PCATCH, "ppcdma", 0);
1725
1726 } while (error == EWOULDBLOCK);
1727
1728 splx(s);
1729
1730 if (error) {
1731#ifdef PPC_DEBUG

--- 15 unchanged lines hidden (view full) ---

1747 while (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) {
1748
1749 for (spin=100; spin; spin--)
1750 if (r_ecr(ppc) & PPC_FIFO_EMPTY)
1751 goto fifo_empty;
1752#ifdef PPC_DEBUG
1753 printf("Z");
1754#endif
1724 PPBPRI | PCATCH, "ppcdma", 0);
1725
1726 } while (error == EWOULDBLOCK);
1727
1728 splx(s);
1729
1730 if (error) {
1731#ifdef PPC_DEBUG

--- 15 unchanged lines hidden (view full) ---

1747 while (!(r_ecr(ppc) & PPC_FIFO_EMPTY)) {
1748
1749 for (spin=100; spin; spin--)
1750 if (r_ecr(ppc) & PPC_FIFO_EMPTY)
1751 goto fifo_empty;
1752#ifdef PPC_DEBUG
1753 printf("Z");
1754#endif
1755 error = tsleep((caddr_t)ppc, PPBPRI | PCATCH, "ppcfifo", hz/100);
1755 error = tsleep(ppc, PPBPRI | PCATCH, "ppcfifo", hz/100);
1756 if (error != EWOULDBLOCK) {
1757#ifdef PPC_DEBUG
1758 printf("I");
1759#endif
1760 /* no dma, no interrupt, flush the fifo */
1761 w_ecr(ppc, PPC_ECR_RESET);
1762
1763 ppc->ppc_dmastat = PPC_DMA_INTERRUPTED;

--- 403 unchanged lines hidden ---
1756 if (error != EWOULDBLOCK) {
1757#ifdef PPC_DEBUG
1758 printf("I");
1759#endif
1760 /* no dma, no interrupt, flush the fifo */
1761 w_ecr(ppc, PPC_ECR_RESET);
1762
1763 ppc->ppc_dmastat = PPC_DMA_INTERRUPTED;

--- 403 unchanged lines hidden ---