Commit 9dfdf818 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] s390: core s390

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

s390 core changes:
 - Move setting/clearing of TIF_31BIT thread flag to SET_PERSONALITY.
 - Use TASK_UNMAPPED_BASE in elf_map32 for mmaps with address 0.
 - Define ARCH_KMALLOC_MINALIGN.
 - Define ARCH_MIN_TASKALIGN.
parent 60d53994
...@@ -40,8 +40,7 @@ ...@@ -40,8 +40,7 @@
passed in R14. */ passed in R14. */
#define ELF_PLAT_INIT(_r, load_addr) \ #define ELF_PLAT_INIT(_r, load_addr) \
do { \ do { \
_r->gprs[14] = 0; \ _r->gprs[14] = 0; \
set_thread_flag(TIF_31BIT); \
} while(0) } while(0)
#define USE_ELF_CORE_DUMP #define USE_ELF_CORE_DUMP
...@@ -82,6 +81,7 @@ do { \ ...@@ -82,6 +81,7 @@ do { \
set_personality(PER_SVR4); \ set_personality(PER_SVR4); \
else if (current->personality != PER_LINUX32) \ else if (current->personality != PER_LINUX32) \
set_personality(PER_LINUX); \ set_personality(PER_LINUX); \
set_thread_flag(TIF_31BIT); \
} while (0) } while (0)
#include "compat_linux.h" #include "compat_linux.h"
...@@ -194,10 +194,7 @@ elf_map32 (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p ...@@ -194,10 +194,7 @@ elf_map32 (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p
unsigned long map_addr; unsigned long map_addr;
if (!addr) if (!addr)
addr = 0x40000000; addr = TASK_UNMAPPED_BASE;
if (prot & PROT_READ)
prot |= PROT_EXEC;
down_write(&current->mm->mmap_sem); down_write(&current->mm->mmap_sem);
map_addr = do_mmap(filep, ELF_PAGESTART(addr), map_addr = do_mmap(filep, ELF_PAGESTART(addr),
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* S390 version * S390 version
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
* Thomas Spatzier (tspat@de.ibm.com)
* *
* Derived from "arch/i386/kernel/sys_i386.c" * Derived from "arch/i386/kernel/sys_i386.c"
* *
......
...@@ -15,4 +15,6 @@ ...@@ -15,4 +15,6 @@
#define L1_CACHE_SHIFT 8 #define L1_CACHE_SHIFT 8
#define L1_CACHE_SHIFT_MAX 8 /* largest L1 which this arch supports */ #define L1_CACHE_SHIFT_MAX 8 /* largest L1 which this arch supports */
#define ARCH_KMALLOC_MINALIGN 8
#endif #endif
...@@ -123,16 +123,10 @@ typedef s390_regs elf_gregset_t; ...@@ -123,16 +123,10 @@ typedef s390_regs elf_gregset_t;
/* For SVR4/S390 the function pointer to be registered with `atexit` is /* For SVR4/S390 the function pointer to be registered with `atexit` is
passed in R14. */ passed in R14. */
#ifndef __s390x__
#define ELF_PLAT_INIT(_r, load_addr) \
_r->gprs[14] = 0
#else /* __s390x__ */
#define ELF_PLAT_INIT(_r, load_addr) \ #define ELF_PLAT_INIT(_r, load_addr) \
do { \ do { \
_r->gprs[14] = 0; \ _r->gprs[14] = 0; \
clear_thread_flag(TIF_31BIT); \ } while (0)
} while(0)
#endif /* __s390x__ */
#define USE_ELF_CORE_DUMP #define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 4096 #define ELF_EXEC_PAGESIZE 4096
......
...@@ -98,6 +98,8 @@ struct thread_struct { ...@@ -98,6 +98,8 @@ struct thread_struct {
typedef struct thread_struct thread_struct; typedef struct thread_struct thread_struct;
#define ARCH_MIN_TASKALIGN 8
#ifndef __s390x__ #ifndef __s390x__
# define __SWAPPER_PG_DIR __pa(&swapper_pg_dir[0]) + _SEGMENT_TABLE # define __SWAPPER_PG_DIR __pa(&swapper_pg_dir[0]) + _SEGMENT_TABLE
#else /* __s390x__ */ #else /* __s390x__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment