diff --git a/sys/arch/macppc/macppc/extintr.c b/sys/arch/macppc/macppc/extintr.c index 8e701d86e48f..3b1b72464852 100644 --- a/sys/arch/macppc/macppc/extintr.c +++ b/sys/arch/macppc/macppc/extintr.c @@ -1,4 +1,4 @@ -/* $NetBSD: extintr.c,v 1.55 2005/12/24 22:45:35 perry Exp $ */ +/* $NetBSD: extintr.c,v 1.56 2006/06/13 18:24:37 freza Exp $ */ /*- * Copyright (c) 2000, 2001 Tsubai Masanari. @@ -74,7 +74,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.55 2005/12/24 22:45:35 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.56 2006/06/13 18:24:37 freza Exp $"); #include "opt_multiprocessor.h" @@ -87,6 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.55 2005/12/24 22:45:35 perry Exp $"); #include #include +#include #include #include #include @@ -103,7 +104,6 @@ __KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.55 2005/12/24 22:45:35 perry Exp $"); void intr_calculatemasks __P((void)); int fakeintr __P((void *)); -static inline int cntlzw __P((int)); static inline uint32_t gc_read_irq __P((void)); static inline int mapirq __P((int)); static void gc_enable_irq __P((int)); @@ -181,20 +181,6 @@ mapirq(irq) return v; } -/* - * Count leading zeros. - */ -static inline int -cntlzw(x) - int x; -{ - int a; - - __asm volatile ("cntlzw %0,%1" : "=r"(a) : "r"(x)); - - return a; -} - uint32_t gc_read_irq() { diff --git a/sys/arch/powerpc/ibm4xx/intr.c b/sys/arch/powerpc/ibm4xx/intr.c index 68b53c2d7051..130d0d1e15b9 100644 --- a/sys/arch/powerpc/ibm4xx/intr.c +++ b/sys/arch/powerpc/ibm4xx/intr.c @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.10 2005/12/24 22:45:36 perry Exp $ */ +/* $NetBSD: intr.c,v 1.11 2006/06/13 18:24:37 freza Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.10 2005/12/24 22:45:36 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.11 2006/06/13 18:24:37 freza Exp $"); #include #include @@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.10 2005/12/24 22:45:36 perry Exp $"); #include +#include #include #include @@ -67,7 +68,6 @@ static void intr_calculatemasks(void); static const char *intr_typename(int); static int fakeintr(void *); -static inline int cntlzw(int); volatile int cpl, ipending; @@ -77,15 +77,6 @@ static int intrtype[ICU_LEN], intrmask[ICU_LEN], intrlevel[ICU_LEN]; static struct intrhand *intrhand[ICU_LEN]; -static inline int -cntlzw(int x) -{ - int a; - - __asm volatile ("cntlzw %0,%1" : "=r"(a) : "r"(x)); - return a; -} - static int fakeintr(void *arg) { diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h index 383908244ca1..a88d70018392 100644 --- a/sys/arch/powerpc/include/cpu.h +++ b/sys/arch/powerpc/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.48 2006/05/30 22:44:13 freza Exp $ */ +/* $NetBSD: cpu.h,v 1.49 2006/06/13 18:24:37 freza Exp $ */ /* * Copyright (C) 1999 Wolfgang Solfrank. @@ -252,6 +252,15 @@ mfpvr(void) return (pvr); } +static __inline int +cntlzw(uint32_t val) +{ + int cnt; + + __asm volatile ("cntlzw %0,%1" : "=r"(cnt) : "r"(val)); + return (cnt); +} + #if defined(PPC_IBM4XX) || defined(PPC_IBM403) /* * DCR (Device Control Register) access. These have to be diff --git a/sys/arch/powerpc/marvell/extintr.c b/sys/arch/powerpc/marvell/extintr.c index 7d7291810d53..2410f41113c2 100644 --- a/sys/arch/powerpc/marvell/extintr.c +++ b/sys/arch/powerpc/marvell/extintr.c @@ -1,4 +1,4 @@ -/* $NetBSD: extintr.c,v 1.15 2005/12/24 20:07:28 perry Exp $ */ +/* $NetBSD: extintr.c,v 1.16 2006/06/13 18:24:37 freza Exp $ */ /* * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.15 2005/12/24 20:07:28 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.16 2006/06/13 18:24:37 freza Exp $"); #include "opt_marvell.h" #include "opt_kgdb.h" @@ -90,6 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.15 2005/12/24 20:07:28 perry Exp $"); #include #include +#include #include #ifdef KGDB #include @@ -258,19 +259,6 @@ imask_print(char *str, volatile imask_t *imp) imp->bits[IMASK_SOFTINT])); } -/* - * Count leading zeros. - */ -static inline int -cntlzw(int x) -{ - int a; - - __asm volatile ("cntlzw %0,%1" : "=r"(a) : "r"(x)); - - return a; -} - /* * softintr_init - establish softclock, softnet; reserve SIR_HWCLOCK */