diff options
Diffstat (limited to 'include/litmus/feather_trace.h')
-rw-r--r-- | include/litmus/feather_trace.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/include/litmus/feather_trace.h b/include/litmus/feather_trace.h index eef8af7a414e..7d27e763406f 100644 --- a/include/litmus/feather_trace.h +++ b/include/litmus/feather_trace.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _FEATHER_TRACE_H_ | 1 | #ifndef _FEATHER_TRACE_H_ |
2 | #define _FEATHER_TRACE_H_ | 2 | #define _FEATHER_TRACE_H_ |
3 | 3 | ||
4 | #include <asm/atomic.h> | ||
4 | #include <asm/feather_trace.h> | 5 | #include <asm/feather_trace.h> |
5 | 6 | ||
6 | int ft_enable_event(unsigned long id); | 7 | int ft_enable_event(unsigned long id); |
@@ -8,6 +9,17 @@ int ft_disable_event(unsigned long id); | |||
8 | int ft_is_event_enabled(unsigned long id); | 9 | int ft_is_event_enabled(unsigned long id); |
9 | int ft_disable_all_events(void); | 10 | int ft_disable_all_events(void); |
10 | 11 | ||
12 | /* atomic_* funcitons are inline anyway */ | ||
13 | static inline int fetch_and_inc(int *val) | ||
14 | { | ||
15 | return atomic_add_return(1, (atomic_t*) val) - 1; | ||
16 | } | ||
17 | |||
18 | static inline int fetch_and_dec(int *val) | ||
19 | { | ||
20 | return atomic_sub_return(1, (atomic_t*) val) + 1; | ||
21 | } | ||
22 | |||
11 | #ifndef __ARCH_HAS_FEATHER_TRACE | 23 | #ifndef __ARCH_HAS_FEATHER_TRACE |
12 | /* provide default implementation */ | 24 | /* provide default implementation */ |
13 | 25 | ||
@@ -32,19 +44,6 @@ extern int ft_events[MAX_EVENTS]; | |||
32 | #define ft_event3(id, callback, p, p2, p3) \ | 44 | #define ft_event3(id, callback, p, p2, p3) \ |
33 | if (ft_events[id]) callback(id, p, p2, p3); | 45 | if (ft_events[id]) callback(id, p, p2, p3); |
34 | 46 | ||
35 | #include <asm/atomic.h> | ||
36 | |||
37 | static inline int fetch_and_inc(int *val) | ||
38 | { | ||
39 | return atomic_add_return(1, (atomic_t*) val) - 1; | ||
40 | } | ||
41 | |||
42 | static inline int fetch_and_dec(int *val) | ||
43 | { | ||
44 | return atomic_sub_return(1, (atomic_t*) val) + 1; | ||
45 | } | ||
46 | |||
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | |||
50 | #endif | 49 | #endif |