[PATCH 27/39] move __addr_ok to uaccess.h
- Date: Fri, 27 Jun 2008 18:34:34 -0300
- From: Glauber Costa <gcosta@xxxxxxxxxx>
- Subject: [PATCH 27/39] move __addr_ok to uaccess.h
Take it out of uaccess_32.h. Since it seems that no users
of the x86_64 exists, we simply pick the i386 version.
Signed-off-by: Glauber Costa <gcosta@xxxxxxxxxx>
---
include/asm-x86/uaccess.h | 4 ++++
include/asm-x86/uaccess_32.h | 4 ----
include/asm-x86/uaccess_64.h | 3 ---
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/include/asm-x86/uaccess.h b/include/asm-x86/uaccess.h
index a06a810..3721513 100644
--- a/include/asm-x86/uaccess.h
+++ b/include/asm-x86/uaccess.h
@@ -33,6 +33,10 @@
#define segment_eq(a, b) ((a).seg == (b).seg)
+#define __addr_ok(addr) \
+ ((unsigned long __force)(addr) < \
+ (current_thread_info()->addr_limit.seg))
+
/*
* Test whether a block of memory is a valid user space address.
* Returns 0 if the range is valid, nonzero otherwise.
diff --git a/include/asm-x86/uaccess_32.h b/include/asm-x86/uaccess_32.h
index 3cc3236..87b1aed 100644
--- a/include/asm-x86/uaccess_32.h
+++ b/include/asm-x86/uaccess_32.h
@@ -20,10 +20,6 @@ extern struct movsl_mask {
} ____cacheline_aligned_in_smp movsl_mask;
#endif
-#define __addr_ok(addr) \
- ((unsigned long __force)(addr) < \
- (current_thread_info()->addr_limit.seg))
-
extern void __put_user_bad(void);
/*
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 4a44b90..8130876 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -9,9 +9,6 @@
#include <linux/prefetch.h>
#include <asm/page.h>
-#define __addr_ok(addr) (!((unsigned long)(addr) & \
- (current_thread_info()->addr_limit.seg)))
-
#define ARCH_HAS_SEARCH_EXTABLE
extern void __put_user_1(void);
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- [PATCH 28/39] use k modifier for 4-byte access.
- From: Glauber Costa
- [PATCH 28/39] use k modifier for 4-byte access.
- References:
- [PATCH 0/39] Merge files at x86/lib
- From: Glauber Costa
- [PATCH 01/39] Don't use size specifiers
- From: Glauber Costa
- [PATCH 02/39] provide delay loop for x86_64
- From: Glauber Costa
- [PATCH 03/39] use rdtscll in read_current_timer for i386.
- From: Glauber Costa
- [PATCH 04/39] explicitly use edx in const delay function.
- From: Glauber Costa
- [PATCH 05/39] integrate delay functions
- From: Glauber Costa
- [PATCH 06/39] use something common for both architectures
- From: Glauber Costa
- [PATCH 07/39] don't clobber r8 nor use rcx
- From: Glauber Costa
- [PATCH 08/39] don't use word-size specifiers
- From: Glauber Costa
- [PATCH 09/39] adapt x86_64 getuser functions
- From: Glauber Costa
- [PATCH 10/39] rename threadinfo to TI
- From: Glauber Costa
- [PATCH 11/39] Don't use word-size specifiers on getuser_64
- From: Glauber Costa
- [PATCH 12/39] introduce __ASM_REG macro
- From: Glauber Costa
- [PATCH 13/39] use _ASM_PTR instead of explicit word-size pointers
- From: Glauber Costa
- [PATCH 14/39] merge getuser asm functions
- From: Glauber Costa
- [PATCH 15/39] don't save ebx in putuser_32.S
- From: Glauber Costa
- [PATCH 16/39] user put_user_x instead of all variants.
- From: Glauber Costa
- [PATCH 17/39] clobber rbx in putuser_64.S
- From: Glauber Costa
- [PATCH 18/39] pass argument to putuser_64 functions in ax register.
- From: Glauber Costa
- [PATCH 19/39] change testing logic in putuser_64.S
- From: Glauber Costa
- [PATCH 20/39] replace function headers by macros
- From: Glauber Costa
- [PATCH 21/39] don't use word-size specifiers in putuser files
- From: Glauber Costa
- [PATCH 22/39] use macros from asm.h
- From: Glauber Costa
- [PATCH 23/39] merge putuser asm functions
- From: Glauber Costa
- [PATCH 24/39] commonize __range_not_ok
- From: Glauber Costa
- [PATCH 25/39] merge common parts of uaccess.
- From: Glauber Costa
- [PATCH 26/39] merge getuser
- From: Glauber Costa
- [PATCH 0/39] Merge files at x86/lib
- Prev by Date: [PATCH 25/39] merge common parts of uaccess.
- Next by Date: [PATCH 29/39] mark x86_64 as having a working WP.
- Previous by thread: [PATCH 26/39] merge getuser
- Next by thread: [PATCH 28/39] use k modifier for 4-byte access.
- Index(es):