From: Eric Anholt Date: Sun, 29 Sep 2002 23:21:55 +0000 (+0000) Subject: Make our set_bit and friends match linux better (cleans up some warnings) X-Git-Tag: submit/1.0/20121108.012404~2470 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=506c1c02a43970e8ae891c9015eba7ab581d08f3;p=profile%2Fivi%2Flibdrm.git Make our set_bit and friends match linux better (cleans up some warnings) --- diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h index 2fa19ce..1206b25 100644 --- a/bsd-core/drm_os_freebsd.h +++ b/bsd-core/drm_os_freebsd.h @@ -220,43 +220,43 @@ typedef u_int8_t u8; /* Fake this */ static __inline atomic_t -test_and_set_bit(int b, atomic_t *p) +test_and_set_bit(int b, volatile void *p) { int s = splhigh(); unsigned int m = 1<> 5), 1 << (b & 0x1f)); + atomic_clear_int(((volatile int *)p) + (b >> 5), 1 << (b & 0x1f)); } static __inline void -set_bit(int b, atomic_t *p) +set_bit(int b, volatile void *p) { - atomic_set_int(p + (b >> 5), 1 << (b & 0x1f)); + atomic_set_int(((volatile int *)p) + (b >> 5), 1 << (b & 0x1f)); } static __inline int -test_bit(int b, atomic_t *p) +test_bit(int b, volatile void *p) { - return p[b >> 5] & (1 << (b & 0x1f)); + return ((volatile int *)p)[b >> 5] & (1 << (b & 0x1f)); } static __inline int -find_first_zero_bit(atomic_t *p, int max) +find_first_zero_bit(volatile void *p, int max) { int b; for (b = 0; b < max; b += 32) { - if (p[b >> 5] != ~0) { + if (((volatile int *)p)[b >> 5] != ~0) { for (;;) { - if ((p[b >> 5] & (1 << (b & 0x1f))) == 0) + if ((((volatile int *)p)[b >> 5] & (1 << (b & 0x1f))) == 0) return b; b++; } diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h index 2fa19ce..1206b25 100644 --- a/bsd/drm_os_freebsd.h +++ b/bsd/drm_os_freebsd.h @@ -220,43 +220,43 @@ typedef u_int8_t u8; /* Fake this */ static __inline atomic_t -test_and_set_bit(int b, atomic_t *p) +test_and_set_bit(int b, volatile void *p) { int s = splhigh(); unsigned int m = 1<> 5), 1 << (b & 0x1f)); + atomic_clear_int(((volatile int *)p) + (b >> 5), 1 << (b & 0x1f)); } static __inline void -set_bit(int b, atomic_t *p) +set_bit(int b, volatile void *p) { - atomic_set_int(p + (b >> 5), 1 << (b & 0x1f)); + atomic_set_int(((volatile int *)p) + (b >> 5), 1 << (b & 0x1f)); } static __inline int -test_bit(int b, atomic_t *p) +test_bit(int b, volatile void *p) { - return p[b >> 5] & (1 << (b & 0x1f)); + return ((volatile int *)p)[b >> 5] & (1 << (b & 0x1f)); } static __inline int -find_first_zero_bit(atomic_t *p, int max) +find_first_zero_bit(volatile void *p, int max) { int b; for (b = 0; b < max; b += 32) { - if (p[b >> 5] != ~0) { + if (((volatile int *)p)[b >> 5] != ~0) { for (;;) { - if ((p[b >> 5] & (1 << (b & 0x1f))) == 0) + if ((((volatile int *)p)[b >> 5] & (1 << (b & 0x1f))) == 0) return b; b++; }