Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma_int.h
Show First 20 Lines • Show All 520 Lines • ▼ Show 20 Lines | |||||
#define UZ_ITEMS_COUNT(x) ((x) & UZ_ITEMS_COUNT_MASK) | #define UZ_ITEMS_COUNT(x) ((x) & UZ_ITEMS_COUNT_MASK) | ||||
#define UZ_ITEMS_SLEEPERS(x) ((x) >> UZ_ITEMS_SLEEPER_SHIFT) | #define UZ_ITEMS_SLEEPERS(x) ((x) >> UZ_ITEMS_SLEEPER_SHIFT) | ||||
#define UZ_ITEMS_SLEEPER (1LL << UZ_ITEMS_SLEEPER_SHIFT) | #define UZ_ITEMS_SLEEPER (1LL << UZ_ITEMS_SLEEPER_SHIFT) | ||||
#define ZONE_ASSERT_COLD(z) \ | #define ZONE_ASSERT_COLD(z) \ | ||||
KASSERT(uma_zone_get_allocs((z)) == 0, \ | KASSERT(uma_zone_get_allocs((z)) == 0, \ | ||||
("zone %s initialization after use.", (z)->uz_name)) | ("zone %s initialization after use.", (z)->uz_name)) | ||||
/* Domains are contiguous after the last CPU */ | |||||
#define ZDOM_GET(z, n) \ | |||||
(&((uma_zone_domain_t)&(z)->uz_cpu[mp_maxid + 1])[n]) | |||||
markj: Fix the indent to be consistent while you're here? | |||||
#undef UMA_ALIGN | #undef UMA_ALIGN | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* Internal prototypes */ | /* Internal prototypes */ | ||||
static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data); | static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data); | ||||
/* Lock Macros */ | /* Lock Macros */ | ||||
Show All 18 Lines | #define KEG_GET(zone, keg) do { \ | ||||
(keg) = (zone)->uz_keg; \ | (keg) = (zone)->uz_keg; \ | ||||
KASSERT((void *)(keg) != NULL, \ | KASSERT((void *)(keg) != NULL, \ | ||||
("%s: Invalid zone %p type", __func__, (zone))); \ | ("%s: Invalid zone %p type", __func__, (zone))); \ | ||||
} while (0) | } while (0) | ||||
#define KEG_ASSERT_COLD(k) \ | #define KEG_ASSERT_COLD(k) \ | ||||
KASSERT(uma_keg_get_allocs((k)) == 0, \ | KASSERT(uma_keg_get_allocs((k)) == 0, \ | ||||
("keg %s initialization after use.", (k)->uk_name)) | ("keg %s initialization after use.", (k)->uk_name)) | ||||
/* Domains are contiguous after the last CPU */ | |||||
#define ZDOM_GET(z, n) \ | |||||
(&((uma_zone_domain_t)&(z)->uz_cpu[mp_maxid + 1])[n]) | |||||
#define ZDOM_LOCK_INIT(z, zdom, lc) \ | #define ZDOM_LOCK_INIT(z, zdom, lc) \ | ||||
do { \ | do { \ | ||||
if ((lc)) \ | if ((lc)) \ | ||||
mtx_init(&(zdom)->uzd_lock, (z)->uz_name, \ | mtx_init(&(zdom)->uzd_lock, (z)->uz_name, \ | ||||
(z)->uz_name, MTX_DEF | MTX_DUPOK); \ | (z)->uz_name, MTX_DEF | MTX_DUPOK); \ | ||||
else \ | else \ | ||||
mtx_init(&(zdom)->uzd_lock, (z)->uz_name, \ | mtx_init(&(zdom)->uzd_lock, (z)->uz_name, \ | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |
Fix the indent to be consistent while you're here?