summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include/param.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/include/param.h')
-rw-r--r--sys/powerpc/include/param.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h
index df5a7be..453915c 100644
--- a/sys/powerpc/include/param.h
+++ b/sys/powerpc/include/param.h
@@ -98,7 +98,7 @@
#define PAGE_SHIFT 12
#define PAGE_SIZE (1L << PAGE_SHIFT) /* Page size */
-#define PAGE_MASK (vm_offset_t)(PAGE_SIZE - 1)
+#define PAGE_MASK (PAGE_SIZE - 1)
#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
#define MAXPAGESIZES 1 /* maximum number of supported page sizes */
@@ -116,15 +116,17 @@
/*
* Mach derived conversion macros
*/
-#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK))
+#define trunc_page(x) ((x) & ~(PAGE_MASK))
#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK)
-#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
-#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT)
+#define atop(x) ((x) >> PAGE_SHIFT)
+#define ptoa(x) ((x) << PAGE_SHIFT)
-#define powerpc_btop(x) ((unsigned long)(x) >> PAGE_SHIFT)
-#define powerpc_ptob(x) ((unsigned long)(x) << PAGE_SHIFT)
+#define powerpc_btop(x) ((x) >> PAGE_SHIFT)
+#define powerpc_ptob(x) ((x) << PAGE_SHIFT)
#define pgtok(x) ((x) * (PAGE_SIZE / 1024UL))
+#define btoc(x) ((vm_offset_t)(((x)+PAGE_MASK)>>PAGE_SHIFT))
+
#endif /* !_POWERPC_INCLUDE_PARAM_H_ */
OpenPOWER on IntegriCloud