summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-08-30 00:29:52 +0000
committerpeter <peter@FreeBSD.org>2002-08-30 00:29:52 +0000
commitf96820418edc4a1b13d0df8d42df2d1c5d558e8e (patch)
tree9882637f2ae8e334c2d31ccfddf4df97021419b5
parentb085f4e6d284cf69ff73ce1640a38c562547f8bc (diff)
downloadFreeBSD-src-f96820418edc4a1b13d0df8d42df2d1c5d558e8e.zip
FreeBSD-src-f96820418edc4a1b13d0df8d42df2d1c5d558e8e.tar.gz
AARGH! btoc() is used in the MI buffer sizing routines to calculate
the minimum of either physmem or KVA. But.. btoc() casts the address to (unsigned int). This is NOT GOOD on 64 bit machines and on alpha and ia64, this results in a buffer limit of around 500K (not megs). This causes extreme disk access problems on alpha and ia64. Since this cast is simply to ensure that it is unsigned, use 'vm_offset_t' instead. This is available because it is already defined in types.h. Alpha has been suffering from this for ages. It always felt like the caching wasn't working, and unfortunately it turned out that way. :-(
-rw-r--r--sys/sys/param.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/param.h b/sys/sys/param.h
index e45a6ea..e875740 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -152,7 +152,7 @@
/* bytes to clicks */
#ifndef btoc
-#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
+#define btoc(x) (((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT)
#endif
/*
OpenPOWER on IntegriCloud