From 7757591ab4a36314a258e181dbf0994415c288c2 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 12 Jun 2009 10:26:25 +0200 Subject: [S390] implement is_compat_task Implement is_compat_task and use it all over the place. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/mm/fault.c | 3 ++- arch/s390/mm/mmap.c | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/s390/mm') diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 833e8366c351..220a152c836c 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -239,7 +240,7 @@ static int signal_return(struct mm_struct *mm, struct pt_regs *regs, up_read(&mm->mmap_sem); clear_tsk_thread_flag(current, TIF_SINGLE_STEP); #ifdef CONFIG_COMPAT - compat = test_tsk_thread_flag(current, TIF_31BIT); + compat = is_compat_task(); if (compat && instruction == 0x0a77) sys32_sigreturn(); else if (compat && instruction == 0x0aad) 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 @@ #include #include #include +#include /* * 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) -- cgit v1.2.2