diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
commit | 27cfca1ec98e91261b1a5355d10a8996464b63af (patch) | |
tree | 8e895a53e372fa682b4c0a585b9377d67ed70d0e /include/asm-ppc/uaccess.h | |
parent | 6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff) |
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too
o Upgrade to 2.1.89.
Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'include/asm-ppc/uaccess.h')
-rw-r--r-- | include/asm-ppc/uaccess.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index b1e19ef1f..df3d3d591 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -4,6 +4,7 @@ #ifndef __ASSEMBLY__ #include <linux/sched.h> #include <linux/errno.h> +#include <asm/processor.h> #define VERIFY_READ 0 #define VERIFY_WRITE 1 @@ -16,15 +17,17 @@ * For historical reasons, these macros are grossly misnamed. */ -#define KERNEL_DS (0) -#define USER_DS (1) +#define KERNEL_DS ((mm_segment_t) { 0 }) +#define USER_DS ((mm_segment_t) { 1 }) -#define get_fs() (current->tss.fs) #define get_ds() (KERNEL_DS) +#define get_fs() (current->tss.fs) #define set_fs(val) (current->tss.fs = (val)) +#define segment_eq(a,b) ((a).seg == (b).seg) + +#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) #define __user_ok(addr,size) (((size) <= 0x80000000)&&((addr) <= 0x80000000-(size))) -#define __kernel_ok (get_fs() == KERNEL_DS) #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) |