Change the ISA DMA API to take an isa_chipset_tag_t rather than
a struct device * corresponding to the ISA bus device. The ISA DMA controller driver functions have been renamed and now take a struct isa_dma_state *, and are called indirectly by machine-dependent code which provides the DMA state. These changes allow e.g. `ofisa' (the OpenFirmware configuration mechanism for the ISA bus, used by e.g. Sharks) to use the MI ISA DMA controller code.
This commit is contained in:
parent
eddb2f4269
commit
0b76aff07b
|
@ -1,7 +1,7 @@
|
|||
/* $NetBSD: isa_machdep.h,v 1.4 1998/06/03 21:52:36 thorpej Exp $ */
|
||||
/* $NetBSD: isa_machdep.h,v 1.5 1998/06/09 00:10:02 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
|
@ -83,6 +83,9 @@
|
|||
#ifndef _BEBOX_ISA_MACHDEP_H_ /* XXX */
|
||||
#define _BEBOX_ISA_MACHDEP_H_ /* XXX */
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <dev/isa/isadmavar.h>
|
||||
|
||||
/*
|
||||
* XXX THIS FILE IS A MESS. copyright: berkeley's probably.
|
||||
* contents from isavar.h and isareg.h, mostly the latter.
|
||||
|
@ -94,7 +97,11 @@
|
|||
/*
|
||||
* Types provided to machine-independent ISA code.
|
||||
*/
|
||||
typedef void *isa_chipset_tag_t;
|
||||
struct bebox_isa_chipset {
|
||||
struct isa_dma_state ic_dmastate;
|
||||
};
|
||||
|
||||
typedef struct bebox_isa_chipset *isa_chipset_tag_t;
|
||||
|
||||
struct device; /* XXX */
|
||||
struct isabus_attach_args; /* XXX */
|
||||
|
@ -108,6 +115,43 @@ void *isa_intr_establish __P((isa_chipset_tag_t ic, int irq, int type,
|
|||
int level, int (*ih_fun)(void *), void *ih_arg));
|
||||
void isa_intr_disestablish __P((isa_chipset_tag_t ic, void *handler));
|
||||
|
||||
#define isa_dmainit(ic, bst, dmat, d) \
|
||||
_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
|
||||
#define isa_dmacascade(ic, c) \
|
||||
_isa_dmacascade(&(ic)->ic_dmastate, (c))
|
||||
#define isa_dmamap_create(ic, c, s, f) \
|
||||
_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
|
||||
#define isa_dmamap_destroy(ic, c) \
|
||||
_isa_dmamap_destroy(&(ic)->ic_dmastate, (c))
|
||||
#define isa_dmastart(ic, c, a, n, p, f, bf) \
|
||||
_isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf))
|
||||
#define isa_dmaabort(ic, c) \
|
||||
_isa_dmaabort(&(ic)->ic_dmastate, (c))
|
||||
#define isa_dmacount(ic, c) \
|
||||
_isa_dmacount(&(ic)->ic_dmastate, (c))
|
||||
#define isa_dmafinished(ic, c) \
|
||||
_isa_dmafinished(&(ic)->ic_dmastate, (c))
|
||||
#define isa_dmadone(ic, c) \
|
||||
_isa_dmadone(&(ic)->ic_dmastate, (c))
|
||||
#define isa_dmamem_alloc(ic, c, s, ap, f) \
|
||||
_isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f))
|
||||
#define isa_dmamem_free(ic, c, a, s) \
|
||||
_isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s))
|
||||
#define isa_dmamem_map(ic, c, a, s, kp, f) \
|
||||
_isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f))
|
||||
#define isa_dmamem_unmap(ic, c, k, s) \
|
||||
_isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s))
|
||||
#define isa_dmamem_mmap(ic, c, a, s, o, p, f) \
|
||||
_isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f))
|
||||
#define isa_drq_isfree(ic, c) \
|
||||
_isa_drq_isfree(&(ic)->ic_dmastate, (c))
|
||||
#define isa_malloc(ic, c, s, p, f) \
|
||||
_isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f))
|
||||
#define isa_free(a, p) \
|
||||
_isa_free((a), (p))
|
||||
#define isa_mappage(m, o, p) \
|
||||
_isa_mappage((m), (o), (p))
|
||||
|
||||
/*
|
||||
* ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED
|
||||
* BY PORTABLE CODE.
|
||||
|
|
Loading…
Reference in New Issue