Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / adf / adf_os_atomic_pvt.h
1 #ifndef __ADF_OS_ATOMIC_PVT_H
2 #define __ADF_OS_ATOMIC_PVT_H
3
4 //#include <sys/types.h>
5 //#include <machine/atomic.h>
6
7 #include <adf_os_types.h>
8
9 typedef a_uint32_t  __adf_os_atomic_t;
10
11 /**
12  * @brief This initiallizes the varriable to zero
13  * 
14  * @param __adf_os_atomic_t (int pointer)
15  * 
16  */
17 static inline void
18 __adf_os_atomic_init(__adf_os_atomic_t *v)
19 {
20         //atomic_store_rel_int(v,0);
21 }
22 static inline a_uint32_t
23 __adf_os_atomic_read(__adf_os_atomic_t *v)
24 {
25         //return (atomic_load_acq_int(v));
26         return *v;
27 }
28
29 static inline void
30 __adf_os_atomic_inc(__adf_os_atomic_t *v)
31 {
32         //atomic_add_int(v,1);
33         (*v)++;
34 }
35
36 static inline void
37 __adf_os_atomic_dec(__adf_os_atomic_t *v)
38 {
39         //atomic_subtract_int(v,1);
40         (*v)--;
41 }
42 /*
43 static inline void
44 __adf_os_atomic_write(__adf_os_atomic_t *v,a_uint32_t p)
45 {
46         atomic_store_rel_int(v,(int)p);
47
48  */
49
50 #endif