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:
thorpej 1998-06-09 00:12:18 +00:00
parent 98d02e5c94
commit e333272393
1 changed files with 45 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: isa_machdep.h,v 1.9 1998/06/03 21:50:48 thorpej Exp $ */
/* $NetBSD: isa_machdep.h,v 1.10 1998/06/09 00:12:18 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
@ -84,6 +84,7 @@
#define _I386_ISA_MACHDEP_H_ /* XXX */
#include <machine/bus.h>
#include <dev/isa/isadmavar.h>
/*
* XXX THIS FILE IS A MESS. copyright: berkeley's probably.
@ -96,7 +97,11 @@
/*
* Types provided to machine-independent ISA code.
*/
typedef void *isa_chipset_tag_t;
struct i386_isa_chipset {
struct isa_dma_state ic_dmastate;
};
typedef struct i386_isa_chipset *isa_chipset_tag_t;
struct device; /* XXX */
struct isabus_attach_args; /* XXX */
@ -114,6 +119,43 @@ int isa_mem_alloc __P((bus_space_tag_t, bus_size_t, bus_size_t,
bus_addr_t, int, bus_addr_t *, bus_space_handle_t *));
void isa_mem_free __P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
#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.