Commit f938a5c8 authored by Linus Torvalds's avatar Linus Torvalds

pl15b mainly fixes some small tty problems.

parent 17d2d71c
VERSION = 0.99 VERSION = 0.99
PATCHLEVEL = 15 PATCHLEVEL = 15
ALPHA = a ALPHA = b
all: Version zImage all: Version zImage
......
...@@ -235,7 +235,7 @@ static struct { ...@@ -235,7 +235,7 @@ static struct {
0x127 in poly_2xm1.c 0x127 in poly_2xm1.c
0x128 in fpu_entry.c 0x128 in fpu_entry.c
0x2nn in an *.S file: 0x2nn in an *.S file:
0x201 in reg_u_add.S, reg_round.S 0x201 in reg_u_add.S
0x202 in reg_u_div.S 0x202 in reg_u_div.S
0x203 in reg_u_div.S 0x203 in reg_u_div.S
0x204 in reg_u_div.S 0x204 in reg_u_div.S
...@@ -250,11 +250,14 @@ static struct { ...@@ -250,11 +250,14 @@ static struct {
0x213 in wm_sqrt.S 0x213 in wm_sqrt.S
0x214 in wm_sqrt.S 0x214 in wm_sqrt.S
0x215 in wm_sqrt.S 0x215 in wm_sqrt.S
0x216 in reg_round.S
0x217 in reg_round.S
0x218 in reg_round.S
0x220 in reg_norm.S 0x220 in reg_norm.S
0x221 in reg_norm.S 0x221 in reg_norm.S
0x230 in reg_round.S
0x231 in reg_round.S
0x232 in reg_round.S
0x233 in reg_round.S
0x234 in reg_round.S
0x235 in reg_round.S
*/ */
void exception(int n) void exception(int n)
......
...@@ -577,10 +577,14 @@ static int valid_prefix(unsigned char *Byte, overrides *override) ...@@ -577,10 +577,14 @@ static int valid_prefix(unsigned char *Byte, overrides *override)
case PREFIX_DS: /* Redundant unless preceded by another override. */ case PREFIX_DS: /* Redundant unless preceded by another override. */
override->segment = PREFIX_DS; override->segment = PREFIX_DS;
/* lock is not a valid prefix for FPU instructions,
let the cpu handle it to generate a SIGILL. */
/* case PREFIX_LOCK: */
/* rep.. prefixes have no meaning for FPU instructions */ /* rep.. prefixes have no meaning for FPU instructions */
case PREFIX_LOCK:
case PREFIX_REPE: case PREFIX_REPE:
case PREFIX_REPNE: case PREFIX_REPNE:
case OP_SIZE_PREFIX: /* Used often by gcc, but has no effect. */ case OP_SIZE_PREFIX: /* Used often by gcc, but has no effect. */
do_next_byte: do_next_byte:
FPU_EIP++; FPU_EIP++;
...@@ -600,6 +604,9 @@ static int valid_prefix(unsigned char *Byte, overrides *override) ...@@ -600,6 +604,9 @@ static int valid_prefix(unsigned char *Byte, overrides *override)
} }
else else
{ {
/* Not a valid sequence of prefix bytes followed by
an FPU instruction. */
*Byte = byte; /* Needed for error message. */
FPU_EIP = ip; FPU_EIP = ip;
return 0; return 0;
} }
......
...@@ -157,7 +157,7 @@ xDenorm_done: ...@@ -157,7 +157,7 @@ xDenorm_done:
je LRound_To_24 je LRound_To_24
#ifdef PARANOID #ifdef PARANOID
jmp L_bugged /* There is no bug, just a bad control word */ jmp L_bugged_denorm /* There is no bug, just a bad control word */
#endif PARANOID #endif PARANOID
...@@ -178,7 +178,7 @@ LRound_To_24: ...@@ -178,7 +178,7 @@ LRound_To_24:
je LDown_24 je LDown_24
#ifdef PARANOID #ifdef PARANOID
jmp L_bugged jmp L_bugged_round24
#endif PARANOID #endif PARANOID
LUp_24: LUp_24:
...@@ -258,7 +258,7 @@ LRound_To_53: ...@@ -258,7 +258,7 @@ LRound_To_53:
je LDown_53 je LDown_53
#ifdef PARANOID #ifdef PARANOID
jmp L_bugged jmp L_bugged_round53
#endif PARANOID #endif PARANOID
LUp_53: LUp_53:
...@@ -332,7 +332,7 @@ LRound_To_64: ...@@ -332,7 +332,7 @@ LRound_To_64:
je LDown_64 je LDown_64
#ifdef PARANOID #ifdef PARANOID
jmp L_bugged jmp L_bugged_round64
#endif PARANOID #endif PARANOID
LUp_64: LUp_64:
...@@ -644,20 +644,38 @@ xDo_unmasked_underflow: ...@@ -644,20 +644,38 @@ xDo_unmasked_underflow:
#ifdef PARANOID #ifdef PARANOID
/* If we ever get here then we have problems! */ /* If we ever get here then we have problems! */
L_bugged: L_bugged_denorm:
pushl EX_INTERNAL|0x201 pushl EX_INTERNAL|0x230
call EXCEPTION
popl %ebx
jmp L_exception_exit
L_bugged_round24:
pushl EX_INTERNAL|0x231
call EXCEPTION
popl %ebx
jmp L_exception_exit
L_bugged_round53:
pushl EX_INTERNAL|0x232
call EXCEPTION
popl %ebx
jmp L_exception_exit
L_bugged_round64:
pushl EX_INTERNAL|0x233
call EXCEPTION call EXCEPTION
popl %ebx popl %ebx
jmp L_exception_exit jmp L_exception_exit
L_norm_bugged: L_norm_bugged:
pushl EX_INTERNAL|0x216 pushl EX_INTERNAL|0x234
call EXCEPTION call EXCEPTION
popl %ebx popl %ebx
jmp L_exception_exit jmp L_exception_exit
L_entry_bugged: L_entry_bugged:
pushl EX_INTERNAL|0x217 pushl EX_INTERNAL|0x235
call EXCEPTION call EXCEPTION
popl %ebx popl %ebx
L_exception_exit: L_exception_exit:
......
...@@ -55,14 +55,11 @@ static inline void pty_copy(struct tty_struct * from, struct tty_struct * to) ...@@ -55,14 +55,11 @@ static inline void pty_copy(struct tty_struct * from, struct tty_struct * to)
{ {
unsigned long count, n; unsigned long count, n;
struct tty_queue *fq, *tq; struct tty_queue *fq, *tq;
int skip_readq;
if (from->stopped || EMPTY(&from->write_q)) if (from->stopped || EMPTY(&from->write_q))
return; return;
fq = &from->write_q; fq = &from->write_q;
/* Bypass the read_q if this is a pty master. */ tq = &to->read_q;
skip_readq = IS_A_PTY_MASTER(to->line) && to->disc == N_TTY;
tq = skip_readq ? &to->secondary : &to->read_q;
count = MIN(CHARS(fq), LEFT(tq)); count = MIN(CHARS(fq), LEFT(tq));
while (count) { while (count) {
n = MIN(MIN(TTY_BUF_SIZE - fq->tail, TTY_BUF_SIZE - tq->head), n = MIN(MIN(TTY_BUF_SIZE - fq->tail, TTY_BUF_SIZE - tq->head),
...@@ -72,9 +69,6 @@ static inline void pty_copy(struct tty_struct * from, struct tty_struct * to) ...@@ -72,9 +69,6 @@ static inline void pty_copy(struct tty_struct * from, struct tty_struct * to)
fq->tail = (fq->tail + n) & (TTY_BUF_SIZE - 1); fq->tail = (fq->tail + n) & (TTY_BUF_SIZE - 1);
tq->head = (tq->head + n) & (TTY_BUF_SIZE - 1); tq->head = (tq->head + n) & (TTY_BUF_SIZE - 1);
} }
if (skip_readq)
wake_up_interruptible(&to->secondary.proc_list);
else
TTY_READ_FLUSH(to); TTY_READ_FLUSH(to);
if (LEFT(fq) > WAKEUP_CHARS) if (LEFT(fq) > WAKEUP_CHARS)
wake_up_interruptible(&fq->proc_list); wake_up_interruptible(&fq->proc_list);
......
...@@ -954,6 +954,24 @@ static int read_chan(struct tty_struct *tty, struct file *file, ...@@ -954,6 +954,24 @@ static int read_chan(struct tty_struct *tty, struct file *file,
int minimum, time; int minimum, time;
int retval = 0; int retval = 0;
/* Job control check -- must be done at start and after
every sleep (POSIX.1 7.1.1.4). */
/* NOTE: not yet done after every sleep pending a thorough
check of the logic of this change. -- jlc */
/* don't stop on /dev/console */
if (file->f_inode->i_rdev != CONSOLE_DEV &&
current->tty == tty->line) {
if (tty->pgrp <= 0)
printk("read_chan: tty->pgrp <= 0!\n");
else if (current->pgrp != tty->pgrp) {
if (is_ignored(SIGTTIN) ||
is_orphaned_pgrp(current->pgrp))
return -EIO;
kill_pg(current->pgrp, SIGTTIN, 1);
return -ERESTARTSYS;
}
}
if (L_ICANON(tty)) { if (L_ICANON(tty)) {
minimum = time = 0; minimum = time = 0;
current->timeout = (unsigned long) -1; current->timeout = (unsigned long) -1;
...@@ -974,24 +992,6 @@ static int read_chan(struct tty_struct *tty, struct file *file, ...@@ -974,24 +992,6 @@ static int read_chan(struct tty_struct *tty, struct file *file,
add_wait_queue(&tty->secondary.proc_list, &wait); add_wait_queue(&tty->secondary.proc_list, &wait);
while (1) { while (1) {
/* Job control check -- must be done at start and after
every sleep (POSIX.1 7.1.1.4). */
/* don't stop on /dev/console */
if (file->f_inode->i_rdev != CONSOLE_DEV &&
current->tty == tty->line) {
if (tty->pgrp <= 0)
printk("read_chan: tty->pgrp <= 0!\n");
else if (current->pgrp != tty->pgrp) {
if (is_ignored(SIGTTIN) ||
is_orphaned_pgrp(current->pgrp)) {
retval = -EIO;
break;
}
kill_pg(current->pgrp, SIGTTIN, 1);
retval = -ERESTARTSYS;
break;
}
}
/* First test for status change. */ /* First test for status change. */
if (tty->packet && tty->link->ctrl_status) { if (tty->packet && tty->link->ctrl_status) {
if (b != buf) if (b != buf)
......
...@@ -359,16 +359,15 @@ int ext2_new_block (struct super_block * sb, unsigned long goal, ...@@ -359,16 +359,15 @@ int ext2_new_block (struct super_block * sb, unsigned long goal,
ext2_debug ("goal=%lu.\n", goal); ext2_debug ("goal=%lu.\n", goal);
if (goal < es->s_first_data_block || goal >= es->s_blocks_count) {
ext2_warning (sb, "ext2_new_block",
"Goal out of bounds: %lu", goal);
goal = es->s_first_data_block;
}
repeat: repeat:
/* /*
* First, test whether the goal block is free. * First, test whether the goal block is free.
*/ */
i = ((goal - es->s_first_data_block) / EXT2_BLOCKS_PER_GROUP(sb)); i = ((goal - es->s_first_data_block) / EXT2_BLOCKS_PER_GROUP(sb));
if (i >= EXT2_BLOCKS_PER_GROUP(sb) || i < 0) {
i = 0;
goal = es->s_first_data_block;
}
gdp = get_group_desc (sb, i, &bh2); gdp = get_group_desc (sb, i, &bh2);
if (gdp->bg_free_blocks_count > 0) { if (gdp->bg_free_blocks_count > 0) {
j = ((goal - es->s_first_data_block) % EXT2_BLOCKS_PER_GROUP(sb)); j = ((goal - es->s_first_data_block) % EXT2_BLOCKS_PER_GROUP(sb));
......
...@@ -392,6 +392,7 @@ extern struct buffer_head * breada(dev_t dev,int block,...); ...@@ -392,6 +392,7 @@ extern struct buffer_head * breada(dev_t dev,int block,...);
extern void put_super(dev_t dev); extern void put_super(dev_t dev);
extern dev_t ROOT_DEV; extern dev_t ROOT_DEV;
extern void show_buffers(void);
extern void mount_root(void); extern void mount_root(void);
extern int char_read(struct inode *, struct file *, char *, int); extern int char_read(struct inode *, struct file *, char *, int);
......
...@@ -89,8 +89,8 @@ asmlinkage void alignment_check(void); ...@@ -89,8 +89,8 @@ asmlinkage void alignment_check(void);
printk("EIP: %04x:%08lx\nEFLAGS: %08lx\n", 0xffff & regs->cs,regs->eip,regs->eflags); printk("EIP: %04x:%08lx\nEFLAGS: %08lx\n", 0xffff & regs->cs,regs->eip,regs->eflags);
printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
regs->eax, regs->ebx, regs->ecx, regs->edx); regs->eax, regs->ebx, regs->ecx, regs->edx);
printk("esi: %08lx edi: %08lx ebp: %08lx\n", printk("esi: %08lx edi: %08lx ebp: %08lx esp: %08x\n",
regs->esi, regs->edi, regs->ebp); regs->esi, regs->edi, regs->ebp, regs->esp);
printk("ds: %04x es: %04x fs: %04x gs: %04x\n", printk("ds: %04x es: %04x fs: %04x gs: %04x\n",
regs->ds, regs->es, regs->fs, regs->gs); regs->ds, regs->es, regs->fs, regs->gs);
store_TR(i); store_TR(i);
...@@ -98,6 +98,9 @@ asmlinkage void alignment_check(void); ...@@ -98,6 +98,9 @@ asmlinkage void alignment_check(void);
for(i=0;i<20;i++) for(i=0;i<20;i++)
printk("%02x ",0xff & get_seg_byte(regs->cs,(i+(char *)regs->eip))); printk("%02x ",0xff & get_seg_byte(regs->cs,(i+(char *)regs->eip)));
printk("\n"); printk("\n");
for(i=0;i<5;i++)
printk("%08x ", get_seg_long(regs->ss,(i+(unsigned long *)regs->esp)));
printk("\n");
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
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