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
0a440cec
Commit
0a440cec
authored
Aug 31, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: Add sys_waitid support.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
dc9267f0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
71 deletions
+117
-71
arch/sparc/kernel/systbls.S
arch/sparc/kernel/systbls.S
+1
-1
arch/sparc64/kernel/signal32.c
arch/sparc64/kernel/signal32.c
+74
-3
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+24
-4
arch/sparc64/kernel/systbls.S
arch/sparc64/kernel/systbls.S
+2
-2
include/asm-sparc/unistd.h
include/asm-sparc/unistd.h
+6
-5
include/asm-sparc64/siginfo.h
include/asm-sparc64/siginfo.h
+3
-51
include/asm-sparc64/unistd.h
include/asm-sparc64/unistd.h
+7
-5
No files found.
arch/sparc/kernel/systbls.S
View file @
0a440cec
...
...
@@ -74,7 +74,7 @@ sys_call_table:
/*
260
*/
.
long
sys_sched_getaffinity
,
sys_sched_setaffinity
,
sys_timer_settime
,
sys_timer_gettime
,
sys_timer_getoverrun
/*
265
*/
.
long
sys_timer_delete
,
sys_timer_create
,
sys_nis_syscall
,
sys_io_setup
,
sys_io_destroy
/*
270
*/
.
long
sys_io_submit
,
sys_io_cancel
,
sys_io_getevents
,
sys_mq_open
,
sys_mq_unlink
/*
275
*/
.
long
sys_mq_timedsend
,
sys_mq_timedreceive
,
sys_mq_notify
,
sys_mq_getsetattr
,
sys_
ni_syscall
/*
275
*/
.
long
sys_mq_timedsend
,
sys_mq_timedreceive
,
sys_mq_notify
,
sys_mq_getsetattr
,
sys_
waitid
/*
280
*/
.
long
sys_ni_syscall
,
sys_ni_syscall
,
sys_ni_syscall
#ifdef CONFIG_SUNOS_EMUL
...
...
arch/sparc64/kernel/signal32.c
View file @
0a440cec
...
...
@@ -86,9 +86,62 @@ struct new_signal_frame32 {
__siginfo_fpu_t
fpu_state
;
};
struct
siginfo32
{
int
si_signo
;
int
si_errno
;
int
si_code
;
union
{
int
_pad
[
SI_PAD_SIZE32
];
/* kill() */
struct
{
compat_pid_t
_pid
;
/* sender's pid */
unsigned
int
_uid
;
/* sender's uid */
}
_kill
;
/* POSIX.1b timers */
struct
{
timer_t
_tid
;
/* timer id */
int
_overrun
;
/* overrun count */
sigval_t32
_sigval
;
/* same as below */
int
_sys_private
;
/* not to be passed to user */
}
_timer
;
/* POSIX.1b signals */
struct
{
compat_pid_t
_pid
;
/* sender's pid */
unsigned
int
_uid
;
/* sender's uid */
sigval_t32
_sigval
;
}
_rt
;
/* SIGCHLD */
struct
{
compat_pid_t
_pid
;
/* which child */
unsigned
int
_uid
;
/* sender's uid */
int
_status
;
/* exit code */
compat_clock_t
_utime
;
compat_clock_t
_stime
;
struct
compat_rusage
_rusage
;
}
_sigchld
;
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
struct
{
u32
_addr
;
/* faulting insn/memory ref. */
int
_trapno
;
}
_sigfault
;
/* SIGPOLL */
struct
{
int
_band
;
/* POLL_IN, POLL_OUT, POLL_MSG */
int
_fd
;
}
_sigpoll
;
}
_sifields
;
};
struct
rt_signal_frame32
{
struct
sparc_stackf32
ss
;
s
iginfo_t32
info
;
s
truct
siginfo32
info
;
struct
pt_regs32
regs
;
compat_sigset_t
mask
;
/* __siginfo_fpu32_t * */
u32
fpu_save
;
...
...
@@ -105,11 +158,11 @@ struct rt_signal_frame32 {
#define NF_ALIGNEDSZ (((sizeof(struct new_signal_frame32) + 7) & (~7)))
#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7)))
int
copy_siginfo_to_user32
(
s
iginfo_t
32
__user
*
to
,
siginfo_t
*
from
)
int
copy_siginfo_to_user32
(
s
truct
siginfo
32
__user
*
to
,
siginfo_t
*
from
)
{
int
err
;
if
(
!
access_ok
(
VERIFY_WRITE
,
to
,
sizeof
(
s
iginfo_t
32
)))
if
(
!
access_ok
(
VERIFY_WRITE
,
to
,
sizeof
(
s
truct
siginfo
32
)))
return
-
EFAULT
;
/* If you change siginfo_t structure, please be sure
...
...
@@ -135,6 +188,8 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from)
err
|=
__put_user
(
from
->
si_utime
,
&
to
->
si_utime
);
err
|=
__put_user
(
from
->
si_stime
,
&
to
->
si_stime
);
err
|=
__put_user
(
from
->
si_status
,
&
to
->
si_status
);
err
|=
put_compat_rusage
(
&
from
->
si_rusage
,
&
to
->
si_rusage
);
default:
err
|=
__put_user
(
from
->
si_pid
,
&
to
->
si_pid
);
err
|=
__put_user
(
from
->
si_uid
,
&
to
->
si_uid
);
...
...
@@ -155,6 +210,22 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from)
return
err
;
}
/* CAUTION: This is just a very minimalist implementation for the
* sake of compat_sys_rt_sigqueueinfo()
*/
int
copy_siginfo_to_kernel32
(
siginfo_t
*
to
,
struct
siginfo32
__user
*
from
)
{
if
(
!
access_ok
(
VERIFY_WRITE
,
from
,
sizeof
(
struct
siginfo32
)))
return
-
EFAULT
;
if
(
copy_from_user
(
to
,
from
,
3
*
sizeof
(
int
))
||
copy_from_user
(
to
->
_sifields
.
_pad
,
from
->
_sifields
.
_pad
,
SI_PAD_SIZE
))
return
-
EFAULT
;
return
0
;
}
/*
* atomically swap in the new signal mask, and wait for a signal.
* This is really tricky on the Sparc, watch out...
...
...
arch/sparc64/kernel/sys_sparc32.c
View file @
0a440cec
...
...
@@ -1045,7 +1045,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
}
asmlinkage
long
sys32_rt_sigtimedwait
(
compat_sigset_t
__user
*
uthese
,
s
iginfo_t
32
__user
*
uinfo
,
s
truct
siginfo
32
__user
*
uinfo
,
struct
compat_timespec
__user
*
uts
,
compat_size_t
sigsetsize
)
{
...
...
@@ -1130,15 +1130,15 @@ asmlinkage long sys32_rt_sigtimedwait(compat_sigset_t __user *uthese,
}
asmlinkage
long
compat_sys_rt_sigqueueinfo
(
int
pid
,
int
sig
,
s
iginfo_t
32
__user
*
uinfo
)
s
truct
siginfo
32
__user
*
uinfo
)
{
siginfo_t
info
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
if
(
copy_from_user
(
&
info
,
uinfo
,
3
*
sizeof
(
int
))
||
copy_from_user
(
info
.
_sifields
.
_pad
,
uinfo
->
_sifields
.
_pad
,
SI_PAD_SIZE
))
if
(
copy_siginfo_to_kernel32
(
&
info
,
uinfo
))
return
-
EFAULT
;
set_fs
(
KERNEL_DS
);
ret
=
sys_rt_sigqueueinfo
(
pid
,
sig
,
(
siginfo_t
__user
*
)
&
info
);
set_fs
(
old_fs
);
...
...
@@ -1736,3 +1736,23 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32,
return
err
;
}
asmlinkage
long
compat_sys_waitid
(
u32
which
,
u32
pid
,
struct
siginfo32
__user
*
uinfo
,
u32
options
)
{
siginfo_t
info
;
long
ret
;
mm_segment_t
old_fs
=
get_fs
();
memset
(
&
info
,
0
,
sizeof
(
info
));
set_fs
(
KERNEL_DS
);
ret
=
sys_waitid
((
int
)
which
,
(
compat_pid_t
)
pid
,
(
siginfo_t
__user
*
)
&
info
,
(
int
)
options
);
set_fs
(
old_fs
);
if
(
ret
<
0
||
info
.
si_signo
==
0
)
return
ret
;
BUG_ON
(
info
.
si_code
&
__SI_MASK
);
info
.
si_code
|=
__SI_CHLD
;
return
copy_siginfo_to_user32
(
uinfo
,
&
info
);
}
arch/sparc64/kernel/systbls.S
View file @
0a440cec
...
...
@@ -75,7 +75,7 @@ sys_call_table32:
/*
260
*/
.
word
compat_sys_sched_getaffinity
,
compat_sys_sched_setaffinity
,
sys32_timer_settime
,
compat_timer_gettime
,
sys_timer_getoverrun
.
word
sys_timer_delete
,
sys32_timer_create
,
sys_ni_syscall
,
compat_sys_io_setup
,
sys_io_destroy
/*
270
*/
.
word
sys32_io_submit
,
sys_io_cancel
,
compat_sys_io_getevents
,
sys32_mq_open
,
sys_mq_unlink
.
word
sys_mq_timedsend
,
sys_mq_timedreceive
,
compat_sys_mq_notify
,
compat_sys_mq_getsetattr
,
sys_ni_syscall
.
word
sys_mq_timedsend
,
sys_mq_timedreceive
,
compat_sys_mq_notify
,
compat_sys_mq_getsetattr
,
compat_sys_waitid
/*
280
*/
.
word
sys_ni_syscall
,
sys_ni_syscall
,
sys_ni_syscall
#endif /* CONFIG_COMPAT */
...
...
@@ -141,7 +141,7 @@ sys_call_table:
/*
260
*/
.
word
sys_sched_getaffinity
,
sys_sched_setaffinity
,
sys_timer_settime
,
sys_timer_gettime
,
sys_timer_getoverrun
.
word
sys_timer_delete
,
sys_timer_create
,
sys_ni_syscall
,
sys_io_setup
,
sys_io_destroy
/*
270
*/
.
word
sys_io_submit
,
sys_io_cancel
,
sys_io_getevents
,
sys_mq_open
,
sys_mq_unlink
.
word
sys_mq_timedsend
,
sys_mq_timedreceive
,
sys_mq_notify
,
sys_mq_getsetattr
,
sys_
ni_syscall
.
word
sys_mq_timedsend
,
sys_mq_timedreceive
,
sys_mq_notify
,
sys_mq_getsetattr
,
sys_
waitid
/*
280
*/
.
word
sys_ni_syscall
,
sys_ni_syscall
,
sys_ni_syscall
#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
...
...
include/asm-sparc/unistd.h
View file @
0a440cec
...
...
@@ -290,11 +290,12 @@
#define __NR_io_cancel 271
#define __NR_io_getevents 272
#define __NR_mq_open 273
#define __NR_mq_unlink (__NR_mq_open+1)
#define __NR_mq_timedsend (__NR_mq_open+2)
#define __NR_mq_timedreceive (__NR_mq_open+3)
#define __NR_mq_notify (__NR_mq_open+4)
#define __NR_mq_getsetattr (__NR_mq_open+5)
#define __NR_mq_unlink 274
#define __NR_mq_timedsend 275
#define __NR_mq_timedreceive 276
#define __NR_mq_notify 277
#define __NR_mq_getsetattr 278
#define __NR_waitid 279
/* WARNING: You MAY NOT add syscall numbers larger than 282, since
* all of the syscall tables in the Sparc kernel are
...
...
include/asm-sparc64/siginfo.h
View file @
0a440cec
...
...
@@ -24,57 +24,8 @@ typedef union sigval32 {
u32
sival_ptr
;
}
sigval_t32
;
typedef
struct
siginfo32
{
int
si_signo
;
int
si_errno
;
int
si_code
;
struct
siginfo32
;
union
{
int
_pad
[
SI_PAD_SIZE32
];
/* kill() */
struct
{
compat_pid_t
_pid
;
/* sender's pid */
unsigned
int
_uid
;
/* sender's uid */
}
_kill
;
/* POSIX.1b timers */
struct
{
timer_t
_tid
;
/* timer id */
int
_overrun
;
/* overrun count */
sigval_t32
_sigval
;
/* same as below */
int
_sys_private
;
/* not to be passed to user */
}
_timer
;
/* POSIX.1b signals */
struct
{
compat_pid_t
_pid
;
/* sender's pid */
unsigned
int
_uid
;
/* sender's uid */
sigval_t32
_sigval
;
}
_rt
;
/* SIGCHLD */
struct
{
compat_pid_t
_pid
;
/* which child */
unsigned
int
_uid
;
/* sender's uid */
int
_status
;
/* exit code */
compat_clock_t
_utime
;
compat_clock_t
_stime
;
}
_sigchld
;
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
struct
{
u32
_addr
;
/* faulting insn/memory ref. */
int
_trapno
;
}
_sigfault
;
/* SIGPOLL */
struct
{
int
_band
;
/* POLL_IN, POLL_OUT, POLL_MSG */
int
_fd
;
}
_sigpoll
;
}
_sifields
;
}
siginfo_t32
;
#endif
/* CONFIG_COMPAT */
#endif
/* __KERNEL__ */
...
...
@@ -105,7 +56,8 @@ typedef struct sigevent32 {
}
_sigev_un
;
}
sigevent_t32
;
extern
int
copy_siginfo_to_user32
(
siginfo_t32
__user
*
to
,
siginfo_t
*
from
);
extern
int
copy_siginfo_to_user32
(
struct
siginfo32
__user
*
to
,
siginfo_t
*
from
);
extern
int
copy_siginfo_to_kernel32
(
siginfo_t
*
to
,
struct
siginfo32
__user
*
from
);
#endif
/* CONFIG_COMPAT */
...
...
include/asm-sparc64/unistd.h
View file @
0a440cec
...
...
@@ -292,11 +292,13 @@
#define __NR_io_cancel 271
#define __NR_io_getevents 272
#define __NR_mq_open 273
#define __NR_mq_unlink (__NR_mq_open+1)
#define __NR_mq_timedsend (__NR_mq_open+2)
#define __NR_mq_timedreceive (__NR_mq_open+3)
#define __NR_mq_notify (__NR_mq_open+4)
#define __NR_mq_getsetattr (__NR_mq_open+5)
#define __NR_mq_unlink 274
#define __NR_mq_timedsend 275
#define __NR_mq_timedreceive 276
#define __NR_mq_notify 277
#define __NR_mq_getsetattr 278
#define __NR_waitid 279
/* WARNING: You MAY NOT add syscall numbers larger than 282, since
* all of the syscall tables in the Sparc kernel are
* sized to have 283 entries (starting at zero). Therefore
...
...
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