Fix compilation for userland:

- Use CTASSERT() only in the kernel.
- the root pointer is required by struct vm_object which is accessible
  (maybe incorrectly?) by userland.
This commit is contained in:
attilio 2011-11-15 23:37:15 +00:00
parent b13f89ff5b
commit 2cf76e3d27

View File

@ -44,20 +44,11 @@
#define VM_RADIX_HEIGHT 0xf /* Bits of height in root */
#define VM_RADIX_STACK 8 /* Nodes to store on stack. */
CTASSERT(VM_RADIX_HEIGHT >= VM_RADIX_LIMIT);
/* Calculates maximum value for a tree of height h. */
#define VM_RADIX_MAX(h) \
((h) == VM_RADIX_LIMIT ? ((vm_pindex_t)-1) : \
(((vm_pindex_t)1 << ((h) * VM_RADIX_WIDTH)) - 1))
#ifdef _KERNEL
struct vm_radix_node {
void *rn_child[VM_RADIX_COUNT]; /* child nodes. */
uint16_t rn_count; /* Valid children. */
};
/*
* Radix tree root. The height and pointer are set together to permit
* coherent lookups while the root is modified.
@ -66,6 +57,14 @@ struct vm_radix {
uintptr_t rt_root; /* root + height */
};
#ifdef _KERNEL
CTASSERT(VM_RADIX_HEIGHT >= VM_RADIX_LIMIT);
struct vm_radix_node {
void *rn_child[VM_RADIX_COUNT]; /* child nodes. */
uint16_t rn_count; /* Valid children. */
};
void vm_radix_init(void);
/*