diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-06-12 04:26:25 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-12 04:27:30 -0400 |
commit | 7757591ab4a36314a258e181dbf0994415c288c2 (patch) | |
tree | 99b414c90dbc7889f7738a795122805f167a00af /arch/s390/mm/mmap.c | |
parent | d90cbd469c9c7c1494fc2084af9319e6a557368b (diff) |
[S390] implement is_compat_task
Implement is_compat_task and use it all over the place.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/mmap.c')
-rw-r--r-- | arch/s390/mm/mmap.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index e008d236cc15..f4558ccf02b9 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <asm/pgalloc.h> | 30 | #include <asm/pgalloc.h> |
31 | #include <asm/compat.h> | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * Top of mmap area (just below the process stack). | 34 | * Top of mmap area (just below the process stack). |
@@ -55,7 +56,7 @@ static inline int mmap_is_legacy(void) | |||
55 | /* | 56 | /* |
56 | * Force standard allocation for 64 bit programs. | 57 | * Force standard allocation for 64 bit programs. |
57 | */ | 58 | */ |
58 | if (!test_thread_flag(TIF_31BIT)) | 59 | if (!is_compat_task()) |
59 | return 1; | 60 | return 1; |
60 | #endif | 61 | #endif |
61 | return sysctl_legacy_va_layout || | 62 | return sysctl_legacy_va_layout || |
@@ -91,7 +92,7 @@ EXPORT_SYMBOL_GPL(arch_pick_mmap_layout); | |||
91 | 92 | ||
92 | int s390_mmap_check(unsigned long addr, unsigned long len) | 93 | int s390_mmap_check(unsigned long addr, unsigned long len) |
93 | { | 94 | { |
94 | if (!test_thread_flag(TIF_31BIT) && | 95 | if (!is_compat_task() && |
95 | len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) | 96 | len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) |
96 | return crst_table_upgrade(current->mm, 1UL << 53); | 97 | return crst_table_upgrade(current->mm, 1UL << 53); |
97 | return 0; | 98 | return 0; |
@@ -108,8 +109,7 @@ s390_get_unmapped_area(struct file *filp, unsigned long addr, | |||
108 | area = arch_get_unmapped_area(filp, addr, len, pgoff, flags); | 109 | area = arch_get_unmapped_area(filp, addr, len, pgoff, flags); |
109 | if (!(area & ~PAGE_MASK)) | 110 | if (!(area & ~PAGE_MASK)) |
110 | return area; | 111 | return area; |
111 | if (area == -ENOMEM && | 112 | if (area == -ENOMEM && !is_compat_task() && TASK_SIZE < (1UL << 53)) { |
112 | !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) { | ||
113 | /* Upgrade the page table to 4 levels and retry. */ | 113 | /* Upgrade the page table to 4 levels and retry. */ |
114 | rc = crst_table_upgrade(mm, 1UL << 53); | 114 | rc = crst_table_upgrade(mm, 1UL << 53); |
115 | if (rc) | 115 | if (rc) |
@@ -131,8 +131,7 @@ s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr, | |||
131 | area = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags); | 131 | area = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags); |
132 | if (!(area & ~PAGE_MASK)) | 132 | if (!(area & ~PAGE_MASK)) |
133 | return area; | 133 | return area; |
134 | if (area == -ENOMEM && | 134 | if (area == -ENOMEM && !is_compat_task() && TASK_SIZE < (1UL << 53)) { |
135 | !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) { | ||
136 | /* Upgrade the page table to 4 levels and retry. */ | 135 | /* Upgrade the page table to 4 levels and retry. */ |
137 | rc = crst_table_upgrade(mm, 1UL << 53); | 136 | rc = crst_table_upgrade(mm, 1UL << 53); |
138 | if (rc) | 137 | if (rc) |