diff options
author | Michal Krol <michal@vmware.com> | 2009-03-17 10:54:08 +0100 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2009-03-17 10:54:08 +0100 |
commit | 1e23dac869ccc08cbb959c63fedb3c82d3187f5a (patch) | |
tree | 748dafebf9032f7acd66244ac2b5bbdddd0f774d /src/gallium | |
parent | 709b3128f3c3e9a0a52d79cc82a0cb9feb195dc1 (diff) | |
download | external_mesa3d-1e23dac869ccc08cbb959c63fedb3c82d3187f5a.zip external_mesa3d-1e23dac869ccc08cbb959c63fedb3c82d3187f5a.tar.gz external_mesa3d-1e23dac869ccc08cbb959c63fedb3c82d3187f5a.tar.bz2 |
gallium: Provide unprotected atomic implementation for display and miniport interfaces.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/include/pipe/p_atomic.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_atomic.h b/src/gallium/include/pipe/p_atomic.h index b9bf711..fb370b0 100644 --- a/src/gallium/include/pipe/p_atomic.h +++ b/src/gallium/include/pipe/p_atomic.h @@ -66,7 +66,21 @@ p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t new) return __sync_val_compare_and_swap(&v->count, old, new); } -#elif (defined(PIPE_ARCH_X86) && defined(PIPE_CC_MSVC)) /* (defined(PIPE_CC_GCC)) */ +#elif (defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)) /* (defined(PIPE_CC_GCC)) */ + +struct pipe_atomic +{ + int32_t count; +}; + +#define p_atomic_set(_v, _i) ((_v)->count = (_i)) +#define p_atomic_read(_v) ((_v)->count) +#define p_atomic_dec_zero(_v) ((boolean) --(_v)->count) +#define p_atomic_inc(_v) ((void) (_v)->count++) +#define p_atomic_dec(_v) ((void) (_v)->count--) +#define p_atomic_cmpxchg(_v, old, new) ((_v)->count == old ? (_v)->count = (new) : (_v)->count) + +#elif (defined(PIPE_ARCH_X86) && defined(PIPE_CC_MSVC)) /* (defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)) */ struct pipe_atomic { |