[2.1.32] compilation+misc patches

Elliot Lee (sopwith@cuc.edu)
Mon, 7 Apr 1997 10:48:27 -0400 (EDT)


This patch includes (against 2.1.32)

- SMP autodetect thing that actually works.
- Some miscellaneous typo-fixes to make drivers like the shaper and arpd
support compile.
- Cut down on the number of compile-time warnings (left some alone because
they looked like they were fragments of the ongoing SMP development).
- Fix so you should be able to compile NFS as a module properly.

This is all stuff of my own discovery (apologies for the inclusion of
other's patches in my last submission).

Hope this helps,
-- Elliot Lee
http://www.redhat.com/ http://www.linuxexpo.org/
--- linux/fs/isofs/inode.c.sopwith Tue Apr 8 00:42:00 1997
+++ linux/fs/isofs/inode.c Tue Apr 8 00:57:13 1997
@@ -394,7 +394,7 @@
&& (orig_zonesize < blocksize) )
{
printk("Logical zone size(%ld) < hardware blocksize(%ld)\n",
- orig_zonesize, blocksize);
+ (long int)orig_zonesize, (long int) blocksize);
goto out;

}
@@ -554,7 +554,7 @@
if( (block << ISOFS_BUFFER_BITS(inode)) >= max_legal_read_offset )
{

- printk("_isofs_bmap: block>= EOF(%d, %d)", block,
+ printk("_isofs_bmap: block>= EOF(%d, %ld)", block,
inode->i_size);
}
return 0;
--- linux/fs/isofs/dir.c.sopwith Tue Apr 8 00:43:49 1997
+++ linux/fs/isofs/dir.c Tue Apr 8 00:44:07 1997
@@ -172,8 +172,8 @@
* entries should terminate with a null size
* or end exactly at the end of the sector.
*/
- printk("next_offset (%x) > bufsize (%x)\n",
- offset,bufsize);
+ printk("next_offset (%x) > bufsize (%lx)\n",
+ offset, bufsize);
break;
}

--- linux/fs/autofs/waitq.c.sopwith Tue Apr 8 00:44:31 1997
+++ linux/fs/autofs/waitq.c Tue Apr 8 00:47:51 1997
@@ -47,6 +47,9 @@

/** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/

+ if(bytes == 0)
+ return 0;
+
/* Save pointer to user space and point back to kernel space */
fs = get_fs();
set_fs(KERNEL_DS);
--- linux/fs/Config.in.sopwith Tue Apr 8 02:22:12 1997
+++ linux/fs/Config.in Tue Apr 8 02:23:54 1997
@@ -25,6 +25,9 @@
bool ' BOOTP support' CONFIG_RNFS_BOOTP
bool ' RARP support' CONFIG_RNFS_RARP
fi
+ elif [ "$CONFIG_NFS_FS" = "m" ]; then
+ define_bool CONFIG_SUNRPC m
+ define_bool CONFIG_LOCKD m
fi
tristate 'SMB filesystem support (to mount WfW shares etc..)' CONFIG_SMB_FS
if [ "$CONFIG_SMB_FS" != "n" ]; then
--- linux/net/ipv4/arp.c.sopwith Mon Apr 7 22:46:10 1997
+++ linux/net/ipv4/arp.c Mon Apr 7 22:57:37 1997
@@ -424,7 +424,7 @@
arpreq->stamp = arpd_stamp;
arpreq->updated = updated;
if (ha)
- memcpy(arpreq->u.neigh.ha, ha, sizeof(arpreq->u.neigh.ha));
+ memcpy(arpreq->ha, ha, sizeof(arpreq->ha));

retval = netlink_post(NETLINK_ARPD, skb);
if (retval)
@@ -503,7 +503,7 @@
else
{
start_bh_atomic();
- arp_update(retreq->ip, retreq->u.neigh.ha, dev, retreq->updated, 0);
+ arp_update(retreq->ip, retreq->ha, dev, retreq->updated, 0);
end_bh_atomic();
}

--- linux/net/ipv4/ipmr.c.sopwith Mon Apr 7 23:04:29 1997
+++ linux/net/ipv4/ipmr.c Mon Apr 7 23:52:04 1997
@@ -314,6 +314,7 @@
kfree_skb(skb, FREE_READ);
return ret;
}
+ return 0;
}

/*
@@ -357,7 +358,7 @@
/* If the report failed throw the cache entry
out - Brad Parker */
if(ipmr_cache_report(skb, vifi, 0)<0)
- impr_cache_delete(cache);
+ ipmr_cache_delete(cache);
}
}
/*
--- linux/net/wanrouter/wanproc.c.sopwith Tue Apr 8 00:49:05 1997
+++ linux/net/wanrouter/wanproc.c Tue Apr 8 00:51:59 1997
@@ -273,7 +273,7 @@

int wanrouter_proc_init (void)
{
- int err = proc_register(&proc_net, &proc_router);
+ int err = proc_net_register(&proc_router);

if (!err)
{
@@ -293,7 +293,7 @@
proc_unregister(&proc_router, proc_router_info.low_ino);
proc_unregister(&proc_router, proc_router_conf.low_ino);
proc_unregister(&proc_router, proc_router_stat.low_ino);
- proc_unregister(&proc_net, proc_router.low_ino);
+ proc_net_unregister(proc_router.low_ino);
}

/*
--- linux/drivers/net/ltpc.c.sopwith Mon Apr 7 23:20:02 1997
+++ linux/drivers/net/ltpc.c Mon Apr 7 23:20:31 1997
@@ -1258,7 +1258,7 @@
if(debug&DEBUG_VERBOSE) printk("waiting\n");
/* if it's in process, wait a bit for it to finish */
timeout = jiffies+HZ;
- add_timer(&ltpc_timer)
+ add_timer(&ltpc_timer);
while(del_timer(&ltpc_timer) && (timeout > jiffies))
{
add_timer(&ltpc_timer);
--- linux/drivers/net/lance.c.sopwith Mon Apr 7 23:48:58 1997
+++ linux/drivers/net/lance.c Mon Apr 7 23:50:38 1997
@@ -610,7 +610,8 @@
can watch the LEDs even if the board isn't opened. */
outw(0x0002, ioaddr+LANCE_ADDR);
/* set autoselect and clean xmausel */
- outw(inw(ioaddr+LANCE_BUS_IF) & 0xfffe | 0x0002, ioaddr+LANCE_BUS_IF);
+ outw((inw(ioaddr+LANCE_BUS_IF) & 0xfffe) | 0x0002,
+ ioaddr+LANCE_BUS_IF);
}

if (lance_debug > 0 && did_version++ == 0)
@@ -668,7 +669,8 @@
/* This is 79C960-specific: Turn on auto-select of media (AUI, BNC). */
outw(0x0002, ioaddr+LANCE_ADDR);
/* set autoselect and clean xmausel */
- outw(inw(ioaddr+LANCE_BUS_IF) & 0xfffe | 0x0002, ioaddr+LANCE_BUS_IF);
+ outw((inw(ioaddr+LANCE_BUS_IF) & 0xfffe) | 0x0002,
+ ioaddr+LANCE_BUS_IF);
}

if (lance_debug > 1)
--- linux/drivers/net/de4x5.c.sopwith Tue Apr 8 00:03:18 1997
+++ linux/drivers/net/de4x5.c Tue Apr 8 00:04:32 1997
@@ -4677,7 +4677,9 @@
u32 *lval;
} tmp;

- tmp.addr = tmp.sval = tmp.lval = kmalloc(HASH_TABLE_LEN * ETH_ALEN, GFP_KERNEL);
+ tmp.addr = (u8 *) tmp.sval = (u16 *) tmp.lval =
+ kmalloc(HASH_TABLE_LEN * ETH_ALEN, GFP_KERNEL);
+
if (!tmp.addr){
printk("%s ioctl: memory squeeze.\n", dev->name);
return -ENOMEM;
--- linux/drivers/net/apricot.c.sopwith Tue Apr 8 00:04:42 1997
+++ linux/drivers/net/apricot.c Tue Apr 8 00:19:56 1997
@@ -826,8 +826,6 @@
}
case CmdMulticastList:
{
- unsigned short count = *((unsigned short *) (ptr + 1));
-
ptr->next = (struct i596_cmd * ) I596_NULL;
kfree(ptr);
break;
@@ -1032,7 +1030,7 @@
cleanup_module(void)
{
unregister_netdev(&dev_apricot);
- kfree(dev_apricot.mem_start);
+ kfree((void *) dev_apricot.mem_start);
dev_apricot.priv = NULL;

/* If we don't do this, we can't re-insmod it later. */
--- linux/drivers/net/dgrs.c.sopwith Tue Apr 8 00:21:23 1997
+++ linux/drivers/net/dgrs.c Tue Apr 8 00:21:45 1997
@@ -843,7 +843,7 @@
{
DGRS_PRIV *privN = (DGRS_PRIV *) devN->priv;
DGRS_IOCTL ioc;
- int i, rc;
+ int i;

if (cmd != DGRSIOCTL)
return -EINVAL;
--- linux/drivers/block/xd.h.sopwith Mon Apr 7 23:09:32 1997
+++ linux/drivers/block/xd.h Mon Apr 7 23:11:16 1997
@@ -112,7 +112,7 @@
static int xd_open (struct inode *inode,struct file *file);
static void do_xd_request (void);
static int xd_ioctl (struct inode *inode,struct file *file,unsigned int cmd,unsigned long arg);
-static void xd_release (struct inode *inode,struct file *file);
+static int xd_release (struct inode *inode,struct file *file);
static int xd_reread_partitions (kdev_t dev);
static int xd_readwrite (u_char operation,u_char drive,char *buffer,u_int block,u_int count);
static void xd_recalibrate (u_char drive);
--- linux/drivers/block/ez.c.sopwith Mon Apr 7 23:57:02 1997
+++ linux/drivers/block/ez.c Mon Apr 7 23:57:35 1997
@@ -175,7 +175,7 @@
static void do_ez_request(void);
static int ez_ioctl(struct inode *inode,struct file *file,
unsigned int cmd, unsigned long arg);
-static void ez_release (struct inode *inode, struct file *file);
+static int ez_release (struct inode *inode, struct file *file);
static int ez_revalidate(kdev_t dev);
static int ez_check_media(kdev_t dev);
static void ez_get_capacity( void );
@@ -386,7 +386,7 @@
}
}

-static void ez_release (struct inode *inode, struct file *file)
+static int ez_release (struct inode *inode, struct file *file)

{ kdev_t devp;

@@ -399,6 +399,8 @@
if (!ez_access) ez_doorlock(IDE_DOORUNLOCK);
MOD_DEC_USE_COUNT;
}
+
+ return 0;
}

static int ez_check_media( kdev_t dev)
--- linux/drivers/char/cyclades.c.sopwith Tue Apr 8 03:45:58 1997
+++ linux/drivers/char/cyclades.c Tue Apr 8 03:46:52 1997
@@ -622,7 +622,7 @@
cy_sched_event(struct cyclades_port *info, int event)
{
info->event |= 1 << event; /* remember what kind of event and who */
- queue_task_irq_off(&info->tqueue, &tq_cyclades); /* it belongs to */
+ queue_task(&info->tqueue, &tq_cyclades); /* it belongs to */
mark_bh(CYCLADES_BH); /* then trigger event */
} /* cy_sched_event */

@@ -820,7 +820,7 @@
#endif
}
}
- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);
}
/* end of service */
base_addr[CyRIR<<index] = (save_xir & 0x3f);
--- linux/drivers/char/istallion.c.sopwith Tue Apr 8 03:46:01 1997
+++ linux/drivers/char/istallion.c Tue Apr 8 03:47:02 1997
@@ -2449,7 +2449,7 @@
if (! ((portp->flags & ASYNC_CALLOUT_ACTIVE) &&
(portp->flags & ASYNC_CALLOUT_NOHUP))) {
if (tty != (struct tty_struct *) NULL)
- queue_task_irq_off(&portp->tqhangup, &tq_scheduler);
+ queue_task(&portp->tqhangup, &tq_scheduler);
}
}
}
--- linux/drivers/char/stallion.c.sopwith Tue Apr 8 03:46:04 1997
+++ linux/drivers/char/stallion.c Tue Apr 8 03:47:23 1997
@@ -3300,7 +3300,7 @@
len = (head >= tail) ? (head - tail) : (STL_TXBUFSIZE - (tail - head));
if ((len == 0) || ((len < STL_TXBUFLOW) && (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate);
- queue_task_irq_off(&portp->tqueue, &tq_scheduler);
+ queue_task(&portp->tqueue, &tq_scheduler);
}

if (len == 0) {
@@ -3478,7 +3478,7 @@
misr = inb(ioaddr + EREG_DATA);
if (misr & MISR_DCD) {
set_bit(ASYI_DCDCHANGE, &portp->istate);
- queue_task_irq_off(&portp->tqueue, &tq_scheduler);
+ queue_task(&portp->tqueue, &tq_scheduler);
portp->stats.modem++;
}

@@ -4158,7 +4158,7 @@
len = (head >= tail) ? (head - tail) : (STL_TXBUFSIZE - (tail - head));
if ((len == 0) || ((len < STL_TXBUFLOW) && (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate);
- queue_task_irq_off(&portp->tqueue, &tq_scheduler);
+ queue_task(&portp->tqueue, &tq_scheduler);
}

if (len == 0) {
@@ -4376,7 +4376,7 @@
ipr = stl_sc26198getreg(portp, IPR);
if (ipr & IPR_DCDCHANGE) {
set_bit(ASYI_DCDCHANGE, &portp->istate);
- queue_task_irq_off(&portp->tqueue, &tq_scheduler);
+ queue_task(&portp->tqueue, &tq_scheduler);
portp->stats.modem++;
}
break;
--- linux/drivers/char/pcxx.c.sopwith Tue Apr 8 03:46:10 1997
+++ linux/drivers/char/pcxx.c Tue Apr 8 03:47:48 1997
@@ -287,7 +287,7 @@
static inline void pcxe_sched_event(struct channel *info, int event)
{
info->event |= 1 << event;
- queue_task_irq_off(&info->tqueue, &tq_pcxx);
+ queue_task(&info->tqueue, &tq_pcxx);
mark_bh(DIGI_BH);
}

--- linux/drivers/char/riscom8.c.sopwith Tue Apr 8 03:46:16 1997
+++ linux/drivers/char/riscom8.c Tue Apr 8 03:48:13 1997
@@ -336,7 +336,7 @@
* Still hope this will be changed in near future.
*/
set_bit(event, &port->event);
- queue_task_irq_off(&port->tqueue, &tq_riscom);
+ queue_task(&port->tqueue, &tq_riscom);
mark_bh(RISCOM8_BH);
}

@@ -418,7 +418,7 @@

*tty->flip.char_buf_ptr++ = ch;
tty->flip.count++;
- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);
}

extern inline void rc_receive(struct riscom_board const * bp)
@@ -448,7 +448,7 @@
*tty->flip.flag_buf_ptr++ = 0;
tty->flip.count++;
}
- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);
}

extern inline void rc_transmit(struct riscom_board const * bp)
@@ -537,7 +537,7 @@
wake_up_interruptible(&port->open_wait);
else if (!((port->flags & ASYNC_CALLOUT_ACTIVE) &&
(port->flags & ASYNC_CALLOUT_NOHUP)))
- queue_task_irq_off(&port->tqueue_hangup,
+ queue_task(&port->tqueue_hangup,
&tq_scheduler);
}

--- linux/drivers/scsi/AM53C974.c.sopwith Tue Apr 8 00:22:14 1997
+++ linux/drivers/scsi/AM53C974.c Tue Apr 8 00:22:42 1997
@@ -2606,7 +2606,7 @@


#ifdef MODULE
-static Scsi_Host_Template driver_template = AM53C974;
+static Scsi_Host_Template driver_template = (Scsi_Host_Template) AM53C974;

#include "scsi_module.c"
#endif
--- linux/drivers/scsi/g_NCR5380.c.sopwith Tue Apr 8 00:22:55 1997
+++ linux/drivers/scsi/g_NCR5380.c Tue Apr 8 00:26:39 1997
@@ -616,10 +616,12 @@
unsigned char status;
int i;
struct Scsi_Host *scsi_ptr;
- Scsi_Device *dev;
Scsi_Cmnd *ptr;
struct NCR5380_hostdata *hostdata;
+#ifdef NCR5380_STATS
+ Scsi_Device *dev;
extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
+#endif

cli();

--- linux/drivers/scsi/t128.c.sopwith Tue Apr 8 00:29:21 1997
+++ linux/drivers/scsi/t128.c Tue Apr 8 00:30:53 1997
@@ -218,8 +218,9 @@
#endif
for (sig = 0; sig < NO_SIGNATURES; ++sig)
if (!bases[current_base].noauto &&
- check_signature(bases[current_base].address +
- signatures[sig].offset,
+ check_signature((unsigned long)
+ (bases[current_base].address +
+ signatures[sig].offset),
signatures[sig].string,
strlen(signatures[sig].string))) {
base = bases[current_base].address;
--- linux/drivers/sound/audio.c.sopwith Tue Apr 8 00:31:19 1997
+++ linux/drivers/sound/audio.c Tue Apr 8 00:31:48 1997
@@ -38,6 +38,9 @@
static int audio_format[MAX_AUDIO_DEV];
static int local_conversion[MAX_AUDIO_DEV];

+static int
+dma_ioctl (int dev, unsigned int cmd, caddr_t arg);
+
#define CNV_MU_LAW 0x00000001
static int
set_format (int dev, int fmt)
--- linux/drivers/isdn/teles/card.c.sopwith Tue Apr 8 00:39:45 1997
+++ linux/drivers/isdn/teles/card.c Tue Apr 8 03:44:02 1997
@@ -350,7 +350,7 @@
hscx_sched_event(struct HscxState *hsp, int event)
{
hsp->event |= 1 << event;
- queue_task_irq_off(&hsp->tqueue, &tq_immediate);
+ queue_task(&hsp->tqueue, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}

@@ -544,7 +544,7 @@
isac_sched_event(struct IsdnCardState *sp, int event)
{
sp->event |= 1 << event;
- queue_task_irq_off(&sp->tqueue, &tq_immediate);
+ queue_task(&sp->tqueue, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}

--- linux/drivers/isdn/hisax/isdnl1.c.sopwith Tue Apr 8 00:40:26 1997
+++ linux/drivers/isdn/hisax/isdnl1.c Tue Apr 8 03:48:36 1997
@@ -230,7 +230,7 @@
hscx_sched_event(struct HscxState *hsp, int event)
{
hsp->event |= 1 << event;
- queue_task_irq_off(&hsp->tqueue, &tq_immediate);
+ queue_task(&hsp->tqueue, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}

@@ -248,7 +248,7 @@
isac_sched_event(struct IsdnCardState *sp, int event)
{
sp->event |= 1 << event;
- queue_task_irq_off(&sp->tqueue, &tq_immediate);
+ queue_task(&sp->tqueue, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}

--- linux/drivers/isdn/isdn_common.c.sopwith Tue Apr 8 00:32:37 1997
+++ linux/drivers/isdn/isdn_common.c Tue Apr 8 00:32:45 1997
@@ -1818,7 +1818,7 @@
if (minor < ISDN_MINOR_CTRL) {
drvidx = isdn_minor2drv(minor);
if (drvidx < 0)
- return;
+ return 0;
c.command = ISDN_CMD_UNLOCK;
c.driver = drvidx;
(void) dev->drv[drvidx]->interface->command(&c);
--- linux/drivers/isdn/isdn_tty.c.sopwith Tue Apr 8 00:33:50 1997
+++ linux/drivers/isdn/isdn_tty.c Tue Apr 8 00:38:59 1997
@@ -212,7 +212,7 @@
}
if (info->emu.mdmreg[12] & 128)
tty->flip.flag_buf_ptr[len - 1] = 0xff;
- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);
SET_SKB_FREE(skb);
kfree_skb(skb, FREE_READ);
return 1;
@@ -263,7 +263,7 @@
tty->flip.flag_buf_ptr += r;
tty->flip.char_buf_ptr += r;
if (r)
- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);
restore_flags(flags);
}
} else
--- linux/drivers/sbus/char/sunserial.c.sopwith Tue Apr 8 03:48:47 1997
+++ linux/drivers/sbus/char/sunserial.c Tue Apr 8 03:49:03 1997
@@ -391,7 +391,7 @@
int event)
{
info->event |= 1 << event;
- queue_task_irq_off(&info->tqueue, &tq_serial);
+ queue_task(&info->tqueue, &tq_serial);
mark_bh(SERIAL_BH);
}

@@ -469,7 +469,7 @@
goto clear_and_exit;

if (tty->flip.count >= TTY_FLIPBUF_SIZE)
- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);
tty->flip.count++;
if(stat & PAR_ERR)
*tty->flip.flag_buf_ptr++ = TTY_PARITY;
@@ -481,7 +481,7 @@
*tty->flip.flag_buf_ptr++ = 0; /* XXX */
*tty->flip.char_buf_ptr++ = ch;

- queue_task_irq_off(&tty->flip.tqueue, &tq_timer);
+ queue_task(&tty->flip.tqueue, &tq_timer);

clear_and_exit:
rs_recv_clear(info->zs_channel);
--- linux/arch/i386/kernel/time.c.sopwith Mon Apr 7 23:54:59 1997
+++ linux/arch/i386/kernel/time.c Mon Apr 7 23:56:10 1997
@@ -245,10 +245,12 @@
/*
* this is only used if we have fast gettimeoffset:
*/
+#ifndef CONFIG_APM
static void do_x86_get_fast_time(struct timeval * tv)
{
do_gettimeofday(tv);
}
+#endif

static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;

--- linux/arch/i386/Makefile.sopwith Tue Apr 8 02:59:24 1997
+++ linux/arch/i386/Makefile Tue Apr 8 02:59:33 1997
@@ -63,10 +63,6 @@
CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
endif

-ifdef SMP
-CFLAGS := $(CFLAGS) -D__SMP__
-endif
-
HEAD := arch/i386/kernel/head.o

SUBDIRS := $(SUBDIRS) arch/i386/kernel arch/i386/mm arch/i386/lib
--- linux/Makefile.sopwith Tue Apr 8 02:32:43 1997
+++ linux/Makefile Tue Apr 8 03:01:38 1997
@@ -11,10 +11,16 @@
#
# NOTE! SMP is experimental. See the file Documentation/SMP.txt
#
+
+SMP=$(shell 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
+#SMP_PROF = 1

.EXPORT_ALL_VARIABLES:

@@ -94,11 +100,11 @@
CFLAGS := $(CFLAGS) -x c++
endif

-ifdef SMP
+ifeq ($(SMP),1)
CFLAGS += -D__SMP__
AFLAGS += -D__SMP__

-ifdef SMP_PROF
+ifeq ($(SMP_PROF),1)
CFLAGS += -D__SMP_PROF__
AFLAGS += -D__SMP_PROF__
endif