summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1998-08-17 08:57:05 +0000
committerdfr <dfr@FreeBSD.org>1998-08-17 08:57:05 +0000
commitc4be7fbe0da23afe0768e33f8aa3350c58f2e0d7 (patch)
treeb184f8aa4b80759a5ec8a98cc7cdb6b19ff9986f /sys/i386
parent2cfb34146c6d83d8dd41f94e589dc3411a14a190 (diff)
downloadFreeBSD-src-c4be7fbe0da23afe0768e33f8aa3350c58f2e0d7.zip
FreeBSD-src-c4be7fbe0da23afe0768e33f8aa3350c58f2e0d7.tar.gz
Add macros for accessing device memory.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/include/cpufunc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 336ac025..977003c 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.79 1998/05/17 18:53:08 tegge Exp $
+ * $Id: cpufunc.h,v 1.80 1998/07/11 04:58:25 bde Exp $
*/
/*
@@ -49,6 +49,14 @@
extern int tlb_flush_count;
#endif
+#define readb(va) (*(volatile u_int8_t *) (va))
+#define readw(va) (*(volatile u_int16_t *) (va))
+#define readl(va) (*(volatile u_int32_t *) (va))
+
+#define writeb(va, d) (*(volatile u_int8_t *) (va) = (d))
+#define writew(va, d) (*(volatile u_int16_t *) (va) = (d))
+#define writel(va, d) (*(volatile u_int32_t *) (va) = (d))
+
#ifdef __GNUC__
static __inline void
OpenPOWER on IntegriCloud