summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/os/os_time.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-06-25 20:39:34 +0200
committerMarek Olšák <[email protected]>2015-07-05 15:08:59 +0200
commit3836857a777a248dd212ce7a1d7307d2984fda7d (patch)
treef08d49934b2f8337e5e9c59506635d4d1472ea2a /src/gallium/auxiliary/os/os_time.h
parent245b464d5caa21680373ae5929dccd294078cc50 (diff)
gallium/os: add os_wait_until_zero (v2)
This will be used by radeon and amdgpu winsyses. Copied from the amdgpu winsys. v2: use volatile and p_atomic_read Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/os/os_time.h')
-rw-r--r--src/gallium/auxiliary/os/os_time.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/os/os_time.h b/src/gallium/auxiliary/os/os_time.h
index 4fab03cc671..2989af10fe2 100644
--- a/src/gallium/auxiliary/os/os_time.h
+++ b/src/gallium/auxiliary/os/os_time.h
@@ -94,6 +94,17 @@ os_time_timeout(int64_t start,
}
+/**
+ * Wait until the variable at the given memory location is zero.
+ *
+ * \param var variable
+ * \param timeout timeout in ns, can be anything from 0 (no wait) to
+ * PIPE_TIME_INFINITE (wait forever)
+ * \return true if the variable is zero
+ */
+bool
+os_wait_until_zero(volatile int *var, uint64_t timeout);
+
#ifdef __cplusplus
}
#endif