diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-01-21 22:23:11 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2001-01-21 22:23:11 +0000 |
| commit | a3ea6d41b97bc23e762caea2704e5775db1675c6 (patch) | |
| tree | ff96057b6037a24d6addf68c7f269cbab898b444 /sys/vm/vm_zone.c | |
| parent | 0dc3067b452c6b3e592ab69a434c06ad82404fa7 (diff) | |
Notes
Diffstat (limited to 'sys/vm/vm_zone.c')
| -rw-r--r-- | sys/vm/vm_zone.c | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index bc843e0cabdf..57aeb104aaca 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -39,6 +39,9 @@ static MALLOC_DEFINE(M_ZONE, "ZONE", "Zone header"); #define ZONE_ROUNDING 32 #define ZENTRY_FREE 0x12342378 + +static void *_zget(vm_zone_t z); + /* * void *zalloc(vm_zone_t zone) -- * Returns an item from a specified zone. @@ -298,41 +301,11 @@ zunlock(vm_zone_t z, int s) * void zfree(vm_zone_t zone, void *item) -- * Frees an item back to a specified zone. * - * void *zalloci(vm_zone_t zone) -- - * Returns an item from a specified zone, interrupt safe. - * - * void zfreei(vm_zone_t zone, void *item) -- - * Frees an item back to a specified zone, interrupt safe. - * */ void * zalloc(vm_zone_t z) { -#if defined(SMP) - return zalloci(z); -#else - return _zalloc(z); -#endif -} - -void -zfree(vm_zone_t z, void *item) -{ -#ifdef SMP - zfreei(z, item); -#else - _zfree(z, item); -#endif -} - -/* - * Zone allocator/deallocator. These are interrupt / (or potentially SMP) - * safe. The raw zalloc/zfree routines are not interrupt safe, but are fast. - */ -void * -zalloci(vm_zone_t z) -{ int s; void *item; @@ -343,7 +316,7 @@ zalloci(vm_zone_t z) } void -zfreei(vm_zone_t z, void *item) +zfree(vm_zone_t z, void *item) { int s; @@ -356,7 +329,7 @@ zfreei(vm_zone_t z, void *item) /* * Internal zone routine. Not to be called from external (non vm_zone) code. */ -void * +static void * _zget(vm_zone_t z) { int i; @@ -405,24 +378,16 @@ _zget(vm_zone_t z) if (lockstatus(&kernel_map->lock, NULL)) { int s; s = splvm(); -#ifdef SMP simple_unlock(&z->zlock); -#endif item = (void *) kmem_malloc(kmem_map, nbytes, M_WAITOK); -#ifdef SMP simple_lock(&z->zlock); -#endif if (item != NULL) zone_kmem_pages += z->zalloc; splx(s); } else { -#ifdef SMP simple_unlock(&z->zlock); -#endif item = (void *) kmem_alloc(kernel_map, nbytes); -#ifdef SMP simple_lock(&z->zlock); -#endif if (item != NULL) zone_kern_pages += z->zalloc; } |
