Chris Kelly | 56ff32f | 2012-02-20 21:12:27 +0000 | [diff] [blame] | 1 | /* ----------------------------------------------------------------------------- |
| 2 | * Copyright (c) 2011 Ozmo Inc |
| 3 | * Released under the GNU General Public License Version 2 (GPLv2). |
| 4 | * ----------------------------------------------------------------------------- |
| 5 | */ |
| 6 | #ifndef _OZEVENT_H |
| 7 | #define _OZEVENT_H |
| 8 | #include "ozconfig.h" |
| 9 | #include "ozeventdef.h" |
| 10 | |
| 11 | #ifdef WANT_EVENT_TRACE |
Rupesh Gujare | 68a75f3 | 2012-03-29 13:11:50 +0100 | [diff] [blame] | 12 | extern u32 g_evt_mask; |
Chris Kelly | 56ff32f | 2012-02-20 21:12:27 +0000 | [diff] [blame] | 13 | void oz_event_init(void); |
| 14 | void oz_event_term(void); |
| 15 | void oz_event_log2(u8 evt, u8 ctx1, u16 ctx2, void *ctx3, unsigned ctx4); |
Rupesh Gujare | 68a75f3 | 2012-03-29 13:11:50 +0100 | [diff] [blame] | 16 | void oz_debugfs_init(void); |
| 17 | void oz_debugfs_remove(void); |
Chris Kelly | 56ff32f | 2012-02-20 21:12:27 +0000 | [diff] [blame] | 18 | #define oz_event_log(__evt, __ctx1, __ctx2, __ctx3, __ctx4) \ |
| 19 | do { \ |
| 20 | if ((1<<(__evt)) & g_evt_mask) \ |
| 21 | oz_event_log2(__evt, __ctx1, __ctx2, __ctx3, __ctx4); \ |
| 22 | } while (0) |
Rupesh Gujare | 68a75f3 | 2012-03-29 13:11:50 +0100 | [diff] [blame] | 23 | |
Chris Kelly | 56ff32f | 2012-02-20 21:12:27 +0000 | [diff] [blame] | 24 | #else |
| 25 | #define oz_event_init() |
| 26 | #define oz_event_term() |
| 27 | #define oz_event_log(__evt, __ctx1, __ctx2, __ctx3, __ctx4) |
Rupesh Gujare | 68a75f3 | 2012-03-29 13:11:50 +0100 | [diff] [blame] | 28 | #define oz_debugfs_init() |
| 29 | #define oz_debugfs_remove() |
Chris Kelly | 56ff32f | 2012-02-20 21:12:27 +0000 | [diff] [blame] | 30 | #endif /* WANT_EVENT_TRACE */ |
| 31 | |
| 32 | #endif /* _OZEVENT_H */ |