svn commit: r203880 - in projects/ppc64/sys/powerpc: aim include
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sun Feb 14 16:21:01 UTC 2010
Author: nwhitehorn
Date: Sun Feb 14 16:21:00 2010
New Revision: 203880
URL: http://svn.freebsd.org/changeset/base/203880
Log:
Update some constants to be the right size on 64-bit kernels.
Modified:
projects/ppc64/sys/powerpc/aim/machdep.c
projects/ppc64/sys/powerpc/include/param.h
Modified: projects/ppc64/sys/powerpc/aim/machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/aim/machdep.c Sun Feb 14 16:19:15 2010 (r203879)
+++ projects/ppc64/sys/powerpc/aim/machdep.c Sun Feb 14 16:21:00 2010 (r203880)
@@ -213,9 +213,9 @@ cpu_startup(void *dummy)
int size1 = phys_avail[indx + 1] - phys_avail[indx];
#ifdef __powerpc64__
- printf("0x%16lx - 0x%16lx, %d bytes (%d pages)\n",
+ printf("0x%16lx - 0x%16lx, %d bytes (%ld pages)\n",
#else
- printf("0x%08x - 0x%08x, %d bytes (%d pages)\n",
+ printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n",
#endif
phys_avail[indx], phys_avail[indx + 1] - 1, size1,
size1 / PAGE_SIZE);
Modified: projects/ppc64/sys/powerpc/include/param.h
==============================================================================
--- projects/ppc64/sys/powerpc/include/param.h Sun Feb 14 16:19:15 2010 (r203879)
+++ projects/ppc64/sys/powerpc/include/param.h Sun Feb 14 16:21:00 2010 (r203880)
@@ -42,7 +42,7 @@
#define _POWERPC_INCLUDE_PARAM_H_
/*
- * Machine dependent constants for PowerPC (32-bit only currently)
+ * Machine dependent constants for PowerPC
*/
#include <machine/_align.h>
@@ -86,7 +86,7 @@
#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)
#define PAGE_SHIFT 12
-#define PAGE_SIZE (1 << PAGE_SHIFT) /* Page size */
+#define PAGE_SIZE (1L << PAGE_SHIFT) /* Page size */
#define PAGE_MASK (vm_offset_t)(PAGE_SIZE - 1)
#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
@@ -103,15 +103,13 @@
*/
#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK))
#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK)
-#define trunc_4mpage(x) ((unsigned)(x) & ~PDRMASK)
-#define round_4mpage(x) ((((unsigned)(x)) + PDRMASK) & ~PDRMASK)
#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT)
-#define powerpc_btop(x) ((unsigned)(x) >> PAGE_SHIFT)
-#define powerpc_ptob(x) ((unsigned)(x) << PAGE_SHIFT)
+#define powerpc_btop(x) ((unsigned long)(x) >> PAGE_SHIFT)
+#define powerpc_ptob(x) ((unsigned long)(x) << PAGE_SHIFT)
-#define pgtok(x) ((x) * (PAGE_SIZE / 1024))
+#define pgtok(x) ((x) * (PAGE_SIZE / 1024UL))
#endif /* !_POWERPC_INCLUDE_PARAM_H_ */
More information about the svn-src-projects
mailing list