From 01015033ec08eb1dbbd61c6e309c76cc7f95ca3d Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Wed, 25 Jun 2008 10:14:13 -0300 Subject: [PATCH] --- yaml --- r: 100063 b: refs/heads/master c: 53938a68a2f971058bc53aaa8c70f9f24f684cdc h: refs/heads/master i: 100061: a974d00a63f33c4835887acfcd50a81bbfa9eded 100059: 8898b03e14230134e0d3c7b4dc68cb75bdba0c61 100055: f41fb6ae3e893d5d826b1e8f737c72dd7204ef41 100047: b35bc7a41f0752bc994af4adf7c7c8b001b0ec13 100031: 256a2f1b99b1e5ac6addb6afee750544d14715db v: v3 --- [refs] | 2 +- trunk/include/asm-x86/uaccess_32.h | 6 +++--- trunk/include/asm-x86/uaccess_64.h | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 080118a6067c..62c6217a0b86 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5cbbc3b1eb37bdc72eefd2de03b39f5e784400c2 +refs/heads/master: 53938a68a2f971058bc53aaa8c70f9f24f684cdc diff --git a/trunk/include/asm-x86/uaccess_32.h b/trunk/include/asm-x86/uaccess_32.h index f8abc12a77c2..8d3f02d3562c 100644 --- a/trunk/include/asm-x86/uaccess_32.h +++ b/trunk/include/asm-x86/uaccess_32.h @@ -56,11 +56,11 @@ extern struct movsl_mask { * * This needs 33-bit arithmetic. We have a carry... */ -#define __range_ok(addr, size) \ +#define __range_not_ok(addr, size) \ ({ \ unsigned long flag, roksum; \ __chk_user_ptr(addr); \ - asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \ + asm("add %3,%1 ; sbb %0,%0; cmp %1,%4; sbb $0,%0" \ :"=&r" (flag), "=r" (roksum) \ :"1" (addr), "g" ((int)(size)), \ "rm" (current_thread_info()->addr_limit.seg)); \ @@ -86,7 +86,7 @@ extern struct movsl_mask { * checks that the pointer is in the user space range - after calling * this function, memory access functions may still return -EFAULT. */ -#define access_ok(type, addr, size) (likely(__range_ok(addr, size) == 0)) +#define access_ok(type, addr, size) (likely(__range_not_ok(addr, size) == 0)) /* * The exception table consists of pairs of addresses: the first is the diff --git a/trunk/include/asm-x86/uaccess_64.h b/trunk/include/asm-x86/uaccess_64.h index f822a36cc1c0..012cba3972d7 100644 --- a/trunk/include/asm-x86/uaccess_64.h +++ b/trunk/include/asm-x86/uaccess_64.h @@ -41,8 +41,7 @@ ({ \ unsigned long flag, roksum; \ __chk_user_ptr(addr); \ - asm("# range_ok\n\r" \ - "addq %3,%1 ; sbbq %0,%0 ; cmpq %1,%4 ; sbbq $0,%0" \ + asm("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0" \ : "=&r" (flag), "=r" (roksum) \ : "1" (addr), "g" ((long)(size)), \ "g" (current_thread_info()->addr_limit.seg)); \