More patches for 2.1.81

Steven N. Hirsch (shirsch@ibm.net)
Sat, 24 Jan 1998 15:58:30 -0500 (EST)


All,

Here are the latest round of patches to build 2.1.81 for UP
(single-processor, for the mnemonically-deprived) machines. Tested on
6x86 and Alpha.

Steve

--- linux/include/asm-i386/softirq.h.orig Fri Jan 23 23:54:28 1998
+++ linux/include/asm-i386/softirq.h Sat Jan 24 00:15:32 1998
@@ -91,8 +91,8 @@
}

/* These are for the irq's testing the lock */
-#define softirq_trylock() (in_bh ? 0 : (local_bh_count[smp_processor_id()]=1))
-#define softirq_endlock() (local_bh_count[smp_processor_id()] = 0)
+#define softirq_trylock(cpu) (in_bh() ? 0 : (local_bh_count[smp_processor_id()]=1))
+#define softirq_endlock(cpu) (local_bh_count[smp_processor_id()] = 0)
#define synchronize_bh() do { } while (0)

#endif /* SMP */
--- linux/arch/i386/kernel/i386_ksyms.c.orig Fri Jan 23 23:54:19 1998
+++ linux/arch/i386/kernel/i386_ksyms.c Sat Jan 24 09:21:21 1998
@@ -39,7 +39,9 @@
EXPORT_SYMBOL_NOVERS(__down_failed);
EXPORT_SYMBOL_NOVERS(__down_failed_interruptible);
EXPORT_SYMBOL_NOVERS(__up_wakeup);
+#ifdef __SMP__
EXPORT_SYMBOL(global_bh_lock);
+#endif
/* Networking helper routines. */
EXPORT_SYMBOL(csum_partial_copy);
/* Delay loops */
--- linux/arch/alpha/kernel/irq.c.orig Fri Jan 23 23:54:19 1998
+++ linux/arch/alpha/kernel/irq.c Sat Jan 24 00:00:04 1998
@@ -373,7 +373,7 @@
if (!action)
continue;
len += sprintf(buf+len, "%2d: %10u %c %s",
- i, kstat.interrupts[0][i],
+ i, kstat.irqs[0][i],
(action->flags & SA_INTERRUPT) ? '+' : ' ',
action->name);
for (action=action->next; action; action = action->next) {
@@ -567,7 +567,7 @@
int cpu = smp_processor_id();

irq_enter(cpu, irq);
- kstat.interrupts[0][irq] += 1;
+ kstat.irqs[0][irq] += 1;
if (!action) {
unexpected_irq(irq, regs);
} else {
@@ -590,7 +590,7 @@
}

irq_enter(cpu, irq);
- kstat.interrupts[0][irq] += 1;
+ kstat.irqs[0][irq] += 1;
action = irq_action[irq];
/*
* For normal interrupts, we mask it out, and then ACK it.
--- linux/include/linux/sched.h.orig Sat Jan 24 09:33:26 1998
+++ linux/include/linux/sched.h Sat Jan 24 09:38:23 1998
@@ -307,8 +307,10 @@
*/
#ifdef __SMP__
#define INIT_LOCKS SPIN_LOCK_UNLOCKED
+#define INIT_CPU_TIMES {0,0,}
#else
#define INIT_LOCKS
+#define INIT_CPU_TIMES {0,}
#endif

/*
@@ -332,7 +334,7 @@
/* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0,0, \
/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
/* utime */ {0,0,0,0},0, \
-/* per cpu times */ {0, 0, }, {0, 0, }, \
+/* per cpu times */ INIT_CPU_TIMES, INIT_CPU_TIMES, \
/* flt */ 0,0,0,0,0,0, \
/* swp */ 0,0,0,0,0, \
/* rlimits */ INIT_RLIMITS, \
--- linux/arch/i386/kernel/irq.c.orig Fri Jan 23 23:54:19 1998
+++ linux/arch/i386/kernel/irq.c Sat Jan 24 09:25:13 1998
@@ -639,6 +639,8 @@
irq_exit(cpu, irq);
}

+#ifdef __SMP__
+
/*
* FIXME! This is completely broken.
*/
@@ -680,6 +682,8 @@
enable_IO_APIC_irq(irq);
}

+#endif
+
/*
* do_IRQ handles all normal device IRQ's (the special
* SMP cross-CPU interrupts have their own specific
@@ -714,9 +718,10 @@
kstat.irqs[cpu][irq]++;

do_lowlevel_IRQ = do_8259A_IRQ;
+#ifdef __SMP__
if (IO_APIC_IRQ(irq))
do_lowlevel_IRQ = do_ioapic_IRQ;
-
+#endif
do_lowlevel_IRQ(irq, cpu, &regs);

/*
--- linux/include/asm-alpha/smp.h.orig Sat Jan 24 13:04:31 1998
+++ linux/include/asm-alpha/smp.h Sat Jan 24 12:58:04 1998
@@ -1,5 +1,12 @@
#ifndef __ASM_SMP_H
#define __ASM_SMP_H
+
+extern inline int cpu_logical_map(int cpu)
+{
+ return cpu;
+}
+
+
/* We'll get here eventually.. */

#endif
--- linux/include/asm-alpha/softirq.h.orig Sat Nov 22 16:49:14 1997
+++ linux/include/asm-alpha/softirq.h Sat Jan 24 12:53:52 1998
@@ -80,10 +80,10 @@
#ifndef __SMP__

/* These are for the irq's testing the lock */
-#define softirq_trylock() (atomic_read(&__alpha_bh_counter) ? \
+#define softirq_trylock(cpu) (atomic_read(&__alpha_bh_counter) ? \
0 : \
((atomic_set(&__alpha_bh_counter,1)),1))
-#define softirq_endlock() (atomic_set(&__alpha_bh_counter, 0))
+#define softirq_endlock(cpu) (atomic_set(&__alpha_bh_counter, 0))

#else