Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
e7e9cae5
Commit
e7e9cae5
authored
Apr 16, 2014
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MIPS: math-emu: Use helpers to manipulate CAUSEF_BD flag.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
5a7ebbf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/cp1emu.c
+7
-7
arch/mips/math-emu/dsemul.c
arch/mips/math-emu/dsemul.c
+1
-1
No files found.
arch/mips/math-emu/cp1emu.c
View file @
e7e9cae5
...
@@ -933,17 +933,17 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
...
@@ -933,17 +933,17 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
int
pc_inc
;
int
pc_inc
;
/* XXX NEC Vr54xx bug workaround */
/* XXX NEC Vr54xx bug workaround */
if
(
xcp
->
cp0_cause
&
CAUSEF_BD
)
{
if
(
delay_slot
(
xcp
)
)
{
if
(
dec_insn
.
micro_mips_mode
)
{
if
(
dec_insn
.
micro_mips_mode
)
{
if
(
!
mm_isBranchInstr
(
xcp
,
dec_insn
,
&
contpc
))
if
(
!
mm_isBranchInstr
(
xcp
,
dec_insn
,
&
contpc
))
xcp
->
cp0_cause
&=
~
CAUSEF_BD
;
clear_delay_slot
(
xcp
)
;
}
else
{
}
else
{
if
(
!
isBranchInstr
(
xcp
,
dec_insn
,
&
contpc
))
if
(
!
isBranchInstr
(
xcp
,
dec_insn
,
&
contpc
))
xcp
->
cp0_cause
&=
~
CAUSEF_BD
;
clear_delay_slot
(
xcp
)
;
}
}
}
}
if
(
xcp
->
cp0_cause
&
CAUSEF_BD
)
{
if
(
delay_slot
(
xcp
)
)
{
/*
/*
* The instruction to be emulated is in a branch delay slot
* The instruction to be emulated is in a branch delay slot
* which means that we have to emulate the branch instruction
* which means that we have to emulate the branch instruction
...
@@ -1178,7 +1178,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
...
@@ -1178,7 +1178,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case
bc_op
:{
case
bc_op
:{
int
likely
=
0
;
int
likely
=
0
;
if
(
xcp
->
cp0_cause
&
CAUSEF_BD
)
if
(
delay_slot
(
xcp
)
)
return
SIGILL
;
return
SIGILL
;
#if __mips >= 4
#if __mips >= 4
...
@@ -1201,7 +1201,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
...
@@ -1201,7 +1201,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
return
SIGILL
;
return
SIGILL
;
}
}
xcp
->
cp0_cause
|=
CAUSEF_BD
;
set_delay_slot
(
xcp
)
;
if
(
cond
)
{
if
(
cond
)
{
/* branch taken: emulate dslot
/* branch taken: emulate dslot
* instruction
* instruction
...
@@ -1321,7 +1321,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
...
@@ -1321,7 +1321,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
/* we did it !! */
/* we did it !! */
xcp
->
cp0_epc
=
contpc
;
xcp
->
cp0_epc
=
contpc
;
xcp
->
cp0_cause
&=
~
CAUSEF_BD
;
clear_delay_slot
(
xcp
)
;
return
0
;
return
0
;
}
}
...
...
arch/mips/math-emu/dsemul.c
View file @
e7e9cae5
...
@@ -59,7 +59,7 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc)
...
@@ -59,7 +59,7 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc)
(
ir
==
0
))
{
(
ir
==
0
))
{
/* NOP is easy */
/* NOP is easy */
regs
->
cp0_epc
=
cpc
;
regs
->
cp0_epc
=
cpc
;
regs
->
cp0_cause
&=
~
CAUSEF_BD
;
clear_delay_slot
(
regs
)
;
return
0
;
return
0
;
}
}
#ifdef DSEMUL_TRACE
#ifdef DSEMUL_TRACE
...
...
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