78 */
79 #define SE_RETIRED 0x04
80
81 #endif /* _KERNEL | _KMEMUSER */
82
83 typedef int selock_t;
84
85 /*
86 * Define VM_STATS to turn on all sorts of statistic gathering about
87 * the VM layer. By default, it is only turned on when DEBUG is
88 * also defined.
89 */
90 #ifdef DEBUG
91 #define VM_STATS
92 #endif /* DEBUG */
93
94 #ifdef VM_STATS
95 #define VM_STAT_ADD(stat) (stat)++
96 #define VM_STAT_COND_ADD(cond, stat) ((void) (!(cond) || (stat)++))
97 #else
98 #define VM_STAT_ADD(stat)
99 #define VM_STAT_COND_ADD(cond, stat)
100 #endif /* VM_STATS */
101
102 #ifdef _KERNEL
103
104 /*
105 * PAGE_LLOCK_SIZE is 2 * NCPU, but no smaller than 128.
106 * PAGE_LLOCK_SHIFT is log2(PAGE_LLOCK_SIZE).
107 *
108 * We use ? : instead of #if because <vm/page.h> is included everywhere;
109 * NCPU_P2 is only a constant in the "unix" module.
110 *
111 */
112 #define PAGE_LLOCK_SHIFT \
113 ((unsigned)(((2*NCPU_P2) > 128) ? NCPU_LOG2 + 1 : 7))
114
115 #define PAGE_LLOCK_SIZE (1ul << PAGE_LLOCK_SHIFT)
116
117 /*
118 * The number of low order 0 (or less variable) bits in the page_t address.
119 */
|
78 */
79 #define SE_RETIRED 0x04
80
81 #endif /* _KERNEL | _KMEMUSER */
82
83 typedef int selock_t;
84
85 /*
86 * Define VM_STATS to turn on all sorts of statistic gathering about
87 * the VM layer. By default, it is only turned on when DEBUG is
88 * also defined.
89 */
90 #ifdef DEBUG
91 #define VM_STATS
92 #endif /* DEBUG */
93
94 #ifdef VM_STATS
95 #define VM_STAT_ADD(stat) (stat)++
96 #define VM_STAT_COND_ADD(cond, stat) ((void) (!(cond) || (stat)++))
97 #else
98 #define VM_STAT_ADD(stat) do { } while (0)
99 #define VM_STAT_COND_ADD(cond, stat) do { } while (0)
100 #endif /* VM_STATS */
101
102 #ifdef _KERNEL
103
104 /*
105 * PAGE_LLOCK_SIZE is 2 * NCPU, but no smaller than 128.
106 * PAGE_LLOCK_SHIFT is log2(PAGE_LLOCK_SIZE).
107 *
108 * We use ? : instead of #if because <vm/page.h> is included everywhere;
109 * NCPU_P2 is only a constant in the "unix" module.
110 *
111 */
112 #define PAGE_LLOCK_SHIFT \
113 ((unsigned)(((2*NCPU_P2) > 128) ? NCPU_LOG2 + 1 : 7))
114
115 #define PAGE_LLOCK_SIZE (1ul << PAGE_LLOCK_SHIFT)
116
117 /*
118 * The number of low order 0 (or less variable) bits in the page_t address.
119 */
|