summaryrefslogtreecommitdiffstats
path: root/sys/netatm
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-04-24 20:56:23 +0000
committerarr <arr@FreeBSD.org>2002-04-24 20:56:23 +0000
commit34c9517fb0c1cf0fb19902dea2d26726722cc3ad (patch)
treec64f8d32274543b1b28353ca8ed5686516a53412 /sys/netatm
parent1cde165502d31017379ab64d5ad449a7ec835fdf (diff)
downloadFreeBSD-src-34c9517fb0c1cf0fb19902dea2d26726722cc3ad.zip
FreeBSD-src-34c9517fb0c1cf0fb19902dea2d26726722cc3ad.tar.gz
- Turn the atm_stackq_pool into a uma_zone (and change it's name to
atm_stackq_zone). - Change the related atm_allocate() and atm_free() calls into uma_zalloc() and uma_zfree() calls.
Diffstat (limited to 'sys/netatm')
-rw-r--r--sys/netatm/atm_subr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c
index fc42da6..2b81900 100644
--- a/sys/netatm/atm_subr.c
+++ b/sys/netatm/atm_subr.c
@@ -93,13 +93,7 @@ static KTimeout_ret atm_timexp(void *);
static struct atm_time *atm_timeq = NULL;
static struct atm_time atm_compactimer = {0, 0};
-static struct sp_info atm_stackq_pool = {
- "Service stack queue pool", /* si_name */
- sizeof(struct stackq_entry), /* si_blksiz */
- 10, /* si_blkcnt */
- 10 /* si_maxallow */
-};
-
+static uma_zone_t atm_stackq_zone;
/*
* Initialize ATM kernel
@@ -136,6 +130,12 @@ atm_initialize()
panic("atm_initialize: unable to allocate attributes pool");
uma_zone_set_max(atm_attributes_zone, 100);
+ atm_stackq_zone = uma_zcreate("atm stackq", sizeof(struct stackq_entry),
+ (uma_ctor)&atm_uma_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+ if (atm_stackq_zone == NULL)
+ panic("atm_initialize: unable to allocate stackq pool");
+ uma_zone_set_max(atm_stackq_zone, 10);
+
register_netisr(NETISR_ATM, atm_intr);
/*
@@ -747,7 +747,7 @@ atm_stack_enq(cmd, func, token, cvp, arg1, arg2)
/*
* Get a new queue entry for this call
*/
- sqp = (struct stackq_entry *)atm_allocate(&atm_stackq_pool);
+ sqp = uma_zalloc(atm_stackq_zone, 0);
if (sqp == NULL) {
(void) splx(s);
return (ENOMEM);
@@ -862,7 +862,7 @@ atm_stack_drain()
atm_stackq_head = qnext;
if (qnext == NULL)
atm_stackq_tail = qprev;
- atm_free((caddr_t)sqp);
+ uma_zfree(atm_stackq_zone, sqp);
sqp = qnext;
}
} while (cnt > 0);
OpenPOWER on IntegriCloud