PERFORCE change 42603 for review

Peter Wemm peter at FreeBSD.org
Sun Nov 16 16:52:04 PST 2003


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

Change 42603 by peter at peter_overcee on 2003/11/16 16:51:36

	ithread_create() changes

Affected files ...

.. //depot/projects/hammer/sys/i386/i386/intr_machdep.c#4 edit

Differences ...

==== //depot/projects/hammer/sys/i386/i386/intr_machdep.c#4 (text+ko) ====

@@ -57,7 +57,7 @@
 
 #define	MAX_STRAY_LOG	5
 
-typedef void (*mask_fn)(int vector);
+typedef void (*mask_fn)(void *cookie);
 
 static int intrcnt_index;
 static struct intsrc *interrupt_sources[NUM_IO_INTS];
@@ -81,19 +81,7 @@
 	vector = isrc->is_pic->pic_vector(isrc);
 	if (interrupt_sources[vector] != NULL)
 		return (EEXIST);
-	/*
-	 * Ok, so this is kind of a nasty optimization that only works
-	 * because sizeof(int) == sizeof(void *) on i386.  If we passed
-	 * in the actual vector to ithread_create and then used wrapper
-	 * functions for disable_intsrc and enable_intsrc, then we'd
-	 * have to go lookup in the table everytime we enabled/disabled
-	 * the interrupt source.  That involves looking at a lock, etc.
-	 * and is just ugly.  Instead, we cast the pointer to the intsrc
-	 * to an int (yuck) and pass in the actual PIC methods meaning
-	 * that when we enable/disable an interrupt we call the PIC
-	 * methods directly.
-	 */
-	error = ithread_create(&isrc->is_ithread, (intptr_t)isrc, 0,
+	error = ithread_create(&isrc->is_ithread, isrc, 0,
 	    (mask_fn)isrc->is_pic->pic_disable_source,
 	    (mask_fn)isrc->is_pic->pic_enable_source, "irq%d:", vector);
 	if (error)


More information about the p4-projects mailing list