libunwind: update to 1.8.1
[openadk.git] / package / libdrm / patches / patch-xf86drm_h
blobaa3f49cca059f5554fb4eb6467ebcff59b65cd38
1         Fix for lemote.
2 --- libdrm-2.4.20.orig/xf86drm.h        2010-03-06 00:21:13.000000000 +0100
3 +++ libdrm-2.4.20/xf86drm.h     2010-06-12 20:43:01.324916826 +0200
4 @@ -374,6 +374,29 @@ typedef struct _drmSetVersion {
5                 : "memory");                    \
6         } while (0)
7  
8 +#elif defined(__mips__)
10 +#define DRM_CAS(lock, old, new, ret)            \
11 +       do {                                    \
12 +               __asm__ __volatile__(           \
13 +               "       .set mips3;.set noreorder;\n" \
14 +               "       sync; \n"               \
15 +               "       ll   %1, %0;\n"         \
16 +               "       bne  %1, %2, 1f;\n"     \
17 +               "        li   %1, 1; \n"        \
18 +               "       move %1, %3; \n"        \
19 +               "       sc    %1, %0;\n"        \
20 +               "       xori   %1, %1, 1\n"     \
21 +               "1:     \n"                     \
22 +               "       .set mips0; .set reorder;\n" \
23 +               : "=m" (__drm_dummy_lock(lock)),\
24 +                 "=&r" (ret)                   \
25 +               : "r" (old),                    \
26 +                 "r" (new)                     \
27 +               : "memory","$8"                 \
28 +               );                              \
29 +       } while(0)
31  #elif defined(__sparc__)
33  #define DRM_CAS(lock,old,new,__ret)                            \
34 @@ -457,7 +480,7 @@ do {        register unsigned int __old __asm("
36  #if defined(__alpha__)
37  #define DRM_CAS_RESULT(_result)                long _result
38 -#elif defined(__powerpc__)
39 +#elif defined(__powerpc__) || defined(__mips__)
40  #define DRM_CAS_RESULT(_result)                int _result
41  #else
42  #define DRM_CAS_RESULT(_result)                char _result