diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/fw/mips/ioaccess.h | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ntos/fw/mips/ioaccess.h')
-rw-r--r-- | private/ntos/fw/mips/ioaccess.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/private/ntos/fw/mips/ioaccess.h b/private/ntos/fw/mips/ioaccess.h new file mode 100644 index 000000000..e6db7c06b --- /dev/null +++ b/private/ntos/fw/mips/ioaccess.h @@ -0,0 +1,79 @@ +/*++ + +Copyright (c) 1990 Microsoft Corporation + +Module Name: + + ioaccess.h + +Abstract: + + This file contains the definitions to read and write IO registers. + +Author: + + Lluis Abello (lluis) 1-May-91 + +Environment: + + Kernel mode + +Revision History: + +--*/ + +#ifndef _IOACCESS +#define _IOACCESS +// +// I/O space read and write macros. +// +#ifdef R4000 +#undef READ_REGISTER_UCHAR +#undef READ_REGISTER_USHORT +#undef READ_REGISTER_ULONG +#undef WRITE_REGISTER_UCHAR +#undef WRITE_REGISTER_USHORT +#undef WRITE_REGISTER_ULONG +// #define READ_REGISTER_UCHAR(x) NtReadByte(x) +// #define READ_REGISTER_USHORT(x) NtReadShort(x) +// #define READ_REGISTER_ULONG(x) NtReadLong(x) +// #define WRITE_REGISTER_UCHAR(x, y) NtFlushByteBuffer(x,y) +// #define WRITE_REGISTER_USHORT(x, y) NtFlushShortBuffer(x,y) +// #define WRITE_REGISTER_ULONG(x, y) NtFlushLongBuffer(x,y) +#define READ_REGISTER_UCHAR(x) *(volatile UCHAR * const)(x) +#define READ_REGISTER_USHORT(x) *(volatile USHORT * const)(x) +#define READ_REGISTER_ULONG(x) *(volatile ULONG * const)(x) + +#define WRITE_REGISTER_UCHAR(x, y) *(volatile UCHAR * const)(x) = y +#define WRITE_REGISTER_USHORT(x, y) *(volatile USHORT * const)(x) = y +#define WRITE_REGISTER_ULONG(x, y) *(volatile ULONG * const)(x) = y + +#endif //R4000 + +#ifdef R3000 +#undef READ_REGISTER_UCHAR +#undef READ_REGISTER_USHORT +#undef READ_REGISTER_ULONG +#undef WRITE_REGISTER_UCHAR +#undef WRITE_REGISTER_USHORT +#undef WRITE_REGISTER_ULONG + +#define READ_REGISTER_UCHAR(x) \ + *(volatile UCHAR * const)(x) + +#define READ_REGISTER_USHORT(x) \ + *(volatile USHORT * const)(x) + +#define READ_REGISTER_ULONG(x) \ + *(volatile ULONG * const)(x) + +#define WRITE_REGISTER_UCHAR(x, y) \ + *(volatile UCHAR * const)(x) = y; FlushWriteBuffer() + +#define WRITE_REGISTER_USHORT(x, y) \ + *(volatile USHORT * const)(x) = y; FlushWriteBuffer() + +#define WRITE_REGISTER_ULONG(x, y) \ + *(volatile ULONG * const)(x) = y; FlushWriteBuffer() +#endif //R3000 +#endif //_IOACCESS |