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
628d0dd8
Commit
628d0dd8
authored
Jan 18, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Plain Diff
Merge samba.org:/scratch/anton/linux-2.5
into samba.org:/scratch/anton/for-alan
parents
6a3354a9
e830a045
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
86 deletions
+50
-86
arch/ppc64/kernel/misc.S
arch/ppc64/kernel/misc.S
+2
-2
arch/ppc64/kernel/signal32.c
arch/ppc64/kernel/signal32.c
+18
-68
arch/ppc64/kernel/sys_ppc32.c
arch/ppc64/kernel/sys_ppc32.c
+21
-4
include/asm-ppc64/compat.h
include/asm-ppc64/compat.h
+7
-0
include/asm-ppc64/ppc32.h
include/asm-ppc64/ppc32.h
+2
-12
No files found.
arch/ppc64/kernel/misc.S
View file @
628d0dd8
...
...
@@ -541,7 +541,7 @@ _GLOBAL(sys_call_table32)
.
llong
.
sys_setreuid
/*
70
*/
.
llong
.
sys_setregid
.
llong
.
sys32_sigsuspend
.
llong
.
sys32
_sigpending
.
llong
.
compat_sys
_sigpending
.
llong
.
sys32_sethostname
.
llong
.
sys32_setrlimit
/*
75
*/
.
llong
.
sys32_old_getrlimit
...
...
@@ -594,7 +594,7 @@ _GLOBAL(sys_call_table32)
.
llong
.
sys_ni_syscall
/*
old
modify_ldt
syscall
*/
.
llong
.
sys32_adjtimex
.
llong
.
sys_mprotect
/*
125
*/
.
llong
.
sys32
_sigprocmask
.
llong
.
compat_sys
_sigprocmask
.
llong
.
sys_ni_syscall
/*
old
create_module
syscall
*/
.
llong
.
sys32_init_module
.
llong
.
sys32_delete_module
...
...
arch/ppc64/kernel/signal32.c
View file @
628d0dd8
...
...
@@ -104,8 +104,6 @@ struct rt_sigframe_32 {
*
* System Calls
* sigaction sys32_sigaction
* sigpending sys32_sigpending
* sigprocmask sys32_sigprocmask
* sigreturn sys32_sigreturn
*
* Note sigsuspend has no special 32 bit routine - uses the 64 bit routine
...
...
@@ -161,7 +159,7 @@ long sys32_sigaction(int sig, struct old_sigaction32 *act,
sig
=
-
sig
;
if
(
act
)
{
old_sigset_t32
mask
;
compat_old_sigset_t
mask
;
if
(
get_user
((
long
)
new_ka
.
sa
.
sa_handler
,
&
act
->
sa_handler
)
||
__get_user
((
long
)
new_ka
.
sa
.
sa_restorer
,
&
act
->
sa_restorer
)
||
...
...
@@ -184,54 +182,6 @@ long sys32_sigaction(int sig, struct old_sigaction32 *act,
}
extern
long
sys_sigpending
(
old_sigset_t
*
set
);
long
sys32_sigpending
(
old_sigset_t32
*
set
)
{
old_sigset_t
s
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_sigpending
(
&
s
);
set_fs
(
old_fs
);
if
(
put_user
(
s
,
set
))
return
-
EFAULT
;
return
ret
;
}
extern
long
sys_sigprocmask
(
int
how
,
old_sigset_t
*
set
,
old_sigset_t
*
oset
);
/*
* Note: it is necessary to treat how as an unsigned int, with the
* corresponding cast to a signed int to insure that the proper
* conversion (sign extension) between the register representation
* of a signed int (msr in 32-bit mode) and the register representation
* of a signed int (msr in 64-bit mode) is performed.
*/
long
sys32_sigprocmask
(
u32
how
,
old_sigset_t32
*
set
,
old_sigset_t32
*
oset
)
{
old_sigset_t
s
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
if
(
set
&&
get_user
(
s
,
set
))
return
-
EFAULT
;
set_fs
(
KERNEL_DS
);
ret
=
sys_sigprocmask
((
int
)
how
,
set
?
&
s
:
NULL
,
oset
?
&
s
:
NULL
);
set_fs
(
old_fs
);
if
(
ret
)
return
ret
;
if
(
oset
&&
put_user
(
s
,
oset
))
return
-
EFAULT
;
return
0
;
}
/*
* When we have signals to deliver, we set up on the
* user stack, going down from the original stack pointer:
...
...
@@ -565,16 +515,16 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 *act,
{
struct
k_sigaction
new_ka
,
old_ka
;
int
ret
;
sigset32
_t
set32
;
compat_sigset
_t
set32
;
/* XXX: Don't preclude handling different sized sigset_t's. */
if
(
sigsetsize
!=
sizeof
(
sigset32
_t
))
if
(
sigsetsize
!=
sizeof
(
compat_sigset
_t
))
return
-
EINVAL
;
if
(
act
)
{
ret
=
get_user
((
long
)
new_ka
.
sa
.
sa_handler
,
&
act
->
sa_handler
);
ret
|=
__copy_from_user
(
&
set32
,
&
act
->
sa_mask
,
sizeof
(
sigset32
_t
));
sizeof
(
compat_sigset
_t
));
switch
(
_NSIG_WORDS
)
{
case
4
:
new_ka
.
sa
.
sa_mask
.
sig
[
3
]
=
set32
.
sig
[
6
]
|
(((
long
)
set32
.
sig
[
7
])
<<
32
);
...
...
@@ -608,7 +558,7 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 *act,
}
ret
=
put_user
((
long
)
old_ka
.
sa
.
sa_handler
,
&
oact
->
sa_handler
);
ret
|=
__copy_to_user
(
&
oact
->
sa_mask
,
&
set32
,
sizeof
(
sigset32
_t
));
sizeof
(
compat_sigset
_t
));
ret
|=
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
);
}
return
ret
;
...
...
@@ -625,16 +575,16 @@ extern long sys_rt_sigprocmask(int how, sigset_t *set,
* of a signed int (msr in 32-bit mode) and the register representation
* of a signed int (msr in 64-bit mode) is performed.
*/
long
sys32_rt_sigprocmask
(
u32
how
,
sigset32
_t
*
set
,
sigset32
_t
*
oset
,
size_t
sigsetsize
)
long
sys32_rt_sigprocmask
(
u32
how
,
compat_sigset
_t
*
set
,
compat_sigset
_t
*
oset
,
size_t
sigsetsize
)
{
sigset_t
s
;
sigset32
_t
s32
;
compat_sigset
_t
s32
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
if
(
set
)
{
if
(
copy_from_user
(
&
s32
,
set
,
sizeof
(
sigset32
_t
)))
if
(
copy_from_user
(
&
s32
,
set
,
sizeof
(
compat_sigset
_t
)))
return
-
EFAULT
;
switch
(
_NSIG_WORDS
)
{
...
...
@@ -658,7 +608,7 @@ long sys32_rt_sigprocmask(u32 how, sigset32_t *set,
case
2
:
s32
.
sig
[
3
]
=
(
s
.
sig
[
1
]
>>
32
);
s32
.
sig
[
2
]
=
s
.
sig
[
1
];
case
1
:
s32
.
sig
[
1
]
=
(
s
.
sig
[
0
]
>>
32
);
s32
.
sig
[
0
]
=
s
.
sig
[
0
];
}
if
(
copy_to_user
(
oset
,
&
s32
,
sizeof
(
sigset32
_t
)))
if
(
copy_to_user
(
oset
,
&
s32
,
sizeof
(
compat_sigset
_t
)))
return
-
EFAULT
;
}
return
0
;
...
...
@@ -668,10 +618,10 @@ long sys32_rt_sigprocmask(u32 how, sigset32_t *set,
extern
long
sys_rt_sigpending
(
sigset_t
*
set
,
size_t
sigsetsize
);
long
sys32_rt_sigpending
(
sigset32
_t
*
set
,
compat_size_t
sigsetsize
)
long
sys32_rt_sigpending
(
compat_sigset
_t
*
set
,
compat_size_t
sigsetsize
)
{
sigset_t
s
;
sigset32
_t
s32
;
compat_sigset
_t
s32
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
...
...
@@ -685,7 +635,7 @@ long sys32_rt_sigpending(sigset32_t *set, compat_size_t sigsetsize)
case
2
:
s32
.
sig
[
3
]
=
(
s
.
sig
[
1
]
>>
32
);
s32
.
sig
[
2
]
=
s
.
sig
[
1
];
case
1
:
s32
.
sig
[
1
]
=
(
s
.
sig
[
0
]
>>
32
);
s32
.
sig
[
0
]
=
s
.
sig
[
0
];
}
if
(
copy_to_user
(
set
,
&
s32
,
sizeof
(
sigset32
_t
)))
if
(
copy_to_user
(
set
,
&
s32
,
sizeof
(
compat_sigset
_t
)))
return
-
EFAULT
;
}
return
ret
;
...
...
@@ -739,17 +689,17 @@ extern long sys_rt_sigtimedwait(const sigset_t *uthese,
siginfo_t
*
uinfo
,
const
struct
timespec
*
uts
,
size_t
sigsetsize
);
long
sys32_rt_sigtimedwait
(
sigset32
_t
*
uthese
,
siginfo_t32
*
uinfo
,
long
sys32_rt_sigtimedwait
(
compat_sigset
_t
*
uthese
,
siginfo_t32
*
uinfo
,
struct
compat_timespec
*
uts
,
compat_size_t
sigsetsize
)
{
sigset_t
s
;
sigset32
_t
s32
;
compat_sigset
_t
s32
;
struct
timespec
t
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
siginfo_t
info
;
if
(
copy_from_user
(
&
s32
,
uthese
,
sizeof
(
sigset32
_t
)))
if
(
copy_from_user
(
&
s32
,
uthese
,
sizeof
(
compat_sigset
_t
)))
return
-
EFAULT
;
switch
(
_NSIG_WORDS
)
{
case
4
:
s
.
sig
[
3
]
=
s32
.
sig
[
6
]
|
(((
long
)
s32
.
sig
[
7
])
<<
32
);
...
...
@@ -837,11 +787,11 @@ long sys32_rt_sigqueueinfo(u32 pid, u32 sig, siginfo_t32 *uinfo)
return
ret
;
}
int
sys32_rt_sigsuspend
(
sigset32
_t
*
unewset
,
size_t
sigsetsize
,
int
p3
,
int
sys32_rt_sigsuspend
(
compat_sigset
_t
*
unewset
,
size_t
sigsetsize
,
int
p3
,
int
p4
,
int
p6
,
int
p7
,
struct
pt_regs
*
regs
)
{
sigset_t
saveset
,
newset
;
sigset32
_t
s32
;
compat_sigset
_t
s32
;
/* XXX: Don't preclude handling different sized sigset_t's. */
if
(
sigsetsize
!=
sizeof
(
sigset_t
))
...
...
arch/ppc64/kernel/sys_ppc32.c
View file @
628d0dd8
...
...
@@ -2756,10 +2756,27 @@ static void cmsg32_recvmsg_fixup(struct msghdr *kmsg, unsigned long orig_cmsg_up
__get_user
(
kcmsg32
->
cmsg_type
,
&
ucmsg
->
cmsg_type
);
clen64
=
kcmsg32
->
cmsg_len
;
copy_from_user
(
CMSG32_DATA
(
kcmsg32
),
CMSG_DATA
(
ucmsg
),
clen64
-
CMSG_ALIGN
(
sizeof
(
*
ucmsg
)));
clen32
=
((
clen64
-
CMSG_ALIGN
(
sizeof
(
*
ucmsg
)))
+
CMSG32_ALIGN
(
sizeof
(
struct
cmsghdr32
)));
if
(
kcmsg32
->
cmsg_level
==
SOL_SOCKET
&&
kcmsg32
->
cmsg_type
==
SO_TIMESTAMP
)
{
struct
timeval
tv
;
struct
compat_timeval
*
tv32
;
if
(
clen64
!=
CMSG_LEN
(
sizeof
(
struct
timeval
)))
{
kfree
(
workbuf
);
goto
fail
;
}
copy_from_user
(
&
tv
,
CMSG_DATA
(
ucmsg
),
sizeof
(
tv
));
tv32
=
(
struct
compat_timeval
*
)
CMSG32_DATA
(
kcmsg32
);
tv32
->
tv_sec
=
tv
.
tv_sec
;
tv32
->
tv_usec
=
tv
.
tv_usec
;
clen32
=
sizeof
(
*
tv32
)
+
CMSG32_ALIGN
(
sizeof
(
struct
cmsghdr32
));
}
else
{
copy_from_user
(
CMSG32_DATA
(
kcmsg32
),
CMSG_DATA
(
ucmsg
),
clen64
-
CMSG_ALIGN
(
sizeof
(
*
ucmsg
)));
clen32
=
((
clen64
-
CMSG_ALIGN
(
sizeof
(
*
ucmsg
)))
+
CMSG32_ALIGN
(
sizeof
(
struct
cmsghdr32
)));
}
kcmsg32
->
cmsg_len
=
clen32
;
switch
(
kcmsg32
->
cmsg_type
)
{
...
...
include/asm-ppc64/compat.h
View file @
628d0dd8
...
...
@@ -77,4 +77,11 @@ struct compat_statfs {
int
f_spare
[
6
];
};
typedef
u32
compat_old_sigset_t
;
#define _COMPAT_NSIG 64
#define _COMPAT_NSIG_BPW 32
typedef
u32
compat_sigset_word
;
#endif
/* _ASM_PPC64_COMPAT_H */
include/asm-ppc64/ppc32.h
View file @
628d0dd8
...
...
@@ -94,32 +94,22 @@ typedef struct siginfo32 {
}
_sifields
;
}
siginfo_t32
;
#define __old_sigset_t32 old_sigset_t32
#define __old_sigaction32 old_sigaction32
typedef
unsigned
int
__old_sigset_t32
;
struct
__old_sigaction32
{
unsigned
sa_handler
;
__old_sigset_t32
sa_mask
;
compat_old_sigset_t
sa_mask
;
unsigned
int
sa_flags
;
unsigned
sa_restorer
;
/* not used by Linux/SPARC yet */
};
#define _PPC32_NSIG 64
#define _PPC32_NSIG_BPW 32
#define _PPC32_NSIG_WORDS (_PPC32_NSIG / _PPC32_NSIG_BPW)
typedef
struct
{
unsigned
int
sig
[
_PPC32_NSIG_WORDS
];
}
sigset32_t
;
struct
sigaction32
{
unsigned
int
sa_handler
;
/* Really a pointer, but need to deal with 32 bits */
unsigned
int
sa_flags
;
unsigned
int
sa_restorer
;
/* Another 32 bit pointer */
sigset32
_t
sa_mask
;
/* A 32 bit mask */
compat_sigset
_t
sa_mask
;
/* A 32 bit mask */
};
typedef
struct
sigaltstack_32
{
...
...
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