From owner-svn-src-all@FreeBSD.ORG Thu Apr 26 20:24:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 430371065673; Thu, 26 Apr 2012 20:24:26 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCFA8FC14; Thu, 26 Apr 2012 20:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3QKOQ5Z067297; Thu, 26 Apr 2012 20:24:26 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3QKOPA6067287; Thu, 26 Apr 2012 20:24:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201204262024.q3QKOPA6067287@svn.freebsd.org> From: Attilio Rao Date: Thu, 26 Apr 2012 20:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234723 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 sparc64/include sparc64/sparc64 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2012 20:24:26 -0000 Author: attilio Date: Thu Apr 26 20:24:25 2012 New Revision: 234723 URL: http://svn.freebsd.org/changeset/base/234723 Log: Clean up the intr* MD KPI from the SMP dependency, removing a cause of discrepancy between modules and kernel, but deal with SMP differences within the functions themselves. As an added bonus this also helps in terms of code readability. Requested by: gibbs Reviewed by: jhb, marius MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/intr_machdep.h head/sys/i386/i386/machdep.c head/sys/i386/include/intr_machdep.h head/sys/pc98/pc98/machdep.c head/sys/sparc64/include/intr_machdep.h head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/x86/x86/intr_machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/amd64/amd64/machdep.c Thu Apr 26 20:24:25 2012 (r234723) @@ -296,12 +296,10 @@ cpu_startup(dummy) cpu_setregs(); -#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); -#endif } /* Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/amd64/include/intr_machdep.h Thu Apr 26 20:24:25 2012 (r234723) @@ -140,15 +140,11 @@ int elcr_probe(void); enum intr_trigger elcr_read_trigger(u_int irq); void elcr_resume(void); void elcr_write_trigger(u_int irq, enum intr_trigger trigger); -#ifdef SMP void intr_add_cpu(u_int cpu); -#endif int intr_add_handler(const char *name, int vector, driver_filter_t filter, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); -#ifdef SMP int intr_bind(u_int vector, u_char cpu); -#endif int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); int intr_describe(u_int vector, void *ih, const char *descr); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/i386/i386/machdep.c Thu Apr 26 20:24:25 2012 (r234723) @@ -337,12 +337,10 @@ cpu_startup(dummy) cpu_setregs(); #endif -#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); -#endif } /* Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/i386/include/intr_machdep.h Thu Apr 26 20:24:25 2012 (r234723) @@ -131,14 +131,10 @@ int elcr_probe(void); enum intr_trigger elcr_read_trigger(u_int irq); void elcr_resume(void); void elcr_write_trigger(u_int irq, enum intr_trigger trigger); -#ifdef SMP void intr_add_cpu(u_int cpu); -#endif int intr_add_handler(const char *name, int vector, driver_filter_t filter, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); -#ifdef SMP int intr_bind(u_int vector, u_char cpu); -#endif int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); int intr_describe(u_int vector, void *ih, const char *descr); Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/pc98/pc98/machdep.c Thu Apr 26 20:24:25 2012 (r234723) @@ -272,12 +272,10 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); -#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); -#endif } /* Modified: head/sys/sparc64/include/intr_machdep.h ============================================================================== --- head/sys/sparc64/include/intr_machdep.h Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/sparc64/include/intr_machdep.h Thu Apr 26 20:24:25 2012 (r234723) @@ -91,9 +91,7 @@ struct intr_vector { extern ih_func_t *intr_handlers[]; extern struct intr_vector intr_vectors[]; -#ifdef SMP void intr_add_cpu(u_int cpu); -#endif int intr_bind(int vec, u_char cpu); int intr_describe(int vec, void *ih, const char *descr); void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf, Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/sparc64/sparc64/intr_machdep.c Thu Apr 26 20:24:25 2012 (r234723) @@ -554,4 +554,20 @@ intr_shuffle_irqs(void *arg __unused) } SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs, NULL); +#else /* !SMP */ + +/* Return EOPNOTSUPP in the UP case. */ +int +intr_bind(int vec __unused, u_char cpu __unused) +{ + + return (EOPNOTSUPP); +} + +/* Use an empty stub for compatibility. */ +void +intr_add_cpu(u_int cpu __unused) +{ + +} #endif Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/sparc64/sparc64/machdep.c Thu Apr 26 20:24:25 2012 (r234723) @@ -197,12 +197,10 @@ cpu_startup(void *arg) cpu_identify(rdpr(ver), PCPU_GET(clock), curcpu); -#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); -#endif } void Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Thu Apr 26 20:23:14 2012 (r234722) +++ head/sys/x86/x86/intr_machdep.c Thu Apr 26 20:24:25 2012 (r234723) @@ -565,4 +565,19 @@ intr_next_cpu(void) return (PCPU_GET(apic_id)); } + +/* Return EOPNOTSUPP in the UP case. */ +int +intr_bind(u_int vector __unused, u_char cpu __unused) +{ + + return (EOPNOTSUPP); +} + +/* Use an empty stub for compatibility. */ +void +intr_add_cpu(u_int cpu __unused) +{ + +} #endif