From 27cfca1ec98e91261b1a5355d10a8996464b63af Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 17 Mar 1998 22:05:47 +0000 Subject: 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 ... --- include/asm-ppc/uaccess.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include/asm-ppc/uaccess.h') 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 #include +#include #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)) -- cgit v1.2.3