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
bf306055
Commit
bf306055
authored
May 14, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: remove old code for stacking signals, its not used any more
parent
c0a8b2ab
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
207 additions
and
306 deletions
+207
-306
arch/ppc64/kernel/signal.c
arch/ppc64/kernel/signal.c
+38
-82
arch/ppc64/kernel/signal32.c
arch/ppc64/kernel/signal32.c
+169
-224
No files found.
arch/ppc64/kernel/signal.c
View file @
bf306055
...
@@ -246,7 +246,6 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
...
@@ -246,7 +246,6 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
struct
rt_sigframe
*
rt_sf
;
struct
rt_sigframe
*
rt_sf
;
struct
sigcontext_struct
sigctx
;
struct
sigcontext_struct
sigctx
;
struct
sigregs
*
sr
;
struct
sigregs
*
sr
;
int
ret
;
elf_gregset_t
saved_regs
;
/* an array of ELF_NGREG unsigned longs */
elf_gregset_t
saved_regs
;
/* an array of ELF_NGREG unsigned longs */
sigset_t
set
;
sigset_t
set
;
stack_t
st
;
stack_t
st
;
...
@@ -263,52 +262,29 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
...
@@ -263,52 +262,29 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
recalc_sigpending
();
recalc_sigpending
();
spin_unlock_irq
(
&
current
->
sigmask_lock
);
spin_unlock_irq
(
&
current
->
sigmask_lock
);
rt_sf
++
;
/* Look at next rt_sigframe */
/* restore registers -
if
(
rt_sf
==
(
struct
rt_sigframe
*
)(
sigctx
.
regs
))
{
* sigctx is initialized to point to the
/* Last stacked signal - restore registers -
* preamble frame (where registers are stored)
* sigctx is initialized to point to the
* see handle_signal()
* preamble frame (where registers are stored)
*/
* see handle_signal()
sr
=
(
struct
sigregs
*
)
sigctx
.
regs
;
*/
if
(
regs
->
msr
&
MSR_FP
)
sr
=
(
struct
sigregs
*
)
sigctx
.
regs
;
giveup_fpu
(
current
);
if
(
regs
->
msr
&
MSR_FP
)
if
(
copy_from_user
(
saved_regs
,
&
sr
->
gp_regs
,
giveup_fpu
(
current
);
sizeof
(
sr
->
gp_regs
)))
if
(
copy_from_user
(
saved_regs
,
&
sr
->
gp_regs
,
goto
badframe
;
sizeof
(
sr
->
gp_regs
)))
saved_regs
[
PT_MSR
]
=
(
regs
->
msr
&
~
MSR_USERCHANGE
)
goto
badframe
;
|
(
saved_regs
[
PT_MSR
]
&
MSR_USERCHANGE
);
saved_regs
[
PT_MSR
]
=
(
regs
->
msr
&
~
MSR_USERCHANGE
)
saved_regs
[
PT_SOFTE
]
=
regs
->
softe
;
|
(
saved_regs
[
PT_MSR
]
&
MSR_USERCHANGE
);
memcpy
(
regs
,
saved_regs
,
GP_REGS_SIZE
);
saved_regs
[
PT_SOFTE
]
=
regs
->
softe
;
if
(
copy_from_user
(
current
->
thread
.
fpr
,
&
sr
->
fp_regs
,
memcpy
(
regs
,
saved_regs
,
GP_REGS_SIZE
);
sizeof
(
sr
->
fp_regs
)))
if
(
copy_from_user
(
current
->
thread
.
fpr
,
&
sr
->
fp_regs
,
goto
badframe
;
sizeof
(
sr
->
fp_regs
)))
/* This function sets back the stack flags into
goto
badframe
;
the current task structure. */
/* This function sets back the stack flags into
sys_sigaltstack
(
&
st
,
NULL
);
the current task structure. */
sys_sigaltstack
(
&
st
,
NULL
);
ret
=
regs
->
result
;
return
regs
->
result
;
}
else
{
/* More signals to go */
/* Set up registers for next signal handler */
regs
->
gpr
[
1
]
=
(
unsigned
long
)
rt_sf
-
__SIGNAL_FRAMESIZE
;
if
(
copy_from_user
(
&
sigctx
,
&
rt_sf
->
uc
.
uc_mcontext
,
sizeof
(
sigctx
)))
goto
badframe
;
sr
=
(
struct
sigregs
*
)
sigctx
.
regs
;
regs
->
gpr
[
3
]
=
ret
=
sigctx
.
signal
;
/* Get the siginfo */
get_user
(
regs
->
gpr
[
4
],
(
unsigned
long
*
)
&
rt_sf
->
pinfo
);
/* Get the ucontext */
get_user
(
regs
->
gpr
[
5
],
(
unsigned
long
*
)
&
rt_sf
->
puc
);
regs
->
gpr
[
6
]
=
(
unsigned
long
)
rt_sf
;
regs
->
link
=
(
unsigned
long
)
&
sr
->
tramp
;
regs
->
nip
=
sigctx
.
handler
;
if
(
get_user
(
prevsp
,
&
sr
->
gp_regs
[
PT_R1
])
||
put_user
(
prevsp
,
(
unsigned
long
*
)
regs
->
gpr
[
1
]))
goto
badframe
;
}
return
ret
;
badframe:
badframe:
do_exit
(
SIGSEGV
);
do_exit
(
SIGSEGV
);
...
@@ -388,7 +364,6 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
...
@@ -388,7 +364,6 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
{
{
struct
sigcontext_struct
*
sc
,
sigctx
;
struct
sigcontext_struct
*
sc
,
sigctx
;
struct
sigregs
*
sr
;
struct
sigregs
*
sr
;
long
ret
;
elf_gregset_t
saved_regs
;
/* an array of ELF_NGREG unsigned longs */
elf_gregset_t
saved_regs
;
/* an array of ELF_NGREG unsigned longs */
sigset_t
set
;
sigset_t
set
;
unsigned
long
prevsp
;
unsigned
long
prevsp
;
...
@@ -407,42 +382,23 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
...
@@ -407,42 +382,23 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
recalc_sigpending
();
recalc_sigpending
();
spin_unlock_irq
(
&
current
->
sigmask_lock
);
spin_unlock_irq
(
&
current
->
sigmask_lock
);
sc
++
;
/* Look at next sigcontext */
/* restore registers */
if
(
sc
==
(
struct
sigcontext_struct
*
)(
sigctx
.
regs
))
{
sr
=
(
struct
sigregs
*
)
sigctx
.
regs
;
/* Last stacked signal - restore registers */
if
(
regs
->
msr
&
MSR_FP
)
sr
=
(
struct
sigregs
*
)
sigctx
.
regs
;
giveup_fpu
(
current
);
if
(
regs
->
msr
&
MSR_FP
)
if
(
copy_from_user
(
saved_regs
,
&
sr
->
gp_regs
,
giveup_fpu
(
current
);
sizeof
(
sr
->
gp_regs
)))
if
(
copy_from_user
(
saved_regs
,
&
sr
->
gp_regs
,
goto
badframe
;
sizeof
(
sr
->
gp_regs
)))
saved_regs
[
PT_MSR
]
=
(
regs
->
msr
&
~
MSR_USERCHANGE
)
goto
badframe
;
|
(
saved_regs
[
PT_MSR
]
&
MSR_USERCHANGE
);
saved_regs
[
PT_MSR
]
=
(
regs
->
msr
&
~
MSR_USERCHANGE
)
saved_regs
[
PT_SOFTE
]
=
regs
->
softe
;
|
(
saved_regs
[
PT_MSR
]
&
MSR_USERCHANGE
);
memcpy
(
regs
,
saved_regs
,
GP_REGS_SIZE
);
saved_regs
[
PT_SOFTE
]
=
regs
->
softe
;
memcpy
(
regs
,
saved_regs
,
GP_REGS_SIZE
);
if
(
copy_from_user
(
current
->
thread
.
fpr
,
&
sr
->
fp_regs
,
sizeof
(
sr
->
fp_regs
)))
goto
badframe
;
ret
=
regs
->
result
;
if
(
copy_from_user
(
current
->
thread
.
fpr
,
&
sr
->
fp_regs
,
sizeof
(
sr
->
fp_regs
)))
goto
badframe
;
}
else
{
return
regs
->
result
;
/* More signals to go */
regs
->
gpr
[
1
]
=
(
unsigned
long
)
sc
-
__SIGNAL_FRAMESIZE
;
if
(
copy_from_user
(
&
sigctx
,
sc
,
sizeof
(
sigctx
)))
goto
badframe
;
sr
=
(
struct
sigregs
*
)
sigctx
.
regs
;
regs
->
gpr
[
3
]
=
ret
=
sigctx
.
signal
;
regs
->
gpr
[
4
]
=
(
unsigned
long
)
sc
;
regs
->
link
=
(
unsigned
long
)
&
sr
->
tramp
;
regs
->
nip
=
sigctx
.
handler
;
if
(
get_user
(
prevsp
,
&
sr
->
gp_regs
[
PT_R1
])
||
put_user
(
prevsp
,
(
unsigned
long
*
)
regs
->
gpr
[
1
]))
goto
badframe
;
}
return
ret
;
badframe:
badframe:
do_exit
(
SIGSEGV
);
do_exit
(
SIGSEGV
);
...
@@ -552,7 +508,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
...
@@ -552,7 +508,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
||
__put_user
(
sig
,
&
rt_sf
->
uc
.
uc_mcontext
.
signal
))
||
__put_user
(
sig
,
&
rt_sf
->
uc
.
uc_mcontext
.
signal
))
goto
badframe
;
goto
badframe
;
}
else
{
}
else
{
/* Put a
nother
sigcontext on the stack */
/* Put a sigcontext on the stack */
*
newspp
-=
sizeof
(
*
sc
);
*
newspp
-=
sizeof
(
*
sc
);
sc
=
(
struct
sigcontext_struct
*
)
*
newspp
;
sc
=
(
struct
sigcontext_struct
*
)
*
newspp
;
if
(
verify_area
(
VERIFY_WRITE
,
sc
,
sizeof
(
*
sc
)))
if
(
verify_area
(
VERIFY_WRITE
,
sc
,
sizeof
(
*
sc
)))
...
...
arch/ppc64/kernel/signal32.c
View file @
bf306055
This diff is collapsed.
Click to expand it.
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