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
f8ab48a7
Commit
f8ab48a7
authored
Sep 05, 2004
by
Richard Henderson
Committed by
Linus Torvalds
Sep 05, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ALPHA] Fix raising of ieee exceptions from userland software.
parent
30bf4cdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
arch/alpha/kernel/osf_sys.c
arch/alpha/kernel/osf_sys.c
+30
-10
include/asm-alpha/sysinfo.h
include/asm-alpha/sysinfo.h
+1
-0
No files found.
arch/alpha/kernel/osf_sys.c
View file @
f8ab48a7
...
...
@@ -723,7 +723,8 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
{
switch
(
op
)
{
case
SSI_IEEE_FP_CONTROL
:
{
unsigned
long
swcr
,
fpcr
,
fex
;
unsigned
long
swcr
,
fpcr
;
unsigned
int
*
state
;
/*
* Alpha Architecture Handbook 4.7.7.3:
...
...
@@ -732,22 +733,42 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
* set in the trap shadow of a software-complete insn.
*/
/* Update softare trap enable bits. */
if
(
get_user
(
swcr
,
(
unsigned
long
__user
*
)
buffer
))
return
-
EFAULT
;
current_thread_info
()
->
ieee_state
=
((
current_thread_info
()
->
ieee_state
&
~
IEEE_SW_MASK
)
|
(
swcr
&
IEEE_SW_MASK
));
state
=
&
current_thread_info
()
->
ieee_state
;
/* Update softare trap enable bits. */
*
state
=
(
*
state
&
~
IEEE_SW_MASK
)
|
(
swcr
&
IEEE_SW_MASK
);
/* Update the real fpcr. */
fpcr
=
rdfpcr
()
&
FPCR_DYN_MASK
;
fpcr
|=
ieee_swcr_to_fpcr
(
swcr
);
wrfpcr
(
fpcr
);
return
0
;
}
case
SSI_IEEE_RAISE_EXCEPTION
:
{
unsigned
long
exc
,
swcr
,
fpcr
,
fex
;
unsigned
int
*
state
;
if
(
get_user
(
exc
,
(
unsigned
long
__user
*
)
buffer
))
return
-
EFAULT
;
state
=
&
current_thread_info
()
->
ieee_state
;
exc
&=
IEEE_STATUS_MASK
;
/* Update softare trap enable bits. */
swcr
=
(
*
state
&
IEEE_SW_MASK
)
|
exc
;
*
state
|=
exc
;
/* Update the real fpcr. */
fpcr
=
rdfpcr
();
fpcr
&=
FPCR_DYN_MASK
;
fpcr
|=
ieee_swcr_to_fpcr
(
swcr
);
wrfpcr
(
fpcr
);
/* If any exceptions
are now unmasked, send a signal. */
fex
=
((
swcr
&
IEEE_STATUS_MASK
)
>>
IEEE_STATUS_TO_EXCSUM_SHIFT
)
&
swcr
;
/* If any exceptions
set by this call, and are unmasked,
send a signal. Old exceptions are not signaled. */
fex
=
(
exc
>>
IEEE_STATUS_TO_EXCSUM_SHIFT
)
&
swcr
;
if
(
fex
)
{
siginfo_t
info
;
int
si_code
=
0
;
...
...
@@ -765,7 +786,6 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
info
.
si_addr
=
NULL
;
/* FIXME */
send_sig_info
(
SIGFPE
,
&
info
,
current
);
}
return
0
;
}
...
...
include/asm-alpha/sysinfo.h
View file @
f8ab48a7
...
...
@@ -18,6 +18,7 @@
#define SSI_IEEE_FP_CONTROL 14
#define SSI_IEEE_STATE_AT_SIGNAL 15
#define SSI_IEEE_IGNORE_STATE_AT_SIGNAL 16
#define SSI_IEEE_RAISE_EXCEPTION 1001
/* linux specific */
#define SSIN_UACPROC 6
...
...
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