Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176110
b: refs/heads/master
c: a3cd613
h: refs/heads/master
v: v3
  • Loading branch information
Michal Simek committed Dec 14, 2009
1 parent 0a68c7e commit 5c33034
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 64 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb5a32dc1ad7d6378363ad2eb7262edb5fba10f8
refs/heads/master: a3cd613b2e775eb59816c2c7c49c038d54917208
3 changes: 3 additions & 0 deletions trunk/arch/microblaze/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

menu "Kernel hacking"

config TRACE_IRQFLAGS_SUPPORT
def_bool y

source "lib/Kconfig.debug"

config EARLY_PRINTK
Expand Down
112 changes: 50 additions & 62 deletions trunk/arch/microblaze/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,114 +10,102 @@
#define _ASM_MICROBLAZE_IRQFLAGS_H

#include <linux/irqflags.h>
#include <asm/registers.h>

# if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR

# define local_irq_save(flags) \
# define raw_local_irq_save(flags) \
do { \
asm volatile ("# local_irq_save \n\t" \
"msrclr %0, %1 \n\t" \
"nop \n\t" \
asm volatile (" msrclr %0, %1; \
nop;" \
: "=r"(flags) \
: "i"(MSR_IE) \
: "memory"); \
} while (0)

# define local_irq_disable() \
do { \
asm volatile ("# local_irq_disable \n\t" \
"msrclr r0, %0 \n\t" \
"nop \n\t" \
: \
: "i"(MSR_IE) \
: "memory"); \
# define raw_local_irq_disable() \
do { \
asm volatile (" msrclr r0, %0; \
nop;" \
: \
: "i"(MSR_IE) \
: "memory"); \
} while (0)

# define local_irq_enable() \
do { \
asm volatile ("# local_irq_enable \n\t" \
"msrset r0, %0 \n\t" \
"nop \n\t" \
: \
: "i"(MSR_IE) \
: "memory"); \
# define raw_local_irq_enable() \
do { \
asm volatile (" msrset r0, %0; \
nop;" \
: \
: "i"(MSR_IE) \
: "memory"); \
} while (0)

# else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */

# define local_irq_save(flags) \
# define raw_local_irq_save(flags) \
do { \
register unsigned tmp; \
asm volatile ("# local_irq_save \n\t" \
"mfs %0, rmsr \n\t" \
"nop \n\t" \
"andi %1, %0, %2 \n\t" \
"mts rmsr, %1 \n\t" \
"nop \n\t" \
asm volatile (" mfs %0, rmsr; \
nop; \
andi %1, %0, %2; \
mts rmsr, %1; \
nop;" \
: "=r"(flags), "=r" (tmp) \
: "i"(~MSR_IE) \
: "memory"); \
} while (0)

# define local_irq_disable() \
# define raw_local_irq_disable() \
do { \
register unsigned tmp; \
asm volatile ("# local_irq_disable \n\t" \
"mfs %0, rmsr \n\t" \
"nop \n\t" \
"andi %0, %0, %1 \n\t" \
"mts rmsr, %0 \n\t" \
"nop \n\t" \
asm volatile (" mfs %0, rmsr; \
nop; \
andi %0, %0, %1; \
mts rmsr, %0; \
nop;" \
: "=r"(tmp) \
: "i"(~MSR_IE) \
: "memory"); \
} while (0)

# define local_irq_enable() \
# define raw_local_irq_enable() \
do { \
register unsigned tmp; \
asm volatile ("# local_irq_enable \n\t" \
"mfs %0, rmsr \n\t" \
"nop \n\t" \
"ori %0, %0, %1 \n\t" \
"mts rmsr, %0 \n\t" \
"nop \n\t" \
asm volatile (" mfs %0, rmsr; \
nop; \
ori %0, %0, %1; \
mts rmsr, %0; \
nop;" \
: "=r"(tmp) \
: "i"(MSR_IE) \
: "memory"); \
} while (0)

# endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */

#define local_save_flags(flags) \
#define raw_local_irq_restore(flags) \
do { \
asm volatile ("# local_save_flags \n\t" \
"mfs %0, rmsr \n\t" \
"nop \n\t" \
: "=r"(flags) \
asm volatile (" mts rmsr, %0; \
nop;" \
: \
: "r"(flags) \
: "memory"); \
} while (0)

#define local_irq_restore(flags) \
do { \
asm volatile ("# local_irq_restore \n\t"\
"mts rmsr, %0 \n\t" \
"nop \n\t" \
: \
: "r"(flags) \
: "memory"); \
} while (0)

static inline int irqs_disabled(void)
static inline unsigned long get_msr(void)
{
unsigned long flags;

local_save_flags(flags);
return ((flags & MSR_IE) == 0);
asm volatile (" mfs %0, rmsr; \
nop;" \
: "=r"(flags) \
: \
: "memory"); \
return flags;
}

#define raw_irqs_disabled irqs_disabled
#define raw_irqs_disabled_flags(flags) ((flags) == 0)
#define raw_local_save_flags(flags) ((flags) = get_msr())
#define raw_irqs_disabled() ((get_msr() & MSR_IE) == 0)
#define raw_irqs_disabled_flags(flags) ((flags & MSR_IE) == 0)

#endif /* _ASM_MICROBLAZE_IRQFLAGS_H */
2 changes: 1 addition & 1 deletion trunk/arch/microblaze/kernel/cpu/pvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

int cpu_has_pvr(void)
{
unsigned flags;
unsigned long flags;
unsigned pvr0;

local_save_flags(flags);
Expand Down

0 comments on commit 5c33034

Please sign in to comment.