diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-08-21 23:29:36 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-08-21 23:29:36 +0000 |
commit | 4beed843c11a1f3079c775e501dbe1069e4c7bbe (patch) | |
tree | 104921f9419e00744b3e787a09c48505bf3b4d83 /libc | |
parent | 82911dd00068e8978d0da4b44dd0fc4b833b8c72 (diff) |
bits/profil-counter.h and bits/atomicity.h are leftovers from the old gprof
based profiling I nuked ages ago since tools like oprofile are non invasive
and work so much better.
Diffstat (limited to 'libc')
20 files changed, 0 insertions, 1403 deletions
diff --git a/libc/sysdeps/linux/alpha/bits/atomicity.h b/libc/sysdeps/linux/alpha/bits/atomicity.h deleted file mode 100644 index df6e01a1e..000000000 --- a/libc/sysdeps/linux/alpha/bits/atomicity.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Low-level functions for atomic operations. Alpha version. - Copyright (C) 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - - -static inline int -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, int val) -{ - register int result, tmp; - - __asm__ __volatile__ ( - "/* Inline exchange & add */\n" - "1:\t" - "ldl_l %0,%3\n\t" - "addl %0,%4,%1\n\t" - "stl_c %1,%2\n\t" - "beq %1,2f\n" - ".subsection 1\n" - "2:\t" - "br 1b\n" - ".previous\n\t" - "mb\n\t" - "/* End exchange & add */" - : "=&r"(result), "=&r"(tmp), "=m"(*mem) - : "m" (*mem), "r"(val)); - - return result; -} - -static inline void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - register int result; - - __asm__ __volatile__ ( - "/* Inline exchange & add */\n" - "1:\t" - "ldl_l %0,%2\n\t" - "addl %0,%3,%0\n\t" - "stl_c %0,%1\n\t" - "beq %0,2f\n\t" - ".subsection 1\n" - "2:\t" - "br 1b\n" - ".previous\n\t" - "mb\n\t" - "/* End exchange & add */" - : "=&r"(result), "=m"(*mem) - : "m" (*mem), "r"(val)); -} - -static inline long -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - long int ret; - - __asm__ __volatile__ ( - "/* Inline compare & swap */\n" - "1:\t" - "ldq_l %0,%4\n\t" - "cmpeq %0,%2,%0\n\t" - "beq %0,3f\n\t" - "mov %3,%0\n\t" - "stq_c %0,%1\n\t" - "beq %0,2f\n\t" - ".subsection 1\n" - "2:\t" - "br 1b\n" - ".previous\n\t" - "3:\t" - "mb\n\t" - "/* End compare & swap */" - : "=&r"(ret), "=m"(*p) - : "r"(oldval), "r"(newval), "m"(*p)); - - return ret; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/arm/bits/atomicity.h b/libc/sysdeps/linux/arm/bits/atomicity.h deleted file mode 100644 index 97d278610..000000000 --- a/libc/sysdeps/linux/arm/bits/atomicity.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Low-level functions for atomic operations. ARM version. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - - -static inline int -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, int val) -{ - int tmp1; - int tmp2; - int result; - __asm__ ("\n" -#if defined(__thumb__) - "\t.align 0\n" - "\tbx pc\n" - "\tnop\n" - "\t.arm\n" -#endif - "0:\tldr\t%0,[%3]\n\t" - "add\t%1,%0,%4\n\t" - "swp\t%2,%1,[%3]\n\t" - "cmp\t%0,%2\n\t" - "swpne\t%1,%2,[%3]\n\t" - "bne\t0b" -#if defined(__thumb__) - "\torr %1, pc, #1\n" - "\tbx %1\n" - "\t.force_thumb" -#endif - : "=&r" (result), "=&r" (tmp1), "=&r" (tmp2) - : "r" (mem), "r"(val) - : "cc", "memory"); - return result; -} - -static inline void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - int tmp1; - int tmp2; - int tmp3; - __asm__ ("\n" -#if defined(__thumb__) - "\t.align 0\n" - "\tbx pc\n" - "\tnop\n" - "\t.arm\n" -#endif - "0:\tldr\t%0,[%3]\n\t" - "add\t%1,%0,%4\n\t" - "swp\t%2,%1,[%3]\n\t" - "cmp\t%0,%2\n\t" - "swpne\t%1,%2,[%3]\n\t" - "bne\t0b" -#if defined(__thumb__) - "\torr %1, pc, #1\n" - "\tbx %1\n" - "\t.force_thumb" -#endif - : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) - : "r" (mem), "r"(val) - : "cc", "memory"); -} - -static inline int -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - int result, tmp; - __asm__ ("\n" -#if defined(__thumb__) - "\t.align 0\n" - "\tbx pc\n" - "\tnop\n" - "\t.arm\n" -#endif - "0:\tldr\t%1,[%2]\n\t" - "mov\t%0,#0\n\t" - "cmp\t%1,%4\n\t" - "bne\t1f\n\t" - "swp\t%0,%3,[%2]\n\t" - "cmp\t%1,%0\n\t" - "swpne\t%1,%0,[%2]\n\t" - "bne\t0b\n\t" - "mov\t%0,#1\n" - "1:" -#if defined(__thumb__) - "\torr %1, pc, #1\n" - "\tbx %1\n" - "\t.force_thumb" -#endif - : "=&r" (result), "=&r" (tmp) - : "r" (p), "r" (newval), "r" (oldval) - : "cc", "memory"); - return result; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/arm/bits/profil-counter.h b/libc/sysdeps/linux/arm/bits/profil-counter.h deleted file mode 100644 index 7639883f1..000000000 --- a/libc/sysdeps/linux/arm/bits/profil-counter.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Low-level statistical profiling support function. Linux/ARM version. - Copyright (C) 1996, 1997, 1998, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <signal.h> -#include <bits/armsigctx.h> - -void -profil_counter (int signo, int _a2, int _a3, int _a4, union k_sigcontext sc) -{ - void *pc; - if (sc.v20.magic == SIGCONTEXT_2_0_MAGIC) - pc = (void *) sc.v20.reg.ARM_pc; - else - pc = (void *) sc.v21.arm_pc; - profil_count (pc); - - /* This is a hack to prevent the compiler from implementing the - above function call as a sibcall. The sibcall would overwrite - the signal context. */ - asm volatile (""); -} diff --git a/libc/sysdeps/linux/common/bits/atomicity.h b/libc/sysdeps/linux/common/bits/atomicity.h deleted file mode 100644 index 57bcaad5d..000000000 --- a/libc/sysdeps/linux/common/bits/atomicity.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Low-level functions for atomic operations. Stub version. - Copyright (C) 1997,2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - -#warning stub atomicity functions are not really atomic - -static inline int -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, int val) -{ - int result = *mem; - *mem += val; - return result; -} - -static inline void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - *mem += val; -} - -static inline int -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - if (*p != oldval) - return 0; - - *p = newval; - return 1; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/common/bits/profil-counter.h b/libc/sysdeps/linux/common/bits/profil-counter.h deleted file mode 100644 index 9cae5840d..000000000 --- a/libc/sysdeps/linux/common/bits/profil-counter.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Machine-dependent SIGPROF signal handler. "Generic" version w/ sigcontext - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* In many Unix systems signal handlers are called like this - and the interrupted PC is easily findable in the `struct sigcontext'. */ - -static void -profil_counter (int signr, int code, struct sigcontext *scp) -{ - profil_count ((void *) scp->sc_pc); -} diff --git a/libc/sysdeps/linux/cris/bits/profil-counter.h b/libc/sysdeps/linux/cris/bits/profil-counter.h deleted file mode 100644 index 37adc1fee..000000000 --- a/libc/sysdeps/linux/cris/bits/profil-counter.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Low-level statistical profiling support function. Linux/CRIS version. - Copyright (C) 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <signal.h> - -static void -profil_counter (int signo, struct sigcontext *scp) -{ - profil_count ((void *) scp->regs.irp); -} diff --git a/libc/sysdeps/linux/h8300/bits/atomicity.h b/libc/sysdeps/linux/h8300/bits/atomicity.h deleted file mode 100644 index a4fcc1524..000000000 --- a/libc/sysdeps/linux/h8300/bits/atomicity.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Low-level functions for atomic operations. H8/300 version. - Copyright (C) 1997, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - - -static inline uint32_t -__attribute__ ((unused)) -exchange_and_add (volatile uint32_t *mem, uint32_t val) -{ - uint32_t result; - __asm__ __volatile__ ("stc ccr,@-sp\n\t" - "orc #0x80,ccr\n\t" - "mov.l %1,er1\n\t" - "mov.l %0,%1\n\t" - "add.l er1,%0\n\t" - "ldc @sp+,ccr" - : "=r" (result), "=m" (*mem) - : "0" (val), "1" (*mem) - : "er1"); - return result; -} - -static inline void -__attribute__ ((unused)) -atomic_add (volatile uint32_t *mem, int val) -{ - __asm__ __volatile__ ("stc ccr,@-sp\n\t" - "orc #0x80,ccr\n\t" - "mov.l %0,er0\n\t" - "add %1,er0\n\t" - "mov.l er0,%0\n\t" - "ldc @sp+,ccr" - : "=m" (*mem) - : "r" (val), "0" (*mem) - : "er0"); -} - -static inline int -__attribute__ ((unused)) -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - int ret = 0; - - __asm__ __volatile__ ("stc ccr,@-sp\n\t" - "orc #0x80,ccr\n\t" - "mov.l %1,er0\n\t" - "cmp.l %2,er0\n\t" - "bne 1f\n\t" - "mov.l %3,%1\n\t" - "inc.l #1,%0\n" - "1:\n\t" - "ldc @sp+,ccr" - : "=r"(ret),"=m"(*p) - : "r"(oldval),"r"(newval),"0"(ret),"1"(*p) - : "er0"); - return ret; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/i386/bits/atomicity.h b/libc/sysdeps/linux/i386/bits/atomicity.h deleted file mode 100644 index d83ae791e..000000000 --- a/libc/sysdeps/linux/i386/bits/atomicity.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Low-level functions for atomic operations. ix86 version, x >= 4. - Copyright (C) 1997, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - - -static inline uint32_t -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, uint32_t val) -{ - register uint32_t result; - __asm__ __volatile__ ("lock; xaddl %0,%1" - : "=r" (result), "=m" (*mem) : "0" (val), "1" (*mem)); - return result; -} - -static inline void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - __asm__ __volatile__ ("lock; addl %1,%0" - : "=m" (*mem) : "ir" (val), "0" (*mem)); -} - -static inline char -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - char ret; - long int readval; - - __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0" - : "=q" (ret), "=m" (*p), "=a" (readval) - : "r" (newval), "1" (*p), "a" (oldval)); - return ret; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/i386/bits/profil-counter.h b/libc/sysdeps/linux/i386/bits/profil-counter.h deleted file mode 100644 index 69045b55b..000000000 --- a/libc/sysdeps/linux/i386/bits/profil-counter.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Low-level statistical profiling support function. Linux/i386 version. - Copyright (C) 1996, 1997, 1998, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <signal.h> -#include <bits/sigcontextinfo.h> - -static void -profil_counter (int signo, const SIGCONTEXT scp) -{ - profil_count ((void *) GET_PC (scp)); - - /* This is a hack to prevent the compiler from implementing the - above function call as a sibcall. The sibcall would overwrite - the signal context. */ - asm volatile (""); -} diff --git a/libc/sysdeps/linux/m68k/bits/atomicity.h b/libc/sysdeps/linux/m68k/bits/atomicity.h deleted file mode 100644 index db1c9bfae..000000000 --- a/libc/sysdeps/linux/m68k/bits/atomicity.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Low-level functions for atomic operations. m680x0 version, x >= 2. - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - - -static inline int -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, int val) -{ - register int result = *mem; - register int temp; - __asm__ __volatile__ ("1: move%.l %0,%1;" - " add%.l %2,%1;" - " cas%.l %0,%1,%3;" - " jbne 1b" - : "=d" (result), "=&d" (temp) - : "d" (val), "m" (*mem), "0" (result) : "memory"); - return result; -} - -static inline void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - /* XXX Use cas here as well? */ - __asm__ __volatile__ ("add%.l %0,%1" - : : "id" (val), "m" (*mem) : "memory"); -} - -static inline int -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - char ret; - long int readval; - - __asm__ __volatile__ ("cas%.l %2,%3,%1; seq %0" - : "=dm" (ret), "=m" (*p), "=d" (readval) - : "d" (newval), "m" (*p), "2" (oldval)); - return ret; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/mips/bits/atomicity.h b/libc/sysdeps/linux/mips/bits/atomicity.h deleted file mode 100644 index 5d1020352..000000000 --- a/libc/sysdeps/linux/mips/bits/atomicity.h +++ /dev/null @@ -1,98 +0,0 @@ -/* Low-level functions for atomic operations. Mips version. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MIPS_ATOMICITY_H -#define _MIPS_ATOMICITY_H 1 - -#include <inttypes.h> - -static inline int -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, int val) -{ - int result, tmp; - - __asm__ __volatile__ - ("/* Inline exchange & add */\n" - "1:\n\t" - ".set push\n\t" - ".set mips2\n\t" - "ll %0,%3\n\t" - "addu %1,%4,%0\n\t" - "sc %1,%2\n\t" - ".set pop\n\t" - "beqz %1,1b\n\t" - "/* End exchange & add */" - : "=&r"(result), "=&r"(tmp), "=m"(*mem) - : "m" (*mem), "r"(val) - : "memory"); - - return result; -} - -static inline void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - int result; - - __asm__ __volatile__ - ("/* Inline atomic add */\n" - "1:\n\t" - ".set push\n\t" - ".set mips2\n\t" - "ll %0,%2\n\t" - "addu %0,%3,%0\n\t" - "sc %0,%1\n\t" - ".set pop\n\t" - "beqz %0,1b\n\t" - "/* End atomic add */" - : "=&r"(result), "=m"(*mem) - : "m" (*mem), "r"(val) - : "memory"); -} - -static inline int -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - long int ret, temp; - - __asm__ __volatile__ - ("/* Inline compare & swap */\n" - "1:\n\t" - ".set push\n\t" - ".set mips2\n\t" - "ll %1,%5\n\t" - "move %0,$0\n\t" - "bne %1,%3,2f\n\t" - "move %0,%4\n\t" - "sc %0,%2\n\t" - ".set pop\n\t" - "beqz %0,1b\n" - "2:\n\t" - "/* End compare & swap */" - : "=&r" (ret), "=&r" (temp), "=m" (*p) - : "r" (oldval), "r" (newval), "m" (*p) - : "memory"); - - return ret; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/nios2/bits/profil-counter.h b/libc/sysdeps/linux/nios2/bits/profil-counter.h deleted file mode 100644 index 3aa3fc0ad..000000000 --- a/libc/sysdeps/linux/nios2/bits/profil-counter.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Low-level statistical profiling support function. Linux/SPARC version. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include <signal.h> - -void -profil_counter (int signo, struct sigcontext *si) -{ - profil_count ((void *) si->regs.ea); -} diff --git a/libc/sysdeps/linux/powerpc/bits/atomicity.h b/libc/sysdeps/linux/powerpc/bits/atomicity.h deleted file mode 100644 index 6969749e8..000000000 --- a/libc/sysdeps/linux/powerpc/bits/atomicity.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Low-level functions for atomic operations. PowerPC version. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _ATOMICITY_H -#define _ATOMICITY_H 1 - -#include <inttypes.h> - -#if BROKEN_PPC_ASM_CR0 -# define __ATOMICITY_INLINE /* nothing */ -#else -# define __ATOMICITY_INLINE inline -#endif - -static __ATOMICITY_INLINE int -__attribute_used__ -exchange_and_add (volatile uint32_t *mem, int val) -{ - int tmp, result; - __asm__ ("\n\ -0: lwarx %0,0,%2 \n\ - add%I3 %1,%0,%3 \n\ - stwcx. %1,0,%2 \n\ - bne- 0b \n\ -" : "=&b"(result), "=&r"(tmp) : "r" (mem), "Ir"(val) : "cr0", "memory"); - return result; -} - -static __ATOMICITY_INLINE void -__attribute_used__ -atomic_add (volatile uint32_t *mem, int val) -{ - int tmp; - __asm__ ("\n\ -0: lwarx %0,0,%1 \n\ - add%I2 %0,%0,%2 \n\ - stwcx. %0,0,%1 \n\ - bne- 0b \n\ -" : "=&b"(tmp) : "r" (mem), "Ir"(val) : "cr0", "memory"); -} - -static __ATOMICITY_INLINE int -__attribute_used__ -compare_and_swap (volatile long int *p, long int oldval, long int newval) -{ - int result; - __asm__ ("\n\ -0: lwarx %0,0,%1 \n\ - sub%I2c. %0,%0,%2 \n\ - cntlzw %0,%0 \n\ - bne- 1f \n\ - stwcx. %3,0,%1 \n\ - bne- 0b \n\ -1: \n\ -" : "=&b"(result) : "r"(p), "Ir"(oldval), "r"(newval) : "cr0", "memory"); - return result >> 5; -} - -static __ATOMICITY_INLINE long int -__attribute_used__ -always_swap (volatile long int *p, long int newval) -{ - long int result; - __asm__ ("\n\ -0: lwarx %0,0,%1 \n\ - stwcx. %2,0,%1 \n\ - bne- 0b \n\ -" : "=&r"(result) : "r"(p), "r"(newval) : "cr0", "memory"); - return result; -} - -static __ATOMICITY_INLINE int -__attribute_used__ -test_and_set (volatile long int *p, long int newval) -{ - int result; - __asm__ ("\n\ -0: lwarx %0,0,%1 \n\ - cmpwi %0,0 \n\ - bne- 1f \n\ - stwcx. %2,0,%1 \n\ - bne- 0b \n\ -1: \n\ -" : "=&r"(result) : "r"(p), "r"(newval) : "cr0", "memory"); - return result; -} - -#endif /* atomicity.h */ diff --git a/libc/sysdeps/linux/powerpc/bits/profil-counter.h b/libc/sysdeps/linux/powerpc/bits/profil-counter.h deleted file mode 100644 index 69045b55b..000000000 --- a/libc/sysdeps/linux/powerpc/bits/profil-counter.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Low-level statistical profiling support function. Linux/i386 version. - Copyright (C) 1996, 1997, 1998, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope |