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
16f6d1c5
Commit
16f6d1c5
authored
Oct 07, 2003
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Reformat bits of include/asm-ppc/uaccess.h.
parent
1368645e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
45 deletions
+67
-45
include/asm-ppc/uaccess.h
include/asm-ppc/uaccess.h
+67
-45
No files found.
include/asm-ppc/uaccess.h
View file @
16f6d1c5
...
@@ -124,17 +124,23 @@ extern long __put_user_bad(void);
...
@@ -124,17 +124,23 @@ extern long __put_user_bad(void);
do { \
do { \
retval = 0; \
retval = 0; \
switch (size) { \
switch (size) { \
case 1: __put_user_asm(x,ptr,retval,"stb"); break; \
case 1: \
case 2: __put_user_asm(x,ptr,retval,"sth"); break; \
__put_user_asm(x, ptr, retval, "stb"); \
case 4: __put_user_asm(x,ptr,retval,"stw"); break; \
break; \
case 8: __put_user_asm2(x,ptr,retval); break; \
case 2: \
default: __put_user_bad(); \
__put_user_asm(x, ptr, retval, "sth"); \
break; \
case 4: \
__put_user_asm(x, ptr, retval, "stw"); \
break; \
case 8: \
__put_user_asm2(x, ptr, retval); \
break; \
default: \
__put_user_bad(); \
} \
} \
} while (0)
} while (0)
struct
__large_struct
{
unsigned
long
buf
[
100
];
};
#define __m(x) (*(struct __large_struct *)(x))
/*
/*
* We don't tell gcc that we are accessing memory, but this is OK
* We don't tell gcc that we are accessing memory, but this is OK
* because we do not write to any memory gcc knows about, so there
* because we do not write to any memory gcc knows about, so there
...
@@ -152,8 +158,8 @@ struct __large_struct { unsigned long buf[100]; };
...
@@ -152,8 +158,8 @@ struct __large_struct { unsigned long buf[100]; };
" .align 2\n" \
" .align 2\n" \
" .long 1b,3b\n" \
" .long 1b,3b\n" \
".previous" \
".previous" \
: "=r"(err) \
: "=r"
(err) \
: "r"
(x), "b"(addr), "i"(-EFAULT), "0"
(err))
: "r"
(x), "b" (addr), "i" (-EFAULT), "0"
(err))
#define __put_user_asm2(x, addr, err) \
#define __put_user_asm2(x, addr, err) \
__asm__ __volatile__( \
__asm__ __volatile__( \
...
@@ -169,69 +175,85 @@ struct __large_struct { unsigned long buf[100]; };
...
@@ -169,69 +175,85 @@ struct __large_struct { unsigned long buf[100]; };
" .long 1b,4b\n" \
" .long 1b,4b\n" \
" .long 2b,4b\n" \
" .long 2b,4b\n" \
".previous" \
".previous" \
: "=r"(err) \
: "=r"
(err) \
: "r"
(x), "b"(addr), "i"(-EFAULT), "0"
(err))
: "r"
(x), "b" (addr), "i" (-EFAULT), "0"
(err))
#define __get_user_nocheck(x,
ptr,size)
\
#define __get_user_nocheck(x,
ptr, size)
\
({ \
({ \
long __gu_err, __gu_val; \
long __gu_err, __gu_val; \
__get_user_size(__gu_val,
(ptr),(size),
__gu_err); \
__get_user_size(__gu_val,
(ptr), (size),
__gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
__gu_err; \
})
})
#define __get_user64_nocheck(x,
ptr,
size) \
#define __get_user64_nocheck(x,
ptr,
size) \
({ \
({ \
long __gu_err; \
long __gu_err; \
long long __gu_val; \
long long __gu_val; \
__get_user_size64(__gu_val,
(ptr),(size),
__gu_err); \
__get_user_size64(__gu_val,
(ptr), (size),
__gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
__gu_err; \
})
})
#define __get_user_check(x,
ptr,
size) \
#define __get_user_check(x,
ptr,
size) \
({ \
({ \
long __gu_err = -EFAULT, __gu_val = 0; \
long __gu_err = -EFAULT, __gu_val = 0; \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ,
__gu_addr,size
)) \
if (access_ok(VERIFY_READ,
__gu_addr, (size)
)) \
__get_user_size(__gu_val,
__gu_addr,(size),
__gu_err); \
__get_user_size(__gu_val,
__gu_addr, (size),
__gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
__gu_err; \
})
})
#define __get_user64_check(x,
ptr,size)
\
#define __get_user64_check(x,
ptr, size)
\
({ \
({ \
long __gu_err = -EFAULT; \
long __gu_err = -EFAULT; \
long long __gu_val = 0; \
long long __gu_val = 0; \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ,
__gu_addr,size))
\
if (access_ok(VERIFY_READ,
__gu_addr, (size)))
\
__get_user_size64(__gu_val,
__gu_addr,(size),__gu_err);
\
__get_user_size64(__gu_val,
__gu_addr, (size), __gu_err);
\
(x) = (__typeof__(*(ptr)))__gu_val; \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
__gu_err; \
})
})
extern
long
__get_user_bad
(
void
);
extern
long
__get_user_bad
(
void
);
#define __get_user_size(x,
ptr,size,
retval) \
#define __get_user_size(x,
ptr, size,
retval) \
do { \
do { \
retval = 0; \
retval = 0; \
switch (size) { \
switch (size) { \
case 1: __get_user_asm(x,ptr,retval,"lbz"); break; \
case 1: \
case 2: __get_user_asm(x,ptr,retval,"lhz"); break; \
__get_user_asm(x, ptr, retval, "lbz"); \
case 4: __get_user_asm(x,ptr,retval,"lwz"); break; \
break; \
default: (x) = __get_user_bad(); \
case 2: \
__get_user_asm(x, ptr, retval, "lhz"); \
break; \
case 4: \
__get_user_asm(x, ptr, retval, "lwz"); \
break; \
default: \
x = __get_user_bad(); \
} \
} \
} while (0)
} while (0)
#define __get_user_size64(x,
ptr,size,
retval) \
#define __get_user_size64(x,
ptr, size,
retval) \
do { \
do { \
retval = 0; \
retval = 0; \
switch (size) { \
switch (size) { \
case 1: __get_user_asm(x,ptr,retval,"lbz"); break; \
case 1: \
case 2: __get_user_asm(x,ptr,retval,"lhz"); break; \
__get_user_asm(x, ptr, retval, "lbz"); \
case 4: __get_user_asm(x,ptr,retval,"lwz"); break; \
break; \
case 8: __get_user_asm2(x, ptr, retval); break; \
case 2: \
default: (x) = __get_user_bad(); \
__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)
} while (0)
...
...
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