]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/glibc/glibc-2.3.2/glibc23-07-hppa-atomicity.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / glibc / glibc-2.3.2 / glibc23-07-hppa-atomicity.patch
1 --- glibc-2.3.1.orig/sysdeps/hppa/atomicity.h   1969-12-31 19:00:00.000000000 -0500
2 +++ glibc-2.3.1/sysdeps/hppa/atomicity.h        2002-11-07 08:35:55.000000000 -0500
3 @@ -0,0 +1,55 @@
4 +/* Low-level functions for atomic operations.  HP-PARISC version.
5 +   Copyright (C) 1997,2001 Free Software Foundation, Inc.
6 +   This file is part of the GNU C Library.
7 +
8 +   The GNU C Library is free software; you can redistribute it and/or
9 +   modify it under the terms of the GNU Lesser General Public
10 +   License as published by the Free Software Foundation; either
11 +   version 2.1 of the License, or (at your option) any later version.
12 +
13 +   The GNU C Library is distributed in the hope that it will be useful,
14 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 +   Lesser General Public License for more details.
17 +
18 +   You should have received a copy of the GNU Lesser General Public
19 +   License along with the GNU C Library; if not, write to the Free
20 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 +   02111-1307 USA.  */
22 +
23 +#ifndef _ATOMICITY_H
24 +#define _ATOMICITY_H   1
25 +
26 +#include <inttypes.h>
27 +
28 +#warning stub atomicity functions are not atomic
29 +#warning CAO This will get implemented soon
30 +
31 +static inline int
32 +__attribute__ ((unused))
33 +exchange_and_add (volatile uint32_t *mem, int val)
34 +{
35 +  int result = *mem;
36 +  *mem += val;
37 +  return result;
38 +}
39 +
40 +static inline void
41 +__attribute__ ((unused))
42 +atomic_add (volatile uint32_t *mem, int val)
43 +{
44 +  *mem += val;
45 +}
46 +
47 +static inline int
48 +__attribute__ ((unused))
49 +compare_and_swap (volatile long int *p, long int oldval, long int newval)
50 +{
51 +  if (*p != oldval)
52 +    return 0;
53 +
54 +  *p = newval;
55 +  return 1;
56 +}
57 +
58 +#endif /* atomicity.h */