summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/addrspace.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-25 21:30:56 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-25 21:30:56 +0000
commitdac103878ffd0ba9eaa80d082ade85f558e8fb5c (patch)
tree4e10c0cc1d005b91182258bc17296257c0353bf4 /include/asm-mips/addrspace.h
parenteb431e0bd1b221804e83f38f6371c256428e43da (diff)
NTP fixes from Maciej.
Diffstat (limited to 'include/asm-mips/addrspace.h')
-rw-r--r--include/asm-mips/addrspace.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 39259486e..45bd9ef3f 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -4,6 +4,7 @@
* for more details.
*
* Copyright (C) 1996 by Ralf Baechle
+ * Copyright (C) 2000 by Maciej W. Rozycki
*
* Defitions for the address spaces of the MIPS CPUs.
*/
@@ -22,20 +23,35 @@
/*
* Returns the kernel segment base of a given address
*/
+#ifndef __ASSEMBLY__
#define KSEGX(a) (((unsigned long)(a)) & 0xe0000000)
+#else
+#define KSEGX(a) ((a) & 0xe0000000)
+#endif
/*
* Returns the physical address of a KSEG0/KSEG1 address
*/
+#ifndef __ASSEMBLY__
#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)
+#else
+#define PHYSADDR(a) ((a) & 0x1fffffff)
+#endif
/*
* Map an address to a certain kernel segment
*/
+#ifndef __ASSEMBLY__
#define KSEG0ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG0))
#define KSEG1ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG1))
#define KSEG2ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG2))
#define KSEG3ADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | KSEG3))
+#else
+#define KSEG0ADDR(a) (((a) & 0x1fffffff) | KSEG0)
+#define KSEG1ADDR(a) (((a) & 0x1fffffff) | KSEG1)
+#define KSEG2ADDR(a) (((a) & 0x1fffffff) | KSEG2)
+#define KSEG3ADDR(a) (((a) & 0x1fffffff) | KSEG3)
+#endif
/*
* Memory segments (64bit kernel mode addresses)