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

s390 core changes:
 - Replace invoke_softirq mechanism with own version of do_softirq.
 - Move /proc/inteerrupts functions to re-added arch/s390/kernel/irq.c
 - Add some includes to avoid compiler warnings.
 - Remove unused #defines.
 - Regenerate default configuration.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/s390/defconfig           |    9 ++-
 25-akpm/arch/s390/kernel/Makefile     |    2 
 25-akpm/arch/s390/kernel/entry.S      |   25 --------
 25-akpm/arch/s390/kernel/entry64.S    |   21 -------
 25-akpm/arch/s390/kernel/irq.c        |   99 ++++++++++++++++++++++++++++++++++
 25-akpm/arch/s390/kernel/s390_ext.c   |    1 
 25-akpm/arch/s390/kernel/s390_ksyms.c |    1 
 25-akpm/arch/s390/kernel/setup.c      |   46 ---------------
 25-akpm/drivers/s390/s390mach.h       |    4 -
 25-akpm/include/asm-s390/hardirq.h    |    5 -
 10 files changed, 109 insertions(+), 104 deletions(-)

diff -puN arch/s390/defconfig~s390-core-changes arch/s390/defconfig
--- 25/arch/s390/defconfig~s390-core-changes	2004-09-20 11:30:12.806732952 -0700
+++ 25-akpm/arch/s390/defconfig	2004-09-20 11:30:12.822730520 -0700
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.9-rc1
-# Mon Aug 30 19:03:48 2004
+# Linux kernel version: 2.6.9-rc2
+# Mon Sep 20 17:16:38 2004
 #
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -17,6 +17,7 @@ CONFIG_CLEAN_COMPILE=y
 #
 # General setup
 #
+CONFIG_LOCALVERSION=""
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
@@ -38,6 +39,8 @@ CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+# CONFIG_TINY_SHMEM is not set
 
 #
 # Loadable module support
@@ -162,7 +165,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_BLK_DEV_XPRAM=m
 # CONFIG_DCSSBLK is not set
 CONFIG_DASD=y
-# CONFIG_DASD_PROFILE is not set
+CONFIG_DASD_PROFILE=y
 CONFIG_DASD_ECKD=y
 CONFIG_DASD_FBA=y
 CONFIG_DASD_DIAG=y
diff -puN arch/s390/kernel/entry64.S~s390-core-changes arch/s390/kernel/entry64.S
--- 25/arch/s390/kernel/entry64.S~s390-core-changes	2004-09-20 11:30:12.807732800 -0700
+++ 25-akpm/arch/s390/kernel/entry64.S	2004-09-20 11:30:12.823730368 -0700
@@ -147,27 +147,6 @@ __switch_to_noper:
 	stg	%r3,__LC_KERNEL_STACK	# __LC_KERNEL_STACK = new kernel stack
 	br	%r14
 
-/*
- * do_softirq calling function. We want to run the softirq functions on the
- * asynchronous interrupt stack.
- */
-	.global do_call_softirq
-do_call_softirq:
-	stnsm	__SF_EMPTY(%r15),0xfc
-	stmg	%r12,%r15,__SF_GPRS(%r15)
-	lgr	%r12,%r15
-	lg	%r0,__LC_ASYNC_STACK
-	slgr    %r0,%r15
-	srag	%r0,%r0,STACK_SHIFT
-	je	0f
-	lg	%r15,__LC_ASYNC_STACK
-0:	aghi	%r15,-STACK_FRAME_OVERHEAD
-	stg	%r12,__SF_BACKCHAIN(%r15)	# store back chain
-	brasl	%r14,do_softirq
-	lmg	%r12,%r15,__SF_GPRS(%r12)
-	ssm	__SF_EMPTY(%r15)
-	br	%r14
-
 __critical_start:
 /*
  * SVC interrupt handler routine. System calls are synchronous events and
diff -puN arch/s390/kernel/entry.S~s390-core-changes arch/s390/kernel/entry.S
--- 25/arch/s390/kernel/entry.S~s390-core-changes	2004-09-20 11:30:12.809732496 -0700
+++ 25-akpm/arch/s390/kernel/entry.S	2004-09-20 11:30:12.824730216 -0700
@@ -150,30 +150,6 @@ __switch_to_noper:
 	st	%r3,__LC_KERNEL_STACK	# __LC_KERNEL_STACK = new kernel stack
 	br	%r14
 
-/*
- * do_softirq calling function. We want to run the softirq functions on the
- * asynchronous interrupt stack.
- */
-	.global do_call_softirq
-do_call_softirq:
-	stnsm	__SF_EMPTY(%r15),0xfc
-	stm	%r12,%r15,__SF_GPRS(%r15)
-	lr	%r12,%r15
-        basr    %r13,0
-do_call_base:
-	l	%r0,__LC_ASYNC_STACK
-	slr     %r0,%r15
-	sra	%r0,STACK_SHIFT
-	be	0f-do_call_base(%r13)
-	l	%r15,__LC_ASYNC_STACK
-0:	sl	%r15,.Lc_overhead-do_call_base(%r13)
-        st	%r12,__SF_BACKCHAIN(%r15)	# store backchain
-	l	%r1,.Ldo_softirq-do_call_base(%r13)
-	basr	%r14,%r1
-	lm	%r12,%r15,__SF_GPRS(%r12)
-	ssm	__SF_EMPTY(%r15)
-	br	%r14
-
 __critical_start:
 /*
  * SVC interrupt handler routine. System calls are synchronous events and
@@ -733,7 +709,6 @@ cleanup_sysc_leave_lpsw:
 .Ldo_IRQ:      .long  do_IRQ
 .Ldo_extint:   .long  do_extint
 .Ldo_signal:   .long  do_signal
-.Ldo_softirq:  .long  do_softirq
 .Lhandle_per:  .long  do_single_step
 .Ljump_table:  .long  pgm_check_table
 .Lschedule:    .long  schedule
diff -puN /dev/null arch/s390/kernel/irq.c
--- /dev/null	2003-09-15 06:40:47.000000000 -0700
+++ 25-akpm/arch/s390/kernel/irq.c	2004-09-20 11:30:12.825730064 -0700
@@ -0,0 +1,99 @@
+/*
+ *  arch/s390/kernel/irq.c
+ *
+ *  S390 version
+ *    Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
+ *
+ * This file contains interrupt related functions.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
+#include <linux/seq_file.h>
+#include <linux/cpu.h>
+
+/*
+ * show_interrupts is needed by /proc/interrupts.
+ */
+int show_interrupts(struct seq_file *p, void *v)
+{
+	static const char *intrclass_names[] = { "EXT", "I/O", };
+	int i = *(loff_t *) v, j;
+
+	if (i == 0) {
+		seq_puts(p, "           ");
+		for (j=0; j<NR_CPUS; j++)
+			if (cpu_online(j))
+				seq_printf(p, "CPU%d       ",j);
+		seq_putc(p, '\n');
+	}
+
+	if (i < NR_IRQS) {
+		seq_printf(p, "%s: ", intrclass_names[i]);
+#ifndef CONFIG_SMP
+		seq_printf(p, "%10u ", kstat_irqs(i));
+#else
+		for (j = 0; j < NR_CPUS; j++)
+			if (cpu_online(j))
+				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
+#endif
+                seq_putc(p, '\n');
+
+        }
+
+        return 0;
+}
+
+/*
+ * For compatibilty only. S/390 specific setup of interrupts et al. is done
+ * much later in init_channel_subsystem().
+ */
+void __init
+init_IRQ(void)
+{
+	/* nothing... */
+}
+
+/*
+ * Switch to the asynchronous interrupt stack for softirq execution.
+ */
+extern void __do_softirq(void);
+
+asmlinkage void do_softirq(void)
+{
+	unsigned long flags, old, new;
+
+	if (in_interrupt())
+		return;
+
+	local_irq_save(flags);
+
+	if (local_softirq_pending()) {
+		/* Get current stack pointer. */
+		asm volatile("la %0,0(15)" : "=a" (old));
+		/* Check against async. stack address range. */
+		new = S390_lowcore.async_stack;
+		if (((new - old) >> (PAGE_SHIFT + THREAD_ORDER)) != 0) {
+			/* Need to switch to the async. stack. */
+			new -= STACK_FRAME_OVERHEAD;
+			((struct stack_frame *) new)->back_chain = old;
+
+			asm volatile("   la    15,0(%0)\n"
+				     "   basr  14,%2\n"
+				     "   la    15,0(%1)\n"
+				     : : "a" (new), "a" (old),
+				         "a" (__do_softirq)
+				     : "0", "1", "2", "3", "4", "5",
+				       "cc", "memory" );
+		} else
+			/* We are already on the async stack. */
+			__do_softirq();
+	}
+
+	local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL(do_softirq);
diff -puN arch/s390/kernel/Makefile~s390-core-changes arch/s390/kernel/Makefile
--- 25/arch/s390/kernel/Makefile~s390-core-changes	2004-09-20 11:30:12.811732192 -0700
+++ 25-akpm/arch/s390/kernel/Makefile	2004-09-20 11:30:12.825730064 -0700
@@ -6,7 +6,7 @@ EXTRA_AFLAGS	:= -traditional
 
 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
+            semaphore.o s390_ext.o debug.o profile.o irq.o
 
 extra-$(CONFIG_ARCH_S390_31)	+= head.o 
 extra-$(CONFIG_ARCH_S390X)	+= head64.o 
diff -puN arch/s390/kernel/s390_ext.c~s390-core-changes arch/s390/kernel/s390_ext.c
--- 25/arch/s390/kernel/s390_ext.c~s390-core-changes	2004-09-20 11:30:12.812732040 -0700
+++ 25-akpm/arch/s390/kernel/s390_ext.c	2004-09-20 11:30:12.825730064 -0700
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
 
 #include <asm/lowcore.h>
 #include <asm/s390_ext.h>
diff -puN arch/s390/kernel/s390_ksyms.c~s390-core-changes arch/s390/kernel/s390_ksyms.c
--- 25/arch/s390/kernel/s390_ksyms.c~s390-core-changes	2004-09-20 11:30:12.814731736 -0700
+++ 25-akpm/arch/s390/kernel/s390_ksyms.c	2004-09-20 11:30:12.826729912 -0700
@@ -61,6 +61,5 @@ EXPORT_SYMBOL(csum_fold);
 EXPORT_SYMBOL(console_mode);
 EXPORT_SYMBOL(console_devno);
 EXPORT_SYMBOL(console_irq);
-EXPORT_SYMBOL(do_call_softirq);
 EXPORT_SYMBOL(sys_wait4);
 EXPORT_SYMBOL(cpcmd);
diff -puN arch/s390/kernel/setup.c~s390-core-changes arch/s390/kernel/setup.c
--- 25/arch/s390/kernel/setup.c~s390-core-changes	2004-09-20 11:30:12.816731432 -0700
+++ 25-akpm/arch/s390/kernel/setup.c	2004-09-20 11:30:12.826729912 -0700
@@ -608,49 +608,3 @@ struct seq_operations cpuinfo_op = {
 	.show	= show_cpuinfo,
 };
 
-/*
- * show_interrupts is needed by /proc/interrupts.
- */
-
-static const char *intrclass_names[] = {
-	"EXT",
-	"I/O",
-};
-
-int show_interrupts(struct seq_file *p, void *v)
-{
-        int i = *(loff_t *) v, j;
-	
-	if (i == 0) {
-		seq_puts(p, "           ");
-		for (j=0; j<NR_CPUS; j++)
-			if (cpu_online(j))
-				seq_printf(p, "CPU%d       ",j);
-		seq_putc(p, '\n');
-	}
-	
-	if (i < NR_IRQS) {
-		seq_printf(p, "%s: ", intrclass_names[i]);
-#ifndef CONFIG_SMP
-		seq_printf(p, "%10u ", kstat_irqs(i));
-#else
-		for (j = 0; j < NR_CPUS; j++)
-			if (cpu_online(j))
-				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
-#endif
-                seq_putc(p, '\n');
-		
-        }
-	
-        return 0;
-}
-
-/*
- * For compatibilty only. S/390 specific setup of interrupts et al. is done
- * much later in init_channel_subsystem().
- */
-void __init
-init_IRQ(void)
-{
-	/* nothing... */
-}
diff -puN drivers/s390/s390mach.h~s390-core-changes drivers/s390/s390mach.h
--- 25/drivers/s390/s390mach.h~s390-core-changes	2004-09-20 11:30:12.817731280 -0700
+++ 25-akpm/drivers/s390/s390mach.h	2004-09-20 11:30:12.827729760 -0700
@@ -63,10 +63,6 @@ struct crw {
 #define CRW_ERC_PERRI    0x07 /* perm. error, facility init */
 #define CRW_ERC_PMOD     0x08 /* installed parameters modified */
 
-#define MCHCHK_STATUS_TO_PROCESS    0x00000001
-#define MCHCHK_STATUS_IN_PROGRESS   0x00000002
-#define MCHCHK_STATUS_WAITING       0x00000004
-
 extern __inline__ int stcrw(struct crw *pcrw )
 {
         int ccode;
diff -puN include/asm-s390/hardirq.h~s390-core-changes include/asm-s390/hardirq.h
--- 25/include/asm-s390/hardirq.h~s390-core-changes	2004-09-20 11:30:12.819730976 -0700
+++ 25-akpm/include/asm-s390/hardirq.h	2004-09-20 11:30:12.827729760 -0700
@@ -61,10 +61,9 @@ softirq_pending(unsigned int cpu)
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-extern void do_call_softirq(void);
 extern void account_ticks(struct pt_regs *);
 
-#define invoke_softirq() do_call_softirq()
+#define __ARCH_HAS_DO_SOFTIRQ
 
 #define irq_enter()							\
 do {									\
@@ -75,7 +74,7 @@ do {									\
 	preempt_count() -= IRQ_EXIT_OFFSET;				\
 	if (!in_interrupt() && local_softirq_pending())			\
 		/* Use the async. stack for softirq */			\
-		do_call_softirq();					\
+		do_softirq();						\
 	preempt_enable_no_resched();					\
 } while (0)
 
_
