2.1.31: PATCH: SMP guess + compile fixes

Elliot Lee (sopwith@cuc.edu)
Fri, 4 Apr 1997 00:17:35 -0500 (EST)


Patch at end of message changes the top-level Makefile so it only sets SMP
on by default if `grep -c '^cpu ' /proc/cpuinfo` is bigger than 1 (i.e.
you have more than one CPU). This will make life easier for both those of
us who have run-of-the-mill systems, and those of them who have SMP
systems.

Patch also includes all the other fixes to date that I know of
that are needed to get 2.1.31 to compile (and one for the new net-tools
release).

I did not include all the patches necessary to get it to work perfectly
because you linux-kernel participants are supposed to be working on
creating those patches instead of (a) posting off-topic messages (b)
posting off-topic messages about posting off-topic messages (c) posting
off-topic messages about posting off-topic messages about posting
off-topic messages ....

I am not a kernel hacker (yet ?), so it would make me most happy to be
able to link to a web page that addresses the question of learning how to
help with kernel development. If someone puts one up, please let me know
via private E-mail.

In addition, is there a TODO list of smallerish tasks that need doing in
the kernel?

May the fleas of 1000 camels infest the armpits of those who persist in
distractive threads :)
-- Elliot Lee
http://www.redhat.com/ http://www.linuxexpo.org/

--- linux/kernel/sys.c.sopwith Fri Apr 4 23:21:08 1997
+++ linux/kernel/sys.c Fri Apr 4 23:10:48 1997
@@ -893,13 +893,14 @@
gid_t *groups = current->groups;
do {
if (*groups == grp)
- return;
+ goto out;
groups++;
i--;
} while (i);
}
return 0;
}
+out:
return 1;
}

--- linux/include/linux/ipv6_route.h.sopwith Fri Apr 4 23:53:43 1997
+++ linux/include/linux/ipv6_route.h Fri Apr 4 23:54:18 1997
@@ -34,6 +34,7 @@
__u16 rtmsg_src_len;
__u32 rtmsg_metric;
unsigned long rtmsg_info;
+ unsigned long rtmsg_prefixlen;
__u32 rtmsg_flags;
int rtmsg_ifindex;
};
--- linux/include/asm-i386/hardirq.h.sopwith Fri Apr 4 23:21:59 1997
+++ linux/include/asm-i386/hardirq.h Fri Apr 4 23:22:11 1997
@@ -1,7 +1,7 @@
#ifndef __ASM_HARDIRQ_H
#define __ASM_HARDIRQ_H

-extern unsigned int local_irq_count[NR_CPUS];
+unsigned int local_irq_count[NR_CPUS];
#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)

#ifndef __SMP__
--- linux/net/netsyms.c.sopwith Fri Apr 4 20:00:31 1997
+++ linux/net/netsyms.c Fri Apr 4 20:00:45 1997
@@ -150,10 +150,6 @@
EXPORT_SYMBOL(scm_detach_fds);
#endif

-#ifdef CONFIG_SMB_FS_MODULE
-EXPORT_SYMBOL(scm_detach_fds);
-#endif
-
#ifdef CONFIG_INET
/* Internet layer registration */
EXPORT_SYMBOL(inet_add_protocol);
--- linux/drivers/net/shaper.c.sopwith Fri Apr 4 23:17:10 1997
+++ linux/drivers/net/shaper.c Fri Apr 4 23:33:25 1997
@@ -614,7 +614,7 @@
if(err<0)
return err;
printk(SHAPER_BANNER);
- if (register_netdev(dev) != 0)
+ if (register_netdev(&dev_shape) != 0)
return -EIO;
printk("Traffic shaper initialised.\n");
return 0;
--- linux/arch/i386/kernel/time.c.sopwith Fri Apr 4 23:17:59 1997
+++ linux/arch/i386/kernel/time.c Fri Apr 4 23:11:42 1997
@@ -454,7 +454,7 @@
)*60 + sec; /* finally seconds */
}

-static unsigned long get_cmos_time(void)
+unsigned long get_cmos_time(void)
{
unsigned int year, mon, day, hour, min, sec;
int i;
--- linux/scripts/guess_smp.sopwith Fri Apr 4 23:29:36 1997
+++ linux/scripts/guess_smp Sat Apr 5 00:00:31 1997
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Guess whether we should be compiling in SMP support
+# Referenced by top-level Makefile
+
+if [ `grep -c '^cpu ' /proc/cpuinfo` -gt 1 ]; then
+ echo 1
+fi
--- linux/Makefile.sopwith Fri Apr 4 23:25:19 1997
+++ linux/Makefile Fri Apr 4 23:47:11 1997
@@ -11,7 +11,14 @@
#
# NOTE! SMP is experimental. See the file Documentation/SMP.txt
#
-SMP = 1
+
+SMP="`sh scripts/guess_smp`"
+
+# Uncomment this line if /proc/cpuinfo does not list more than one CPU
+# (perhaps because the presently running kernel does not have SMP support
+# in it)
+#SMP = 1
+
#
# SMP profiling options
# SMP_PROF = 1