Ingo Molnar | de30a2b | 2006-07-03 00:24:42 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-powerpc/irqflags.h |
| 3 | * |
| 4 | * IRQ flags handling |
Ingo Molnar | de30a2b | 2006-07-03 00:24:42 -0700 | [diff] [blame] | 5 | */ |
| 6 | #ifndef _ASM_IRQFLAGS_H |
| 7 | #define _ASM_IRQFLAGS_H |
| 8 | |
Benjamin Herrenschmidt | 945feb1 | 2008-04-17 14:35:01 +1000 | [diff] [blame] | 9 | #ifndef __ASSEMBLY__ |
Ingo Molnar | de30a2b | 2006-07-03 00:24:42 -0700 | [diff] [blame] | 10 | /* |
| 11 | * Get definitions for raw_local_save_flags(x), etc. |
| 12 | */ |
| 13 | #include <asm-powerpc/hw_irq.h> |
| 14 | |
Ingo Molnar | de30a2b | 2006-07-03 00:24:42 -0700 | [diff] [blame] | 15 | #else |
Benjamin Herrenschmidt | 945feb1 | 2008-04-17 14:35:01 +1000 | [diff] [blame] | 16 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 17 | /* |
| 18 | * Most of the CPU's IRQ-state tracing is done from assembly code; we |
| 19 | * have to call a C function so call a wrapper that saves all the |
| 20 | * C-clobbered registers. |
| 21 | */ |
| 22 | #define TRACE_ENABLE_INTS bl .trace_hardirqs_on |
| 23 | #define TRACE_DISABLE_INTS bl .trace_hardirqs_off |
| 24 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ |
| 25 | cmpdi en, 0; \ |
| 26 | bne 95f; \ |
| 27 | stb en,PACASOFTIRQEN(r13); \ |
| 28 | bl .trace_hardirqs_off; \ |
| 29 | b skip; \ |
| 30 | 95: bl .trace_hardirqs_on; \ |
| 31 | li en,1; |
| 32 | #define TRACE_AND_RESTORE_IRQ(en) \ |
| 33 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ |
| 34 | 96: stb en,PACASOFTIRQEN(r13) |
| 35 | #else |
| 36 | #define TRACE_ENABLE_INTS |
| 37 | #define TRACE_DISABLE_INTS |
| 38 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) |
| 39 | #define TRACE_AND_RESTORE_IRQ(en) \ |
| 40 | stb en,PACASOFTIRQEN(r13) |
| 41 | #endif |
Ingo Molnar | de30a2b | 2006-07-03 00:24:42 -0700 | [diff] [blame] | 42 | #endif |
| 43 | |
| 44 | #endif |