From owner-p4-projects@FreeBSD.ORG Sun Nov 16 16:52:04 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3E94D16A4D0; Sun, 16 Nov 2003 16:52:04 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1888A16A4CE for ; Sun, 16 Nov 2003 16:52:04 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83A0643FE3 for ; Sun, 16 Nov 2003 16:52:03 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hAH0q3XJ048087 for ; Sun, 16 Nov 2003 16:52:03 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hAH0q2XS048084 for perforce@freebsd.org; Sun, 16 Nov 2003 16:52:02 -0800 (PST) (envelope-from peter@freebsd.org) Date: Sun, 16 Nov 2003 16:52:02 -0800 (PST) Message-Id: <200311170052.hAH0q2XS048084@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 42603 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2003 00:52:04 -0000 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)