summaryrefslogtreecommitdiffstats
path: root/sys/netatm
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-04-22 05:11:44 +0000
committerarr <arr@FreeBSD.org>2002-04-22 05:11:44 +0000
commit9570c296c3ac817ab93aa035b91fc28606b26c70 (patch)
tree857e380ee6af9318cde75b6611884ede13fe5ef7 /sys/netatm
parentb2815166cb32c64d47e52596284d3a753b88d7d6 (diff)
downloadFreeBSD-src-9570c296c3ac817ab93aa035b91fc28606b26c70.zip
FreeBSD-src-9570c296c3ac817ab93aa035b91fc28606b26c70.tar.gz
- Change the atm_attributes_pool and atm_stackq_pool to be uma_zone's
(with the appropriate set_max) rather than using the HARP storage pool code.
Diffstat (limited to 'sys/netatm')
-rw-r--r--sys/netatm/atm_cm.c2
-rw-r--r--sys/netatm/atm_subr.c29
-rw-r--r--sys/netatm/atm_var.h5
3 files changed, 19 insertions, 17 deletions
diff --git a/sys/netatm/atm_cm.c b/sys/netatm/atm_cm.c
index f509f38..d83bf9c 100644
--- a/sys/netatm/atm_cm.c
+++ b/sys/netatm/atm_cm.c
@@ -709,7 +709,7 @@ atm_cm_listen(epp, token, ap, copp)
/*
* Get an attribute block and save listening attributes
*/
- cop->co_lattr = (Atm_attributes *)atm_allocate(&atm_attributes_pool);
+ cop->co_lattr = uma_zalloc(atm_attributes_zone, 0);
if (cop->co_lattr == NULL) {
err = ENOMEM;
goto done;
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);
diff --git a/sys/netatm/atm_var.h b/sys/netatm/atm_var.h
index bacee49..eb7ee35 100644
--- a/sys/netatm/atm_var.h
+++ b/sys/netatm/atm_var.h
@@ -40,6 +40,9 @@
#ifdef _KERNEL
+
+#include <vm/uma.h>
+
/*
* Global variable declarations
*/
@@ -63,7 +66,7 @@ extern int atm_debug;
extern struct timeval atm_debugtime;
extern int atm_dev_print;
extern int atm_print_data;
-extern struct sp_info atm_attributes_pool;
+extern uma_zone_t atm_attributes_zone;
extern struct pr_usrreqs atm_dgram_usrreqs;
OpenPOWER on IntegriCloud