From bb4752537d40ebda7ee4e2d5465c17fbdd80b5c6 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Wed, 22 Jul 1998 08:25:39 +0000 Subject: [PATCH] Add macros and chipset support for accessing device i/o memory on the alpha. --- sys/alpha/include/chipset.h | 19 ++++++++++++++++++- sys/alpha/include/cpufunc.h | 17 ++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/sys/alpha/include/chipset.h b/sys/alpha/include/chipset.h index 54b56c7988e1..772f3e08e3be 100644 --- a/sys/alpha/include/chipset.h +++ b/sys/alpha/include/chipset.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: chipset.h,v 1.1 1998/06/10 10:54:32 dfr Exp $ + * $Id: chipset.h,v 1.2 1998/07/12 16:16:22 dfr Exp $ */ #ifndef _MACHINE_CHIPSET_H_ @@ -36,6 +36,13 @@ typedef void alpha_chipset_outb_t(u_int32_t port, u_int8_t data); typedef void alpha_chipset_outw_t(u_int32_t port, u_int16_t data); typedef void alpha_chipset_outl_t(u_int32_t port, u_int32_t data); +typedef u_int8_t alpha_chipset_readb_t(u_int32_t pa); +typedef u_int16_t alpha_chipset_readw_t(u_int32_t pa); +typedef u_int32_t alpha_chipset_readl_t(u_int32_t pa); +typedef void alpha_chipset_writeb_t(u_int32_t pa, u_int8_t data); +typedef void alpha_chipset_writew_t(u_int32_t pa, u_int16_t data); +typedef void alpha_chipset_writel_t(u_int32_t pa, u_int32_t data); + typedef int alpha_chipset_maxdevs_t(u_int bus); typedef u_int8_t alpha_chipset_cfgreadb_t(u_int, u_int, u_int, u_int); typedef u_int16_t alpha_chipset_cfgreadw_t(u_int, u_int, u_int, u_int); @@ -59,6 +66,16 @@ typedef struct alpha_chipset { alpha_chipset_outw_t* outw; alpha_chipset_outl_t* outl; + /* + * Memory access + */ + alpha_chipset_readb_t* readb; + alpha_chipset_readw_t* readw; + alpha_chipset_readl_t* readl; + alpha_chipset_writeb_t* writeb; + alpha_chipset_writew_t* writew; + alpha_chipset_writel_t* writel; + /* * PCI configuration access */ diff --git a/sys/alpha/include/cpufunc.h b/sys/alpha/include/cpufunc.h index 6125ba3e49ba..960b2b40ed32 100644 --- a/sys/alpha/include/cpufunc.h +++ b/sys/alpha/include/cpufunc.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: cpufunc.h,v 1.1 1998/06/10 10:54:51 dfr Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -41,6 +41,21 @@ #define outw(port, data) chipset.outw(port, data) #define outl(port, data) chipset.outl(port, data) +#define readb(pa) chipset.readb(pa) +#define readw(pa) chipset.readw(pa) +#define readl(pa) chipset.readl(pa) +#define writeb(pa,v) chipset.writeb(pa,v) +#define writew(pa,v) chipset.writew(pa,v) +#define writel(pa,v) chipset.writel(pa,v) + +/* + * String version of IO memory access ops: + */ +extern void memcpy_fromio(void *, u_int32_t, size_t); +extern void memcpy_toio(u_int32_t, void *, size_t); +extern void memset_io(u_int32_t, int, size_t); + + #endif /* KERNEL */ #endif /* !_MACHINE_CPUFUNC_H_ */