]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/s390/mm/mmap.c
[S390] implement is_compat_task
[karo-tx-linux.git] / arch / s390 / mm / mmap.c
index e008d236cc150666187fc7921df901523fe476ce..f4558ccf02b9cd266ad005cb2925a2dfa5d7ea89 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <asm/pgalloc.h>
+#include <asm/compat.h>
 
 /*
  * Top of mmap area (just below the process stack).
@@ -55,7 +56,7 @@ static inline int mmap_is_legacy(void)
        /*
         * Force standard allocation for 64 bit programs.
         */
-       if (!test_thread_flag(TIF_31BIT))
+       if (!is_compat_task())
                return 1;
 #endif
        return sysctl_legacy_va_layout ||
@@ -91,7 +92,7 @@ EXPORT_SYMBOL_GPL(arch_pick_mmap_layout);
 
 int s390_mmap_check(unsigned long addr, unsigned long len)
 {
-       if (!test_thread_flag(TIF_31BIT) &&
+       if (!is_compat_task() &&
            len >= TASK_SIZE && TASK_SIZE < (1UL << 53))
                return crst_table_upgrade(current->mm, 1UL << 53);
        return 0;
@@ -108,8 +109,7 @@ s390_get_unmapped_area(struct file *filp, unsigned long addr,
        area = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
        if (!(area & ~PAGE_MASK))
                return area;
-       if (area == -ENOMEM &&
-           !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) {
+       if (area == -ENOMEM && !is_compat_task() && TASK_SIZE < (1UL << 53)) {
                /* Upgrade the page table to 4 levels and retry. */
                rc = crst_table_upgrade(mm, 1UL << 53);
                if (rc)
@@ -131,8 +131,7 @@ s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr,
        area = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags);
        if (!(area & ~PAGE_MASK))
                return area;
-       if (area == -ENOMEM &&
-           !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) {
+       if (area == -ENOMEM && !is_compat_task() && TASK_SIZE < (1UL << 53)) {
                /* Upgrade the page table to 4 levels and retry. */
                rc = crst_table_upgrade(mm, 1UL << 53);
                if (rc)