svn commit: r204501 - user/jmallett/octeon/sys/mips/include
Juli Mallett
jmallett at FreeBSD.org
Mon Mar 1 03:24:57 UTC 2010
Author: jmallett
Date: Mon Mar 1 03:24:56 2010
New Revision: 204501
URL: http://svn.freebsd.org/changeset/base/204501
Log:
o) Fix size_t and ssize_t max values for n64.
o) Don't define MIPS_MAX_MEM_ADDR and MIPS_RESERVED_ADDR in two places.
o) Try to correctly define the kseg addresses for both 32-bit and 64-bit
systems. Ugly :(
Modified:
user/jmallett/octeon/sys/mips/include/_limits.h
user/jmallett/octeon/sys/mips/include/cpu.h
user/jmallett/octeon/sys/mips/include/cpuregs.h
Modified: user/jmallett/octeon/sys/mips/include/_limits.h
==============================================================================
--- user/jmallett/octeon/sys/mips/include/_limits.h Mon Mar 1 02:52:37 2010 (r204500)
+++ user/jmallett/octeon/sys/mips/include/_limits.h Mon Mar 1 03:24:56 2010 (r204501)
@@ -76,9 +76,9 @@
#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */
#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
-#define __SSIZE_MAX __INT_MAX /* max value for a ssize_t */
+#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
-#define __SIZE_T_MAX __UINT_MAX /* max value for a size_t */
+#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
#define __OFF_MAX __LLONG_MAX /* max value for an off_t */
#define __OFF_MIN __LLONG_MIN /* min value for an off_t */
Modified: user/jmallett/octeon/sys/mips/include/cpu.h
==============================================================================
--- user/jmallett/octeon/sys/mips/include/cpu.h Mon Mar 1 02:52:37 2010 (r204500)
+++ user/jmallett/octeon/sys/mips/include/cpu.h Mon Mar 1 03:24:56 2010 (r204501)
@@ -52,8 +52,6 @@
#define MIPS_CACHED_MEMORY_ADDR 0x80000000
#define MIPS_UNCACHED_MEMORY_ADDR 0xa0000000
-#define MIPS_MAX_MEM_ADDR 0xbe000000
-#define MIPS_RESERVED_ADDR 0xbfc80000
#define MIPS_KSEG0_LARGEST_PHYS 0x20000000
#define MIPS_CACHED_TO_PHYS(x) ((uintptr_t)(x) & 0x1fffffff)
Modified: user/jmallett/octeon/sys/mips/include/cpuregs.h
==============================================================================
--- user/jmallett/octeon/sys/mips/include/cpuregs.h Mon Mar 1 02:52:37 2010 (r204500)
+++ user/jmallett/octeon/sys/mips/include/cpuregs.h Mon Mar 1 03:24:56 2010 (r204501)
@@ -78,19 +78,30 @@
* Caching of mapped addresses is controlled by bits in the TLB entry.
*/
+#if defined(_LOCORE) || defined(LOCORE)
+#ifdef __mips_n64
+#define KSEG_ADDRESS(x) __CONCAT(0xffffffff, x)
+#else
+#define KSEG_ADDRESS(x) __CONCAT(0x, x)
+#endif
+#else
+#define KSEG_ADDRESS(x) ((intptr_t)(int32_t)__CONCAT(0x, x))
+#endif
+
#define MIPS_KUSEG_START 0x0
-#define MIPS_KSEG0_START 0x80000000
-#define MIPS_KSEG0_END 0x9fffffff
-#define MIPS_KSEG1_START 0xa0000000
-#define MIPS_KSEG1_END 0xbfffffff
-#define MIPS_KSSEG_START 0xc0000000
-#define MIPS_KSSEG_END 0xdfffffff
+#define MIPS_KSEG0_START KSEG_ADDRESS(80000000)
+#define MIPS_KSEG0_END KSEG_ADDRESS(9fffffff)
+#define MIPS_KSEG1_START KSEG_ADDRESS(a0000000)
+#define MIPS_KSEG1_END KSEG_ADDRESS(bfffffff)
+#define MIPS_KSSEG_START KSEG_ADDRESS(c0000000)
+#define MIPS_KSSEG_END KSEG_ADDRESS(dfffffff)
+#define MIPS_KSEG3_START KSEG_ADDRESS(e0000000)
+#define MIPS_KSEG3_END KSEG_ADDRESS(ffffffff)
+#define MIPS_MAX_MEM_ADDR KSEG_ADDRESS(be000000)
+#define MIPS_RESERVED_ADDR KSEG_ADDRESS(bfc80000)
+
#define MIPS_KSEG2_START MIPS_KSSEG_START
#define MIPS_KSEG2_END MIPS_KSSEG_END
-#define MIPS_KSEG3_START 0xe0000000
-#define MIPS_KSEG3_END 0xffffffff
-#define MIPS_MAX_MEM_ADDR 0xbe000000
-#define MIPS_RESERVED_ADDR 0xbfc80000
/* Map virtual address to index in mips3 r4k virtually-indexed cache */
#define MIPS3_VA_TO_CINDEX(x) \
More information about the svn-src-user
mailing list