Deleted Added
full compact
vm_radix.h (228314) vm_radix.h (230750)
1/*
2 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
3 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 21 unchanged lines hidden (view full) ---

30#define _VM_RADIX_H_
31
32#include <sys/queue.h>
33
34/* Default values of the tree parameters */
35#define VM_RADIX_WIDTH 5
36#define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH)
37#define VM_RADIX_MASK (VM_RADIX_COUNT - 1)
1/*
2 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
3 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 21 unchanged lines hidden (view full) ---

30#define _VM_RADIX_H_
31
32#include <sys/queue.h>
33
34/* Default values of the tree parameters */
35#define VM_RADIX_WIDTH 5
36#define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH)
37#define VM_RADIX_MASK (VM_RADIX_COUNT - 1)
38#define VM_RADIX_MAXVAL ((vm_pindex_t)-1)
38#define VM_RADIX_LIMIT howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH)
39#define VM_RADIX_FLAGS 0x3 /* Flag bits stored in node pointers. */
40#define VM_RADIX_BLACK 0x1 /* Black node. (leaf only) */
41#define VM_RADIX_RED 0x2 /* Red node. (leaf only) */
42#define VM_RADIX_ANY (VM_RADIX_RED | VM_RADIX_BLACK)
43#define VM_RADIX_EMPTY 0x1 /* Empty hint. (internal only) */
44#define VM_RADIX_HEIGHT 0xf /* Bits of height in root */
45#define VM_RADIX_STACK 8 /* Nodes to store on stack. */
46
47/* Calculates maximum value for a tree of height h. */
48#define VM_RADIX_MAX(h) \
39#define VM_RADIX_LIMIT howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH)
40#define VM_RADIX_FLAGS 0x3 /* Flag bits stored in node pointers. */
41#define VM_RADIX_BLACK 0x1 /* Black node. (leaf only) */
42#define VM_RADIX_RED 0x2 /* Red node. (leaf only) */
43#define VM_RADIX_ANY (VM_RADIX_RED | VM_RADIX_BLACK)
44#define VM_RADIX_EMPTY 0x1 /* Empty hint. (internal only) */
45#define VM_RADIX_HEIGHT 0xf /* Bits of height in root */
46#define VM_RADIX_STACK 8 /* Nodes to store on stack. */
47
48/* Calculates maximum value for a tree of height h. */
49#define VM_RADIX_MAX(h) \
49 ((h) == VM_RADIX_LIMIT ? ((vm_pindex_t)-1) : \
50 ((h) == VM_RADIX_LIMIT ? VM_RADIX_MAXVAL : \
50 (((vm_pindex_t)1 << ((h) * VM_RADIX_WIDTH)) - 1))
51
52/*
53 * Radix tree root. The height and pointer are set together to permit
54 * coherent lookups while the root is modified.
55 */
56struct vm_radix {
57 uintptr_t rt_root; /* root + height */

--- 78 unchanged lines hidden ---
51 (((vm_pindex_t)1 << ((h) * VM_RADIX_WIDTH)) - 1))
52
53/*
54 * Radix tree root. The height and pointer are set together to permit
55 * coherent lookups while the root is modified.
56 */
57struct vm_radix {
58 uintptr_t rt_root; /* root + height */

--- 78 unchanged lines hidden ---