On Fri, Nov 01, 2013 at 04:25:05PM +0530, Vineet Gupta wrote:
>Signed-off-by: Vineet Gupta <[email protected]>
>---
> .../linuxthreads.old/sysdeps/arc/pt-machine.h      | 48 ++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
> create mode 100644 libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h
>
>diff --git a/libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h 
>b/libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h
>new file mode 100644
>index 000000000000..59a490ba1357
>--- /dev/null
>+++ b/libpthread/linuxthreads.old/sysdeps/arc/pt-machine.h
>@@ -0,0 +1,48 @@
>+/* Machine-dependent pthreads configuration and inline functions.
>+   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; see the file COPYING.LIB.  If not,
>+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
>+   Boston, MA 02111-1307, USA.  */
>+#ifndef _PT_MACHINE_H
>+#define _PT_MACHINE_H   1
>+#include <features.h>
>+
>+#ifndef PT_EI
>+# define PT_EI __extern_always_inline /* ARC LOCAL: was: extern inline */

this is ok, we changed that to __extern_always_inline a couple of years
ago, IIRC.

My endless TODO has a note to
#define PT_EI __extern_always_inline attribute_hidden
everywhere, not just i386, fwiw.

>+#endif
>+
>+extern long int testandset (int *spinlock);
>+extern int __compare_and_swap (long int *p, long int oldval, long int newval);
>+
>+PT_EI long int
>+testandset (int *spinlock)
>+{
>+  register unsigned long int old;
>+  int *m = spinlock;
>+
>+  __asm__ ("ex %0,[%3]" : "=r" (old), "+m" (*m) : "0" (1), "ri" (m));

I take it that you checked this and all other modifiers :)

>+  return old;
>+
>+}
>+
>+/* Get some notion of the current stack.  Need not be exactly the top
>+   of the stack, just something somewhere in the current frame.
>+   I don't trust register variables, so let's do this the safe way.  */
>+#define CURRENT_STACK_FRAME \

__extension__ please.

>+({ char *__sp; __asm__ ("mov %0,sp" : "=r" (__sp)); __sp; })

no CAS ? :(

>+
>+#else
>+#error PT_MACHINE already defined
>+#endif /* pt-machine.h */
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to