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
Kirill Smelkov
linux
Commits
256b22ca
Commit
256b22ca
authored
Nov 10, 2007
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh: Have SH-5 provide an {en,dis}able_fpu() impl.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
27a511c6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
arch/sh/kernel/ptrace_64.c
arch/sh/kernel/ptrace_64.c
+4
-4
arch/sh/kernel/traps_64.c
arch/sh/kernel/traps_64.c
+4
-4
include/asm-sh/processor_64.h
include/asm-sh/processor_64.h
+13
-2
No files found.
arch/sh/kernel/ptrace_64.c
View file @
256b22ca
...
@@ -74,9 +74,9 @@ get_fpu_long(struct task_struct *task, unsigned long addr)
...
@@ -74,9 +74,9 @@ get_fpu_long(struct task_struct *task, unsigned long addr)
}
}
if
(
last_task_used_math
==
task
)
{
if
(
last_task_used_math
==
task
)
{
grab
_fpu
();
enable
_fpu
();
fpsave
(
&
task
->
thread
.
fpu
.
hard
);
fpsave
(
&
task
->
thread
.
fpu
.
hard
);
releas
e_fpu
();
disabl
e_fpu
();
last_task_used_math
=
0
;
last_task_used_math
=
0
;
regs
->
sr
|=
SR_FD
;
regs
->
sr
|=
SR_FD
;
}
}
...
@@ -110,9 +110,9 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
...
@@ -110,9 +110,9 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
fpinit
(
&
task
->
thread
.
fpu
.
hard
);
fpinit
(
&
task
->
thread
.
fpu
.
hard
);
set_stopped_child_used_math
(
task
);
set_stopped_child_used_math
(
task
);
}
else
if
(
last_task_used_math
==
task
)
{
}
else
if
(
last_task_used_math
==
task
)
{
grab
_fpu
();
enable
_fpu
();
fpsave
(
&
task
->
thread
.
fpu
.
hard
);
fpsave
(
&
task
->
thread
.
fpu
.
hard
);
releas
e_fpu
();
disabl
e_fpu
();
last_task_used_math
=
0
;
last_task_used_math
=
0
;
regs
->
sr
|=
SR_FD
;
regs
->
sr
|=
SR_FD
;
}
}
...
...
arch/sh/kernel/traps_64.c
View file @
256b22ca
...
@@ -617,9 +617,9 @@ static int misaligned_fpu_load(struct pt_regs *regs,
...
@@ -617,9 +617,9 @@ static int misaligned_fpu_load(struct pt_regs *regs,
context switch the registers into memory so they can be
context switch the registers into memory so they can be
indexed by register number. */
indexed by register number. */
if
(
last_task_used_math
==
current
)
{
if
(
last_task_used_math
==
current
)
{
grab
_fpu
();
enable
_fpu
();
fpsave
(
&
current
->
thread
.
fpu
.
hard
);
fpsave
(
&
current
->
thread
.
fpu
.
hard
);
releas
e_fpu
();
disabl
e_fpu
();
last_task_used_math
=
NULL
;
last_task_used_math
=
NULL
;
regs
->
sr
|=
SR_FD
;
regs
->
sr
|=
SR_FD
;
}
}
...
@@ -690,9 +690,9 @@ static int misaligned_fpu_store(struct pt_regs *regs,
...
@@ -690,9 +690,9 @@ static int misaligned_fpu_store(struct pt_regs *regs,
context switch the registers into memory so they can be
context switch the registers into memory so they can be
indexed by register number. */
indexed by register number. */
if
(
last_task_used_math
==
current
)
{
if
(
last_task_used_math
==
current
)
{
grab
_fpu
();
enable
_fpu
();
fpsave
(
&
current
->
thread
.
fpu
.
hard
);
fpsave
(
&
current
->
thread
.
fpu
.
hard
);
releas
e_fpu
();
disabl
e_fpu
();
last_task_used_math
=
NULL
;
last_task_used_math
=
NULL
;
regs
->
sr
|=
SR_FD
;
regs
->
sr
|=
SR_FD
;
}
}
...
...
include/asm-sh/processor_64.h
View file @
256b22ca
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include <asm/page.h>
#include <asm/page.h>
#include <asm/types.h>
#include <asm/types.h>
#include <asm/cache.h>
#include <asm/cache.h>
#include <asm/ptrace.h>
#include <asm/cpu/registers.h>
#include <asm/cpu/registers.h>
/*
/*
...
@@ -218,7 +219,7 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
...
@@ -218,7 +219,7 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
* FPU lazy state save handling.
* FPU lazy state save handling.
*/
*/
static
inline
void
releas
e_fpu
(
void
)
static
inline
void
disabl
e_fpu
(
void
)
{
{
unsigned
long
long
__dummy
;
unsigned
long
long
__dummy
;
...
@@ -230,7 +231,7 @@ static inline void release_fpu(void)
...
@@ -230,7 +231,7 @@ static inline void release_fpu(void)
:
"r"
(
SR_FD
));
:
"r"
(
SR_FD
));
}
}
static
inline
void
grab
_fpu
(
void
)
static
inline
void
enable
_fpu
(
void
)
{
{
unsigned
long
long
__dummy
;
unsigned
long
long
__dummy
;
...
@@ -242,6 +243,16 @@ static inline void grab_fpu(void)
...
@@ -242,6 +243,16 @@ static inline void grab_fpu(void)
:
"r"
(
~
SR_FD
));
:
"r"
(
~
SR_FD
));
}
}
static
inline
void
release_fpu
(
struct
pt_regs
*
regs
)
{
regs
->
sr
|=
SR_FD
;
}
static
inline
void
grab_fpu
(
struct
pt_regs
*
regs
)
{
regs
->
sr
&=
~
SR_FD
;
}
/* Round to nearest, no exceptions on inexact, overflow, underflow,
/* Round to nearest, no exceptions on inexact, overflow, underflow,
zero-divide, invalid. Configure option for whether to flush denorms to
zero-divide, invalid. Configure option for whether to flush denorms to
zero, or except if a denorm is encountered. */
zero, or except if a denorm is encountered. */
...
...
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