~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/irqflags.h

Version: ~ [ linux-4.14 ] ~ [ linux-4.13.12 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.61 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.97 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.46 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.80 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.50 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.95 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * IRQ flags handling
  4  */
  5 #ifndef _ASM_IRQFLAGS_H
  6 #define _ASM_IRQFLAGS_H
  7 
  8 #ifndef __ASSEMBLY__
  9 /*
 10  * Get definitions for arch_local_save_flags(x), etc.
 11  */
 12 #include <asm/hw_irq.h>
 13 
 14 #else
 15 #ifdef CONFIG_TRACE_IRQFLAGS
 16 #ifdef CONFIG_IRQSOFF_TRACER
 17 /*
 18  * Since the ftrace irqsoff latency trace checks CALLER_ADDR1,
 19  * which is the stack frame here, we need to force a stack frame
 20  * in case we came from user space.
 21  */
 22 #define TRACE_WITH_FRAME_BUFFER(func)           \
 23         mflr    r0;                             \
 24         stdu    r1, -STACK_FRAME_OVERHEAD(r1);  \
 25         std     r0, 16(r1);                     \
 26         stdu    r1, -STACK_FRAME_OVERHEAD(r1);  \
 27         bl func;                                \
 28         ld      r1, 0(r1);                      \
 29         ld      r1, 0(r1);
 30 #else
 31 #define TRACE_WITH_FRAME_BUFFER(func)           \
 32         bl func;
 33 #endif
 34 
 35 /*
 36  * These are calls to C code, so the caller must be prepared for volatiles to
 37  * be clobbered.
 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 first and
 44  * reconcile irq state.
 45  *
 46  * NB: This may call C code, so the caller must be prepared for volatiles to
 47  * be clobbered.
 48  */
 49 #define RECONCILE_IRQ_STATE(__rA, __rB)         \
 50         lbz     __rA,PACASOFTIRQEN(r13);        \
 51         lbz     __rB,PACAIRQHAPPENED(r13);      \
 52         cmpwi   cr0,__rA,0;                     \
 53         li      __rA,0;                         \
 54         ori     __rB,__rB,PACA_IRQ_HARD_DIS;    \
 55         stb     __rB,PACAIRQHAPPENED(r13);      \
 56         beq     44f;                            \
 57         stb     __rA,PACASOFTIRQEN(r13);        \
 58         TRACE_DISABLE_INTS;                     \
 59 44:
 60 
 61 #else
 62 #define TRACE_ENABLE_INTS
 63 #define TRACE_DISABLE_INTS
 64 
 65 #define RECONCILE_IRQ_STATE(__rA, __rB)         \
 66         lbz     __rA,PACAIRQHAPPENED(r13);      \
 67         li      __rB,0;                         \
 68         ori     __rA,__rA,PACA_IRQ_HARD_DIS;    \
 69         stb     __rB,PACASOFTIRQEN(r13);        \
 70         stb     __rA,PACAIRQHAPPENED(r13)
 71 #endif
 72 #endif
 73 
 74 #endif
 75 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp