summaryrefslogtreecommitdiffstats
path: root/sys/netatm/atm_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netatm/atm_subr.c')
-rw-r--r--sys/netatm/atm_subr.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c
index 0581725..c7436cf 100644
--- a/sys/netatm/atm_subr.c
+++ b/sys/netatm/atm_subr.c
@@ -79,13 +79,7 @@ int atm_print_data = 0;
int atm_version = ATM_VERSION;
struct timeval atm_debugtime = {0, 0};
-struct sp_info atm_attributes_pool = {
- "atm attributes pool", /* si_name */
- sizeof(Atm_attributes), /* si_blksiz */
- 10, /* si_blkcnt */
- 100 /* si_maxallow */
-};
-
+uma_zone_t atm_attributes_zone;
/*
* Local functions
@@ -99,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
@@ -135,6 +123,17 @@ atm_initialize()
mtx_init(&atm_intrq.ifq_mtx, "atm_inq", NULL, MTX_DEF);
atmintrq_present = 1;
+ atm_attributes_zone = uma_zcreate("atm_attributes",
+ sizeof(Atm_attributes), (uma_ctor)&atm_uma_ctor, NULL, NULL, NULL,
+ UMA_ALIGN_PTR, 0);
+ 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);
+ uma_zone_set_max(atm_stackq_zone, 10);
+
register_netisr(NETISR_ATM, atm_intr);
/*
@@ -746,7 +745,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);
OpenPOWER on IntegriCloud