Commit a6686074 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Import 1.1.42

parent 598a477a
......@@ -19,7 +19,7 @@ CHANGES since 0.99 patchlevel 13:
- readonly OS/2 filesystem support (HPFS) added (Chris Smith)
- NTP support (Philip Gladstone, Torsten Duwe, ??)
- fixed 16MB swap-area limit
- lots of minor cleanups, buxfixes etc.
- lots of minor cleanups, bugfixes etc.
CHANGES since 0.99 patchlevel 12 and earlier:
......@@ -117,7 +117,7 @@ NOTABLE changes since patchlevel 10 or earlier:
it.
- named pipes and normal pipes should hopefully have the right select()
semantics in the presense/absense of writers.
semantics in the presence/absence of writers.
- QIC-02 tape driver by Hennus Bergman
......@@ -135,7 +135,7 @@ NOTABLE changes since patchlevel 10 or earlier:
- udelay() function for short delays (busy-waiting) added. Used
currently only by the QIC driver.
- fork() and sheduler changes to make task switches happen only from
- fork() and scheduler changes to make task switches happen only from
kernel mode to kernel mode. Cleaner and more portable than the old
code which counted on being able to task-switch directly into user
mode.
......
......@@ -129,7 +129,7 @@ D: Second extended file system co-designer
N: Thomas Dunbar
E: tdunbar@vtaix.cc.vt.edu
D: TeX & METAFONT hacking/maintainence
D: TeX & METAFONT hacking/maintenance
S: Dean, Graduate School
S: Virginia Tech
S: Blacksburg, Virginia 24061
......@@ -581,7 +581,7 @@ D: HOWTO coordinator and writer
D: Maintainer of sunsite.unc.edu Linux doc archives
D: Moderator, comp.os.linux.announce
S: 205 Gray Street NE
S: Wilson, North Caroilina 27893
S: Wilson, North Carolina 27893
S: USA
......
......@@ -6,7 +6,7 @@ are unique.
It is a *very* good idea to protect kernel data structures with magic
numbers. This allows you to check at run time whether (a) a structure
has been clobbered, or (b) you've passed the wrong structure to a
routine. This last is especially useful --- particlarly when you are
routine. This last is especially useful --- particularly when you are
passing pointers to structures via a void * pointer. The tty code,
for example, does this frequently to pass driver-specific and line
discipline-specific structures back and forth.
......@@ -19,11 +19,11 @@ struct tty_ldisc {
...
};
Please follow this discpline when you are adding future enhancements
Please follow this discipline when you are adding future enhancements
to the kernel! It has saved me countless hours of debugging,
especially in the screw cases where an array has been overrun and
structures following the array have been overwritten. Using this
discpline, these cases get detected quickly and safely.
discipline, these cases get detected quickly and safely.
Theodore Ts'o
31-Mar-94
......
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 41
SUBLEVEL = 42
all: Version zImage
......
......@@ -71,7 +71,7 @@ CONFIGURING the kernel:
but it should not hurt performance.
- A kernel with math-emulation compiled in will still use the
coprocessor if one is present: the math emulation will just
never get used in that case. The kernel will be slighly larger,
never get used in that case. The kernel will be slightly larger,
but will work on different machines regardless of whether they
have a math coprocessor or not.
- the "kernel hacking" configuration details usually result in a
......@@ -162,7 +162,7 @@ IF SOMETHING GOES WRONG:
important: it tells something about why the kernel dumped code (in
the above example it's due to a bad kernel pointer)
- in debugging dumps like the above, it helps enourmously if you can
- in debugging dumps like the above, it helps enormously if you can
look up what the EIP value means. The hex value as such doesn't help
me or anybody else very much: it will depend on your particular
kernel setup. What you should do is take the hex value from the EIP
......
......@@ -242,7 +242,7 @@ root_defined:
seg cs
mov root_dev,ax
! after that (everyting loaded), we jump to
! after that (everything loaded), we jump to
! the setup-routine loaded directly after
! the bootblock:
......@@ -397,7 +397,7 @@ print_nl:
/*
* print_hex is for debugging purposes, and prints the word
* pointed to by ss:bp in hexadecmial.
* pointed to by ss:bp in hexadecimal.
*/
print_hex:
......
......@@ -243,7 +243,7 @@ end_move:
! we let the gnu-compiled 32-bit programs do that. We just jump to
! absolute address 0x00000, in 32-bit protected mode.
!
! Note that the short jump isn't strictly needed, althought there are
! Note that the short jump isn't strictly needed, although there are
! reasons why it might be a good idea. It won't hurt in any case.
!
xor ax,ax
......@@ -408,7 +408,7 @@ svga: cld
mov bh,al ! store current value of CRT-register 0x38
mov ax,#0x0038
call outidx ! disable writing to special regs
movb al,cl ! check wether we can write special reg 0x35
movb al,cl ! check whether we can write special reg 0x35
call inidx
movb bl,al ! save the current value of CRT reg 0x35
andb al,#0xf0 ! clear bits 0-3
......@@ -436,7 +436,7 @@ s3_2: mov ax,cx ! load ah with 0xf and al with 0x35
je no_s3 ! writing is allowed => this is not an S3
s3_1: mov ax,#0x4838 ! allow writing to special regs by putting
call outidx ! magic number into CRT-register 0x38
movb al,cl ! check wether we can write special reg 0x35
movb al,cl ! check whether we can write special reg 0x35
call inidx
movb bl,al
andb al,#0xf0
......
......@@ -85,7 +85,6 @@ extern unsigned long mcd_init(unsigned long mem_start, unsigned long mem_end);
#ifdef CONFIG_SBPCD
extern unsigned long sbpcd_init(unsigned long, unsigned long);
#endif CONFIG_SBPCD
extern int is_read_only(int dev);
extern void set_device_ro(int dev,int flag);
extern void rd_load(void);
......
......@@ -1750,6 +1750,8 @@ static void rw_interrupt(void)
return;
}
current_type[current_drive] = floppy;
floppy_sizes[DRIVE(current_drive) + (FDC(current_drive) << 7)] =
floppy->size >> 1;
break;
}
......
......@@ -604,9 +604,10 @@ static void hd_times_out(void)
{
DEVICE_INTR = NULL;
sti();
special_op [DEVICE_NR(CURRENT->dev)] += reset = 1;
reset = 1;
if (!CURRENT)
return;
special_op [DEVICE_NR(CURRENT->dev)] ++;
printk(KERN_DEBUG "HD timeout\n");
cli();
if (++CURRENT->errors >= MAX_ERRORS) {
......
......@@ -202,6 +202,7 @@ static void make_request(int major,int rw, struct buffer_head * bh)
if (blk_size[major])
if (blk_size[major][MINOR(bh->b_dev)] < (sector + count)>>1) {
bh->b_dirt = bh->b_uptodate = 0;
bh->b_req = 0;
return;
}
lock_buffer(bh);
......
......@@ -20,7 +20,7 @@ OBJS = tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o \
defkeymap.o
SRCS = tty_io.c console.c keyboard.c serial.c \
SRCS = tty_io.c n_tty.c console.c keyboard.c serial.c \
tty_ioctl.c pty.c vt.c mem.c \
defkeymap.c
......
......@@ -9,7 +9,7 @@
*
* This module exports the console io functions:
*
* 'long con_init(long)'
* 'long console_init(long, long)'
* 'int con_open(struct tty_struct *tty, struct file * filp)'
* 'void update_screen(int new_console)'
* 'void blank_screen(void)'
......@@ -801,6 +801,7 @@ static void cursor_report(int currcons, struct tty_struct * tty)
respond_string(buf, tty);
}
#ifdef CONFIG_SELECTION
static void mouse_report(int currcons, struct tty_struct * tty,
int butt, int mrx, int mry)
{
......@@ -810,6 +811,7 @@ static void mouse_report(int currcons, struct tty_struct * tty,
(char)('!' + mry));
respond_string(buf, tty);
}
#endif
static inline void status_report(int currcons, struct tty_struct * tty)
{
......@@ -1519,7 +1521,7 @@ static void con_unthrottle(struct tty_struct *tty)
}
/*
* long con_init(long);
* long console_init(long, long);
*
* This routine initalizes console interrupts, and does nothing
* else. If you want the screen to clear, call tty_write with
......@@ -1528,7 +1530,7 @@ static void con_unthrottle(struct tty_struct *tty)
* Reads the information preserved by setup.s to determine the current display
* type and sets everything accordingly.
*/
long con_init(long kmem_start)
long console_init(long kmem_start, long kmem_end)
{
char *display_desc = "????";
int currcons = 0;
......
......@@ -76,7 +76,8 @@ void n_tty_flush_buffer(struct tty_struct * tty)
if (!tty->link)
return;
wake_up_interruptible(&tty->link->write_wait);
if (tty->driver.unthrottle)
(tty->driver.unthrottle)(tty);
if (tty->link->packet) {
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
wake_up_interruptible(&tty->link->read_wait);
......@@ -895,12 +896,6 @@ static int read_chan(struct tty_struct *tty, struct file *file,
current->state = TASK_RUNNING;
current->timeout = 0;
/*
* Hack for PTY's; we need to wake up the other tty if there's
* enough space.
*/
if (tty->link && tty->read_cnt <= TTY_THRESHOLD_UNTHROTTLE)
wake_up_interruptible(&tty->link->write_wait);
return (b - buf) ? b - buf : retval;
}
......
......@@ -85,6 +85,30 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
}
}
/*
* The unthrottle routine is called by the line discipline to signal
* that it can receive more characters. For PTY's, the TTY_THROTTLED
* flag is always set, to force the line discpline to always call the
* unthrottle routine when there are fewer than TTY_THRESHOLD_UNTHROTTLE
* characters in the queue. This is necessary since each time this
* happens, we need to wake up any sleeping processes that could be
* (1) trying to send data to the pty, or (2) waiting in wait_until_sent()
* for the pty buffer to be drained.
*/
static void pty_unthrottle(struct tty_struct * tty)
{
struct tty_struct *o_tty = tty->link;
if (!o_tty)
return;
if ((o_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
o_tty->ldisc.write_wakeup)
(o_tty->ldisc.write_wakeup)(o_tty);
wake_up_interruptible(&o_tty->write_wait);
set_bit(TTY_THROTTLED, &tty->flags);
}
static int pty_write(struct tty_struct * tty, int from_user,
unsigned char *buf, int count)
{
......@@ -177,6 +201,7 @@ int pty_open(struct tty_struct *tty, struct file * filp)
if (tty->driver.subtype == PTY_TYPE_SLAVE)
clear_bit(TTY_SLAVE_CLOSED, &tty->link->flags);
wake_up_interruptible(&pty->open_wait);
set_bit(TTY_THROTTLED, &tty->flags);
if (filp->f_flags & O_NDELAY)
return 0;
while (!tty->link->count && !(current->signal & ~current->blocked))
......@@ -215,6 +240,7 @@ long pty_init(long kmem_start)
pty_driver.write_room = pty_write_room;
pty_driver.flush_buffer = pty_flush_buffer;
pty_driver.chars_in_buffer = pty_chars_in_buffer;
pty_driver.unthrottle = pty_unthrottle;
pty_slave_driver = pty_driver;
pty_slave_driver.name = "ttyp";
......
......@@ -1205,7 +1205,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
if (serial_paranoia_check(info, tty->device, "rs_put_char"))
return;
if (!tty || tty->stopped || tty->hw_stopped || !info->xmit_buf)
if (!tty || !info->xmit_buf)
return;
save_flags(flags); cli();
......
......@@ -75,7 +75,7 @@ extern int shift_state;
extern int do_screendump(int arg);
struct termios tty_std_termios; /* for the benefit of tty drivers */
struct tty_driver *tty_drivers; /* linked list of tty drivers */
struct tty_driver *tty_drivers = NULL; /* linked list of tty drivers */
struct tty_ldisc ldiscs[NR_LDISCS]; /* line disc dispatch table */
/*
......@@ -1529,13 +1529,14 @@ void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
*/
int tty_register_driver(struct tty_driver *driver)
{
int error;
if (driver->flags & TTY_DRIVER_INSTALLED)
return 0;
/*
* XXX need to check to see if major device already
* registered, and then handle error checking.
*/
(void) register_chrdev(driver->major, driver->name, &tty_fops);
error = register_chrdev(driver->major, driver->name, &tty_fops);
if (error)
return error;
if (!driver->put_char)
driver->put_char = tty_default_put_char;
......@@ -1555,7 +1556,6 @@ long tty_init(long kmem_start)
panic("unable to get major %d for tty device", TTY_MAJOR);
if (register_chrdev(TTYAUX_MAJOR,"tty",&tty_fops))
panic("unable to get major %d for tty device", TTYAUX_MAJOR);
tty_drivers = 0;
/* Setup the default TTY line discipline. */
memset(ldiscs, 0, sizeof(ldiscs));
......@@ -1573,7 +1573,6 @@ long tty_init(long kmem_start)
tty_std_termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK |
ECHOCTL | ECHOKE | IEXTEN;
kmem_start = con_init(kmem_start);
kmem_start = kbd_init(kmem_start);
kmem_start = rs_init(kmem_start);
kmem_start = pty_init(kmem_start);
......
......@@ -705,7 +705,7 @@ static void NCR5380_print_options (struct Scsi_Host *instance) {
* Inputs : instance, pointer to this instance.
*/
void NCR5380_print_status (struct Scsi_Host *instance) {
static void NCR5380_print_status (struct Scsi_Host *instance) {
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *)
instance->hostdata;
Scsi_Cmnd *ptr;
......
......@@ -670,18 +670,20 @@ static int internal_command(unsigned char target, unsigned char lun, const void
* target ID are asserted. A valid initator ID is not on the bus
* until IO is asserted, so we must wait for that.
*/
for (clock = jiffies + 10, temp = 0; (jiffies < clock) &&
!((temp = STATUS) & (STAT_IO | STAT_BSY)););
clock = jiffies + 10;
for (;;) {
temp = STATUS;
if ((temp & STAT_IO) && !(temp & STAT_BSY))
break;
if (jiffies >= clock)
{
if (jiffies > clock) {
#if (DEBUG & PHASE_RESELECT)
printk("scsi%d : RESELECT timed out while waiting for IO .\n",
hostno);
printk("scsi%d : RESELECT timed out while waiting for IO .\n",
hostno);
#endif
return (DID_BAD_INTR << 16);
return (DID_BAD_INTR << 16);
}
}
/*
* After I/O is asserted by the target, we can read our ID and its
......
......@@ -298,15 +298,18 @@ static inline int find_and_clear_bit_16(unsigned short *field)
return rv;
}
/* This asm is fragile: it doesn't work without the casts and it may
/* This has been re-implemented with the help of Richard Earnshaw,
<rwe@pegasus.esprit.ec.org> and works with gcc-2.5.8 and gcc-2.6.0.
The instability noted by jfc below appears to be a bug in
gcc-2.5.x when compiling w/o optimization. --Caleb
This asm is fragile: it doesn't work without the casts and it may
not work without optimization. Maybe I should add a swap builtin
to gcc. --jfc */
static inline unsigned char xchgb(unsigned char reg,
volatile unsigned char *mem)
{
asm("xchgb %0,%1" :
"=q" (reg), "=m" (*(unsigned char *)mem) :
"0" (reg), "1" (*(unsigned char *)mem));
asm ("xchgb %0, (%2)" : "=q" (reg) : "0" (reg), "q" (mem) : "m");
return reg;
}
......
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