1
0

patch-xf86drm_h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. +#elif defined(__mips__)
  8. +
  9. +#define DRM_CAS(lock, old, new, ret) \
  10. + do { \
  11. + __asm__ __volatile__( \
  12. + " .set mips3;.set noreorder;\n" \
  13. + " sync; \n" \
  14. + " ll %1, %0;\n" \
  15. + " bne %1, %2, 1f;\n" \
  16. + " li %1, 1; \n" \
  17. + " move %1, %3; \n" \
  18. + " sc %1, %0;\n" \
  19. + " xori %1, %1, 1\n" \
  20. + "1: \n" \
  21. + " .set mips0; .set reorder;\n" \
  22. + : "=m" (__drm_dummy_lock(lock)),\
  23. + "=&r" (ret) \
  24. + : "r" (old), \
  25. + "r" (new) \
  26. + : "memory","$8" \
  27. + ); \
  28. + } while(0)
  29. +
  30. #elif defined(__sparc__)
  31. #define DRM_CAS(lock,old,new,__ret) \
  32. @@ -457,7 +480,7 @@ do { register unsigned int __old __asm("
  33. #if defined(__alpha__)
  34. #define DRM_CAS_RESULT(_result) long _result
  35. -#elif defined(__powerpc__)
  36. +#elif defined(__powerpc__) || defined(__mips__)
  37. #define DRM_CAS_RESULT(_result) int _result
  38. #else
  39. #define DRM_CAS_RESULT(_result) char _result