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
2bbc35cb
Commit
2bbc35cb
authored
Sep 27, 2003
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Plain Diff
Merge samba.org:/home/paulus/kernel/linux-2.5
into samba.org:/home/paulus/kernel/for-linus-ppc
parents
c9c9f146
e1b93c9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
12 deletions
+51
-12
arch/ppc/kernel/signal.c
arch/ppc/kernel/signal.c
+5
-8
include/asm-ppc/uaccess.h
include/asm-ppc/uaccess.h
+44
-1
include/asm-ppc/ucontext.h
include/asm-ppc/ucontext.h
+2
-3
No files found.
arch/ppc/kernel/signal.c
View file @
2bbc35cb
...
...
@@ -272,7 +272,7 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr)
sizeof
(
sr
->
mc_vregs
)))
return
1
;
}
else
if
(
current
->
thread
.
used_vr
)
memset
(
&
current
->
thread
.
vr
,
0
,
sizeof
(
current
->
thread
.
vr
));
memset
(
&
current
->
thread
.
vr
,
0
,
ELF_NVRREG
*
sizeof
(
vector128
));
/* Always get VRSAVE back */
if
(
__get_user
(
current
->
thread
.
vrsave
,
(
u32
*
)
&
sr
->
mc_vregs
[
32
]))
...
...
@@ -328,7 +328,6 @@ handle_rt_signal(unsigned long sig, struct k_sigaction *ka,
&
rt_sf
->
uc
.
uc_stack
.
ss_flags
)
||
__put_user
(
current
->
sas_ss_size
,
&
rt_sf
->
uc
.
uc_stack
.
ss_size
)
||
__put_user
(
&
rt_sf
->
uc
.
uc_mcontext
,
&
rt_sf
->
uc
.
uc_regs
)
||
__copy_to_user
(
&
rt_sf
->
uc
.
uc_oldsigmask
,
oldset
,
sizeof
(
*
oldset
))
||
__copy_to_user
(
&
rt_sf
->
uc
.
uc_sigmask
,
oldset
,
sizeof
(
*
oldset
)))
goto
badframe
;
...
...
@@ -363,12 +362,13 @@ handle_rt_signal(unsigned long sig, struct k_sigaction *ka,
static
int
do_setcontext
(
struct
ucontext
__user
*
ucp
,
struct
pt_regs
*
regs
)
{
sigset_t
set
;
struct
mcontext
*
mcp
;
if
(
__copy_from_user
(
&
set
,
&
ucp
->
uc_sigmask
,
sizeof
(
set
)))
if
(
__copy_from_user
(
&
set
,
&
ucp
->
uc_sigmask
,
sizeof
(
set
))
||
__get_user
(
mcp
,
&
ucp
->
uc_regs
))
return
-
EFAULT
;
restore_sigmask
(
&
set
);
if
(
restore_user_regs
(
regs
,
&
ucp
->
uc_mcontext
))
if
(
restore_user_regs
(
regs
,
mcp
))
return
-
EFAULT
;
return
0
;
...
...
@@ -385,9 +385,6 @@ int sys_swapcontext(struct ucontext __user *old_ctx,
||
save_user_regs
(
regs
,
&
old_ctx
->
uc_mcontext
,
0
)
||
__copy_to_user
(
&
old_ctx
->
uc_sigmask
,
&
current
->
blocked
,
sizeof
(
sigset_t
))
/* the next 2 things aren't strictly necessary */
||
__copy_to_user
(
&
old_ctx
->
uc_oldsigmask
,
&
current
->
blocked
,
sizeof
(
sigset_t
))
||
__put_user
(
&
old_ctx
->
uc_mcontext
,
&
old_ctx
->
uc_regs
))
return
-
EFAULT
;
}
...
...
include/asm-ppc/uaccess.h
View file @
2bbc35cb
...
...
@@ -79,16 +79,28 @@ extern void sort_exception_table(void);
* As we use the same address space for kernel and user data on the
* PowerPC, we can just do these as direct assignments. (Of course, the
* exception handling means that it's no longer "just"...)
*
* The "user64" versions of the user access functions are versions that
* allow access of 64-bit data. The "get_user" functions do not
* properly handle 64-bit data because the value gets down cast to a long.
* The "put_user" functions already handle 64-bit data properly but we add
* "user64" versions for completeness
*/
#define get_user(x,ptr) \
__get_user_check((x),(ptr),sizeof(*(ptr)))
#define get_user64(x,ptr) \
__get_user64_check((x),(ptr),sizeof(*(ptr)))
#define put_user(x,ptr) \
__put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
#define put_user64(x,ptr) put_user(x,ptr)
#define __get_user(x,ptr) \
__get_user_nocheck((x),(ptr),sizeof(*(ptr)))
#define __get_user64(x,ptr) \
__get_user64_nocheck((x),(ptr),sizeof(*(ptr)))
#define __put_user(x,ptr) \
__put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
#define __put_user64(x,ptr) __put_user(x,ptr)
extern
long
__put_user_bad
(
void
);
...
...
@@ -168,6 +180,15 @@ struct __large_struct { unsigned long buf[100]; };
__gu_err; \
})
#define __get_user64_nocheck(x,ptr,size) \
({ \
long __gu_err; \
long long __gu_val; \
__get_user_size64(__gu_val,(ptr),(size),__gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
})
#define __get_user_check(x,ptr,size) \
({ \
long __gu_err = -EFAULT, __gu_val = 0; \
...
...
@@ -178,6 +199,17 @@ struct __large_struct { unsigned long buf[100]; };
__gu_err; \
})
#define __get_user64_check(x,ptr,size) \
({ \
long __gu_err = -EFAULT; \
long long __gu_val = 0; \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ,__gu_addr,size)) \
__get_user_size64(__gu_val,__gu_addr,(size),__gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
})
extern
long
__get_user_bad
(
void
);
#define __get_user_size(x,ptr,size,retval) \
...
...
@@ -187,7 +219,18 @@ do { \
case 1: __get_user_asm(x,ptr,retval,"lbz"); break; \
case 2: __get_user_asm(x,ptr,retval,"lhz"); break; \
case 4: __get_user_asm(x,ptr,retval,"lwz"); break; \
case 8: __get_user_asm2(x, ptr, retval); \
default: (x) = __get_user_bad(); \
} \
} while (0)
#define __get_user_size64(x,ptr,size,retval) \
do { \
retval = 0; \
switch (size) { \
case 1: __get_user_asm(x,ptr,retval,"lbz"); break; \
case 2: __get_user_asm(x,ptr,retval,"lhz"); break; \
case 4: __get_user_asm(x,ptr,retval,"lwz"); break; \
case 8: __get_user_asm2(x, ptr, retval); break; \
default: (x) = __get_user_bad(); \
} \
} while (0)
...
...
include/asm-ppc/ucontext.h
View file @
2bbc35cb
...
...
@@ -16,12 +16,11 @@ struct ucontext {
struct
ucontext
*
uc_link
;
stack_t
uc_stack
;
int
uc_pad
[
7
];
struct
mcontext
*
uc_regs
;
/* backward compat */
sigset_t
uc_oldsigmask
;
/* backward compat */
int
uc_pad2
;
struct
mcontext
*
uc_regs
;
/* points to uc_mcontext field */
sigset_t
uc_sigmask
;
/* glibc has 1024-bit signal masks, ours are 64-bit */
int
uc_maskext
[
30
];
int
uc_pad2
[
3
];
struct
mcontext
uc_mcontext
;
};
...
...
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