Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
ff88f8a3
Commit
ff88f8a3
authored
Jul 12, 2005
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ei / di MIPS32 R2 instructions if available.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
1e5f1caa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
53 deletions
+85
-53
include/asm-mips/interrupt.h
include/asm-mips/interrupt.h
+85
-53
No files found.
include/asm-mips/interrupt.h
View file @
ff88f8a3
...
...
@@ -11,20 +11,25 @@
#ifndef _ASM_INTERRUPT_H
#define _ASM_INTERRUPT_H
#include <linux/config.h>
#include <asm/hazards.h>
__asm__
(
".macro
\t
local_irq_enable
\n\t
"
".set
\t
push
\n\t
"
".set
\t
reorder
\n\t
"
".set
\t
noat
\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
\t
pop
\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
)
{
...
...
@@ -43,17 +48,21 @@ static inline void local_irq_enable(void)
* no nops at all.
*/
__asm__
(
".macro
\t
local_irq_disable
\n\t
"
".set
\t
push
\n\t
"
".set
\t
noat
\n\t
"
"mfc0
\t
$1,$12
\n\t
"
"ori
\t
$1,1
\n\t
"
"xori
\t
$1,1
\n\t
"
".set
\t
noreorder
\n\t
"
"mtc0
\t
$1,$12
\n\t
"
"irq_disable_hazard
\n\t
"
".set
\t
pop
\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
)
{
...
...
@@ -65,12 +74,12 @@ static inline void local_irq_disable(void)
}
__asm__
(
"
.macro
\t
local_save_flags flags
\n\t
"
"
.set
\t
push
\n\t
"
"
.set
\t
reorder
\n\t
"
"
mfc0
\t\\
flags, $12
\n\t
"
"
.set
\t
pop
\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__( \
...
...
@@ -78,18 +87,22 @@ __asm__ __volatile__( \
: "=r" (x))
__asm__
(
".macro
\t
local_irq_save result
\n\t
"
".set
\t
push
\n\t
"
".set
\t
reorder
\n\t
"
".set
\t
noat
\n\t
"
"mfc0
\t\\
result, $12
\n\t
"
"ori
\t
$1,
\\
result, 1
\n\t
"
"xori
\t
$1, 1
\n\t
"
".set
\t
noreorder
\n\t
"
"mtc0
\t
$1, $12
\n\t
"
"irq_disable_hazard
\n\t
"
".set
\t
pop
\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__( \
...
...
@@ -99,19 +112,38 @@ __asm__ __volatile__( \
: "memory")
__asm__
(
".macro
\t
local_irq_restore flags
\n\t
"
".set
\t
noreorder
\n\t
"
".set
\t
noat
\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
\t
at
\n\t
"
".set
\t
reorder
\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 { \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment