irqflags.h (9a64e8e0ace51b309fdcff4b4754b3649250382a) irqflags.h (de021bb79c7636df24864fa2dbb958121303663b)
1/*
2 * IRQ flags handling
3 */
4#ifndef _ASM_IRQFLAGS_H
5#define _ASM_IRQFLAGS_H
6
7#ifndef __ASSEMBLY__
8/*

--- 26 unchanged lines hidden (view full) ---

35 * Most of the CPU's IRQ-state tracing is done from assembly code; we
36 * have to call a C function so call a wrapper that saves all the
37 * C-clobbered registers.
38 */
39#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on)
40#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off)
41
42/*
1/*
2 * IRQ flags handling
3 */
4#ifndef _ASM_IRQFLAGS_H
5#define _ASM_IRQFLAGS_H
6
7#ifndef __ASSEMBLY__
8/*

--- 26 unchanged lines hidden (view full) ---

35 * Most of the CPU's IRQ-state tracing is done from assembly code; we
36 * have to call a C function so call a wrapper that saves all the
37 * C-clobbered registers.
38 */
39#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on)
40#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off)
41
42/*
43 * This is used by assembly code to soft-disable interrupts
43 * This is used by assembly code to soft-disable interrupts first and
44 * reconcile irq state.
44 */
45 */
45#define SOFT_DISABLE_INTS(__rA, __rB) \
46#define RECONCILE_IRQ_STATE(__rA, __rB) \
46 lbz __rA,PACASOFTIRQEN(r13); \
47 lbz __rB,PACAIRQHAPPENED(r13); \
48 cmpwi cr0,__rA,0; \
49 li __rA,0; \
50 ori __rB,__rB,PACA_IRQ_HARD_DIS; \
51 stb __rB,PACAIRQHAPPENED(r13); \
52 beq 44f; \
53 stb __rA,PACASOFTIRQEN(r13); \
54 TRACE_DISABLE_INTS; \
5544:
56
57#else
58#define TRACE_ENABLE_INTS
59#define TRACE_DISABLE_INTS
60
47 lbz __rA,PACASOFTIRQEN(r13); \
48 lbz __rB,PACAIRQHAPPENED(r13); \
49 cmpwi cr0,__rA,0; \
50 li __rA,0; \
51 ori __rB,__rB,PACA_IRQ_HARD_DIS; \
52 stb __rB,PACAIRQHAPPENED(r13); \
53 beq 44f; \
54 stb __rA,PACASOFTIRQEN(r13); \
55 TRACE_DISABLE_INTS; \
5644:
57
58#else
59#define TRACE_ENABLE_INTS
60#define TRACE_DISABLE_INTS
61
61#define SOFT_DISABLE_INTS(__rA, __rB) \
62#define RECONCILE_IRQ_STATE(__rA, __rB) \
62 lbz __rA,PACAIRQHAPPENED(r13); \
63 li __rB,0; \
64 ori __rA,__rA,PACA_IRQ_HARD_DIS; \
65 stb __rB,PACASOFTIRQEN(r13); \
66 stb __rA,PACAIRQHAPPENED(r13)
67#endif
68#endif
69
70#endif
63 lbz __rA,PACAIRQHAPPENED(r13); \
64 li __rB,0; \
65 ori __rA,__rA,PACA_IRQ_HARD_DIS; \
66 stb __rB,PACASOFTIRQEN(r13); \
67 stb __rA,PACAIRQHAPPENED(r13)
68#endif
69#endif
70
71#endif