Date: Sun, 16 Nov 2003 16:52:02 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 42603 for review Message-ID: <200311170052.hAH0q2XS048084@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=42603 Change 42603 by peter@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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311170052.hAH0q2XS048084>