mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[PATCH] lockdep: irqtrace subsystem, i386 support
Add irqflags-tracing support to i386. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
55df314fbd
commit
55f327fa9e
6 changed files with 104 additions and 23 deletions
56
include/asm-i386/irqflags.h
Normal file
56
include/asm-i386/irqflags.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* include/asm-i386/irqflags.h
|
||||
*
|
||||
* IRQ flags handling
|
||||
*
|
||||
* This file gets included from lowlevel asm headers too, to provide
|
||||
* wrapped versions of the local_irq_*() APIs, based on the
|
||||
* raw_local_irq_*() macros from the lowlevel headers.
|
||||
*/
|
||||
#ifndef _ASM_IRQFLAGS_H
|
||||
#define _ASM_IRQFLAGS_H
|
||||
|
||||
#define raw_local_save_flags(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */); } while (0)
|
||||
#define raw_local_irq_restore(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc"); } while (0)
|
||||
#define raw_local_irq_disable() __asm__ __volatile__("cli": : :"memory")
|
||||
#define raw_local_irq_enable() __asm__ __volatile__("sti": : :"memory")
|
||||
/* used in the idle loop; sti takes one instruction cycle to complete */
|
||||
#define raw_safe_halt() __asm__ __volatile__("sti; hlt": : :"memory")
|
||||
/* used when interrupts are already enabled or to shutdown the processor */
|
||||
#define halt() __asm__ __volatile__("hlt": : :"memory")
|
||||
|
||||
#define raw_irqs_disabled_flags(flags) (!((flags) & (1<<9)))
|
||||
|
||||
/* For spinlocks etc */
|
||||
#define raw_local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
|
||||
|
||||
/*
|
||||
* Do the CPU's IRQ-state tracing from assembly code. We call a
|
||||
* C function, so save all the C-clobbered registers:
|
||||
*/
|
||||
#ifdef CONFIG_TRACE_IRQFLAGS
|
||||
|
||||
# define TRACE_IRQS_ON \
|
||||
pushl %eax; \
|
||||
pushl %ecx; \
|
||||
pushl %edx; \
|
||||
call trace_hardirqs_on; \
|
||||
popl %edx; \
|
||||
popl %ecx; \
|
||||
popl %eax;
|
||||
|
||||
# define TRACE_IRQS_OFF \
|
||||
pushl %eax; \
|
||||
pushl %ecx; \
|
||||
pushl %edx; \
|
||||
call trace_hardirqs_off; \
|
||||
popl %edx; \
|
||||
popl %ecx; \
|
||||
popl %eax;
|
||||
|
||||
#else
|
||||
# define TRACE_IRQS_ON
|
||||
# define TRACE_IRQS_OFF
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -31,6 +31,11 @@
|
|||
"jmp 1b\n" \
|
||||
"3:\n\t"
|
||||
|
||||
/*
|
||||
* NOTE: there's an irqs-on section here, which normally would have to be
|
||||
* irq-traced, but on CONFIG_TRACE_IRQFLAGS we never use
|
||||
* __raw_spin_lock_string_flags().
|
||||
*/
|
||||
#define __raw_spin_lock_string_flags \
|
||||
"\n1:\t" \
|
||||
"lock ; decb %0\n\t" \
|
||||
|
|
|
|||
|
|
@ -456,25 +456,7 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l
|
|||
|
||||
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
|
||||
|
||||
/* interrupt control.. */
|
||||
#define local_save_flags(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */); } while (0)
|
||||
#define local_irq_restore(x) do { typecheck(unsigned long,x); __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc"); } while (0)
|
||||
#define local_irq_disable() __asm__ __volatile__("cli": : :"memory")
|
||||
#define local_irq_enable() __asm__ __volatile__("sti": : :"memory")
|
||||
/* used in the idle loop; sti takes one instruction cycle to complete */
|
||||
#define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory")
|
||||
/* used when interrupts are already enabled or to shutdown the processor */
|
||||
#define halt() __asm__ __volatile__("hlt": : :"memory")
|
||||
|
||||
#define irqs_disabled() \
|
||||
({ \
|
||||
unsigned long flags; \
|
||||
local_save_flags(flags); \
|
||||
!(flags & (1<<9)); \
|
||||
})
|
||||
|
||||
/* For spinlocks etc */
|
||||
#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
|
||||
#include <linux/irqflags.h>
|
||||
|
||||
/*
|
||||
* disable hlt during certain critical i/o operations
|
||||
|
|
|
|||
Loading…
Reference in a new issue