From owner-p4-projects@FreeBSD.ORG Sat Jul 1 00:47:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DFB1C16A58E; Sat, 1 Jul 2006 00:47:17 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 BD6FF16A519 for ; Sat, 1 Jul 2006 00:47:17 +0000 (UTC) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6997E441DC for ; Sat, 1 Jul 2006 00:24:36 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k610OaUC099834 for ; Sat, 1 Jul 2006 00:24:36 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k610OaUl099821 for perforce@freebsd.org; Sat, 1 Jul 2006 00:24:36 GMT (envelope-from peter@freebsd.org) Date: Sat, 1 Jul 2006 00:24:36 GMT Message-Id: <200607010024.k610OaUl099821@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 Cc: Subject: PERFORCE change 100373 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2006 00:47:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=100373 Change 100373 by peter@peter_work on 2006/07/01 00:24:00 Eliminate a call to intr_lookup_source() in the critical code paths which collapses to a function index operation. Just do the array lookup. Also, include prototype change for intr_execute_handlers() to include the vector argument. Affected files ... .. //depot/projects/bike_sched/sys/i386/i386/intr_machdep.c#4 edit .. //depot/projects/bike_sched/sys/i386/i386/local_apic.c#4 edit .. //depot/projects/bike_sched/sys/i386/include/intr_machdep.h#2 edit Differences ... ==== //depot/projects/bike_sched/sys/i386/i386/intr_machdep.c#4 (text+ko) ==== @@ -60,9 +60,10 @@ typedef void (*mask_fn)(void *); static int intrcnt_index; -static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; +struct intsrc *interrupt_sources[NUM_IO_INTS]; + #ifdef SMP static int assign_cpu; ==== //depot/projects/bike_sched/sys/i386/i386/local_apic.c#4 (text+ko) ==== @@ -604,7 +604,7 @@ KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL && vector <= APIC_IO_INTS + APIC_NUM_IOINTS, ("Vector %u does not map to an IRQ line", vector)); - isrc = intr_lookup_source(ioint_irqs[vector - APIC_IO_INTS]); + isrc = interrupt_sources[ioint_irqs[vector - APIC_IO_INTS]]; intr_execute_handlers(isrc, vector, &frame); } ==== //depot/projects/bike_sched/sys/i386/include/intr_machdep.h#2 (text+ko) ==== @@ -109,6 +109,8 @@ u_int is_enabled:1; }; +extern struct intsrc *interrupt_sources[NUM_IO_INTS]; + struct trapframe; extern struct mtx icu_lock; @@ -128,7 +130,8 @@ void *arg, enum intr_type flags, void **cookiep); int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); -void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); +void intr_execute_handlers(struct intsrc *isrc, u_int vector, + struct trapframe *frame); struct intsrc *intr_lookup_source(int vector); int intr_register_source(struct intsrc *isrc); int intr_remove_handler(void *cookie);