From f95017bdebd1eca364ac84ade26a9419bab591c0 Mon Sep 17 00:00:00 2001 From: jsing Date: Mon, 25 Aug 2008 14:05:51 +0000 Subject: [PATCH] Add bus_space_read_raw_region_* and bus_space_write_raw_region_* bus space accessors to OpenBSD/sgi. ok miod@ --- sys/arch/sgi/include/bus.h | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/sys/arch/sgi/include/bus.h b/sys/arch/sgi/include/bus.h index 8b01655edc4..dfd9a7f615f 100644 --- a/sys/arch/sgi/include/bus.h +++ b/sys/arch/sgi/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.10 2008/07/30 17:37:44 miod Exp $ */ +/* $OpenBSD: bus.h,v 1.11 2008/08/25 14:05:51 jsing Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. @@ -152,6 +152,25 @@ bus_space_read_region(2,16) bus_space_read_region(4,32) bus_space_read_region(8,64) +/*----------------------------------------------------------------------------*/ +#define bus_space_read_raw_region(n,m) \ +static __inline void \ +CAT(bus_space_read_raw_region_,n)(bus_space_tag_t bst, \ + bus_space_handle_t bsh, \ + bus_addr_t ba, u_int8_t *x, size_t cnt) \ +{ \ + cnt >>= ((n) >> 1); \ + while (cnt--) { \ + CAT(bus_space_read_raw_multi_,n)(bst, bsh, ba, x, 1); \ + ba += (n); \ + x += (n); \ + } \ +} + +bus_space_read_raw_region(2,16) +bus_space_read_raw_region(4,32) +bus_space_read_raw_region(8,64) + /*----------------------------------------------------------------------------*/ #define bus_space_write_multi(n,m) \ static __inline void \ @@ -185,6 +204,25 @@ bus_space_write_region(2,16) bus_space_write_region(4,32) bus_space_write_region(8,64) +/*----------------------------------------------------------------------------*/ +#define bus_space_write_raw_region(n,m) \ +static __inline void \ +CAT(bus_space_write_raw_region_,n)(bus_space_tag_t bst, \ + bus_space_handle_t bsh, \ + bus_addr_t ba, const u_int8_t *x, size_t cnt) \ +{ \ + cnt >>= ((n) >> 1); \ + while (cnt--) { \ + CAT(bus_space_write_raw_multi_,n)(bst, bsh, ba, x, 1); \ + ba += (n); \ + x += (n); \ + } \ +} + +bus_space_write_raw_region(2,16) +bus_space_write_raw_region(4,32) +bus_space_write_raw_region(8,64) + /*----------------------------------------------------------------------------*/ #define bus_space_set_region(n,m) \ static __inline void \ -- 2.20.1