diff options
author | dfr <dfr@FreeBSD.org> | 1998-08-17 08:57:05 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-08-17 08:57:05 +0000 |
commit | c4be7fbe0da23afe0768e33f8aa3350c58f2e0d7 (patch) | |
tree | b184f8aa4b80759a5ec8a98cc7cdb6b19ff9986f /sys/amd64 | |
parent | 2cfb34146c6d83d8dd41f94e589dc3411a14a190 (diff) | |
download | FreeBSD-src-c4be7fbe0da23afe0768e33f8aa3350c58f2e0d7.zip FreeBSD-src-c4be7fbe0da23afe0768e33f8aa3350c58f2e0d7.tar.gz |
Add macros for accessing device memory.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/cpufunc.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 336ac025..977003c 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/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 |