Commit bfe296ce authored by Linus Torvalds's avatar Linus Torvalds

[tytso] include/asm-i386/posix_types.h

This quick fix eliminates a lot of warning messages when
compiling e2fsprogs under glibc.  This is because the glibc header files
defines its own version of FD_SET, FD_ZERO, etc., and so if you need to
#include the kernel include files, you get a lot of duplicate defined
macro warning messages.  This patch simply #ifdef's out the kernel
versions of these function if the kernel is not being compiled and the
glibc header files are in use.
parent 17559565
......@@ -467,7 +467,7 @@ S: Italy
N: Rik Faith
E: faith@cs.unc.edu
E: r.faith@ieee.org
E: faith@acm.org
D: Author: Future Domain TMC-16x0 SCSI driver
D: Debugging: SCSI code; Cyclades serial driver; APM driver
D: Debugging: XFree86 Mach 32 server, accelerated server code
......
This is a brief list of all the files in ./linux/Documentation and what
they contain. If you add a documentation file, please list it here in
alphabetical order as well, or risk being hunted down like a rabid dog.
Note that subdirectories have their own index files too.
Note that subdirectories have their own index files too. Please try and
keep the descriptions small enough to fit on one line.
Thanks -- Paul G.
00-INDEX
......@@ -56,6 +57,8 @@ java.txt
- info on the in-kernel binary support for Java(tm)
joystick.txt
- info on using joystick devices (and driver) with linux.
kmod.txt
- - info on the kernel module loader/unloader (kerneld replacement)
locks.txt
- info on file locking implementations, flock() vs. fcntl(), etc.
logo.gif
......@@ -76,6 +79,8 @@ memory.txt
- info on typical Linux memory problems.
modules.txt
- short guide on how to make kernel parts into loadable modules
mtrr.txt
- how to use PPro Memory Type Range Registers to increase performance
nbd.txt
- info on a TCP implementation of a network block device.
networking/
......
00-INDEX
- this file (info on CD-ROMs and Linux)
Makefile
- only used to generate TeX output from the documentation.
aztcd
- info on Aztech/Orchid/Okano/Wearnes/Conrad/CyCDROM driver.
cdrom-standard.tex
- LaTeX document on standardizing the CD-ROM programming interface.
cdu31a
......
......@@ -5,8 +5,7 @@ affs.txt
coda.txt
- description of the CODA filesystem.
fat_cvf.txt
- Description of the Compressed Volume Files extension to the FAT
filesystem
- info on the Compressed Volume Files extension to the FAT filesystem
hpfs.txt
- info and mount options for the OS/2 HPFS.
isofs.txt
......
......@@ -93,7 +93,7 @@ Installation
First, the "normal" root file system has to be prepared as follows:
# mknod /dev/initrd b 0 250
# mknod /dev/initrd b 1 250
# chmod 400 /dev/initrd
# mkdir /initrd
......
......@@ -315,7 +315,7 @@ applications, please refer to the following documentation:
All necessary files can be found at
ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/680x0/
ftp://ftp.uni-erlangen.de/pub/Linux/680x0/
and on its mirrors.
......
......@@ -15,7 +15,7 @@ the same filter code structure as the BSD Berkeley Packet Filter
(BPF), so refering to the BSD bpf.4 manpage is very helpful in
creating filters.
LSF is much simpler that BPF. One does not have to worry about
LSF is much simpler than BPF. One does not have to worry about
devices or anything like that. You simply create your filter
code, send it to the kernel via the SO_ATTACH_FILTER ioctl and
if your filter code passes the kernel check on it, you then
......
Behaviour of cards under Multicast. This is how they currently
behave not what the hardware can do. In particular all the 8390 based
cards don't use the onboard hash filter, and the lance driver doesn't
behave not what the hardware can do - i.e. the lance driver doesn't
use its filter, even though the code for loading it is in the DEC
lance based driver.
......
......@@ -129,7 +129,7 @@ fprintf(stderr, "\nAgain, from using select(2) on /dev/rtc:");
fflush(stderr);
for (i=1; i<6; i++) {
struct timeval tv = {5, 0}; /* 5 second timeout on select */
struct fd_set readfds;
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(fd, &readfds);
......
......@@ -72,14 +72,12 @@ Flag Dependencies
modular, 'make' will notice that the foo.o was not compiled
with -DMODULE and will recompile foo.c.
Flag dependencies also work with per-source-file flags such
as those in drivers/net/CONFIG.
All .a and .o files made from C source or with 'ld' or 'ar'
have flag dependencies. .S files do not have flag dependencies.
Per-source-file Flags
Flag dependencies also work with per-source-file flags.
You can specify compilation flags for individual source files
like this:
......
......@@ -46,7 +46,7 @@ On other - If you know of the key combos for other architectures, please
'm' - Will dump current memory info to your console.
'0'-'8' - Sets the console log level, controlling which kernel messages
'0'-'9' - Sets the console log level, controlling which kernel messages
will be printed to your console. ('0', for example would make
it so that only emergency messages like PANICs or OOPSes would
make it to your console.)
......@@ -69,12 +69,17 @@ re'B'oot is good when you're unable to shut down. But you should also 'S'ync
and 'U'mount first.
'S'ync is great when your system is locked up, it allows you to sync your
disks and will certainly lessen the chance of data loss and fscking.
disks and will certainly lessen the chance of data loss and fscking. Note
that the sync hasn't taken place until you see the "OK" and "Done" appear
on the screen. (If the kernel is really in strife, you may not ever get the
OK or Done message...)
'U'mount is basically useful in the same ways as 'S'ync. I generally 'S'ync,
'U'mount, then re'B'oot when my system locks. It's saved me many a fsck.
Again, the unmount (remount read-only) hasn't taken place until you see the
"OK" and "Done" message appear on the screen.
The loglevel'0'-'8' is useful when your console is being flooded with
The loglevel'0'-'9' is useful when your console is being flooded with
kernel messages you do not want to see. Setting '0' will prevent all but
the most urgent kernel messages from reaching your console. (They will
still be logged if syslogd/klogd are alive, though.)
......@@ -87,7 +92,8 @@ processes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That happens to me, also. I've found that tapping shift, alt, and control
on both sides of the keyboard, and hitting an invalid sysrq sequence again
will fix the problem. (ie, something like alt-sysrq-z).
will fix the problem. (ie, something like alt-sysrq-z). Switching to another
virtual console (ALT+Fn) and then back again should also help.
* I hit SysRQ, but nothing seems to happen, what's wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -107,8 +107,8 @@ L: linux-scsi@vger.rutgers.edu
S: Maintained
APM DRIVER
P: Rik Faith & Stephen Rothwell
M: faith@cs.unc.edu, Stephen.Rothwell@canb.auug.org.au
P: Stephen Rothwell
M: Stephen.Rothwell@canb.auug.org.au
L: linux-laptop@vger.rutgers.edu
S: Maintained
......
......@@ -46,6 +46,8 @@
#endif
#include "irq.h"
spinlock_t semaphore_wake_lock = SPIN_LOCK_UNLOCKED;
struct task_struct *last_task_used_math = NULL;
#ifdef __SMP__
......
......@@ -57,8 +57,6 @@
#include "irq.h"
spinlock_t semaphore_wake_lock = SPIN_LOCK_UNLOCKED;
extern unsigned long start_kernel, _etext;
extern void update_one_process( struct task_struct *p,
unsigned long ticks, unsigned long user,
......
This diff is collapsed.
......@@ -168,6 +168,7 @@ static __inline__ void lp_schedule(int minor)
register unsigned long int timeslip = (jiffies - dev->time);
if ((timeslip > dev->timeslice) && (dev->port->waithead != NULL)) {
lp_parport_release(minor);
lp_table[minor].irq_missed = 1;
schedule ();
lp_parport_claim(minor);
} else
......
This diff is collapsed.
This diff is collapsed.
......@@ -1022,6 +1022,10 @@ static void release_dev(struct file * filp)
}
}
#endif
if (tty->driver.close)
tty->driver.close(tty, filp);
/*
* Sanity check: if tty->count is going to zero, there shouldn't be
* any waiters on tty->read_wait or tty->write_wait. We test the
......@@ -1079,9 +1083,6 @@ static void release_dev(struct file * filp)
* block, so it's safe to proceed with closing.
*/
if (tty->driver.close)
tty->driver.close(tty, filp);
if (pty_master) {
if (--o_tty->count < 0) {
printk("release_dev: bad pty slave count (%d) for %s\n",
......
......@@ -595,7 +595,7 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
performed, so there should be no Host Adapter state lost by a
Soft Reset in response to a Command Invalid condition.
*/
mdelay(1);
udelay(1000);
StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter);
if (StatusRegister.Bits.CommandInvalid ||
StatusRegister.Bits.Reserved ||
......@@ -607,7 +607,7 @@ static int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter,
StatusRegister.Bits.DiagnosticFailure)
{
BusLogic_SoftReset(HostAdapter);
mdelay(1);
udelay(1000);
}
BusLogic_CommandFailureReason = "Command Invalid";
Result = -1;
......
......@@ -100,8 +100,6 @@ linux-1.1.x and fairly stable since linux-1.2.x, and are also in FreeBSD
Boot Command line options
------------------------------
"aic7xxx=no_reset" - Eliminate the SCSI reset delay during startup.
Some SCSI devices need some extra time to reset.
"aic7xxx=reverse_scan" - Have the driver register the SCSI cards in the
reverse of the normal order. This may help those people who have more
than one PCI Adaptec controller force the correct controller to be
......
......@@ -319,8 +319,7 @@ static int aha1542_test_port(int bse, struct Scsi_Host * shpnt)
outb(SRST|IRST/*|SCRST*/, CONTROL(bse));
i = jiffies + 2;
while (i>jiffies); /* Wait a little bit for things to settle down. */
mdelay(20); /* Wait a little bit for things to settle down. */
debug = 1;
/* Expect INIT and IDLE, any of the others are bad */
......
......@@ -209,7 +209,7 @@ struct proc_dir_entry proc_scsi_aic7xxx = {
0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
#define AIC7XXX_C_VERSION "5.0.17"
#define AIC7XXX_C_VERSION "5.0.18"
#define NUMBER(arr) (sizeof(arr) / sizeof(arr[0]))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
......@@ -874,9 +874,10 @@ struct aic7xxx_host {
unsigned char dev_commands_sent[MAX_TARGETS];
/*
* The next 64 (or 128 on 64 bit machines)....
* The next 128 (or 256 on 64 bit machines)....
*/
Scsi_Cmnd *dev_negotiation_cmnd[MAX_TARGETS];
Scsi_Cmnd *dev_wdtr_cmnd[MAX_TARGETS];
Scsi_Cmnd *dev_sdtr_cmnd[MAX_TARGETS];
/*
* The next 64....
......@@ -1050,7 +1051,6 @@ static int aic7xxx_7895_irq_hack = -1; /* This enables a hack to fix
* 1 == Use the Channel B IRQ
*/
static unsigned int aic7xxx_extended = 0; /* extended translation on? */
static unsigned int aic7xxx_no_reset = 0; /* no resetting of SCSI bus */
static int aic7xxx_irq_trigger = -1; /*
* -1 use board setting
* 0 use edge triggered
......@@ -1222,7 +1222,6 @@ aic7xxx_setup(char *s, int *dummy)
unsigned int *flag;
} options[] = {
{ "extended", &aic7xxx_extended },
{ "no_reset", &aic7xxx_no_reset },
{ "irq_trigger", &aic7xxx_irq_trigger },
{ "verbose", &aic7xxx_verbose },
{ "reverse_scan",&aic7xxx_reverse_scan },
......@@ -6408,7 +6407,7 @@ aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p,
scsi_conf |= p->scsi_id_b;
aic_outb(p, scsi_conf | (term) ? TERM_ENB : 0, SCSICONF + 1);
}
if ((scsi_conf & RESET_SCSI) && (aic7xxx_no_reset == 0))
if (scsi_conf & RESET_SCSI)
{
/* Reset SCSI bus B. */
if (aic7xxx_verbose & VERBOSE_PROBE)
......@@ -6444,7 +6443,7 @@ aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p,
}
if ((scsi_conf & RESET_SCSI) && (aic7xxx_no_reset == 0))
if (scsi_conf & RESET_SCSI)
{
/* Reset SCSI bus A. */
if (aic7xxx_verbose & VERBOSE_PROBE)
......@@ -6843,8 +6842,10 @@ aic7xxx_free(struct aic7xxx_host *p)
*/
for (i = 0; i < MAX_TARGETS; i++)
{
if(p->dev_negotiation_cmnd[i])
kfree(p->dev_negotiation_cmnd[i]);
if(p->dev_wdtr_cmnd[i])
kfree(p->dev_wdtr_cmnd[i]);
if(p->dev_sdtr_cmnd[i])
kfree(p->dev_sdtr_cmnd[i]);
}
/*
......@@ -8165,16 +8166,17 @@ aic7xxx_build_negotiation_cmnd(struct aic7xxx_host *p, Scsi_Cmnd *old_cmd,
int tindex)
{
if(p->dev_negotiation_cmnd[tindex] == NULL)
if ( (p->needwdtr & (1<<tindex)) && !(p->wdtr_pending & (1<<tindex)) )
{
if(p->dev_wdtr_cmnd[tindex] == NULL)
{
Scsi_Cmnd *cmd;
if (!(p->dev_negotiation_cmnd[tindex] =
kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC)) )
if (!(p->dev_wdtr_cmnd[tindex] = kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC)) )
{
return;
}
cmd = p->dev_negotiation_cmnd[tindex];
cmd = p->dev_wdtr_cmnd[tindex];
memset(cmd, 0, sizeof(Scsi_Cmnd));
memcpy(cmd, old_cmd, sizeof(Scsi_Cmnd));
memset(&cmd->cmnd[0], 0, sizeof(cmd->cmnd));
......@@ -8188,8 +8190,36 @@ aic7xxx_build_negotiation_cmnd(struct aic7xxx_host *p, Scsi_Cmnd *old_cmd,
cmd->underflow = 0;
cmd->cmd_len = 6;
}
aic7xxx_queue(p->dev_negotiation_cmnd[tindex],
aic7xxx_queue(p->dev_wdtr_cmnd[tindex],
aic7xxx_negotiation_complete);
}
else if ( (p->needsdtr & (1<<tindex)) && !(p->sdtr_pending & (1<<tindex)) )
{
if(p->dev_sdtr_cmnd[tindex] == NULL)
{
Scsi_Cmnd *cmd;
if (!(p->dev_sdtr_cmnd[tindex] = kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC)) )
{
return;
}
cmd = p->dev_sdtr_cmnd[tindex];
memset(cmd, 0, sizeof(Scsi_Cmnd));
memcpy(cmd, old_cmd, sizeof(Scsi_Cmnd));
memset(&cmd->cmnd[0], 0, sizeof(cmd->cmnd));
memset(&cmd->data_cmnd[0], 0, sizeof(cmd->data_cmnd));
cmd->lun = 0;
cmd->request_bufflen = 0;
cmd->request_buffer = NULL;
cmd->use_sg = cmd->old_use_sg = cmd->sglist_len = 0;
cmd->bufflen = 0;
cmd->buffer = NULL;
cmd->underflow = 0;
cmd->cmd_len = 6;
}
aic7xxx_queue(p->dev_sdtr_cmnd[tindex],
aic7xxx_negotiation_complete);
}
}
/*+F*************************************************************************
......@@ -8245,26 +8275,32 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
}
if (p->dev_flags[TARGET_INDEX(cmd)] & DEVICE_SCANNED)
{
if ( ((p->needwdtr & mask) || (p->needsdtr & mask)) &&
!((p->wdtr_pending & mask) || (p->sdtr_pending & mask)) )
{
if (cmd == p->dev_negotiation_cmnd[TARGET_INDEX(cmd)])
if ( (p->needwdtr & mask) && !(p->wdtr_pending & mask) )
{
if (p->needwdtr & mask)
if (cmd == p->dev_wdtr_cmnd[TARGET_INDEX(cmd)])
{
p->wdtr_pending |= mask;
scb->flags |= SCB_MSGOUT_WDTR_16BIT;
hscb->control &= DISCENB;
hscb->control |= MK_MESSAGE;
scb->tag_action = 0;
}
else
{
aic7xxx_build_negotiation_cmnd(p, cmd, TARGET_INDEX(cmd));
}
}
if ( (p->needsdtr & mask) && !(p->sdtr_pending & mask) )
{
if (cmd == p->dev_sdtr_cmnd[TARGET_INDEX(cmd)])
{
p->sdtr_pending |= mask;
scb->flags |= SCB_MSGOUT_SDTR;
}
hscb->control &= DISCENB;
hscb->control |= MK_MESSAGE;
scb->tag_action = 0;
}
else
else if (cmd != p->dev_wdtr_cmnd[TARGET_INDEX(cmd)])
{
aic7xxx_build_negotiation_cmnd(p, cmd, TARGET_INDEX(cmd));
}
......
......@@ -243,8 +243,6 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
p->adapter_control);
size += sprintf(BLS, " Extended Translation: %sabled\n",
(p->flags & AHC_EXTEND_TRANS_A) ? "En" : "Dis");
size += sprintf(BLS, " SCSI Bus Reset: %sabled\n",
aic7xxx_no_reset ? "Dis" : "En");
size += sprintf(BLS, "Disconnect Enable Flags: 0x%04x\n", p->discenable);
if (p->type & AHC_ULTRA)
{
......
/*
* eata.c - Low-level driver for EATA/DMA SCSI host adapters.
*
* 28 May 1998 Rev. 4.32 for linux 2.0.33 and 2.1.104
* Increased busy timeout from 10 msec. to 200 msec. while
* processing interrupts.
*
* 16 May 1998 Rev. 4.31 for linux 2.0.33 and 2.1.102
* Improved abort handling during the eh recovery process.
*
......@@ -9,7 +13,7 @@
* abort and reset routines.
* Added command line options (eh:[y|n]) to choose between
* new_eh_code and the old scsi code.
* If linux verion >= 2.1.101 the default is eh:y, while the eh
* If linux version >= 2.1.101 the default is eh:y, while the eh
* option is ignored for previous releases and the old scsi code
* is used.
*
......@@ -2020,7 +2024,7 @@ static inline void ihdlr(int irq, unsigned int j) {
HD(j)->iocount);
/* Check if this board is still busy */
if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
if (wait_on_busy(sh[j]->io_port, 20 * MAXLOOP)) {
reg = inb(sh[j]->io_port + REG_STATUS);
printk("%s: ihdlr, busy timeout error, irq %d, reg 0x%x, count %d.\n",
BN(j), irq, reg, HD(j)->iocount);
......
......@@ -15,7 +15,7 @@ int eata2x_old_abort(Scsi_Cmnd *);
int eata2x_reset(Scsi_Cmnd *);
int eata2x_old_reset(Scsi_Cmnd *, unsigned int);
#define EATA_VERSION "4.31.00"
#define EATA_VERSION "4.32.00"
#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s))
......
/* fdomain.c -- Future Domain TMC-16x0 SCSI driver
* Created: Sun May 3 18:53:19 1992 by faith@cs.unc.edu
* Revised: Wed Oct 2 11:10:55 1996 by r.faith@ieee.org
* Revised: Wed Oct 2 11:10:55 1996 by faith@acm.org
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994, 1995, 1996 Rickard E. Faith
*
......@@ -956,14 +956,14 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
if (retcode == -EINVAL) {
printk( "fdomain: IRQ %d is bad!\n", interrupt_level );
printk( " This shouldn't happen!\n" );
printk( " Send mail to faith@cs.unc.edu\n" );
printk( " Send mail to faith@acm.org\n" );
} else if (retcode == -EBUSY) {
printk( "fdomain: IRQ %d is already in use!\n", interrupt_level );
printk( " Please use another IRQ!\n" );
} else {
printk( "fdomain: Error getting IRQ %d\n", interrupt_level );
printk( " This shouldn't happen!\n" );
printk( " Send mail to faith@cs.unc.edu\n" );
printk( " Send mail to faith@acm.org\n" );
}
panic( "fdomain: Driver requires interruptions\n" );
}
......
/* fdomain.h -- Header for Future Domain TMC-16x0 driver
* Created: Sun May 3 18:47:33 1992 by faith@cs.unc.edu
* Revised: Thu Oct 12 13:21:35 1995 by r.faith@ieee.org
* Revised: Thu Oct 12 13:21:35 1995 by faith@acm.org
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994, 1995 Rickard E. Faith
*
......
......@@ -6,6 +6,7 @@
#include <asm/system.h>
#include <asm/page.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......@@ -107,15 +108,17 @@ static int ioctl_internal_command(Scsi_Device *dev, char * cmd,
Scsi_Cmnd * SCpnt;
Scsi_Device * SDpnt;
spin_lock_irqsave(&io_request_lock, flags);
SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", cmd[0]));
SCpnt = scsi_allocate_device(NULL, dev, 1);
{
struct semaphore sem = MUTEX_LOCKED;
SCpnt->request.sem = &sem;
spin_lock_irqsave(&io_request_lock, flags);
scsi_do_cmd(SCpnt, cmd, NULL, 0, scsi_ioctl_done, timeout, retries);
spin_unlock_irqrestore(&io_request_lock, flags);
down(&sem);
spin_lock_irqsave(&io_request_lock, flags);
SCpnt->request.sem = NULL;
}
......@@ -163,6 +166,7 @@ static int ioctl_internal_command(Scsi_Device *dev, char * cmd,
(*SDpnt->scsi_request_fn)();
wake_up(&SDpnt->device_wait);
spin_unlock_irqrestore(&io_request_lock, flags);
return result;
}
......@@ -277,12 +281,13 @@ int scsi_ioctl_send_command(Scsi_Device *dev, Scsi_Ioctl_Command *sic)
#ifndef DEBUG_NO_CMD
spin_lock_irqsave(&io_request_lock, flags);
SCpnt = scsi_allocate_device(NULL, dev, 1);
{
struct semaphore sem = MUTEX_LOCKED;
SCpnt->request.sem = &sem;
spin_lock_irqsave(&io_request_lock, flags);
scsi_do_cmd(SCpnt, cmd, buf, needed, scsi_ioctl_done,
timeout, retries);
spin_unlock_irqrestore(&io_request_lock, flags);
......@@ -308,6 +313,8 @@ int scsi_ioctl_send_command(Scsi_Device *dev, Scsi_Ioctl_Command *sic)
}
result = SCpnt->result;
spin_lock_irqsave(&io_request_lock, flags);
wake_up(&SCpnt->device->device_wait);
SDpnt = SCpnt->device;
scsi_release_command(SCpnt);
......@@ -318,6 +325,7 @@ int scsi_ioctl_send_command(Scsi_Device *dev, Scsi_Ioctl_Command *sic)
if(SDpnt->scsi_request_fn)
(*SDpnt->scsi_request_fn)();
spin_unlock_irqrestore(&io_request_lock, flags);
return result;
#else
{
......
/*
* u14-34f.c - Low-level driver for UltraStor 14F/34F SCSI host adapters.
*
* 28 May 1998 Rev. 4.32 for linux 2.0.33 and 2.1.104
* Increased busy timeout from 10 msec. to 200 msec. while
* processing interrupts.
*
* 18 May 1998 Rev. 4.31 for linux 2.0.33 and 2.1.102
* Improved abort handling during the eh recovery process.
*
......@@ -9,7 +13,7 @@
* abort and reset routines.
* Added command line options (eh:[y|n]) to choose between
* new_eh_code and the old scsi code.
* If linux verion >= 2.1.101 the default is eh:y, while the eh
* If linux version >= 2.1.101 the default is eh:y, while the eh
* option is ignored for previous releases and the old scsi code
* is used.
*
......@@ -1733,7 +1737,7 @@ static inline void ihdlr(int irq, unsigned int j) {
HD(j)->iocount);
/* Check if this board is still busy */
if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
if (wait_on_busy(sh[j]->io_port, 20 * MAXLOOP)) {
outb(CMD_CLR_INTR, sh[j]->io_port + REG_SYS_INTR);
printk("%s: ihdlr, busy timeout error, irq %d, reg 0x%x, count %d.\n",
BN(j), irq, reg, HD(j)->iocount);
......
......@@ -15,7 +15,7 @@ int u14_34f_reset(Scsi_Cmnd *);
int u14_34f_old_reset(Scsi_Cmnd *, unsigned int);
int u14_34f_biosparam(Disk *, kdev_t, int *);
#define U14_34F_VERSION "4.31.00"
#define U14_34F_VERSION "4.32.00"
#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s))
......
......@@ -10,7 +10,6 @@
* data, of course), but instead letting the caller do it.
*/
/* Some bdflush() changes for the dynamic ramdisk - Paul Gortmaker, 12/94 */
/* Start bdflush() with kernel_thread not syscall - Paul Gortmaker, 12/95 */
/* Removed a lot of unnecessary code and simplified things now that
......@@ -21,6 +20,10 @@
* hash table, use SLAB cache for buffer heads. -DaveM
*/
/* Added 32k buffer block sizes - these are required older ARM systems.
* - RMK
*/
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/major.h>
......@@ -46,9 +49,13 @@
#include <asm/io.h>
#include <asm/bitops.h>
#define NR_SIZES 5
static char buffersize_index[17] =
{-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 4};
#define NR_SIZES 7
static char buffersize_index[65] =
{-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
4, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1,
5, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1,-1, -1, -1, -1, -1, -1, -1,
6};
#define BUFSIZE_INDEX(X) ((int) buffersize_index[(X)>>9])
#define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
......@@ -637,13 +644,9 @@ void set_blocksize(kdev_t dev, int size)
if (!blksize_size[MAJOR(dev)])
return;
if (size > PAGE_SIZE)
size = 0;
switch (size) {
default: panic("Invalid blocksize passed to set_blocksize");
case 512: case 1024: case 2048: case 4096: case 8192: ;
}
/* Size must be a power of two, and between 512 and PAGE_SIZE */
if (size > PAGE_SIZE || size < 512 || (size & (size-1)))
panic("Invalid blocksize passed to set_blocksize");
if (blksize_size[MAJOR(dev)][MINOR(dev)] == 0 && size == BLOCK_SIZE) {
blksize_size[MAJOR(dev)][MINOR(dev)] = size;
......
......@@ -267,8 +267,7 @@ void coda_flag_alias_children(struct inode *inode, int flag)
while ( alias != &inode->i_dentry ) {
alias_de = list_entry(alias, struct dentry, d_alias);
if ( !alias_de ) {
printk("Corrupt alias list for %*s\n",
alias_de->d_name.len, alias_de->d_name.name);
printk("Null alias list for inode %ld\n", inode->i_ino);
return;
}
coda_flag_children(alias_de, flag);
......
......@@ -15,7 +15,7 @@ extern int coda_print_entry;
/* cnode.c */
static void coda_fill_inode (struct inode *inode, struct coda_vattr *attr)
static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr)
{
CDEBUG(D_SUPER, "ino: %ld\n", inode->i_ino);
......@@ -82,16 +82,26 @@ int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb)
INIT_LIST_HEAD(&(cnp->c_cnhead));
INIT_LIST_HEAD(&(cnp->c_volrootlist));
} else {
printk("coda_cnode make on initialized inode %ld, %s!\n",
cnp->c_flags = 0;
CDEBUG(D_CNODE, "coda_cnode make on initialized"
"inode %ld, %s!\n",
(*inode)->i_ino, coda_f2s(&cnp->c_fid));
}
/* fill in the inode attributes */
if ( coda_fid_is_volroot(fid) )
if ( coda_f2i(fid) != ino ) {
if ( !coda_fid_is_weird(fid) )
printk("Coda: unknown weird fid: ino %ld, fid %s."
"Tell Peter.", ino, coda_f2s(&cnp->c_fid));
list_add(&cnp->c_volrootlist, &sbi->sbi_volroothead);
CDEBUG(D_CNODE, "Added %ld ,%s to volroothead\n",
ino, coda_f2s(&cnp->c_fid));
}
coda_fill_inode(*inode, &attr);
CDEBUG(D_CNODE, "Done linking: ino %ld, at 0x%x with cnp 0x%x, cnp->c_vnode 0x%x\n", (*inode)->i_ino, (int) (*inode), (int) cnp, (int)cnp->c_vnode);
CDEBUG(D_CNODE, "Done linking: ino %ld, at 0x%x with cnp 0x%x,"
"cnp->c_vnode 0x%x\n", (*inode)->i_ino, (int) (*inode),
(int) cnp, (int)cnp->c_vnode);
EXIT;
return 0;
......@@ -132,7 +142,7 @@ struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb)
}
if ( coda_fid_is_volroot(fid) ) {
if ( coda_fid_is_weird(fid) ) {
struct coda_inode_info *cii;
struct list_head *lh, *le;
struct coda_sb_info *sbi = coda_sbp(sb);
......@@ -141,7 +151,7 @@ struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb)
while ( (le = le->next) != lh ) {
cii = list_entry(le, struct coda_inode_info,
c_volrootlist);
if ( cii->c_fid.Volume == fid->Volume) {
if ( coda_fideq(&cii->c_fid, fid) ) {
inode = cii->c_vnode;
CDEBUG(D_INODE, "volume root, found %ld\n", cii->c_vnode->i_ino);
return cii->c_vnode;
......@@ -151,7 +161,7 @@ struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb)
return NULL;
}
/* fid is not volume root, hence ino is computable */
/* fid is not weird: ino should be computable */
nr = coda_f2i(fid);
inode = iget(sb, nr);
if ( !inode ) {
......@@ -173,9 +183,9 @@ struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb)
These have the same inode as the root of the volume they
mount, but the fid will be wrong.
*/
if ( !coda_fideq(fid, &(cnp->c_fid)) &&
!coda_fid_is_volroot(&(cnp->c_fid))) {
printk("coda_fid2inode: bad cnode! Tell Peter.\n");
if ( !coda_fideq(fid, &(cnp->c_fid)) ) {
printk("coda_fid2inode: bad cnode (ino %ld, fid %s)"
"Tell Peter.\n", nr, coda_f2s(fid));
iput(inode);
return NULL;
}
......
......@@ -66,6 +66,36 @@ int coda_fid_is_volroot(struct ViceFid *fid)
return ( (fid->Vnode == 1) && (fid->Unique == 1 ) );
}
int coda_fid_is_weird(struct ViceFid *fid)
{
/* volume roots */
if ( (fid->Vnode == 1) && (fid->Unique == 1 ) )
return 1;
/* tmpfid unique (simulate.cc) */
if ( fid->Unique == 0xffffffff )
return 1;
/* LocalFakeVnode (local.h) */
if ( fid->Vnode == 0xfffffffd )
return 1;
/* LocalFileVnode (venus.private.h) */
if ( fid->Vnode == 0xfffffffe )
return 1;
/* local fake vid (local.h) */
if ( fid->Volume == 0xffffffff )
return 1;
/* local DirVnode (venus.private.h) */
if ( fid->Vnode == 0xffffffff )
return 1;
/* FakeVnode (venus.private.h) */
if ( fid->Vnode == 0xfffffffc )
return 1;
return 0;
}
/* put the current process credentials in the cred */
void coda_load_creds(struct coda_cred *cred)
{
......@@ -94,14 +124,23 @@ unsigned short coda_flags_to_cflags(unsigned short flags)
{
unsigned short coda_flags = 0;
if ( flags & (O_RDONLY | O_RDWR) )
if ( (flags & 0xf) == O_RDONLY )
coda_flags |= C_O_READ;
if ( flags & O_RDWR )
coda_flags |= C_O_READ;
if ( flags & (O_WRONLY | O_RDWR) )
coda_flags |= C_O_WRITE;
if ( flags & O_TRUNC )
if ( flags & O_TRUNC ) {
CDEBUG(D_FILE, "--> C_O_TRUNC added\n");
coda_flags |= C_O_TRUNC;
}
if ( flags & O_EXCL ) {
coda_flags |= C_O_EXCL;
CDEBUG(D_FILE, "--> C_O_EXCL added\n");
}
return coda_flags;
}
......
......@@ -167,8 +167,10 @@ static int coda_lookup(struct inode *dir, struct dentry *entry)
entry->d_time = 0;
entry->d_op = &coda_dentry_operations;
d_add(entry, res_inode);
if ( dropme )
if ( dropme ) {
d_drop(entry);
ITOC(res_inode)->c_flags |= C_VATTR;
}
EXIT;
return 0;
}
......@@ -264,7 +266,7 @@ static int coda_create(struct inode *dir, struct dentry *de, int mode)
}
/* invalidate the directory cnode's attributes */
dircnp->c_flags &= ~C_VATTR;
dircnp->c_flags |= C_VATTR;
d_instantiate(de, result);
return 0;
}
......@@ -320,7 +322,7 @@ static int coda_mkdir(struct inode *dir, struct dentry *de, int mode)
}
/* invalidate the directory cnode's attributes */
dircnp->c_flags &= ~C_VATTR;
dircnp->c_flags |= C_VATTR;
dir->i_nlink++;
d_instantiate(de, inode);
return 0;
......@@ -359,7 +361,7 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode,
(const char *)name, len);
if ( ! error ) {
dir_cnp->c_flags &= ~C_VATTR;
dir_cnp->c_flags |= C_VATTR;
inode->i_nlink++;
d_instantiate(de, inode);
} else {
......@@ -442,7 +444,7 @@ int coda_unlink(struct inode *dir, struct dentry *de)
}
/* cache management */
dircnp->c_flags &= ~C_VATTR;
dircnp->c_flags |= C_VATTR;
de->d_inode->i_nlink--;
d_delete(de);
......@@ -814,7 +816,7 @@ int coda_dentry_revalidate(struct dentry *de)
if (is_bad_inode(inode))
return 0;
cii = ITOC(de->d_inode);
if (cii->c_flags & C_PURGE)
if (cii->c_flags & (C_PURGE | C_VATTR))
valid = 0;
}
return valid || coda_isroot(de->d_inode);
......@@ -852,7 +854,7 @@ static int coda_refresh_inode(struct dentry *dentry)
return -EIO;
}
cii->c_flags &= ~C_VATTR;
cii->c_flags &= ~(C_VATTR | C_PURGE);
return 0;
}
......
......@@ -192,14 +192,15 @@ static ssize_t coda_file_write(struct file *coda_file, const char *buff,
return -1;
}
cnp->c_flags &= ~C_VATTR;
down(&cont_inode->i_sem);
result = cont_file.f_op->write(&cont_file , buff, count,
&(cont_file.f_pos));
up(&cont_inode->i_sem);
coda_restore_codafile(coda_inode, coda_file, cont_inode, &cont_file);
if (result)
cnp->c_flags |= C_VATTR;
return result;
}
......
......@@ -161,6 +161,8 @@ static void coda_put_super(struct super_block *sb)
ENTRY;
sb->s_dev = 0;
coda_cache_clear_all(sb);
sb_info = coda_sbp(sb);
sb_info->sbi_vcomm->vc_inuse = 0;
......
......@@ -401,10 +401,18 @@ static struct file_operations coda_psdev_fops = {
#ifdef CONFIG_PROC_FS
extern struct proc_dir_entry proc_sys_root;
struct proc_dir_entry proc_sys_root = {
PROC_SYS, 3, "sys", /* inode, name */
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0, /* mode, nlink, uid, gid */
0, &proc_dir_inode_operations, /* size, ops */
NULL, NULL, /* get_info, fill_inode */
NULL, /* next */
NULL, NULL /* parent, subdir */
};
struct proc_dir_entry proc_fs_coda = {
PROC_FS_CODA, 4, "coda",
struct proc_dir_entry proc_sys_coda = {
0, 4, "coda",
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
0, &proc_dir_inode_operations,
NULL, NULL,
......@@ -412,8 +420,8 @@ struct proc_dir_entry proc_fs_coda = {
NULL, NULL
};
struct proc_dir_entry proc_sys_coda = {
0, 4, "coda",
struct proc_dir_entry proc_fs = {
PROC_FS, 2, "fs",
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
0, &proc_dir_inode_operations,
NULL, NULL,
......@@ -421,8 +429,17 @@ struct proc_dir_entry proc_sys_coda = {
NULL, NULL
};
struct proc_dir_entry proc_fs = {
PROC_FS, 2, "fs",
/*
* target directory structure:
/proc/fs/
/proc/fs/coda
/proc/fs/coda/{vfs_stats,
*/
struct proc_dir_entry proc_fs_coda = {
PROC_FS_CODA, 4, "coda",
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
0, &proc_dir_inode_operations,
NULL, NULL,
......@@ -430,15 +447,6 @@ struct proc_dir_entry proc_fs = {
NULL, NULL
};
#if 0
struct proc_dir_entry proc_coda_ncstats = {
0 , 12, "coda-ncstats",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_net_inode_operations,
cfsnc_nc_info
};
#endif
struct proc_dir_entry proc_coda_vfs = {
PROC_VFS_STATS , 9, "vfs_stats",
S_IFREG | S_IRUGO, 1, 0, 0,
......@@ -521,9 +529,7 @@ int init_coda_psdev(void)
proc_register(&proc_fs_coda,&proc_coda_upcall);
proc_register(&proc_fs_coda,&proc_coda_permission);
proc_register(&proc_fs_coda,&proc_coda_cache_inv);
#if 0
proc_register(&proc_fs_coda, &proc_coda_ncstats);
#endif
proc_register(&proc_sys_root,&proc_sys_coda);
proc_register(&proc_sys_coda,&proc_coda_vfs_control);
proc_register(&proc_sys_coda,&proc_coda_upcall_control);
......@@ -578,12 +584,9 @@ void cleanup_module(void)
proc_unregister(&proc_sys_coda, proc_coda_cache_inv_control.low_ino);
proc_unregister(&proc_sys_coda, proc_coda_permission_control.low_ino);
proc_unregister(&proc_sys_coda, proc_coda_upcall_control.low_ino);
proc_unregister(&proc_sys_coda,proc_coda_vfs_control.low_ino);
proc_unregister(&proc_sys_coda, proc_coda_vfs_control.low_ino);
proc_unregister(&proc_sys_root, proc_sys_coda.low_ino);
#if 0
proc_unregister(&proc_fs_coda, proc_coda_ncstats.low_ino);
#endif
proc_unregister(&proc_fs_coda, proc_coda_cache_inv.low_ino);
proc_unregister(&proc_fs_coda, proc_coda_permission.low_ino);
proc_unregister(&proc_fs_coda, proc_coda_upcall.low_ino);
......
......@@ -7,6 +7,7 @@
*
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/sysctl.h>
......
......@@ -777,8 +777,6 @@ ENTRY;
* force a new lookup for all the children
of this dir.
* CFS_ZAPVNODE -- intended to be a zapfile for just one cred.
Not used?
*
* The next is a result of Venus detecting an inconsistent file.
* CFS_PURGEFID -- flush the attribute for the file
......@@ -792,8 +790,14 @@ ENTRY;
int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
{
/* Handle invalidate requests. */
/* Handle invalidation requests. */
if ( !sb ) {
printk("coda_downcall: opcode %d, no sb!\n", opcode);
return 0;
}
switch (opcode) {
case CFS_FLUSH : {
clstats(CFS_FLUSH);
CDEBUG(D_DOWNCALL, "CFS_FLUSH\n");
......@@ -801,6 +805,7 @@ int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
shrink_dcache_sb(sb);
return(0);
}
case CFS_PURGEUSER : {
struct coda_cred *cred = &out->cfs_purgeuser.cred;
CDEBUG(D_DOWNCALL, "CFS_PURGEUSER\n");
......@@ -812,51 +817,48 @@ int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
coda_cache_clear_cred(sb, cred);
return(0);
}
case CFS_ZAPDIR : {
struct inode *inode;
ViceFid *fid = &out->cfs_zapdir.CodaFid;
if ( !fid ) {
printk("ZAPDIR: Null fid\n");
return 0;
}
CDEBUG(D_DOWNCALL, "zapdir: fid = %s\n", coda_f2s(fid));
clstats(CFS_ZAPDIR);
inode = coda_fid_to_inode(fid, sb);
if ( inode ) {
coda_flag_inode(inode, C_VATTR);
coda_cache_clear_inode(inode);
coda_flag_alias_children(inode, C_PURGE);
}
return(0);
}
case CFS_ZAPVNODE :
case CFS_ZAPFILE : {
struct inode *inode;
struct ViceFid *fid = &out->cfs_zapfile.CodaFid;
clstats(CFS_ZAPFILE);
if ( !fid ) {
printk("ZAPFILE: Null fid\n");
return 0;
}
CDEBUG(D_DOWNCALL, "zapfile: fid = %s\n", coda_f2s(fid));
inode = coda_fid_to_inode(fid, sb);
if ( inode ) {
coda_flag_inode(inode, C_VATTR);
coda_cache_clear_inode(inode);
}
return 0;
}
case CFS_PURGEFID : {
struct inode *inode;
ViceFid *fid = &out->cfs_purgefid.CodaFid;
if ( !fid ) {
printk("PURGEFID: Null fid\n");
return 0;
}
CDEBUG(D_DOWNCALL, "purgefid: fid = %s\n", coda_f2s(fid));
clstats(CFS_PURGEFID);
inode = coda_fid_to_inode(fid, sb);
if ( inode ) {
coda_flag_inode(inode, C_PURGE);
coda_cache_clear_inode(inode);
}
return 0;
}
case CFS_REPLACE : {
printk("CFS_REPLACCE\n");
clstats(CFS_REPLACE);
......
......@@ -22,6 +22,7 @@ EXPORT_SYMBOL(in_group_p);
EXPORT_SYMBOL(proc_dir_inode_operations);
EXPORT_SYMBOL(proc_net_inode_operations);
EXPORT_SYMBOL(proc_net);
EXPORT_SYMBOL(proc_bus);
/*
* This is required so that if we load scsi later, that the
......
......@@ -38,10 +38,15 @@ do_revalidate(struct dentry *dentry)
*/
static int cp_old_stat(struct inode * inode, struct __old_kernel_stat * statbuf)
{
static int warncount = 5;
struct __old_kernel_stat tmp;
if (warncount) {
warncount--;
printk("VFS: Warning: %s using old stat() call. Recompile your binary.\n",
current->comm);
}
tmp.st_dev = kdev_t_to_nr(inode->i_dev);
tmp.st_ino = inode->i_ino;
tmp.st_mode = inode->i_mode;
......
......@@ -37,6 +37,8 @@ typedef struct {
#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
} __kernel_fsid_t;
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#undef __FD_SET
#define __FD_SET(fd,fdsetp) \
__asm__ __volatile__("btsl %1,%0": \
......@@ -62,4 +64,6 @@ typedef struct {
:"a" (0), "c" (__FDSET_LONGS), \
"D" ((__kernel_fd_set *) (fdsetp)) :"cx","di")
#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
#endif
......@@ -61,14 +61,14 @@ typedef struct {
#define spin_lock_init(x) do { (x)->lock = 0; } while (0)
#define spin_trylock(lock) (!test_and_set_bit(0,(lock)))
#define spin_lock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s: spin_lock(%s:%p) already locked\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1; restore_flags(__spinflags);} while (0)
#define spin_unlock_wait(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s: spin_unlock_wait(%s:%p) deadlock\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} restore_flags(__spinflags);} while (0)
#define spin_unlock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if (!(x)->lock&&(x)->babble) {printk("%s: spin_unlock(%s:%p) not locked\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; restore_flags(__spinflags);} while (0)
#define spin_lock_irq(x) do {cli(); if ((x)->lock&&(x)->babble) {printk("%s: spin_lock_irq(%s:%p) already locked\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1;} while (0)
#define spin_unlock_irq(x) do {cli(); if ((x)->lock&&(x)->babble) {printk("%s: spin_lock(%s:%p) already locked\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1; sti();} while (0)
#define spin_lock_irqsave(x,flags) do {save_flags(flags); cli(); if ((x)->lock&&(x)->babble) {printk("%s: spin_lock_irqsave(%s:%p) already locked\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1;} while (0)
#define spin_unlock_irqrestore(x,flags) do {cli(); if (!(x)->lock&&(x)->babble) {printk("%s: spin_unlock_irqrestore(%s:%p) not locked\n", __BASE_FILE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; restore_flags(flags);} while (0)
#define spin_lock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1; restore_flags(__spinflags);} while (0)
#define spin_unlock_wait(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_unlock_wait(%s:%p) deadlock\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} restore_flags(__spinflags);} while (0)
#define spin_unlock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if (!(x)->lock&&(x)->babble) {printk("%s:%d: spin_unlock(%s:%p) not locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; restore_flags(__spinflags);} while (0)
#define spin_lock_irq(x) do {cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock_irq(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1;} while (0)
#define spin_unlock_irq(x) do {cli(); if (!(x)->lock&&(x)->babble) {printk("%s:%d: spin_lock(%s:%p) not locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; sti();} while (0)
#define spin_lock_irqsave(x,flags) do {save_flags(flags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock_irqsave(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1;} while (0)
#define spin_unlock_irqrestore(x,flags) do {cli(); if (!(x)->lock&&(x)->babble) {printk("%s:%d: spin_unlock_irqrestore(%s:%p) not locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 0; restore_flags(flags);} while (0)
#endif /* DEBUG_SPINLOCKS */
......
......@@ -79,7 +79,7 @@ struct user{
esp register. */
long int signal; /* Signal that caused the core dump. */
int reserved; /* No longer used */
struct pt_regs * u_ar0; /* Used by gdb to help find the values for */
struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
/* the registers. */
struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */
unsigned long magic; /* To uniquely identify a core file */
......
......@@ -148,8 +148,8 @@ static inline ino_t coda_f2i(struct ViceFid *fid)
#ifndef _VUID_T_
#define _VUID_T_
typedef u_long vuid_t;
typedef u_long vgid_t;
typedef unsigned int vuid_t;
typedef unsigned int vgid_t;
#endif /*_VUID_T_ */
#ifndef _CODACRED_T_
......@@ -223,7 +223,7 @@ struct coda_vattr {
#define CFS_PURGEUSER ((u_long) 26)
#define CFS_ZAPFILE ((u_long) 27)
#define CFS_ZAPDIR ((u_long) 28)
#define CFS_ZAPVNODE ((u_long) 29)
/* #define CFS_ZAPVNODE ((u_long) 29) obsolete */
#define CFS_PURGEFID ((u_long) 30)
#define CFS_OPEN_BY_PATH ((u_long) 31)
#define CFS_NCALLS 32
......
......@@ -48,6 +48,7 @@ static __inline__ struct ViceFid *coda_i2f(struct inode *);
char *coda_f2s(ViceFid *f);
int coda_isroot(struct inode *i);
int coda_fid_is_volroot(struct ViceFid *);
int coda_fid_is_weird(struct ViceFid *fid);
int coda_iscontrol(const char *name, size_t length);
......
/* $Revision: 2.3 $$Date: 1998/03/16 18:01:12 $
/* $Revision: 2.4 $$Date: 1998/06/01 12:09:53 $
* linux/include/linux/cyclades.h
*
* This file is maintained by Ivan Passos <ivan@cyclades.com>,
......@@ -7,10 +7,14 @@
*
* This file contains the general definitions for the cyclades.c driver
*$Log: cyclades.h,v $
*Revision 2.4 1998/06/01 12:09:53 ivan
*removed closing_wait2 from cyclades_port structure;
*
*Revision 2.3 1998/03/16 18:01:12 ivan
*changes in the cyclades_port structure to get it closer to the
*standard serial port structure;
*added constants for new ioctls;
*
*Revision 2.2 1998/02/17 16:50:00 ivan
*changes in the cyclades_port structure (addition of shutdown_wait and
*chip_rev variables);
......@@ -89,8 +93,8 @@ struct cyclades_monitor {
#define CZ_DEF_POLL (HZ/25)
#define MAX_BOARD 4 /* Max number of boards */
#define MAX_PORT 128 /* Max number of ports per board */
#define MAX_DEV 256 /* Max number of ports total */
#define CYZ_MAX_SPEED 921600
#define CYZ_FIFO_SIZE 16
......@@ -508,7 +512,6 @@ struct cyclades_port {
int x_char; /* to be pushed out ASAP */
int close_delay;
unsigned short closing_wait;
unsigned short closing_wait2;
unsigned long event;
unsigned long last_active;
int count; /* # of fd on device */
......@@ -544,11 +547,15 @@ struct cyclades_port {
#define Cy_EVENT_OPEN_WAKEUP 4
#define Cy_EVENT_SHUTDOWN_WAKEUP 5
#define CLOSING_WAIT_DELAY 30
#define CLOSING_WAIT_DELAY 30*HZ
#define CY_CLOSING_WAIT_NONE 65535
#define CY_CLOSING_WAIT_INF 0
#define CyMAX_CHIPS_PER_CARD 8
#define CyMAX_CHAR_FIFO 12
#define CyPORTS_PER_CHIP 4
#define CD1400_MAX_SPEED 115200
#define CyISA_Ywin 0x2000
......
......@@ -565,7 +565,7 @@ extern inline int fsuser(void)
extern inline int capable(int cap)
{
#if 0 /* not yet */
#if 1 /* ok now */
if (cap_raised(current->cap_effective, cap))
#else
if (cap_is_fs_cap(cap) ? current->fsuid == 0 : current->euid == 0)
......
/*
* include/linux/serial.h
* include/linux/serial_reg.h
*
* Copyright (C) 1992, 1994 by Theodore Ts'o.
*
......
#ifndef _LINUX_SOCKET_H
#define _LINUX_SOCKET_H
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#include <asm/socket.h> /* arch-dependent defines */
#include <linux/sockios.h> /* the SIOCxxx I/O controls */
#include <linux/uio.h> /* iovec support */
......@@ -256,4 +258,5 @@ extern int move_addr_to_user(void *kaddr, int klen, void *uaddr, int *ulen);
extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr);
extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
#endif
#endif /* not kernel and not glibc */
#endif /* _LINUX_SOCKET_H */
......@@ -7,6 +7,8 @@
#endif
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#define S_IFMT 00170000
#define S_IFSOCK 0140000
#define S_IFLNK 0120000
......@@ -42,6 +44,8 @@
#define S_IWOTH 00002
#define S_IXOTH 00001
#endif
#ifdef __KERNEL__
#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
......
......@@ -142,6 +142,22 @@ static inline void move_last_runqueue(struct task_struct * p)
prev->next_run = p;
}
static inline void move_first_runqueue(struct task_struct * p)
{
struct task_struct *next = p->next_run;
struct task_struct *prev = p->prev_run;
/* remove from list */
next->prev_run = prev;
prev->next_run = next;
/* add back to list */
p->prev_run = &init_task;
next = init_task.next_run;
init_task.next_run = p;
p->next_run = next;
next->prev_run = p;
}
/*
* The tasklist_lock protects the linked list of processes.
*
......@@ -1329,7 +1345,7 @@ static int setscheduler(pid_t pid, int policy,
p->policy = policy;
p->rt_priority = lp.sched_priority;
if (p->next_run)
move_last_runqueue(p);
move_first_runqueue(p);
need_resched = 1;
......
......@@ -448,7 +448,7 @@ asmlinkage int sys_setuid(uid_t uid)
if (current->euid != old_euid)
current->dumpable = 0;
if(new_ruid != old_ruid) {
if (new_ruid != old_ruid) {
/* See comment above about NPROC rlimit issues... */
charge_uid(current, -1);
current->uid = new_ruid;
......@@ -473,7 +473,7 @@ asmlinkage int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
int old_ruid = current->uid;
int old_euid = current->euid;
int old_suid = current->suid;
if (current->uid != 0 && current->euid != 0 && current->suid != 0) {
if (!capable(CAP_SETUID)) {
if ((ruid != (uid_t) -1) && (ruid != current->uid) &&
(ruid != current->euid) && (ruid != current->suid))
return -EPERM;
......@@ -523,7 +523,7 @@ asmlinkage int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
*/
asmlinkage int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{
if (current->uid != 0 && current->euid != 0 && current->suid != 0) {
if (!capable(CAP_SETGID)) {
if ((rgid != (gid_t) -1) && (rgid != current->gid) &&
(rgid != current->egid) && (rgid != current->sgid))
return -EPERM;
......
......@@ -26,104 +26,74 @@ extern int sysctl_tcp_syncookies;
static unsigned long tcp_lastsynq_overflow;
/*
* This table has to be sorted. Only 8 entries are allowed and the
* last entry has to be duplicated.
* This table has to be sorted and terminated with (__u16)-1.
* XXX generate a better table.
* Unresolved Issues: HIPPI with a 64k MSS is not well supported.
*/
static __u16 const msstab[] = {
64,
256,
512,
536,
1024,
1440,
1460,
4312,
4312
64-1,
256-1,
512-1,
536-1,
1024-1,
1440-1,
1460-1,
4312-1,
(__u16)-1
};
static __u32 make_syncookie(struct sk_buff *skb, __u32 counter, __u32 seq)
{
__u32 z;
z = secure_tcp_syn_cookie(skb->nh.iph->saddr, skb->nh.iph->daddr,
skb->h.th->source, skb->h.th->dest,
seq,
counter);
#if 0
printk(KERN_DEBUG
"msc: z=%u,cnt=%u,seq=%u,sadr=%u,dadr=%u,sp=%u,dp=%u\n",
z,counter,seq,
skb->nh.iph->saddr,skb->nh.iph->daddr,
ntohs(skb->h.th->source), ntohs(skb->h.th->dest));
#endif
return z;
}
/* The number doesn't include the -1 terminator */
#define NUM_MSS (sizeof(msstab)/sizeof(msstab[0]) - 1)
/*
* Generate a syncookie.
* Generate a syncookie. mssp points to the mss, which is returned
* rounded down to the value encoded in the cookie.
*/
__u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
__u16 *mssp)
{
int i;
__u32 isn;
const __u16 mss = *mssp, *w;
int mssind;
const __u16 mss = *mssp;
tcp_lastsynq_overflow = jiffies;
isn = make_syncookie(skb, (jiffies/HZ) >> 6, ntohl(skb->h.th->seq));
/* XXX sort msstab[] by probability? */
w = msstab;
for (i = 0; i < 8; i++)
if (mss >= *w && mss < *++w)
goto found;
i--;
found:
*mssp = w[-1];
/* XXX sort msstab[] by probability? Binary search? */
for (mssind = 0; mss > msstab[mssind+1]; mssind++)
;
*mssp = msstab[mssind]+1;
net_statistics.SyncookiesSent++;
isn |= i;
return isn;
return secure_tcp_syn_cookie(skb->nh.iph->saddr, skb->nh.iph->daddr,
skb->h.th->source, skb->h.th->dest,
ntohl(skb->h.th->seq),
jiffies / (HZ*60), mssind);
}
/* This value should be dependent on TCP_TIMEOUT_INIT and
* sysctl_tcp_retries1. It's a rather complicated formula
* (exponential backoff) to compute at runtime so it's currently hardcoded
* here.
/*
* This (misnamed) value is the age of syncookie which is permitted.
* Its ideal value should be dependent on TCP_TIMEOUT_INIT and
* sysctl_tcp_retries1. It's a rather complicated formula (exponential
* backoff) to compute at runtime so it's currently hardcoded here.
*/
#define COUNTER_TRIES 4
/*
* Check if a ack sequence number is a valid syncookie.
* Return the decoded mss if it is, or 0 if not.
*/
static inline int cookie_check(struct sk_buff *skb, __u32 cookie)
{
int mssind;
int i;
__u32 counter;
__u32 seq;
__u32 mssind;
if ((jiffies - tcp_lastsynq_overflow) > TCP_TIMEOUT_INIT
&& tcp_lastsynq_overflow) {
if ((jiffies - tcp_lastsynq_overflow) > TCP_TIMEOUT_INIT)
return 0;
}
mssind = cookie & 7;
cookie &= ~7;
counter = (jiffies/HZ)>>6;
seq = ntohl(skb->h.th->seq)-1;
for (i = 0; i < COUNTER_TRIES; i++)
if (make_syncookie(skb, counter-i, seq) == cookie)
return msstab[mssind];
mssind = check_tcp_syn_cookie(cookie,
skb->nh.iph->saddr, skb->nh.iph->daddr,
skb->h.th->source, skb->h.th->dest,
seq, jiffies/(HZ*60), COUNTER_TRIES);
return 0;
return mssind < NUM_MSS ? msstab[mssind]+1 : 0;
}
extern struct or_calltable or_ipv4;
......
......@@ -630,7 +630,7 @@ void spx_rcv(struct sock *sk, int bytes)
&& (pdata->state != SPX_CONNECTED))
{
pdata->state = SPX_CONNECTED;
pdatat->dest_connid = ipxh->spx.sconn;
pdata->dest_connid = ipxh->spx.sconn;
if(spx_retransmit_chk(pdata, 0, CONACK) < 0)
goto toss_skb;
......
......@@ -26,6 +26,9 @@
// command-line argument, and redirect the oops-log into stdin. Out
// will come the EIP and call-trace in symbolic form.
// Changed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
// adapted to Linux/m68k
//////////////////////////////////////////////////////////////////////////////
// BUGS:
......@@ -39,8 +42,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <a.out.h>
inline int strnequ(char const* x, char const* y, size_t n) { return (::strncmp(x, y, n) == 0); }
inline int strnequ(char const* x, char const* y, size_t n) { return (strncmp(x, y, n) == 0); }
const int code_size = 20;
......@@ -149,32 +153,34 @@ NameList::decode(unsigned char* code, long eip_addr)
/* This is a hack to avoid using gcc. We create an object file by
concatenating objfile_head, the twenty bytes of code, and
objfile_tail. */
unsigned char objfile_head[] = {
0x07, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
static struct exec objfile_head = {
OMAGIC, code_size + 4, 0, 0, sizeof (struct nlist) * 3, 0, 0, 0
};
unsigned char objfile_tail[] = {
0x00, 0x90, 0x90, 0x90,
0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x25, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,
'g', 'c', 'c', '2', '_', 'c', 'o', 'm',
'p', 'i', 'l', 'e', 'd', '.', '\0', '_',
'E', 'I', 'P', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0'
static struct {
unsigned char tail[4];
struct nlist syms[3];
unsigned long strsize;
char strings[42];
} objfile_tail = {
#ifdef i386
{ 0x00, 0x90, 0x90, 0x90 },
#endif
#ifdef mc68000
{ 0x00, 0x00, 0x00, 0x00 },
#endif
{ { (char *) 4, N_TEXT, 0, 0, 0 },
{ (char *) 19, N_TEXT, 0, 0, 0 },
{ (char *) 37, N_TEXT | N_EXT, 0, 0, 0 } },
42,
"gcc2_compiled.\0___gnu_compiled_c\0_EIP\0"
};
char const* objdump_command = "objdump -d oops_decode.o";
char const* objfile_name = &objdump_command[11];
ofstream objfile_stream(objfile_name);
objfile_stream.write(objfile_head, sizeof(objfile_head));
objfile_stream.write((char *) &objfile_head, sizeof(objfile_head));
objfile_stream.write(code, code_size);
objfile_stream.write(objfile_tail, sizeof(objfile_tail));
objfile_stream.write((char *) &objfile_tail, sizeof(objfile_tail));
objfile_stream.close();
FILE* objdump_FILE = popen(objdump_command, "r");
......@@ -197,8 +203,8 @@ NameList::decode(unsigned char* code, long eip_addr)
memset(newbuf, '\0', sizeof(newbuf));
ostrstream ost(newbuf, sizeof(newbuf));
ost.width(8);
ost << offset;
ost << " <_EIP+" << offset << ">: " << &buf[6] << ends;
ost << hex << offset;
ost << " <_EIP+" << hex << offset << ">: " << &buf[6] << ends;
strcpy(buf, newbuf);
}
if (!strnequ(&buf[9], "<_EIP", 5))
......@@ -233,6 +239,7 @@ NameList::decode(unsigned char* code, long eip_addr)
bp++;
if (!isxdigit(*bp)) {
cout << bp_0;
#ifdef i386
} else if (*bp_1 == 'j' || strnequ(bp_1, "call", 4)) { // a jump or call insn
long rel_addr = strtol(bp, 0, 16);
ksym = find(eip_addr + rel_addr);
......@@ -241,6 +248,21 @@ NameList::decode(unsigned char* code, long eip_addr)
cout << bp_0 << *ksym << endl;
} else
cout << bp_0;
#endif
#ifdef mc68000
} else if ((bp_1[0] == 'b' && bp_1[4] == ' ' && strchr("swl", bp_1[3]))
|| (bp_1[0] == 'd' && bp_1[1] == 'b')) {
// a branch or decr-and-branch insn
if (bp_1[0] == 'd') // skip register
while (*bp && *bp++ != ',');
long rel_addr = strtoul(bp, 0, 16);
ksym = find(eip_addr + rel_addr);
if (ksym) {
*bp++ = '\0';
cout << bp_0 << *ksym << endl;
} else
cout << bp_0;
#endif
} else {
cout << bp_0;
}
......@@ -308,6 +330,7 @@ main(int argc, char** argv)
if (cin.eof())
break;
cin.get(c); /* swallow newline */
#ifdef i386
if (strstr(buffer, "EIP:") && names.valid()) {
oops_column = strstr(buffer, "EIP:");
if (sscanf(oops_column+13, "[<%x>]", &eip_addr) != 1) {
......@@ -321,6 +344,22 @@ main(int argc, char** argv)
else
cout << ::hex << eip_addr << " cannot be resolved" << endl;
}
#endif
#ifdef mc68000
if (strstr(buffer, "PC:") && names.valid()) {
oops_column = strstr(buffer, "PC:");
if (sscanf(oops_column+4, "[<%x>]", &eip_addr) != 1) {
cout << "Cannot read pc address from PC: line. Is this a valid oops file?" << endl;
exit(1);
}
cout << ">>PC: ";
KSym* ksym = names.find(eip_addr);
if (ksym)
cout << *ksym << endl;
else
cout << ::hex << eip_addr << " cannot be resolved" << endl;
}
#endif
else if (oops_column && strstr(oops_column, "[<") && names.valid()) {
unsigned long address;
while (strstr(oops_column, "[<")) {
......@@ -356,6 +395,9 @@ main(int argc, char** argv)
++p;
if (sscanf(p, "%x", &c) != 1)
break;
#ifdef mc68000
*cp++ = c >> 8;
#endif
*cp++ = c;
while (*p && *p++ != ' ')
;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment