PERFORCE change 98119 for review

Kip Macy kmacy at FreeBSD.org
Tue May 30 01:20:34 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=98119

Change 98119 by kmacy at kmacy_storage:sun4v_work on 2006/05/30 08:19:01

	remove nexus_intr_wrapper, set interrupt state in intr_execute_handlers

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/intr_machdep.c#7 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/nexus.c#12 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/intr_machdep.c#7 (text+ko) ====

@@ -295,6 +295,8 @@
 		ih->ih_handler(ih->ih_argument);
 	}
 
+	hvio_intr_setstate(iv->iv_vec, HV_INTR_IDLE_STATE);
+
 	/* Schedule a heavyweight interrupt process. */
 	if (thread)
 		error = intr_event_schedule_thread(ie);

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/nexus.c#12 (text+ko) ====

@@ -81,15 +81,6 @@
 	struct rman	sc_mem_rman;
 };
 
-typedef struct nexus_id {
-	devhandle_t	dh;
-	uint32_t	ino;
-	devhandle_t    nid_ihdl;
-	driver_intr_t *nid_handler;
-	void          *nid_arg;
-
-} nexus_id_t;
-
 static device_probe_t nexus_probe;
 static device_attach_t nexus_attach;
 static bus_print_child_t nexus_print_child;
@@ -310,48 +301,6 @@
 
 #ifdef SUN4V
 
-void nexus_intr_reset(void *arg);
-
-void
-nexus_intr_reset(void *arg)
-{
-	nexus_id_t    *nidp;
-
-	nidp = (nexus_id_t *)arg;
-
-	hvio_intr_setstate(nidp->nid_ihdl, HV_INTR_IDLE_STATE);
-
-}
-
-
-static void
-nexus_intr_wrapper(void *arg)
-{
-	nexus_id_t    *nidp;
-	driver_intr_t *handler;
-	void          *harg;
-
-	nidp = (nexus_id_t *)arg;
-	handler = nidp->nid_handler;
-	harg = nidp->nid_arg;
-
-	(*handler)(harg);
-
-	hvio_intr_setstate(nidp->nid_ihdl, HV_INTR_IDLE_STATE);
-
-#ifdef DEBUG
-	if (nidp->dh == 0x7c0) {
-		int	state, valid;
-		hvio_intr_getstate(nidp->nid_ihdl, &state);
-		hvio_intr_getvalid(nidp->nid_ihdl, &valid);
-		printf("i: %#lx, s: %d, v: %d\n", nidp->nid_ihdl, state, valid);
-	}
-#endif
-}
-
-
-
-
 static int
 nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
     driver_intr_t *intr, void *arg, void **cookiep)
@@ -360,7 +309,6 @@
 	uint64_t ihdl;
 	uint64_t ino;
 	int error, cpuid;
-	nexus_id_t    *nidp;
 
 	ndi = device_get_ivars(child);
 
@@ -405,19 +353,8 @@
 	if ((error = rman_activate_resource(res)))
 		goto fail;
 
-	if ((nidp = malloc(sizeof(nexus_id_t), M_DEVBUF, M_NOWAIT)) == NULL) {
-		printf("failed to allocate nexus_id\n");
-		error = ENOMEM;
-		goto fail;
-	}
-	nidp->nid_ihdl = ihdl;
-	nidp->nid_handler = intr;
-	nidp->nid_arg = arg;
-	nidp->dh = ndi->ndi_devhandle;
-	nidp->ino = ino;
-
 	error = inthand_add(device_get_nameunit(child), ihdl,
-			    nexus_intr_wrapper, nidp, flags, cookiep);
+			   intr, arg, flags, cookiep);
 
 fail:
 


More information about the p4-projects mailing list