summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_param.h
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-05-25 09:21:21 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-05-25 09:21:21 +0000
commit2469c867a164210ce96143517059f21db7f1fd17 (patch)
tree9179427ac860211c445df663fd2b86267366bfba /sys/vm/vm_param.h
parentcb0aba89af15a48e2655e898a503946ac4cb42ae (diff)
downloadFreeBSD-src-2469c867a164210ce96143517059f21db7f1fd17.zip
FreeBSD-src-2469c867a164210ce96143517059f21db7f1fd17.tar.gz
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
Diffstat (limited to 'sys/vm/vm_param.h')
-rw-r--r--sys/vm/vm_param.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h
index 2d2c715..4a785ce 100644
--- a/sys/vm/vm_param.h
+++ b/sys/vm/vm_param.h
@@ -84,14 +84,25 @@ typedef int boolean_t;
*/
#define DEFAULT_PAGE_SIZE 4096
+#if 0
+
/*
* All references to the size of a page should be done with PAGE_SIZE
* or PAGE_SHIFT. The fact they are variables is hidden here so that
* we can easily make them constant if we so desire.
*/
+#ifndef PAGE_SIZE
#define PAGE_SIZE cnt.v_page_size /* size of page */
+#endif
+#ifndef PAGE_MASK
#define PAGE_MASK page_mask /* size of page - 1 */
+#endif
+#ifndef PAGE_SHIFT
#define PAGE_SHIFT page_shift /* bits to shift for pages */
+#endif
+
+#endif
+
#ifdef KERNEL
extern vm_size_t page_mask;
extern int page_shift;
@@ -129,17 +140,34 @@ extern int page_shift;
* No rounding is used.
*/
#ifdef KERNEL
+
+#if 0
+
+#ifndef atop
#define atop(x) (((unsigned)(x)) >> PAGE_SHIFT)
+#endif
+#ifndef ptoa
#define ptoa(x) ((vm_offset_t)((x) << PAGE_SHIFT))
+#endif
/*
* Round off or truncate to the nearest page. These will work
* for either addresses or counts (i.e., 1 byte rounds to 1 page).
*/
+#ifndef round_page
#define round_page(x) \
((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) & ~PAGE_MASK))
+#endif
+#ifndef trunc_page
#define trunc_page(x) \
((vm_offset_t)(((vm_offset_t)(x)) & ~PAGE_MASK))
+#endif
+#ifndef num_pages
+#define num_pages(x) \
+ ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
+#endif
+
+#endif
#define num_pages(x) \
((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
@@ -148,11 +176,13 @@ extern vm_offset_t first_addr; /* first physical page */
extern vm_offset_t last_addr; /* last physical page */
#else
+#if 0
/* out-of-kernel versions of round_page and trunc_page */
#define round_page(x) \
((((vm_offset_t)(x) + (vm_page_size - 1)) / vm_page_size) * vm_page_size)
#define trunc_page(x) \
((((vm_offset_t)(x)) / vm_page_size) * vm_page_size)
+#endif
#endif /* KERNEL */
#endif /* ASSEMBLER */
OpenPOWER on IntegriCloud