Subject: Re: MI bus ops(Re: 16bit aligned NS16550 variant)
To: None <thorpej@wasabisystems.com>
From: TAKEMURA Shin <takemura@netbsd.org>
List: tech-kern
Date: 11/11/2001 00:25:10
This is a multi-part message in MIME format.
------=_NextPart_000_00C8_01C16A47.52A40DF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Sorry, I didn't attach the file!
Takemura
----- Original Message -----
From: "TAKEMURA Shin" <takemura@netbsd.org>
To: <thorpej@wasabisystems.com>
Cc: <cgd@broadcom.com>; <eeh@netbsd.org>; <mouse@rodents.montreal.qc.ca>;
<simonb@wasabisystems.com>; <tech-kern@netbsd.org>
Sent: Sunday, November 11, 2001 12:09 AM
Subject: Re: MI bus ops(Re: 16bit aligned NS16550 variant)
> Okay... I've wrote rough draft of sys/bus.h (attached).
------=_NextPart_000_00C8_01C16A47.52A40DF0
Content-Type: application/octet-stream;
name="bus.h"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="bus.h"
=0A=
/*-=0A=
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.=0A=
* All rights reserved.=0A=
*(snipped)=0A=
*/=0A=
=0A=
#include <machine/bus_types.h>=0A=
=0A=
#ifndef BUS_SPACE_MD_CALLS=0A=
/*=0A=
* bus space operaion table=0A=
*/=0A=
struct bus_space_ops {=0A=
/* sniped */=0A=
};=0A=
=0A=
/* here shuld be many macro definitions,=0A=
#define bus_space_read_1(t, h, o) ...=0A=
(snipped) */=0A=
=0A=
#endif /* ! BUS_SPACE_MD_CALLS */=0A=
=0A=
#ifndef BUS_DMA_MD_CALLS=0A=
/*=0A=
* bus DMA operaion table=0A=
*/=0A=
struct bus_dma_ops {=0A=
/* sniped */=0A=
};=0A=
=0A=
/* here shuld be many macro definitions,=0A=
#define bus_dmamap_create(t, s, n, m, b, f, p) ...=0A=
(snipped) */=0A=
=0A=
#endif /* ! BUS_DMA_MD_CALLS */=0A=
=0A=
#ifndef BUS_SPACE_MD_TYPES=0A=
typedef struct bus_space *bus_space_tag_t;=0A=
=0A=
/*=0A=
* bus_space_tag_t=0A=
*=0A=
* bus space tag structure=0A=
*/=0A=
struct bus_space_tag {=0A=
bus_space_tag_t bs_base;=0A=
struct bus_space_ops bs_ops;=0A=
};=0A=
#endif /* ! BUS_SPACE_MD_TYPES */=0A=
=0A=
#ifndef BUS_DMA_MD_TYPES=0A=
typedef struct bus_dma_tag *bus_dma_tag_t;=0A=
typedef struct bus_dma_segment bus_dma_segment_t;=0A=
typedef struct bus_dmamap *bus_dmamap_t;=0A=
=0A=
/*=0A=
* bus_dma_tag_t=0A=
*=0A=
* Describes a implementation of DMA for a given bus.=0A=
*/=0A=
struct bus_dma_tag {=0A=
bus_dma_tag_t bd_base;=0A=
struct bus_dma_ops bd_ops;=0A=
};=0A=
=0A=
/*=0A=
* bus_dma_segment_t=0A=
*=0A=
* Describes a single contiguous DMA transaction.=0A=
*/=0A=
struct bus_dma_segment {=0A=
bus_addr_t ds_addr; /* DMA address */=0A=
bus_size_t ds_len; /* length of transfer */=0A=
};=0A=
=0A=
/*=0A=
* bus_dmamap_t=0A=
*=0A=
* Describes a DMA mapping.=0A=
*/=0A=
struct bus_dmamap {=0A=
bus_size_t dm_mapsize; /* size of the mapping */=0A=
int dm_nsegs; /* # valid segments in mapping */=0A=
bus_dma_segment_t *dm_segs; /* segments; variable length */=0A=
};=0A=
=0A=
#endif /* ! BUS_DMA_MD_TYPES */=0A=
=0A=
#include <machine/bus.h>=0A=
------=_NextPart_000_00C8_01C16A47.52A40DF0--