svn commit: r192177 - projects/mips/sys/mips/include
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Sat May 16 02:39:14 UTC 2009
Author: gonzo
Date: Sat May 16 02:39:13 2009
New Revision: 192177
URL: http://svn.freebsd.org/changeset/base/192177
Log:
- Add MIPS_IS_KSEG0_ADDR, MIPS_IS_KSEG1_ADDR and MIPS_IS_VALID_PTR
macroses thet check if address belongs to KSEG0, KSEG1 or both
of them respectively.
Modified:
projects/mips/sys/mips/include/cpu.h
Modified: projects/mips/sys/mips/include/cpu.h
==============================================================================
--- projects/mips/sys/mips/include/cpu.h Sat May 16 02:34:03 2009 (r192176)
+++ projects/mips/sys/mips/include/cpu.h Sat May 16 02:39:13 2009 (r192177)
@@ -72,6 +72,15 @@
#define MIPS_KSEG0_TO_PHYS(x) ((unsigned)(x) & MIPS_PHYS_MASK)
#define MIPS_KSEG1_TO_PHYS(x) ((unsigned)(x) & MIPS_PHYS_MASK)
+#define MIPS_IS_KSEG0_ADDR(x) \
+ (((vm_offset_t)(x) >= MIPS_KSEG0_START) && \
+ ((vm_offset_t)(x) <= MIPS_KSEG0_END))
+#define MIPS_IS_KSEG1_ADDR(x) \
+ (((vm_offset_t)(x) >= MIPS_KSEG1_START) && \
+ ((vm_offset_t)(x) <= MIPS_KSEG1_END))
+#define MIPS_IS_VALID_PTR(x) (MIPS_IS_KSEG0_ADDR(x) || \
+ MIPS_IS_KSEG1_ADDR(x))
+
/*
* Status register.
*/
More information about the svn-src-projects
mailing list