diff options
author | Michal Simek <monstr@monstr.eu> | 2010-03-05 09:34:12 -0500 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-04-01 02:38:19 -0400 |
commit | 40db0834337ef0cde586feeb5588e45f0349098b (patch) | |
tree | cd5b0fe32e2416bb5a39591a479f904427d436ff /arch/microblaze/include/asm/uaccess.h | |
parent | 4009819cf90c26e3ec7b0ed949d5ff37c568e197 (diff) |
microblaze: Remove segment.h
I would like to use asm-generic uaccess.h where are segment
macros defined. This is just first step.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/include/asm/uaccess.h')
-rw-r--r-- | arch/microblaze/include/asm/uaccess.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index 371bd6e56d9a..a8f794d03c5f 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h | |||
@@ -22,12 +22,40 @@ | |||
22 | #include <asm/mmu.h> | 22 | #include <asm/mmu.h> |
23 | #include <asm/page.h> | 23 | #include <asm/page.h> |
24 | #include <asm/pgtable.h> | 24 | #include <asm/pgtable.h> |
25 | #include <asm/segment.h> | ||
26 | #include <linux/string.h> | 25 | #include <linux/string.h> |
27 | 26 | ||
28 | #define VERIFY_READ 0 | 27 | #define VERIFY_READ 0 |
29 | #define VERIFY_WRITE 1 | 28 | #define VERIFY_WRITE 1 |
30 | 29 | ||
30 | /* | ||
31 | * On Microblaze the fs value is actually the top of the corresponding | ||
32 | * address space. | ||
33 | * | ||
34 | * The fs value determines whether argument validity checking should be | ||
35 | * performed or not. If get_fs() == USER_DS, checking is performed, with | ||
36 | * get_fs() == KERNEL_DS, checking is bypassed. | ||
37 | * | ||
38 | * For historical reasons, these macros are grossly misnamed. | ||
39 | * | ||
40 | * For non-MMU arch like Microblaze, KERNEL_DS and USER_DS is equal. | ||
41 | */ | ||
42 | # define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | ||
43 | |||
44 | # ifndef CONFIG_MMU | ||
45 | # define KERNEL_DS MAKE_MM_SEG(0) | ||
46 | # define USER_DS KERNEL_DS | ||
47 | # else | ||
48 | # define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
49 | # define USER_DS MAKE_MM_SEG(TASK_SIZE - 1) | ||
50 | # endif | ||
51 | |||
52 | # define get_ds() (KERNEL_DS) | ||
53 | # define get_fs() (current_thread_info()->addr_limit) | ||
54 | # define set_fs(val) (current_thread_info()->addr_limit = (val)) | ||
55 | |||
56 | # define segment_eq(a, b) ((a).seg == (b).seg) | ||
57 | |||
58 | |||
31 | #define __clear_user(addr, n) (memset((void *)(addr), 0, (n)), 0) | 59 | #define __clear_user(addr, n) (memset((void *)(addr), 0, (n)), 0) |
32 | 60 | ||
33 | #ifndef CONFIG_MMU | 61 | #ifndef CONFIG_MMU |