Commit bb9c5bf1 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.10

parent c3aa3674
...@@ -172,13 +172,20 @@ S: East Malvern, Victoria, 3145 ...@@ -172,13 +172,20 @@ S: East Malvern, Victoria, 3145
S: Australia S: Australia
N: Alan Cox N: Alan Cox
E: A.Cox@swansea.ac.uk E: iialan@iifeak.swan.ac.uk
E: iiitac@pyr.swan.ac.uk E: alan@cymru.net (use for commercial traffic)
E: gw4pts@gw4pts.ampr.org E: gw4pts@gw4pts.ampr.org
E: GW4PTS@GB7SWN (packet radio) E: GW4PTS@GB7SWN (packet radio)
D: NET2Debugged author S: c/o I^2IT Limited
S: The Innovation Centre
S: University Of Wales
S: Swansea, SA2 8PP
S: Wales, UK
D: NET2Debugged/NET3 author
D: Network layer debugging D: Network layer debugging
D: AX.25 & IPX alpha releases D: Initial AX.25 & IPX releases
D: Original Linux netatalk patches.
D: Current 3c501 hacker. >>More 3c501 info/tricks wanted<<.
N: Laurence Culhane N: Laurence Culhane
E: loz@holmes.demon.co.uk E: loz@holmes.demon.co.uk
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 3 PATCHLEVEL = 3
SUBLEVEL = 9 SUBLEVEL = 10
ARCH = i386 ARCH = i386
...@@ -283,3 +283,5 @@ else ...@@ -283,3 +283,5 @@ else
dummy: dummy:
endif endif
include Rules.make
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Common rules # Common rules
# #
.c.s: .c.s:
$(CC) $(CFLAGS) -S $< $(CC) $(CFLAGS) -S $< -o $@
# #
# A rule to do nothing # A rule to do nothing
......
OUTPUT_FORMAT("ecoff-littlealpha")
ENTRY(__start)
SECTIONS
{
.text 0x20000000: {
_ftext = . ;
__istart = . ;
eprol = .;
*(.text)
__fstart = . ;
_etext = .;
}
.rdata : {
*(.rdata)
}
.pdata : {
_fpdata = .;
*(.pdata)
}
.data : {
_fdata = .;
*(.data)
CONSTRUCTORS
}
.xdata : {
*(.xdata)
}
_gp = ALIGN (16) + 0x8000;
.lit8 : {
*(.lit8)
}
.lita : {
*(.lita)
}
.sdata : {
*(.sdata)
}
_EDATA = .;
_FBSS = .;
.sbss : {
*(.sbss)
*(.scommon)
}
.bss : {
*(.bss)
*(COMMON)
}
_end = .;
}
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
OBJS = entry.o traps.o process.o osf_sys.o irq.o signal.o setup.o \ OBJS = entry.o traps.o process.o osf_sys.o irq.o signal.o setup.o \
lca.o bios32.o lca.o bios32.o ptrace.o
all: kernel.o head.o all: kernel.o head.o
......
...@@ -105,6 +105,9 @@ ...@@ -105,6 +105,9 @@
.text .text
.set noat .set noat
#ifdef __linux__
.set singlegp
#endif
.align 3 .align 3
.globl entInt .globl entInt
...@@ -191,9 +194,11 @@ kernel_fork: ...@@ -191,9 +194,11 @@ kernel_fork:
stq $16,24($30) stq $16,24($30)
stq $17,32($30) stq $17,32($30)
stq $18,40($30) stq $18,40($30)
bis $31,2,$0 /* Register v0: syscall nr for fork() */
SAVE_ALL SAVE_ALL
lda $27,sys_fork lda $27,sys_fork
jsr $26,($27),sys_fork jsr $26,($27),sys_fork
stq $0,0($30)
br ret_from_sys_call br ret_from_sys_call
.end kernel_fork .end kernel_fork
...@@ -240,7 +245,7 @@ do_switch_stack: ...@@ -240,7 +245,7 @@ do_switch_stack:
stt $f28,288($30) stt $f28,288($30)
stt $f29,296($30) stt $f29,296($30)
stt $f30,304($30) stt $f30,304($30)
ret $31,($0),1 ret $31,($1),1
.end do_switch_stack .end do_switch_stack
.align 3 .align 3
...@@ -286,7 +291,7 @@ undo_switch_stack: ...@@ -286,7 +291,7 @@ undo_switch_stack:
ldt $f29,296($30) ldt $f29,296($30)
ldt $f30,304($30) ldt $f30,304($30)
lda $30,SWITCH_STACK_SIZE($30) lda $30,SWITCH_STACK_SIZE($30)
ret $31,($0),1 ret $31,($1),1
.end undo_switch_stack .end undo_switch_stack
.align 3 .align 3
...@@ -363,14 +368,11 @@ entUna: ...@@ -363,14 +368,11 @@ entUna:
.globl sys_fork .globl sys_fork
.ent sys_fork .ent sys_fork
sys_fork: sys_fork:
br $0,do_switch_stack br $1,do_switch_stack
bis $30,$30,$16 bis $30,$30,$16
lda $27,alpha_fork lda $27,alpha_fork
jsr $26,($27),alpha_fork jsr $26,($27),alpha_fork
br $0,undo_switch_stack br $1,undo_switch_stack
ldq $0,0($30)
bis $31,2,$19 /* Make sure that the stored user register v0 has */
stq $19,0($30) /* the syscall # for fork */
ret $31,($26),1 ret $31,($26),1
.end sys_fork .end sys_fork
...@@ -378,9 +380,9 @@ sys_fork: ...@@ -378,9 +380,9 @@ sys_fork:
.globl alpha_switch_to .globl alpha_switch_to
.ent alpha_switch_to .ent alpha_switch_to
alpha_switch_to: alpha_switch_to:
br $0,do_switch_stack br $1,do_switch_stack
call_pal PAL_swpctx call_pal PAL_swpctx
br $0,undo_switch_stack br $1,undo_switch_stack
ret $31,($26),1 ret $31,($26),1
.end alpha_switch_to .end alpha_switch_to
...@@ -450,7 +452,7 @@ restore_all: ...@@ -450,7 +452,7 @@ restore_all:
.align 3 .align 3
signal_return: signal_return:
bis $30,$30,$17 bis $30,$30,$17
br $0,do_switch_stack br $1,do_switch_stack
bis $30,$30,$18 bis $30,$30,$18
lda $27,do_signal lda $27,do_signal
jsr $26,($27),do_signal jsr $26,($27),do_signal
...@@ -480,7 +482,7 @@ sys_sigreturn: ...@@ -480,7 +482,7 @@ sys_sigreturn:
bis $30,$30,$18 bis $30,$30,$18
lda $27,do_sigreturn lda $27,do_sigreturn
jsr $26,($27),do_sigreturn jsr $26,($27),do_sigreturn
br $0,undo_switch_stack br $1,undo_switch_stack
br $31,ret_from_sys_call br $31,ret_from_sys_call
.end sys_sigreturn .end sys_sigreturn
...@@ -488,7 +490,7 @@ sys_sigreturn: ...@@ -488,7 +490,7 @@ sys_sigreturn:
.ent sys_sigsuspend .ent sys_sigsuspend
sys_sigsuspend: sys_sigsuspend:
bis $30,$30,$17 bis $30,$30,$17
br $0,do_switch_stack br $1,do_switch_stack
bis $30,$30,$18 bis $30,$30,$18
lda $27,do_sigsuspend lda $27,do_sigsuspend
jsr $26,($27),do_sigsuspend jsr $26,($27),do_sigsuspend
...@@ -504,7 +506,7 @@ sys_call_table: ...@@ -504,7 +506,7 @@ sys_call_table:
.quad sys_unlink, do_entSys, sys_chdir, sys_fchdir, sys_mknod .quad sys_unlink, do_entSys, sys_chdir, sys_fchdir, sys_mknod
.quad sys_chmod, sys_chown, sys_brk, do_entSys, sys_lseek .quad sys_chmod, sys_chown, sys_brk, do_entSys, sys_lseek
.quad sys_getxpid, osf_mount, osf_umount, sys_setuid, sys_getxuid .quad sys_getxpid, osf_mount, osf_umount, sys_setuid, sys_getxuid
.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys .quad do_entSys, sys_ptrace, do_entSys, do_entSys, do_entSys
.quad do_entSys, do_entSys, do_entSys, sys_access, do_entSys .quad do_entSys, do_entSys, do_entSys, sys_access, do_entSys
.quad do_entSys, sys_sync, sys_kill, do_entSys, sys_setpgid .quad do_entSys, sys_sync, sys_kill, do_entSys, sys_setpgid
.quad do_entSys, sys_dup, sys_pipe, do_entSys, do_entSys .quad do_entSys, sys_dup, sys_pipe, do_entSys, do_entSys
......
...@@ -123,7 +123,6 @@ void copy_thread(int nr, unsigned long clone_flags, unsigned long usp, ...@@ -123,7 +123,6 @@ void copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
childregs->r0 = 0; childregs->r0 = 0;
childregs->r19 = 0; childregs->r19 = 0;
childregs->r20 = 1; /* OSF/1 has some strange fork() semantics.. */ childregs->r20 = 1; /* OSF/1 has some strange fork() semantics.. */
regs->r0 = p->pid;
regs->r20 = 0; regs->r20 = 0;
stack = ((struct switch_stack *) regs) - 1; stack = ((struct switch_stack *) regs) - 1;
childstack = ((struct switch_stack *) childregs) - 1; childstack = ((struct switch_stack *) childregs) - 1;
......
This diff is collapsed.
...@@ -19,10 +19,10 @@ void die_if_kernel(char * str, struct pt_regs * regs, long err) ...@@ -19,10 +19,10 @@ void die_if_kernel(char * str, struct pt_regs * regs, long err)
unsigned long sp; unsigned long sp;
unsigned int * pc; unsigned int * pc;
if (regs->ps & 8)
return;
printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err); printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
sp = (unsigned long) (regs+1); sp = (unsigned long) (regs+1);
if (regs->ps & 8)
sp = rdusp();
printk("pc = %lx ps = %04lx\n", regs->pc, regs->ps); printk("pc = %lx ps = %04lx\n", regs->pc, regs->ps);
printk("rp = %lx sp = %lx\n", regs->r26, sp); printk("rp = %lx sp = %lx\n", regs->r26, sp);
printk("r0=%lx r1=%lx r2=%lx r3=%lx\n", printk("r0=%lx r1=%lx r2=%lx r3=%lx\n",
...@@ -36,8 +36,6 @@ void die_if_kernel(char * str, struct pt_regs * regs, long err) ...@@ -36,8 +36,6 @@ void die_if_kernel(char * str, struct pt_regs * regs, long err)
regs->r24, regs->r25, regs->r26, regs->r27); regs->r24, regs->r25, regs->r26, regs->r27);
printk("r28=%lx r29=%lx r30=%lx\n", printk("r28=%lx r29=%lx r30=%lx\n",
regs->r28, regs->gp, sp); regs->r28, regs->gp, sp);
if (regs->ps & 8)
return;
printk("Code:"); printk("Code:");
pc = (unsigned int *) regs->pc; pc = (unsigned int *) regs->pc;
for (i = -3; i < 6; i++) for (i = -3; i < 6; i++)
...@@ -61,8 +59,29 @@ asmlinkage void do_entIF(unsigned long type, unsigned long a1, unsigned long a2, ...@@ -61,8 +59,29 @@ asmlinkage void do_entIF(unsigned long type, unsigned long a1, unsigned long a2,
unsigned long a3, unsigned long a4, unsigned long a5, unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs regs) struct pt_regs regs)
{ {
extern int ptrace_cancel_bpt (struct task_struct *who);
die_if_kernel("Instruction fault", &regs, type); die_if_kernel("Instruction fault", &regs, type);
switch (type) {
case 0: /* breakpoint */
if (ptrace_cancel_bpt(current)) {
regs.pc -= 4; /* make pc point to former bpt */
}
if (current->flags & PF_PTRACED)
current->blocked &= ~(1 << (SIGTRAP - 1));
send_sig(SIGTRAP, current, 1);
break;
case 1: /* bugcheck */
case 2: /* gentrap */
case 3: /* FEN fault */
case 4: /* opDEC */
send_sig(SIGILL, current, 1); send_sig(SIGILL, current, 1);
break;
default:
panic("do_entIF: unexpected instruction-fault type");
}
} }
/* /*
...@@ -131,6 +150,7 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg, ...@@ -131,6 +150,7 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg,
asmlinkage long do_entSys(unsigned long a0, unsigned long a1, unsigned long a2, asmlinkage long do_entSys(unsigned long a0, unsigned long a1, unsigned long a2,
unsigned long a3, unsigned long a4, unsigned long a5, struct pt_regs regs) unsigned long a3, unsigned long a4, unsigned long a5, struct pt_regs regs)
{ {
if (regs.r0 != 112)
printk("<sc %ld(%lx,%lx,%lx)>", regs.r0, a0, a1, a2); printk("<sc %ld(%lx,%lx,%lx)>", regs.r0, a0, a1, a2);
return -1; return -1;
} }
......
OUTPUT_FORMAT("ecoff-littlealpha")
ENTRY(__start)
SECTIONS
{
.text 0xfffffc0000310000: {
_ftext = . ;
__istart = . ;
eprol = .;
*(.text)
__fstart = . ;
_etext = .;
}
.rdata : {
*(.rdata)
}
.pdata : {
_fpdata = .;
*(.pdata)
}
.data : {
_fdata = .;
*(.data)
CONSTRUCTORS
}
.xdata : {
*(.xdata)
}
_gp = ALIGN (16) + 0x8000;
.lit8 : {
*(.lit8)
}
.lita : {
*(.lita)
}
.sdata : {
*(.sdata)
}
_EDATA = .;
_FBSS = .;
.sbss : {
*(.sbss)
*(.scommon)
}
.bss : {
*(.bss)
*(COMMON)
}
_end = .;
}
...@@ -60,6 +60,7 @@ bool 'IP: Reverse ARP' CONFIG_INET_RARP n ...@@ -60,6 +60,7 @@ bool 'IP: Reverse ARP' CONFIG_INET_RARP n
bool 'IP: Assume subnets are local' CONFIG_INET_SNARL y bool 'IP: Assume subnets are local' CONFIG_INET_SNARL y
bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n bool 'IP: Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n
bool 'IP: Drop source routed frames' CONFIG_IP_NOSR y bool 'IP: Drop source routed frames' CONFIG_IP_NOSR y
bool 'IP: Allow large windows (not recommend if <16Mb of memory)' CONFIG_SKB_LARGE y
fi fi
bool 'The IPX protocol' CONFIG_IPX n bool 'The IPX protocol' CONFIG_IPX n
bool 'Appletalk DDP' CONFIG_ATALK n bool 'Appletalk DDP' CONFIG_ATALK n
......
This diff is collapsed.
...@@ -114,7 +114,9 @@ static int msdos_partition(struct gendisk *hd, unsigned int dev, unsigned long f ...@@ -114,7 +114,9 @@ static int msdos_partition(struct gendisk *hd, unsigned int dev, unsigned long f
struct buffer_head *bh; struct buffer_head *bh;
struct partition *p; struct partition *p;
int mask = (1 << hd->minor_shift) - 1; int mask = (1 << hd->minor_shift) - 1;
#ifdef CONFIG_BLK_DEV_IDE
extern void ide_xlate_1024(dev_t); extern void ide_xlate_1024(dev_t);
#endif
read_mbr: read_mbr:
if (!(bh = bread(dev,0,1024))) { if (!(bh = bread(dev,0,1024))) {
...@@ -149,7 +151,9 @@ static int msdos_partition(struct gendisk *hd, unsigned int dev, unsigned long f ...@@ -149,7 +151,9 @@ static int msdos_partition(struct gendisk *hd, unsigned int dev, unsigned long f
first_sector += p->end_sector; first_sector += p->end_sector;
hd->part[MINOR(dev)].start_sect += p->end_sector; hd->part[MINOR(dev)].start_sect += p->end_sector;
hd->part[MINOR(dev)].nr_sects -= p->end_sector; hd->part[MINOR(dev)].nr_sects -= p->end_sector;
#ifdef CONFIG_BLK_DEV_IDE
ide_xlate_1024(dev); /* harmless if not an IDE drive */ ide_xlate_1024(dev); /* harmless if not an IDE drive */
#endif
bh->b_dirt = 0; /* prevent re-use of this block */ bh->b_dirt = 0; /* prevent re-use of this block */
bh->b_uptodate = 0; bh->b_uptodate = 0;
bh->b_req = 0; bh->b_req = 0;
...@@ -162,7 +166,9 @@ static int msdos_partition(struct gendisk *hd, unsigned int dev, unsigned long f ...@@ -162,7 +166,9 @@ static int msdos_partition(struct gendisk *hd, unsigned int dev, unsigned long f
*/ */
if (p->sys_ind == DM6_AUXPARTITION) { if (p->sys_ind == DM6_AUXPARTITION) {
printk(" [DM6]"); printk(" [DM6]");
#ifdef CONFIG_BLK_DEV_IDE
ide_xlate_1024(dev); /* harmless if not an IDE drive */ ide_xlate_1024(dev); /* harmless if not an IDE drive */
#endif
} }
current_minor += 4; /* first "extra" minor (for extended partitions) */ current_minor += 4; /* first "extra" minor (for extended partitions) */
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <linux/types.h>
#include <asm/segment.h> #include <asm/segment.h>
...@@ -69,7 +70,7 @@ clear_selection(void) { ...@@ -69,7 +70,7 @@ clear_selection(void) {
* User settable table: what characters are to be considered alphabetic? * User settable table: what characters are to be considered alphabetic?
* 256 bits * 256 bits
*/ */
static unsigned long inwordLut[8]={ static u32 inwordLut[8]={
0x00000000, /* control chars */ 0x00000000, /* control chars */
0x03FF0000, /* digits */ 0x03FF0000, /* digits */
0x87FFFFFE, /* uppercase and '_' */ 0x87FFFFFE, /* uppercase and '_' */
...@@ -90,7 +91,7 @@ int sel_loadlut(const unsigned long arg) ...@@ -90,7 +91,7 @@ int sel_loadlut(const unsigned long arg)
int i = verify_area(VERIFY_READ, (char *) arg, 36); int i = verify_area(VERIFY_READ, (char *) arg, 36);
if (i) if (i)
return i; return i;
memcpy_fromfs(inwordLut, (unsigned long *)(arg+4), 32); memcpy_fromfs(inwordLut, (u32 *)(arg+4), 32);
return 0; return 0;
} }
......
...@@ -94,48 +94,13 @@ static void unset_locked_termios(struct termios *termios, ...@@ -94,48 +94,13 @@ static void unset_locked_termios(struct termios *termios,
old->c_cc[i] : termios->c_cc[i]; old->c_cc[i] : termios->c_cc[i];
} }
static int set_termios(struct tty_struct * tty, unsigned long arg, int opt) static void change_termios(struct tty_struct * tty, struct termios * new_termios)
{ {
struct termio tmp_termio; int canon_change;
struct termios tmp_termios;
struct termios old_termios = *tty->termios; struct termios old_termios = *tty->termios;
int retval, canon_change;
retval = tty_check_change(tty);
if (retval)
return retval;
if (opt & TERMIOS_TERMIO) {
retval = verify_area(VERIFY_READ, (void *) arg, sizeof(struct termio));
if (retval)
return retval;
tmp_termios = *tty->termios;
memcpy_fromfs(&tmp_termio, (struct termio *) arg,
sizeof (struct termio));
#define SET_LOW_BITS(x,y) ((x) = (0xffff0000 & (x)) | (y))
SET_LOW_BITS(tmp_termios.c_iflag, tmp_termio.c_iflag);
SET_LOW_BITS(tmp_termios.c_oflag, tmp_termio.c_oflag);
SET_LOW_BITS(tmp_termios.c_cflag, tmp_termio.c_cflag);
SET_LOW_BITS(tmp_termios.c_lflag, tmp_termio.c_lflag);
memcpy(&tmp_termios.c_cc, &tmp_termio.c_cc, NCC);
#undef SET_LOW_BITS
} else {
retval = verify_area(VERIFY_READ, (void *) arg, sizeof(struct termios));
if (retval)
return retval;
memcpy_fromfs(&tmp_termios, (struct termios *) arg,
sizeof (struct termios));
}
if ((opt & TERMIOS_FLUSH) && tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (opt & TERMIOS_WAIT)
tty_wait_until_sent(tty, 0);
cli(); cli();
*tty->termios = tmp_termios; *tty->termios = *new_termios;
unset_locked_termios(tty->termios, &old_termios, tty->termios_locked); unset_locked_termios(tty->termios, &old_termios, tty->termios_locked);
canon_change = (old_termios.c_lflag ^ tty->termios->c_lflag) & ICANON; canon_change = (old_termios.c_lflag ^ tty->termios->c_lflag) & ICANON;
if (canon_change) { if (canon_change) {
...@@ -173,7 +138,41 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt) ...@@ -173,7 +138,41 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
if (tty->ldisc.set_termios) if (tty->ldisc.set_termios)
(*tty->ldisc.set_termios)(tty, &old_termios); (*tty->ldisc.set_termios)(tty, &old_termios);
}
static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
{
struct termios tmp_termios;
int retval;
retval = tty_check_change(tty);
if (retval)
return retval;
if (opt & TERMIOS_TERMIO) {
struct termio tmp_termio;
retval = verify_area(VERIFY_READ, (void *) arg, sizeof(struct termio));
if (retval)
return retval;
tmp_termios = *tty->termios;
memcpy_fromfs(&tmp_termio, (struct termio *) arg,
sizeof (struct termio));
trans_from_termio(&tmp_termio, &tmp_termios);
} else {
retval = verify_area(VERIFY_READ, (void *) arg, sizeof(struct termios));
if (retval)
return retval;
memcpy_fromfs(&tmp_termios, (struct termios *) arg,
sizeof (struct termios));
}
if ((opt & TERMIOS_FLUSH) && tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (opt & TERMIOS_WAIT)
tty_wait_until_sent(tty, 0);
change_termios(tty, &tmp_termios);
return 0; return 0;
} }
...@@ -185,13 +184,7 @@ static int get_termio(struct tty_struct * tty, struct termio * termio) ...@@ -185,13 +184,7 @@ static int get_termio(struct tty_struct * tty, struct termio * termio)
i = verify_area(VERIFY_WRITE, termio, sizeof (struct termio)); i = verify_area(VERIFY_WRITE, termio, sizeof (struct termio));
if (i) if (i)
return i; return i;
tmp_termio.c_iflag = tty->termios->c_iflag; trans_to_termio(tty->termios, &tmp_termio);
tmp_termio.c_oflag = tty->termios->c_oflag;
tmp_termio.c_cflag = tty->termios->c_cflag;
tmp_termio.c_lflag = tty->termios->c_lflag;
tmp_termio.c_line = tty->termios->c_line;
for(i=0 ; i < NCC ; i++)
tmp_termio.c_cc[i] = tty->termios->c_cc[i];
memcpy_tofs(termio, &tmp_termio, sizeof (struct termio)); memcpy_tofs(termio, &tmp_termio, sizeof (struct termio));
return 0; return 0;
} }
...@@ -215,6 +208,169 @@ static unsigned long inq_canon(struct tty_struct * tty) ...@@ -215,6 +208,169 @@ static unsigned long inq_canon(struct tty_struct * tty)
return nr; return nr;
} }
#ifdef TIOCGETP
/*
* These are depracated, but there is limited support..
*
* The "sg_flags" translation is a joke..
*/
static int get_sgflags(struct tty_struct * tty)
{
int flags = 0;
if (!(tty->termios->c_lflag & ICANON))
if (tty->termios->c_lflag & ISIG)
flags |= 0x02; /* cbreak */
else
flags |= 0x20; /* raw */
if (tty->termios->c_lflag & ECHO)
flags |= 0x08; /* echo */
if (tty->termios->c_oflag & OPOST)
if (tty->termios->c_oflag & ONLCR)
flags |= 0x10; /* crmod */
return flags;
}
static int get_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
{
int retval;
struct sgttyb tmp;
retval = verify_area(VERIFY_WRITE, sgttyb, sizeof(struct sgttyb));
if (retval)
return retval;
tmp.sg_ispeed = 0;
tmp.sg_ospeed = 0;
tmp.sg_erase = tty->termios->c_cc[VERASE];
tmp.sg_kill = tty->termios->c_cc[VKILL];
tmp.sg_flags = get_sgflags(tty);
memcpy_tofs(sgttyb, &tmp, sizeof(tmp));
return 0;
}
static void set_sgflags(struct termios * termios, int flags)
{
termios->c_iflag = ICRNL | IXON;
termios->c_oflag = 0;
termios->c_lflag = ISIG | ICANON;
if (flags & 0x02) { /* cbreak */
termios->c_iflag = 0;
termios->c_lflag &= ~ICANON;
}
if (flags & 0x08) { /* echo */
termios->c_lflag |= ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
}
if (flags & 0x10) { /* crmod */
termios->c_oflag |= OPOST | ONLCR;
}
if (flags & 0x20) { /* raw */
termios->c_iflag = 0;
termios->c_lflag &= ~(ISIG | ICANON);
}
if (!(termios->c_lflag & ICANON)) {
termios->c_cc[VMIN] = 1;
termios->c_cc[VTIME] = 0;
}
}
static int set_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
{
int retval;
struct sgttyb tmp;
struct termios termios;
retval = verify_area(VERIFY_READ, sgttyb, sizeof(struct sgttyb));
if (retval)
return retval;
retval = tty_check_change(tty);
if (retval)
return retval;
termios = *tty->termios;
memcpy_fromfs(&tmp, sgttyb, sizeof(tmp));
termios.c_cc[VERASE] = tmp.sg_erase;
termios.c_cc[VKILL] = tmp.sg_kill;
set_sgflags(&termios, tmp.sg_flags);
change_termios(tty, &termios);
return 0;
}
#endif
#ifdef TIOCGETC
static int get_tchars(struct tty_struct * tty, struct tchars * tchars)
{
int retval;
struct tchars tmp;
retval = verify_area(VERIFY_WRITE, tchars, sizeof(struct tchars));
if (retval)
return retval;
tmp.t_intrc = tty->termios->c_cc[VINTR];
tmp.t_quitc = tty->termios->c_cc[VQUIT];
tmp.t_startc = tty->termios->c_cc[VSTART];
tmp.t_stopc = tty->termios->c_cc[VSTOP];
tmp.t_eofc = tty->termios->c_cc[VEOF];
tmp.t_brkc = tty->termios->c_cc[VEOL2]; /* what is brkc anyway? */
memcpy_tofs(tchars, &tmp, sizeof(tmp));
return 0;
}
static int set_tchars(struct tty_struct * tty, struct tchars * tchars)
{
int retval;
struct tchars tmp;
retval = verify_area(VERIFY_READ, tchars, sizeof(struct tchars));
if (retval)
return retval;
memcpy_fromfs(&tmp, tchars, sizeof(tmp));
tty->termios->c_cc[VINTR] = tmp.t_intrc;
tty->termios->c_cc[VQUIT] = tmp.t_quitc;
tty->termios->c_cc[VSTART] = tmp.t_startc;
tty->termios->c_cc[VSTOP] = tmp.t_stopc;
tty->termios->c_cc[VEOF] = tmp.t_eofc;
tty->termios->c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */
return 0;
}
#endif
#ifdef TIOCGLTC
static int get_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
{
int retval;
struct ltchars tmp;
retval = verify_area(VERIFY_WRITE, ltchars, sizeof(struct ltchars));
if (retval)
return retval;
tmp.t_suspc = tty->termios->c_cc[VSUSP];
tmp.t_dsuspc = tty->termios->c_cc[VSUSP]; /* what is dsuspc anyway? */
tmp.t_rprntc = tty->termios->c_cc[VREPRINT];
tmp.t_flushc = tty->termios->c_cc[VEOL2]; /* what is flushc anyway? */
tmp.t_werasc = tty->termios->c_cc[VWERASE];
tmp.t_lnextc = tty->termios->c_cc[VLNEXT];
memcpy_tofs(ltchars, &tmp, sizeof(tmp));
return 0;
}
static int set_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
{
int retval;
struct ltchars tmp;
retval = verify_area(VERIFY_READ, ltchars, sizeof(struct ltchars));
if (retval)
return retval;
memcpy_fromfs(&tmp, ltchars, sizeof(tmp));
tty->termios->c_cc[VSUSP] = tmp.t_suspc;
tty->termios->c_cc[VEOL2] = tmp.t_dsuspc; /* what is dsuspc anyway? */
tty->termios->c_cc[VREPRINT] = tmp.t_rprntc;
tty->termios->c_cc[VEOL2] = tmp.t_flushc; /* what is flushc anyway? */
tty->termios->c_cc[VWERASE] = tmp.t_werasc;
tty->termios->c_cc[VLNEXT] = tmp.t_lnextc;
return 0;
}
#endif
int n_tty_ioctl(struct tty_struct * tty, struct file * file, int n_tty_ioctl(struct tty_struct * tty, struct file * file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
...@@ -229,6 +385,25 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, ...@@ -229,6 +385,25 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
real_tty = tty; real_tty = tty;
switch (cmd) { switch (cmd) {
#ifdef TIOCGETP
case TIOCGETP:
return get_sgttyb(real_tty, (struct sgttyb *) arg);
case TIOCSETP:
case TIOCSETN:
return set_sgttyb(real_tty, (struct sgttyb *) arg);
#endif
#ifdef TIOCGETC
case TIOCGETC:
return get_tchars(real_tty, (struct tchars *) arg);
case TIOCSETC:
return set_tchars(real_tty, (struct tchars *) arg);
#endif
#ifdef TIOCGLTC
case TIOCGLTC:
return get_ltchars(real_tty, (struct ltchars *) arg);
case TIOCSLTC:
return set_ltchars(real_tty, (struct ltchars *) arg);
#endif
case TCGETS: case TCGETS:
retval = verify_area(VERIFY_WRITE, (void *) arg, retval = verify_area(VERIFY_WRITE, (void *) arg,
sizeof (struct termios)); sizeof (struct termios));
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -249,7 +249,7 @@ eql_init(struct device *dev) ...@@ -249,7 +249,7 @@ eql_init(struct device *dev)
dev->pa_addr = 0; dev->pa_addr = 0;
dev->pa_brdaddr = 0; dev->pa_brdaddr = 0;
dev->pa_mask = 0; dev->pa_mask = 0;
dev->pa_alen = sizeof (unsigned long); dev->pa_alen = 4;
dev->type = ARPHRD_SLIP; dev->type = ARPHRD_SLIP;
......
...@@ -139,7 +139,7 @@ int loopback_init(struct device *dev) ...@@ -139,7 +139,7 @@ int loopback_init(struct device *dev)
dev->pa_addr = in_aton("127.0.0.1"); dev->pa_addr = in_aton("127.0.0.1");
dev->pa_brdaddr = in_aton("127.255.255.255"); dev->pa_brdaddr = in_aton("127.255.255.255");
dev->pa_mask = in_aton("255.0.0.0"); dev->pa_mask = in_aton("255.0.0.0");
dev->pa_alen = sizeof(unsigned long); dev->pa_alen = 4;
#endif #endif
dev->priv = kmalloc(sizeof(struct enet_statistics), GFP_KERNEL); dev->priv = kmalloc(sizeof(struct enet_statistics), GFP_KERNEL);
memset(dev->priv, 0, sizeof(struct enet_statistics)); memset(dev->priv, 0, sizeof(struct enet_statistics));
......
...@@ -194,6 +194,7 @@ void ether_setup(struct device *dev) ...@@ -194,6 +194,7 @@ void ether_setup(struct device *dev)
dev->hard_header = eth_header; dev->hard_header = eth_header;
dev->rebuild_header = eth_rebuild_header; dev->rebuild_header = eth_rebuild_header;
dev->set_mac_address = eth_mac_addr; dev->set_mac_address = eth_mac_addr;
dev->header_cache = eth_header_cache;
dev->type = ARPHRD_ETHER; dev->type = ARPHRD_ETHER;
dev->hard_header_len = ETH_HLEN; dev->hard_header_len = ETH_HLEN;
...@@ -209,7 +210,7 @@ void ether_setup(struct device *dev) ...@@ -209,7 +210,7 @@ void ether_setup(struct device *dev)
dev->pa_addr = 0; dev->pa_addr = 0;
dev->pa_brdaddr = 0; dev->pa_brdaddr = 0;
dev->pa_mask = 0; dev->pa_mask = 0;
dev->pa_alen = sizeof(unsigned long); dev->pa_alen = 4;
} }
#ifdef CONFIG_TR #ifdef CONFIG_TR
...@@ -239,7 +240,7 @@ void tr_setup(struct device *dev) ...@@ -239,7 +240,7 @@ void tr_setup(struct device *dev)
dev->pa_addr = 0; dev->pa_addr = 0;
dev->pa_brdaddr = 0; dev->pa_brdaddr = 0;
dev->pa_mask = 0; dev->pa_mask = 0;
dev->pa_alen = sizeof(unsigned long); dev->pa_alen = 4;
} }
#endif #endif
......
...@@ -1442,7 +1442,7 @@ static int pi_probe(struct device *dev, int card_type) ...@@ -1442,7 +1442,7 @@ static int pi_probe(struct device *dev, int card_type)
dev->pa_addr = 0; dev->pa_addr = 0;
dev->pa_brdaddr = 0; dev->pa_brdaddr = 0;
dev->pa_mask = 0; dev->pa_mask = 0;
dev->pa_alen = sizeof(unsigned long); dev->pa_alen = 4;
return 0; return 0;
} }
......
...@@ -295,7 +295,7 @@ ppp_init(struct device *dev) ...@@ -295,7 +295,7 @@ ppp_init(struct device *dev)
dev->pa_addr = 0; dev->pa_addr = 0;
dev->pa_brdaddr = 0; dev->pa_brdaddr = 0;
dev->pa_mask = 0; dev->pa_mask = 0;
dev->pa_alen = sizeof(unsigned long); dev->pa_alen = 4;
return 0; return 0;
} }
...@@ -1144,7 +1144,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c, ...@@ -1144,7 +1144,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c,
sendit: sendit:
if (ppp_debug_netpackets) { if (ppp_debug_netpackets) {
struct iphdr *iph = (struct iphdr *) c; struct iphdr *iph = (struct iphdr *) c;
PRINTK ((KERN_INFO "%s <-- src %lx dst %lx len %d\n", ppp->dev->name, PRINTK ((KERN_INFO "%s <-- src %x dst %x len %d\n", ppp->dev->name,
iph->saddr, iph->daddr, count)) iph->saddr, iph->daddr, count))
} }
...@@ -1251,9 +1251,8 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned ...@@ -1251,9 +1251,8 @@ ppp_read(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigned
CHECK_PPP(-ENXIO); CHECK_PPP(-ENXIO);
PRINTKN (4,(KERN_DEBUG "ppp_read: called %x num %u\n", PRINTKN (4,(KERN_DEBUG "ppp_read: called %p num %u\n",
(unsigned int) buf, buf, nr));
nr));
do { do {
/* try to acquire read lock */ /* try to acquire read lock */
...@@ -1323,8 +1322,8 @@ ppp_stuff_char(struct ppp *ppp, unsigned char c) ...@@ -1323,8 +1322,8 @@ ppp_stuff_char(struct ppp *ppp, unsigned char c)
{ {
int curpt = ppp->xhead - ppp->xbuff; int curpt = ppp->xhead - ppp->xbuff;
if ((curpt < 0) || (curpt > 3000)) { if ((curpt < 0) || (curpt > 3000)) {
PRINTK ((KERN_DEBUG "ppp_stuff_char: %x %x %d\n", PRINTK ((KERN_DEBUG "ppp_stuff_char: %p %p %d\n",
(unsigned int) ppp->xbuff, (unsigned int) ppp->xhead, curpt)) ppp->xbuff, ppp->xhead, curpt))
} }
if (in_xmap (ppp, c)) { if (in_xmap (ppp, c)) {
*ppp->xhead++ = PPP_ESC; *ppp->xhead++ = PPP_ESC;
...@@ -1402,8 +1401,8 @@ ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigne ...@@ -1402,8 +1401,8 @@ ppp_write(struct tty_struct *tty, struct file *file, unsigned char *buf, unsigne
if (ppp_debug >= 6) if (ppp_debug >= 6)
ppp_print_buffer ("xmit buffer", ppp->xbuff, ppp->xhead - ppp->xbuff, KERNEL_DS); ppp_print_buffer ("xmit buffer", ppp->xbuff, ppp->xhead - ppp->xbuff, KERNEL_DS);
else { else {
PRINTKN (4,(KERN_DEBUG PRINTKN (4,(KERN_DEBUG "ppp_write: writing %d chars\n",
"ppp_write: writing %d chars\n", ppp->xhead - ppp->xbuff)); (int) (ppp->xhead - ppp->xbuff)));
} }
/* packet is ready-to-go */ /* packet is ready-to-go */
...@@ -1471,7 +1470,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i, ...@@ -1471,7 +1470,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i,
if (error == 0) { if (error == 0) {
put_user (ppp->xmit_async_map[0], (int *) l); put_user (ppp->xmit_async_map[0], (int *) l);
PRINTKN (3,(KERN_INFO "ppp_ioctl: get asyncmap: addr %lx asyncmap %lx\n", PRINTKN (3,(KERN_INFO "ppp_ioctl: get asyncmap: addr %lx asyncmap %lx\n",
l, ppp->xmit_async_map[0])); l, (unsigned long) ppp->xmit_async_map[0]));
} }
break; break;
...@@ -1482,7 +1481,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i, ...@@ -1482,7 +1481,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i,
bset (ppp->xmit_async_map, PPP_FLAG); bset (ppp->xmit_async_map, PPP_FLAG);
bset (ppp->xmit_async_map, PPP_ESC); bset (ppp->xmit_async_map, PPP_ESC);
PRINTKN (3,(KERN_INFO "ppp_ioctl: set xmit asyncmap %lx\n", PRINTKN (3,(KERN_INFO "ppp_ioctl: set xmit asyncmap %lx\n",
ppp->xmit_async_map[0])); (unsigned long) ppp->xmit_async_map[0]));
} }
break; break;
...@@ -1491,7 +1490,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i, ...@@ -1491,7 +1490,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i,
if (error == 0) { if (error == 0) {
ppp->recv_async_map = get_user ((int *) l); ppp->recv_async_map = get_user ((int *) l);
PRINTKN (3,(KERN_INFO "ppp_ioctl: set recv asyncmap %lx\n", PRINTKN (3,(KERN_INFO "ppp_ioctl: set recv asyncmap %lx\n",
ppp->recv_async_map)); (unsigned long) ppp->recv_async_map));
} }
break; break;
...@@ -1573,7 +1572,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i, ...@@ -1573,7 +1572,7 @@ ppp_ioctl(struct tty_struct *tty, struct file *file, unsigned int i,
error = verify_area (VERIFY_READ, (void *) l, error = verify_area (VERIFY_READ, (void *) l,
sizeof (ppp->xmit_async_map)); sizeof (ppp->xmit_async_map));
if (error == 0) { if (error == 0) {
unsigned long temp_tbl [8]; __u32 temp_tbl [8];
memcpy_fromfs (temp_tbl, (void *) l, sizeof (ppp->xmit_async_map)); memcpy_fromfs (temp_tbl, (void *) l, sizeof (ppp->xmit_async_map));
temp_tbl[1] = 0x00000000; /* must not escape 0x20 - 0x3f */ temp_tbl[1] = 0x00000000; /* must not escape 0x20 - 0x3f */
...@@ -1831,8 +1830,8 @@ ppp_xmit(struct sk_buff *skb, struct device *dev) ...@@ -1831,8 +1830,8 @@ ppp_xmit(struct sk_buff *skb, struct device *dev)
if (ppp_debug >= 6) if (ppp_debug >= 6)
ppp_print_buffer ("xmit buffer", ppp->xbuff, ppp->xhead - ppp->xbuff, KERNEL_DS); ppp_print_buffer ("xmit buffer", ppp->xbuff, ppp->xhead - ppp->xbuff, KERNEL_DS);
else { else {
PRINTKN (4,(KERN_DEBUG PRINTKN (4,(KERN_DEBUG "ppp_write: writing %d chars\n",
"ppp_write: writing %d chars\n", ppp->xhead - ppp->xbuff)); (int) (ppp->xhead - ppp->xbuff)));
} }
ppp_kick_tty(ppp); ppp_kick_tty(ppp);
......
...@@ -1141,7 +1141,7 @@ slip_init(struct device *dev) ...@@ -1141,7 +1141,7 @@ slip_init(struct device *dev)
dev->pa_addr = 0; dev->pa_addr = 0;
dev->pa_brdaddr = 0; dev->pa_brdaddr = 0;
dev->pa_mask = 0; dev->pa_mask = 0;
dev->pa_alen = sizeof(unsigned long); dev->pa_alen = 4;
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -105,7 +105,6 @@ int generic_proc_info(char *buffer, char **start, off_t offset, ...@@ -105,7 +105,6 @@ int generic_proc_info(char *buffer, char **start, off_t offset,
extern int dispatch_scsi_info(int ino, char *buffer, char **start, extern int dispatch_scsi_info(int ino, char *buffer, char **start,
off_t offset, int length, int func) off_t offset, int length, int func)
{ {
int retval;
struct Scsi_Host *hpnt = scsi_hostlist; struct Scsi_Host *hpnt = scsi_hostlist;
if(func != 2) { if(func != 2) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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