Skip to content

Commit

Permalink
[PATCH] s390: cleanup Kconfig
Browse files Browse the repository at this point in the history
Sanitize some s390 Kconfig options.  We have ARCH_S390, ARCH_S390X,
ARCH_S390_31, 64BIT, S390_SUPPORT and COMPAT.  Replace these 6 options by
S390, 64BIT and COMPAT.

Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Martin Schwidefsky authored and Linus Torvalds committed Jan 6, 2006
1 parent 9bbc834 commit 347a8dc
Show file tree
Hide file tree
Showing 60 changed files with 183 additions and 208 deletions.
27 changes: 7 additions & 20 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,27 @@ config GENERIC_BUST_SPINLOCK

mainmenu "Linux Kernel Configuration"

config ARCH_S390
config S390
bool
default y

config UID16
bool
default y
depends on ARCH_S390X = 'n'
depends on !64BIT

source "init/Kconfig"

menu "Base setup"

comment "Processor type and features"

config ARCH_S390X
config 64BIT
bool "64 bit kernel"
help
Select this option if you have a 64 bit IBM zSeries machine
and want to use the 64 bit addressing mode.

config 64BIT
def_bool ARCH_S390X

config ARCH_S390_31
bool
depends on ARCH_S390X = 'n'
default y

config SMP
bool "Symmetric multi-processing support"
---help---
Expand Down Expand Up @@ -101,28 +93,23 @@ config MATHEMU
on older S/390 machines. Say Y unless you know your machine doesn't
need this.

config S390_SUPPORT
config COMPAT
bool "Kernel support for 31 bit emulation"
depends on ARCH_S390X
depends on 64BIT
help
Select this option if you want to enable your system kernel to
handle system-calls from ELF binaries for 31 bit ESA. This option
(and some other stuff like libraries and such) is needed for
executing 31 bit applications. It is safe to say "Y".

config COMPAT
bool
depends on S390_SUPPORT
default y

config SYSVIPC_COMPAT
bool
depends on COMPAT && SYSVIPC
default y

config BINFMT_ELF32
tristate "Kernel support for 31 bit ELF binaries"
depends on S390_SUPPORT
depends on COMPAT
help
This allows you to run 32-bit Linux/ELF binaries on your zSeries
in 64 bit mode. Everybody wants this; say Y.
Expand All @@ -135,7 +122,7 @@ choice

config MARCH_G5
bool "S/390 model G5 and G6"
depends on ARCH_S390_31
depends on !64BIT
help
Select this to build a 31 bit kernel that works
on all S/390 and zSeries machines.
Expand Down
6 changes: 2 additions & 4 deletions arch/s390/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
# Copyright (C) 1994 by Linus Torvalds
#

ifdef CONFIG_ARCH_S390_31
ifndef CONFIG_64BIT
LDFLAGS := -m elf_s390
CFLAGS += -m31
AFLAGS += -m31
UTS_MACHINE := s390
STACK_SIZE := 8192
CHECKFLAGS += -D__s390__
endif

ifdef CONFIG_ARCH_S390X
else
LDFLAGS := -m elf64_s390
MODFLAGS += -fpic -D__PIC__
CFLAGS += -m64
Expand Down
8 changes: 4 additions & 4 deletions arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#define TOD_MICRO 0x01000 /* nr. of TOD clock units
for 1 microsecond */
#ifndef CONFIG_ARCH_S390X
#ifndef CONFIG_64BIT

#define APPLDATA_START_INTERVAL_REC 0x00 /* Function codes for */
#define APPLDATA_STOP_REC 0x01 /* DIAG 0xDC */
Expand All @@ -54,13 +54,13 @@
#define APPLDATA_GEN_EVENT_RECORD 0x82
#define APPLDATA_START_CONFIG_REC 0x83

#endif /* CONFIG_ARCH_S390X */
#endif /* CONFIG_64BIT */


/*
* Parameter list for DIAGNOSE X'DC'
*/
#ifndef CONFIG_ARCH_S390X
#ifndef CONFIG_64BIT
struct appldata_parameter_list {
u16 diag; /* The DIAGNOSE code X'00DC' */
u8 function; /* The function code for the DIAGNOSE */
Expand All @@ -82,7 +82,7 @@ struct appldata_parameter_list {
u64 product_id_addr;
u64 buffer_addr;
};
#endif /* CONFIG_ARCH_S390X */
#endif /* CONFIG_64BIT */

/*
* /proc entries (sysctl)
Expand Down
10 changes: 5 additions & 5 deletions arch/s390/crypto/crypt_s390.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct crypt_s390_query_status {
* [ret] is the variable to receive the error code
* [ERR] is the error code value
*/
#ifndef __s390x__
#ifndef CONFIG_64BIT
#define __crypt_s390_fixup \
".section .fixup,\"ax\" \n" \
"7: lhi %0,%h[e1] \n" \
Expand All @@ -129,7 +129,7 @@ struct crypt_s390_query_status {
" .long 0b,7b \n" \
" .long 1b,8b \n" \
".previous"
#else /* __s390x__ */
#else /* CONFIG_64BIT */
#define __crypt_s390_fixup \
".section .fixup,\"ax\" \n" \
"7: lhi %0,%h[e1] \n" \
Expand All @@ -142,18 +142,18 @@ struct crypt_s390_query_status {
" .quad 0b,7b \n" \
" .quad 1b,8b \n" \
".previous"
#endif /* __s390x__ */
#endif /* CONFIG_64BIT */

/*
* Standard code for setting the result of s390 crypto instructions.
* %0: the register which will receive the result
* [result]: the register containing the result (e.g. second operand length
* to compute number of processed bytes].
*/
#ifndef __s390x__
#ifndef CONFIG_64BIT
#define __crypt_s390_set_result \
" lr %0,%[result] \n"
#else /* __s390x__ */
#else /* CONFIG_64BIT */
#define __crypt_s390_set_result \
" lgr %0,%[result] \n"
#endif
Expand Down
4 changes: 1 addition & 3 deletions arch/s390/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_S390=y
CONFIG_S390=y
CONFIG_UID16=y

#
Expand Down Expand Up @@ -89,9 +89,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
#
# Processor type and features
#
# CONFIG_ARCH_S390X is not set
# CONFIG_64BIT is not set
CONFIG_ARCH_S390_31=y
CONFIG_SMP=y
CONFIG_NR_CPUS=32
CONFIG_HOTPLUG_CPU=y
Expand Down
15 changes: 5 additions & 10 deletions arch/s390/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,26 @@ obj-y := bitmap.o traps.o time.o process.o \
setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
semaphore.o s390_ext.o debug.o profile.o irq.o reipl_diag.o

obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o)
obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)

extra-y += head.o init_task.o vmlinux.lds

obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
obj-$(CONFIG_SMP) += smp.o

obj-$(CONFIG_S390_SUPPORT) += compat_linux.o compat_signal.o \
obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \
compat_ioctl.o compat_wrapper.o \
compat_exec_domain.o
obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o

obj-$(CONFIG_ARCH_S390_31) += entry.o reipl.o
obj-$(CONFIG_ARCH_S390X) += entry64.o reipl64.o

obj-$(CONFIG_VIRT_TIMER) += vtime.o

# Kexec part
S390_KEXEC_OBJS := machine_kexec.o crash.o
ifeq ($(CONFIG_ARCH_S390X),y)
S390_KEXEC_OBJS += relocate_kernel64.o
else
S390_KEXEC_OBJS += relocate_kernel.o
endif
S390_KEXEC_OBJS += $(if $(CONFIG_64BIT),relocate_kernel64.o,relocate_kernel.o)
obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)


#
# This is just to get the dependencies...
#
Expand Down
16 changes: 8 additions & 8 deletions arch/s390/kernel/cpcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)

if (response != NULL && rlen > 0) {
memset(response, 0, rlen);
#ifndef CONFIG_ARCH_S390X
#ifndef CONFIG_64BIT
asm volatile ( "lra 2,0(%2)\n"
"lr 4,%3\n"
"o 4,%6\n"
Expand All @@ -55,7 +55,7 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
: "a" (cpcmd_buf), "d" (cmdlen),
"a" (response), "d" (rlen), "m" (mask)
: "cc", "2", "3", "4", "5" );
#else /* CONFIG_ARCH_S390X */
#else /* CONFIG_64BIT */
asm volatile ( "lrag 2,0(%2)\n"
"lgr 4,%3\n"
"o 4,%6\n"
Expand All @@ -73,19 +73,19 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
: "a" (cpcmd_buf), "d" (cmdlen),
"a" (response), "d" (rlen), "m" (mask)
: "cc", "2", "3", "4", "5" );
#endif /* CONFIG_ARCH_S390X */
#endif /* CONFIG_64BIT */
EBCASC(response, rlen);
} else {
return_len = 0;
#ifndef CONFIG_ARCH_S390X
#ifndef CONFIG_64BIT
asm volatile ( "lra 2,0(%1)\n"
"lr 3,%2\n"
"diag 2,3,0x8\n"
"lr %0,3\n"
: "=d" (return_code)
: "a" (cpcmd_buf), "d" (cmdlen)
: "2", "3" );
#else /* CONFIG_ARCH_S390X */
#else /* CONFIG_64BIT */
asm volatile ( "lrag 2,0(%1)\n"
"lgr 3,%2\n"
"sam31\n"
Expand All @@ -95,7 +95,7 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
: "=d" (return_code)
: "a" (cpcmd_buf), "d" (cmdlen)
: "2", "3" );
#endif /* CONFIG_ARCH_S390X */
#endif /* CONFIG_64BIT */
}
spin_unlock_irqrestore(&cpcmd_lock, flags);
if (response_code != NULL)
Expand All @@ -105,7 +105,7 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)

EXPORT_SYMBOL(__cpcmd);

#ifdef CONFIG_ARCH_S390X
#ifdef CONFIG_64BIT
int cpcmd(const char *cmd, char *response, int rlen, int *response_code)
{
char *lowbuf;
Expand All @@ -129,4 +129,4 @@ int cpcmd(const char *cmd, char *response, int rlen, int *response_code)
}

EXPORT_SYMBOL(cpcmd);
#endif /* CONFIG_ARCH_S390X */
#endif /* CONFIG_64BIT */
18 changes: 9 additions & 9 deletions arch/s390/kernel/entry64.S
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ sysc_nr_ok:
mvc SP_ARGS(8,%r15),SP_R7(%r15)
sysc_do_restart:
larl %r10,sys_call_table
#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
tm __TI_flags+5(%r9),(_TIF_31BIT>>16) # running in 31 bit mode ?
jno sysc_noemu
larl %r10,sys_call_table_emu # use 31 bit emulation system calls
Expand Down Expand Up @@ -361,7 +361,7 @@ sys_clone_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs
jg sys_clone # branch to sys_clone

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_clone_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs
jg sys32_clone # branch to sys32_clone
Expand All @@ -383,7 +383,7 @@ sys_execve_glue:
bnz 0(%r12) # it did fail -> store result in gpr2
b 6(%r12) # SKIP STG 2,SP_R2(15) in
# system_call/sysc_tracesys
#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_execve_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs
lgr %r12,%r14 # save return address
Expand All @@ -398,7 +398,7 @@ sys_sigreturn_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
jg sys_sigreturn # branch to sys_sigreturn

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_sigreturn_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
jg sys32_sigreturn # branch to sys32_sigreturn
Expand All @@ -408,7 +408,7 @@ sys_rt_sigreturn_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
jg sys_rt_sigreturn # branch to sys_sigreturn

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_rt_sigreturn_glue:
la %r2,SP_PTREGS(%r15) # load pt_regs as parameter
jg sys32_rt_sigreturn # branch to sys32_sigreturn
Expand All @@ -429,7 +429,7 @@ sys_sigsuspend_glue:
la %r14,6(%r14) # skip store of return value
jg sys_sigsuspend # branch to sys_sigsuspend

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_sigsuspend_glue:
llgfr %r4,%r4 # unsigned long
lgr %r5,%r4 # move mask back
Expand All @@ -449,7 +449,7 @@ sys_rt_sigsuspend_glue:
la %r14,6(%r14) # skip store of return value
jg sys_rt_sigsuspend # branch to sys_rt_sigsuspend

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_rt_sigsuspend_glue:
llgfr %r3,%r3 # size_t
lgr %r4,%r3 # move sigsetsize parameter
Expand All @@ -464,7 +464,7 @@ sys_sigaltstack_glue:
la %r4,SP_PTREGS(%r15) # load pt_regs as parameter
jg sys_sigaltstack # branch to sys_sigreturn

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT
sys32_sigaltstack_glue:
la %r4,SP_PTREGS(%r15) # load pt_regs as parameter
jg sys32_sigaltstack_wrapper # branch to sys_sigreturn
Expand Down Expand Up @@ -1009,7 +1009,7 @@ sys_call_table:
#include "syscalls.S"
#undef SYSCALL

#ifdef CONFIG_S390_SUPPORT
#ifdef CONFIG_COMPAT

#define SYSCALL(esa,esame,emu) .long emu
.globl sys_call_table_emu
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <asm/thread_info.h>
#include <asm/page.h>

#ifdef CONFIG_ARCH_S390X
#ifdef CONFIG_64BIT
#define ARCH_OFFSET 4
#else
#define ARCH_OFFSET 0
Expand Down Expand Up @@ -539,7 +539,7 @@ ipl_devno:
.word 0
.endm

#ifdef CONFIG_ARCH_S390X
#ifdef CONFIG_64BIT
#include "head64.S"
#else
#include "head31.S"
Expand Down
Loading

0 comments on commit 347a8dc

Please sign in to comment.