Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11147
b: refs/heads/master
c: ff88f8a
h: refs/heads/master
i:
  11145: f3dafc7
  11143: fb1abec
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent f0dd59f commit 3f7779d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 54 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: 1e5f1caa5dc4398298a2b7c2638855881a5057c5
refs/heads/master: ff88f8a3d290c213f90d40aa81bdea5c054f58b5
138 changes: 85 additions & 53 deletions trunk/include/asm-mips/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@
#ifndef _ASM_INTERRUPT_H
#define _ASM_INTERRUPT_H

#include <linux/config.h>
#include <asm/hazards.h>

__asm__ (
".macro\tlocal_irq_enable\n\t"
".set\tpush\n\t"
".set\treorder\n\t"
".set\tnoat\n\t"
"mfc0\t$1,$12\n\t"
"ori\t$1,0x1f\n\t"
"xori\t$1,0x1e\n\t"
"mtc0\t$1,$12\n\t"
"irq_enable_hazard\n\t"
".set\tpop\n\t"
".endm");
" .macro local_irq_enable \n"
" .set push \n"
" .set reorder \n"
" .set noat \n"
#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
" ei \n"
#else
" mfc0 $1,$12 \n"
" ori $1,0x1f \n"
" xori $1,0x1e \n"
" mtc0 $1,$12 \n"
#endif
" irq_enable_hazard \n"
" .set pop \n"
" .endm");

static inline void local_irq_enable(void)
{
Expand All @@ -43,17 +48,21 @@ static inline void local_irq_enable(void)
* no nops at all.
*/
__asm__ (
".macro\tlocal_irq_disable\n\t"
".set\tpush\n\t"
".set\tnoat\n\t"
"mfc0\t$1,$12\n\t"
"ori\t$1,1\n\t"
"xori\t$1,1\n\t"
".set\tnoreorder\n\t"
"mtc0\t$1,$12\n\t"
"irq_disable_hazard\n\t"
".set\tpop\n\t"
".endm");
" .macro local_irq_disable\n"
" .set push \n"
" .set noat \n"
#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
" di \n"
#else
" mfc0 $1,$12 \n"
" ori $1,1 \n"
" xori $1,1 \n"
" .set noreorder \n"
" mtc0 $1,$12 \n"
#endif
" irq_disable_hazard \n"
" .set pop \n"
" .endm \n");

static inline void local_irq_disable(void)
{
Expand All @@ -65,31 +74,35 @@ static inline void local_irq_disable(void)
}

__asm__ (
".macro\tlocal_save_flags flags\n\t"
".set\tpush\n\t"
".set\treorder\n\t"
"mfc0\t\\flags, $12\n\t"
".set\tpop\n\t"
".endm");
" .macro local_save_flags flags \n"
" .set push \n"
" .set reorder \n"
" mfc0 \\flags, $12 \n"
" .set pop \n"
" .endm \n");

#define local_save_flags(x) \
__asm__ __volatile__( \
"local_save_flags %0" \
: "=r" (x))

__asm__ (
".macro\tlocal_irq_save result\n\t"
".set\tpush\n\t"
".set\treorder\n\t"
".set\tnoat\n\t"
"mfc0\t\\result, $12\n\t"
"ori\t$1, \\result, 1\n\t"
"xori\t$1, 1\n\t"
".set\tnoreorder\n\t"
"mtc0\t$1, $12\n\t"
"irq_disable_hazard\n\t"
".set\tpop\n\t"
".endm");
" .macro local_irq_save result \n"
" .set push \n"
" .set reorder \n"
" .set noat \n"
#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
" di \\result \n"
#else
" mfc0 \\result, $12 \n"
" ori $1, \\result, 1 \n"
" xori $1, 1 \n"
" .set noreorder \n"
" mtc0 $1, $12 \n"
#endif
" irq_disable_hazard \n"
" .set pop \n"
" .endm \n");

#define local_irq_save(x) \
__asm__ __volatile__( \
Expand All @@ -99,19 +112,38 @@ __asm__ __volatile__( \
: "memory")

__asm__ (
".macro\tlocal_irq_restore flags\n\t"
".set\tnoreorder\n\t"
".set\tnoat\n\t"
"mfc0\t$1, $12\n\t"
"andi\t\\flags, 1\n\t"
"ori\t$1, 1\n\t"
"xori\t$1, 1\n\t"
"or\t\\flags, $1\n\t"
"mtc0\t\\flags, $12\n\t"
"irq_disable_hazard\n\t"
".set\tat\n\t"
".set\treorder\n\t"
".endm");
" .macro local_irq_restore flags \n"
" .set noreorder \n"
" .set noat \n"
#if (defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)) && \
defined(CONFIG_IRQ_CPU)
/*
* Slow, but doesn't suffer from a relativly unlikely race
* condition we're having since days 1.
*/
" beqz \\flags, 1f \n"
" di \n"
" ei \n"
"1: \n"
#elif defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
/*
* Fast, dangerous. Life is fun, life is good.
*/
" mfc0 $1, $12 \n"
" ins $1, \\flags, 0, 1 \n"
" mtc0 $1, $12 \n"
#else
" mfc0 $1, $12 \n"
" andi \\flags, 1 \n"
" ori $1, 1 \n"
" xori $1, 1 \n"
" or \\flags, $1 \n"
" mtc0 \\flags, $12 \n"
#endif
" irq_disable_hazard \n"
" .set at \n"
" .set reorder \n"
" .endm \n");

#define local_irq_restore(flags) \
do { \
Expand Down

0 comments on commit 3f7779d

Please sign in to comment.