Commit f7f228f4 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.73

parent 66a2c418
VERSION = 1 VERSION = 1
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 72 SUBLEVEL = 73
ARCH = i386 ARCH = i386
......
...@@ -122,9 +122,15 @@ isnew: pushl %ecx # restore original EFLAGS ...@@ -122,9 +122,15 @@ isnew: pushl %ecx # restore original EFLAGS
/* get processor type */ /* get processor type */
movl $1, %eax # Use the CPUID instruction to movl $1, %eax # Use the CPUID instruction to
.byte 0x0f, 0xa2 # check the processor type .byte 0x0f, 0xa2 # check the processor type
andl $0xf00, %eax # Set _x86 with the family movb %al, %cl # save reg for future use
shrl $8, %eax # returned. andb $0x0f,%ah # mask processor family
movl %eax, _x86 movb %ah, _x86
andb $0xf0, %eax # mask model
shrb $4, %al
movb %al, _x86_model
andb $0x0f, %cl # mask mask revision
movb %cl, _x86_mask
movl %edx, _x86_capability
/* get vendor info */ /* get vendor info */
xorl %eax, %eax # call CPUID with 0 -> return vendor ID xorl %eax, %eax # call CPUID with 0 -> return vendor ID
.byte 0x0f, 0xa2 # CPUID .byte 0x0f, 0xa2 # CPUID
...@@ -174,7 +180,7 @@ L6: ...@@ -174,7 +180,7 @@ L6:
* We depend on ET to be correct. This checks for 287/387. * We depend on ET to be correct. This checks for 287/387.
*/ */
check_x87: check_x87:
movl $0,_hard_math movb $0,_hard_math
clts clts
fninit fninit
fstsw %ax fstsw %ax
...@@ -185,7 +191,7 @@ check_x87: ...@@ -185,7 +191,7 @@ check_x87:
movl %eax,%cr0 movl %eax,%cr0
ret ret
.align 2 .align 2
1: movl $1,_hard_math 1: movb $1,_hard_math
.byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */ .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */
ret ret
......
...@@ -19,13 +19,6 @@ bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y ...@@ -19,13 +19,6 @@ bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
#fi #fi
comment 'Screen saver mode'
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
if [ "$CONFIG_NET" = "y" ]; then if [ "$CONFIG_NET" = "y" ]; then
comment 'Networking options' comment 'Networking options'
bool 'TCP/IP networking' CONFIG_INET y bool 'TCP/IP networking' CONFIG_INET y
...@@ -212,6 +205,11 @@ fi ...@@ -212,6 +205,11 @@ fi
bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
if [ "$CONFIG_QIC02_TAPE" = "y" ]; then if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
...@@ -241,6 +239,9 @@ comment 'Kernel hacking' ...@@ -241,6 +239,9 @@ comment 'Kernel hacking'
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
bool 'Kernel profiling support' CONFIG_PROFILE n bool 'Kernel profiling support' CONFIG_PROFILE n
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
if [ "$CONFIG_SCSI" = "y" ]; then if [ "$CONFIG_SCSI" = "y" ]; then
bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
fi fi
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
document those I have come across thus far. Upon bootup the boot document those I have come across thus far. Upon bootup the boot
prom loads your a.out image into memory. This memory the prom has prom loads your a.out image into memory. This memory the prom has
already mapped for you, however as far as I can tell the virtual already mapped for you, however as far as I can tell the virtual
adress cache is not turned on although the MMU is translating address cache is not turned on although the MMU is translating
things. You get loaded at 0xf8004000 exactly. So, when you link things. You get loaded at 0xf8004000 exactly. So, when you link
a boot-loadable object you want to do something like: a boot-loadable object you want to do something like:
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
the 'rom vector' in register %o0 right before it jumps to your the 'rom vector' in register %o0 right before it jumps to your
starting address. This is a pointer to a struct that is full of starting address. This is a pointer to a struct that is full of
pointer to functions (ie. printf, halt, reboot), pointers to pointer to functions (ie. printf, halt, reboot), pointers to
linked lists (ie. memory mappings), and pointer to imperical linked lists (ie. memory mappings), and pointer to empirical
constants (ie. stdin and stdout magic cookies + rom version). constants (ie. stdin and stdout magic cookies + rom version).
Starting with this piece of information you can figure out Starting with this piece of information you can figure out
just about anything you want about the machine you are on. just about anything you want about the machine you are on.
...@@ -62,6 +62,10 @@ _cputypval: ...@@ -62,6 +62,10 @@ _cputypval:
.asciz "sun4c" .asciz "sun4c"
.ascii " " .ascii " "
/*
* Sun people can't spell worth damn. "compatability" indeed.
* At least we *know* we can't spell, and use a spell-checker.
*/
_cputypvar: _cputypvar:
.asciz "compatability" .asciz "compatability"
...@@ -109,7 +113,7 @@ prom_revision: .skip 4 ! PROM revision (ie. 1.4) ...@@ -109,7 +113,7 @@ prom_revision: .skip 4 ! PROM revision (ie. 1.4)
prom_bootstr: .skip 4 ! what we are invoked with prom_bootstr: .skip 4 ! what we are invoked with
prom_putchar: .skip 4 ! void putchar(int ch) BLOCKING. prom_putchar: .skip 4 ! void putchar(int ch) BLOCKING.
prom_getchar: .skip 4 ! int getchar(void) BLOCKING. prom_getchar: .skip 4 ! int getchar(void) BLOCKING.
prom_nputchar: .skip 4 ! int purchar(int ch) non-block prom_nputchar: .skip 4 ! int putchar(int ch) non-block
prom_ngetchar: .skip 4 ! int getchar(void) non-block prom_ngetchar: .skip 4 ! int getchar(void) non-block
prom_halt: .skip 4 ! void halt(void) solaris friend prom_halt: .skip 4 ! void halt(void) solaris friend
prom_eval: .skip 4 ! void eval(int len, char* string) prom_eval: .skip 4 ! void eval(int len, char* string)
...@@ -137,7 +141,7 @@ prom_ticks: .skip 4 ! number of ticks since reset ...@@ -137,7 +141,7 @@ prom_ticks: .skip 4 ! number of ticks since reset
*/ */
prom_sync: .skip 4 ! hook in prom for "sync" func prom_sync: .skip 4 ! hook in prom for "sync" func
prom_v0bootarg: .skip 4 ! v0 prom boot arguements prom_v0bootarg: .skip 4 ! v0 prom boot arguments
prom_v2bootarg: .skip 4 ! same as above for v2 proms prom_v2bootarg: .skip 4 ! same as above for v2 proms
prom_ethaddr_func: .skip 4 ! extract ethernet device address prom_ethaddr_func: .skip 4 ! extract ethernet device address
prom_v2devfunc: .skip 4 ! ptr to v2 style device ops. prom_v2devfunc: .skip 4 ! ptr to v2 style device ops.
...@@ -244,7 +248,7 @@ whereis_prom_vector_p = _prom_vector_p-KERNBASE ...@@ -244,7 +248,7 @@ whereis_prom_vector_p = _prom_vector_p-KERNBASE
or unimplemented) and 128 software traps (ditto). or unimplemented) and 128 software traps (ditto).
One of the instructions must be a branch. More often than not this One of the instructions must be a branch. More often than not this
will be to a trap handler entry point becuase it is completely will be to a trap handler entry point because it is completely
impossible to handle any trap in 4 insns. I welcome anyone to impossible to handle any trap in 4 insns. I welcome anyone to
challenge this theory. :-) challenge this theory. :-)
...@@ -285,7 +289,7 @@ _msgbufmapped: ...@@ -285,7 +289,7 @@ _msgbufmapped:
*/ */
.data .data
.skip 32 ! alignment byte & negative indicies .skip 32 ! alignment byte & negative indices
lnx_uw: .skip 32 ! u_char uwtab[-31..31]; lnx_uw: .skip 32 ! u_char uwtab[-31..31];
lnx_winmask: .skip 32 ! u_char wmask[0..31]; lnx_winmask: .skip 32 ! u_char wmask[0..31];
...@@ -347,7 +351,7 @@ not_v2: ...@@ -347,7 +351,7 @@ not_v2:
set _cputypvar, %o1 ! first node has cpu-arch set _cputypvar, %o1 ! first node has cpu-arch
set _cputypval, %o2 ! information, the string set _cputypval, %o2 ! information, the string
ld [%g7 + 0x1c], %o4 ! 'compatability' tells ld [%g7 + 0x1c], %o4 ! 'compatibility' tells
ld [%o4 + 0x0c], %o4 ! that we want 'sun4x' where ld [%o4 + 0x0c], %o4 ! that we want 'sun4x' where
call %o4 ! x is one of '', 'c', 'm', call %o4 ! x is one of '', 'c', 'm',
nop ! 'd' or 'e'. %o2 holds pointer nop ! 'd' or 'e'. %o2 holds pointer
...@@ -476,7 +480,7 @@ _newline: set newline-KERNBASE, %o0 ...@@ -476,7 +480,7 @@ _newline: set newline-KERNBASE, %o0
*/ */
/* Another Note: /* Another Note:
The prom printf() function can take up to 5 arguements in registers The prom printf() function can take up to 5 arguments in registers
%o1 -- %o5 , the format string goes in %o0. It is your usual libc %o1 -- %o5 , the format string goes in %o0. It is your usual libc
printf() believe it or not. printf() believe it or not.
*/ */
...@@ -503,7 +507,7 @@ memloop: ...@@ -503,7 +507,7 @@ memloop:
be mv_to_vmprom ! is there more? be mv_to_vmprom ! is there more?
nop nop
ld [%l4 + 0x8], %l6 ! aparently so... ld [%l4 + 0x8], %l6 ! apparently so...
add %o1, %l6, %o1 add %o1, %l6, %o1
b memloop b memloop
ld [%l4], %l4 ld [%l4], %l4
...@@ -524,7 +528,7 @@ memloop2: ...@@ -524,7 +528,7 @@ memloop2:
cmp %l4, 0 cmp %l4, 0
be mv_to_vmprom2 ! is there more? be mv_to_vmprom2 ! is there more?
nop nop
ld [%l4 + 0x8], %l6 ! aparently so... ld [%l4 + 0x8], %l6 ! apparently so...
add %o2, %l6, %o2 add %o2, %l6, %o2
b memloop2 b memloop2
ld [%l4], %l4 ld [%l4], %l4
...@@ -545,7 +549,7 @@ memloop3: ...@@ -545,7 +549,7 @@ memloop3:
cmp %l4, 0 cmp %l4, 0
be mv_to_vmprom3 ! is there more? be mv_to_vmprom3 ! is there more?
nop nop
ld [%l4 + 0x8], %l6 ! aparently so... ld [%l4 + 0x8], %l6 ! apparently so...
add %o3, %l6, %o3 add %o3, %l6, %o3
b memloop3 b memloop3
ld [%l4], %l4 ld [%l4], %l4
...@@ -668,7 +672,7 @@ no_sun4d_here: ...@@ -668,7 +672,7 @@ no_sun4d_here:
halt_me: halt_me:
ld [%g7 + 0x74], %o0 ld [%g7 + 0x74], %o0
call %o0 ! get us out of here... call %o0 ! get us out of here...
nop ! aparently solaris is better nop ! apparently solaris is better
_strlen: _strlen:
mov %o0, %l1 mov %o0, %l1
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
.align 4 .align 4
.globl _strlen .globl _strlen
_strlen: _strlen:
mov %o0, %g3 ! leaf-proceedure optimization, here mov %o0, %g3 ! leaf-procedure optimization, here
ldsb [%g3], %g2 ! I only use the register sent to me ldsb [%g3], %g2 ! I only use the register sent to me
cmp %g2, 0 ! and the globals. Now, this routine cmp %g2, 0 ! and the globals. Now, this routine
be 1f ! is callable from boot code. be 1f ! is callable from boot code.
...@@ -24,16 +24,16 @@ _strlen: ...@@ -24,16 +24,16 @@ _strlen:
add %o0, 1, %o0 add %o0, 1, %o0
0: ldsb [%o0], %g2 0: ldsb [%o0], %g2
cmp %g2, 0 cmp %g2, 0
bne,a 0b ! annuling branch, yuck bne,a 0b ! annulling branch, yuck
add %o0, 1, %o0 add %o0, 1, %o0
1: retl 1: retl
sub %o0, %g3, %o0 ! since %g3 holds the origional pointer sub %o0, %g3, %o0 ! since %g3 holds the original pointer
! and %o0 is at the end byte, we can ! and %o0 is at the end byte, we can
! subtract and the result is strlen. ! subtract and the result is strlen.
/* String concatenate function. I am too lazy to honor the third count /* String concatenate function. I am too lazy to honor the third count
arguement at this time. Once again, this could be optimized so much argument at this time. Once again, this could be optimized so much
more to use word accesses instead of slooow byte loads. more to use word accesses instead of slooow byte loads.
*/ */
.align 4 .align 4
......
...@@ -3208,7 +3208,7 @@ void floppy_setup(char *str, int *ints) ...@@ -3208,7 +3208,7 @@ void floppy_setup(char *str, int *ints)
return; return;
} }
} }
printk("unknown floppy paramter %s\n", str); printk("unknown floppy parameter %s\n", str);
} }
#endif #endif
......
Thu Dec 8 14:52:11 1994 <tytso@rsx-11.mit.edu>
* serial.c (rs_ioctl): Don't allow most ioctl's if the serial port
isn't initialized.
* serial.c (rs_close): Don't clear the IER if the serial port
isn't initialized.
* serial.c (block_til_ready): Don't try to block on the dialin
port if the serial port isn't initialized.
Wed Dec 7 10:48:30 1994 Si Park (si@wimpol.demon.co.uk)
* tty_io.c (tty_register_driver): Fix bug when linking onto
the tty_drivers list. We now test that there are elements
already on the list before setting the back link from the
first element to the new driver.
* tty_io.c (tty_unregister_driver): Fix bug in unlinking the
specified driver from the tty_drivers list. We were not
setting the back link correctly. This used to result in
a dangling back link pointer and cause panics on the next
call to get_tty_driver().
Tue Nov 29 10:21:09 1994 Theodore Y. Ts'o (tytso@rt-11) Tue Nov 29 10:21:09 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_io.c (tty_unregister_driver): Fix bug in * tty_io.c (tty_unregister_driver): Fix bug in
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
* 'void console_print(const char * b)' * 'void console_print(const char * b)'
* 'void update_screen(int new_console)' * 'void update_screen(int new_console)'
* *
* 'void blank_screen(void)' * 'void do_blank_screen(int)'
* 'void unblank_screen(void)' * 'void do_unblank_screen(void)'
* 'void poke_blanked_console(void)' * 'void poke_blanked_console(void)'
* 'void scrollback(int lines)' * 'void scrollback(int lines)'
* 'void scrollfront(int lines)' * 'void scrollfront(int lines)'
...@@ -117,11 +117,11 @@ static void clear_selection(void); ...@@ -117,11 +117,11 @@ static void clear_selection(void);
static void highlight_pointer(const int currcons, const int where); static void highlight_pointer(const int currcons, const int where);
/* Variables for selection control. */ /* Variables for selection control. */
#define SEL_BUFFER_SIZE 4096 /* Use a dynamic buffer, instead of static (Dec 1994) */
static int sel_cons = 0; static int sel_cons = 0;
static int sel_start = -1; static int sel_start = -1;
static int sel_end; static int sel_end;
static char sel_buffer[SEL_BUFFER_SIZE] = { '\0' }; static char *sel_buffer = NULL;
#endif /* CONFIG_SELECTION */ #endif /* CONFIG_SELECTION */
#define NPAR 16 #define NPAR 16
...@@ -132,6 +132,8 @@ static void vc_init(unsigned int console, unsigned long rows, unsigned long cols ...@@ -132,6 +132,8 @@ static void vc_init(unsigned int console, unsigned long rows, unsigned long cols
static void get_scrmem(int currcons); static void get_scrmem(int currcons);
static void set_scrmem(int currcons, long offset); static void set_scrmem(int currcons, long offset);
static void set_origin(int currcons); static void set_origin(int currcons);
static void blank_screen(void);
static void unblank_screen(void);
static void gotoxy(int currcons, int new_x, int new_y); static void gotoxy(int currcons, int new_x, int new_y);
static void save_cur(int currcons); static void save_cur(int currcons);
static inline void set_cursor(int currcons); static inline void set_cursor(int currcons);
...@@ -160,9 +162,7 @@ static unsigned short *vc_scrbuf[MAX_NR_CONSOLES]; ...@@ -160,9 +162,7 @@ static unsigned short *vc_scrbuf[MAX_NR_CONSOLES];
static int console_blanked = 0; static int console_blanked = 0;
static int blankinterval = 10*60*HZ; static int blankinterval = 10*60*HZ;
#ifndef CONFIG_VESA_PSPM
static long blank_origin, blank__origin, unblank_origin; static long blank_origin, blank__origin, unblank_origin;
#endif
struct vc_data { struct vc_data {
unsigned long vc_screenbuf_size; unsigned long vc_screenbuf_size;
...@@ -338,6 +338,8 @@ static struct { ...@@ -338,6 +338,8 @@ static struct {
unsigned char ClockingMode; /* Seq-Controller:01h */ unsigned char ClockingMode; /* Seq-Controller:01h */
} vga; } vga;
static int vesa_blanked = 0;
/* routine to blank a vesa screen */ /* routine to blank a vesa screen */
static void vesa_blank(void) static void vesa_blank(void)
{ {
...@@ -405,11 +407,15 @@ static void vesa_blank(void) ...@@ -405,11 +407,15 @@ static void vesa_blank(void)
outb_p(vga.CrtCtrlIndex,video_port_reg); outb_p(vga.CrtCtrlIndex,video_port_reg);
sti(); sti();
vesa_blanked = 1;
} }
/* routine to unblank a vesa screen */ /* routine to unblank a vesa screen */
static void vesa_unblank(void) static void vesa_unblank(void)
{ {
if (!vesa_blanked)
return;
/* restore original values of VGA controller registers */ /* restore original values of VGA controller registers */
cli(); cli();
outb_p(vga.CrtMiscIO,video_misc_wr); outb_p(vga.CrtMiscIO,video_misc_wr);
...@@ -438,6 +444,8 @@ static void vesa_unblank(void) ...@@ -438,6 +444,8 @@ static void vesa_unblank(void)
outb_p(vga.SeqCtrlIndex,seq_port_reg); outb_p(vga.SeqCtrlIndex,seq_port_reg);
outb_p(vga.CrtCtrlIndex,video_port_reg); outb_p(vga.CrtCtrlIndex,video_port_reg);
sti(); sti();
vesa_blanked = 0;
} }
#endif /* CONFIG_VESA_PSPM */ #endif /* CONFIG_VESA_PSPM */
...@@ -1426,7 +1434,7 @@ static void reset_terminal(int currcons, int do_clear) ...@@ -1426,7 +1434,7 @@ static void reset_terminal(int currcons, int do_clear)
utf = 0; utf = 0;
utf_count = 0; utf_count = 0;
disp_ctrl = 0; disp_ctrl = 1;
toggle_meta = 0; toggle_meta = 0;
decscnm = 0; decscnm = 0;
...@@ -1925,9 +1933,11 @@ void console_print(const char * b) ...@@ -1925,9 +1933,11 @@ void console_print(const char * b)
{ {
int currcons = fg_console; int currcons = fg_console;
unsigned char c; unsigned char c;
static int printing = 0;
if (!printable) if (!printable || printing)
return; /* console not yet initialized */ return; /* console not yet initialized */
printing = 1;
if (!vc_cons_allocated(currcons)) { if (!vc_cons_allocated(currcons)) {
/* impossible */ /* impossible */
...@@ -1952,16 +1962,8 @@ void console_print(const char * b) ...@@ -1952,16 +1962,8 @@ void console_print(const char * b)
pos+=2; pos+=2;
} }
set_cursor(currcons); set_cursor(currcons);
if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) poke_blanked_console();
return; printing = 0;
timer_active &= ~(1<<BLANK_TIMER);
if (console_blanked) {
timer_table[BLANK_TIMER].expires = 0;
timer_active |= 1<<BLANK_TIMER;
} else if (blankinterval) {
timer_table[BLANK_TIMER].expires = jiffies + blankinterval;
timer_active |= 1<<BLANK_TIMER;
}
} }
/* /*
...@@ -2185,24 +2187,16 @@ static void set_scrmem(int currcons, long offset) ...@@ -2185,24 +2187,16 @@ static void set_scrmem(int currcons, long offset)
pos = origin + y*video_size_row + (x<<1); pos = origin + y*video_size_row + (x<<1);
} }
void blank_screen(void) void do_blank_screen(int nopowersave)
{ {
#ifndef CONFIG_VESA_PSPM
int currcons; int currcons;
#endif
if (console_blanked) if (console_blanked)
return; return;
if (!vc_cons_allocated(fg_console)) {
/* impossible */ timer_active &= ~(1<<BLANK_TIMER);
printk("blank_screen: tty %d not allocated ??\n", fg_console+1);
return;
}
timer_table[BLANK_TIMER].fn = unblank_screen; timer_table[BLANK_TIMER].fn = unblank_screen;
#ifdef CONFIG_VESA_PSPM
vesa_blank();
#else
/* try not to lose information by blanking, and not to waste memory */ /* try not to lose information by blanking, and not to waste memory */
currcons = fg_console; currcons = fg_console;
has_scrolled = 0; has_scrolled = 0;
...@@ -2213,17 +2207,19 @@ void blank_screen(void) ...@@ -2213,17 +2207,19 @@ void blank_screen(void)
unblank_origin = origin; unblank_origin = origin;
memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin); memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin);
hide_cursor(); hide_cursor();
#endif
console_blanked = fg_console + 1; console_blanked = fg_console + 1;
#ifdef CONFIG_VESA_PSPM
if(!nopowersave)
vesa_blank();
#endif
} }
void unblank_screen(void) void do_unblank_screen(void)
{ {
int currcons; int currcons;
#ifndef CONFIG_VESA_PSPM
int resetorg; int resetorg;
long offset; long offset;
#endif
if (!console_blanked) if (!console_blanked)
return; return;
...@@ -2237,11 +2233,8 @@ void unblank_screen(void) ...@@ -2237,11 +2233,8 @@ void unblank_screen(void)
timer_table[BLANK_TIMER].expires = jiffies + blankinterval; timer_table[BLANK_TIMER].expires = jiffies + blankinterval;
timer_active |= 1<<BLANK_TIMER; timer_active |= 1<<BLANK_TIMER;
} }
currcons = fg_console; currcons = fg_console;
#ifdef CONFIG_VESA_PSPM
vesa_unblank();
console_blanked=0;
#else
offset = 0; offset = 0;
resetorg = 0; resetorg = 0;
if (console_blanked == fg_console + 1 && origin == unblank_origin if (console_blanked == fg_console + 1 && origin == unblank_origin
...@@ -2258,9 +2251,25 @@ void unblank_screen(void) ...@@ -2258,9 +2251,25 @@ void unblank_screen(void)
set_cursor(fg_console); set_cursor(fg_console);
if (resetorg) if (resetorg)
__set_origin(blank__origin); __set_origin(blank__origin);
#ifdef CONFIG_VESA_PSPM
vesa_unblank();
#endif #endif
} }
/*
* If a blank_screen is due to a timer, then a power save is allowed.
* If it is related to console_switching, then avoid vesa_blank().
*/
static void blank_screen(void)
{
do_blank_screen(0);
}
static void unblank_screen(void)
{
do_unblank_screen();
}
void update_screen(int new_console) void update_screen(int new_console)
{ {
static int lock = 0; static int lock = 0;
...@@ -2323,6 +2332,9 @@ int do_screendump(int arg, int mode) ...@@ -2323,6 +2332,9 @@ int do_screendump(int arg, int mode)
put_fs_byte((char)(video_num_lines),buf++); put_fs_byte((char)(video_num_lines),buf++);
put_fs_byte((char)(video_num_columns),buf++); put_fs_byte((char)(video_num_columns),buf++);
} }
#ifdef CONFIG_SELECTION
clear_selection();
#endif
switch(mode) { switch(mode) {
case 0: case 0:
sptr = (char *) origin; sptr = (char *) origin;
...@@ -2330,9 +2342,6 @@ int do_screendump(int arg, int mode) ...@@ -2330,9 +2342,6 @@ int do_screendump(int arg, int mode)
put_fs_byte(*sptr++,buf++); put_fs_byte(*sptr++,buf++);
break; break;
case 1: case 1:
#ifdef CONFIG_SELECTION
clear_selection();
#endif
put_fs_byte((char)x,buf++); put_fs_byte((char)y,buf++); put_fs_byte((char)x,buf++); put_fs_byte((char)y,buf++);
memcpy_tofs(buf,(char *)origin,2*chcount); memcpy_tofs(buf,(char *)origin,2*chcount);
break; break;
...@@ -2379,12 +2388,7 @@ static void highlight(const int currcons, const int s, const int e) ...@@ -2379,12 +2388,7 @@ static void highlight(const int currcons, const int s, const int e)
p1 = (unsigned char *)origin - hwscroll_offset + s + 1; p1 = (unsigned char *)origin - hwscroll_offset + s + 1;
p2 = (unsigned char *)origin - hwscroll_offset + e + 1; p2 = (unsigned char *)origin - hwscroll_offset + e + 1;
if (p1 > p2)
{
p = p1;
p1 = p2;
p2 = p;
}
for (p = p1; p <= p2; p += 2) for (p = p1; p <= p2; p += 2)
*p = (*p & 0x88) | ((*p << 4) & 0x70) | ((*p >> 4) & 0x07); *p = (*p & 0x88) | ((*p << 4) & 0x70) | ((*p >> 4) & 0x07);
} }
...@@ -2415,6 +2419,7 @@ static void highlight_pointer(const int currcons, const int where) ...@@ -2415,6 +2419,7 @@ static void highlight_pointer(const int currcons, const int where)
/* /*
* This function uses a 128-bit look up table * This function uses a 128-bit look up table
* WARNING: This depends on both endianness and the ascii code
*/ */
static unsigned long inwordLut[4]={ static unsigned long inwordLut[4]={
0x00000000, /* control chars */ 0x00000000, /* control chars */
...@@ -2439,10 +2444,10 @@ static inline int atedge(const int p) ...@@ -2439,10 +2444,10 @@ static inline int atedge(const int p)
return (!(p % video_size_row) || !((p + 2) % video_size_row)); return (!(p % video_size_row) || !((p + 2) % video_size_row));
} }
/* constrain v such that l <= v <= u */ /* constrain v such that v <= u */
static inline short limit(const int v, const int l, const int u) static inline short limit(const unsigned short v, const unsigned short u)
{ {
return (v < l) ? l : ((v > u) ? u : v); return ((v > u) ? u : v);
} }
/* invoked via ioctl(TIOCLINUX) */ /* invoked via ioctl(TIOCLINUX) */
...@@ -2471,10 +2476,10 @@ int set_selection(const int arg, struct tty_struct *tty) ...@@ -2471,10 +2476,10 @@ int set_selection(const int arg, struct tty_struct *tty)
ye = get_fs_word(args++) - 1; ye = get_fs_word(args++) - 1;
sel_mode = get_fs_word(args); sel_mode = get_fs_word(args);
xs = limit(xs, 0, video_num_columns - 1); xs = limit(xs, video_num_columns - 1);
ys = limit(ys, 0, video_num_lines - 1); ys = limit(ys, video_num_lines - 1);
xe = limit(xe, 0, video_num_columns - 1); xe = limit(xe, video_num_columns - 1);
ye = limit(ye, 0, video_num_lines - 1); ye = limit(ye, video_num_lines - 1);
ps = ys * video_size_row + (xs << 1); ps = ys * video_size_row + (xs << 1);
pe = ye * video_size_row + (xe << 1); pe = ye * video_size_row + (xe << 1);
...@@ -2578,6 +2583,16 @@ int set_selection(const int arg, struct tty_struct *tty) ...@@ -2578,6 +2583,16 @@ int set_selection(const int arg, struct tty_struct *tty)
} }
sel_start = new_sel_start; sel_start = new_sel_start;
sel_end = new_sel_end; sel_end = new_sel_end;
/* realloc the buffer (it seems to be efficient, anyway) */
if (sel_buffer) kfree(sel_buffer);
sel_buffer = kmalloc((sel_end-sel_start)/2+2, GFP_KERNEL);
if (!sel_buffer)
{
printk("selection: kmalloc() failed\n");
clear_selection();
return (0); /* is it right? */
}
obp = bp = sel_buffer; obp = bp = sel_buffer;
for (i = sel_start; i <= sel_end; i += 2) for (i = sel_start; i <= sel_end; i += 2)
{ {
...@@ -2596,10 +2611,6 @@ int set_selection(const int arg, struct tty_struct *tty) ...@@ -2596,10 +2611,6 @@ int set_selection(const int arg, struct tty_struct *tty)
} }
obp = bp; obp = bp;
} }
/* check for space, leaving room for next character, possible
newline, and null at end. */
if (bp - sel_buffer > SEL_BUFFER_SIZE - 3)
break;
} }
*bp = '\0'; *bp = '\0';
return 0; return 0;
...@@ -2614,7 +2625,7 @@ int paste_selection(struct tty_struct *tty) ...@@ -2614,7 +2625,7 @@ int paste_selection(struct tty_struct *tty)
int c, l; int c, l;
struct vt_struct *vt = (struct vt_struct *) tty->driver_data; struct vt_struct *vt = (struct vt_struct *) tty->driver_data;
if (!sel_buffer[0]) if (!bp || !bp[0])
return 0; return 0;
unblank_screen(); unblank_screen();
c = strlen(sel_buffer); c = strlen(sel_buffer);
......
...@@ -1667,6 +1667,13 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1667,6 +1667,13 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
if (serial_paranoia_check(info, tty->device, "rs_ioctl")) if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
return -ENODEV; return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
(cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
(cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
if (tty->flags & (1 << TTY_IO_ERROR))
return -EIO;
}
switch (cmd) { switch (cmd) {
case TCSBRK: /* SVID version: non-zero arg --> no break */ case TCSBRK: /* SVID version: non-zero arg --> no break */
retval = tty_check_change(tty); retval = tty_check_change(tty);
...@@ -1852,9 +1859,9 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ...@@ -1852,9 +1859,9 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
* line status register. * line status register.
*/ */
info->IER &= ~UART_IER_RLSI; info->IER &= ~UART_IER_RLSI;
serial_out(info, UART_IER, info->IER);
info->read_status_mask &= ~UART_LSR_DR; info->read_status_mask &= ~UART_LSR_DR;
if (info->flags & ASYNC_INITIALIZED) { if (info->flags & ASYNC_INITIALIZED) {
serial_out(info, UART_IER, info->IER);
wait_until_sent(tty, 3000); /* 30 seconds timeout */ wait_until_sent(tty, 3000); /* 30 seconds timeout */
/* /*
* Before we drop DTR, make sure the UART transmitter * Before we drop DTR, make sure the UART transmitter
...@@ -1965,10 +1972,11 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, ...@@ -1965,10 +1972,11 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
} }
/* /*
* If non-blocking mode is set, then make the check up front * If non-blocking mode is set, or the port is not enabled,
* and then exit. * then make the check up front and then exit.
*/ */
if (filp->f_flags & O_NONBLOCK) { if ((filp->f_flags & O_NONBLOCK) ||
(tty->flags & (1 << TTY_IO_ERROR))) {
if (info->flags & ASYNC_CALLOUT_ACTIVE) if (info->flags & ASYNC_CALLOUT_ACTIVE)
return -EBUSY; return -EBUSY;
info->flags |= ASYNC_NORMAL_ACTIVE; info->flags |= ASYNC_NORMAL_ACTIVE;
......
...@@ -73,6 +73,8 @@ extern int mouse_reporting(void); ...@@ -73,6 +73,8 @@ extern int mouse_reporting(void);
extern int shift_state; extern int shift_state;
#endif /* CONFIG_SELECTION */ #endif /* CONFIG_SELECTION */
extern int do_screendump(int arg, int mode); extern int do_screendump(int arg, int mode);
extern void do_blank_screen(int nopowersave);
extern void do_unblank_screen(void);
struct termios tty_std_termios; /* for the benefit of tty drivers */ struct termios tty_std_termios; /* for the benefit of tty drivers */
struct tty_driver *tty_drivers = NULL; /* linked list of tty drivers */ struct tty_driver *tty_drivers = NULL; /* linked list of tty drivers */
...@@ -513,11 +515,9 @@ void complete_change_console(unsigned int new_console) ...@@ -513,11 +515,9 @@ void complete_change_console(unsigned int new_console)
if (old_vc_mode != vt_cons[new_console]->vc_mode) if (old_vc_mode != vt_cons[new_console]->vc_mode)
{ {
if (vt_cons[new_console]->vc_mode == KD_TEXT) if (vt_cons[new_console]->vc_mode == KD_TEXT)
unblank_screen(); do_unblank_screen();
else { else
timer_active &= ~(1<<BLANK_TIMER); do_blank_screen(1);
blank_screen();
}
} }
/* /*
...@@ -1414,7 +1414,7 @@ static int tty_ioctl(struct inode * inode, struct file * file, ...@@ -1414,7 +1414,7 @@ static int tty_ioctl(struct inode * inode, struct file * file,
return paste_selection(tty); return paste_selection(tty);
#endif /* CONFIG_SELECTION */ #endif /* CONFIG_SELECTION */
case 4: case 4:
unblank_screen(); do_unblank_screen();
return 0; return 0;
#ifdef CONFIG_SELECTION #ifdef CONFIG_SELECTION
case 5: case 5:
...@@ -1596,7 +1596,7 @@ int tty_register_driver(struct tty_driver *driver) ...@@ -1596,7 +1596,7 @@ int tty_register_driver(struct tty_driver *driver)
driver->prev = 0; driver->prev = 0;
driver->next = tty_drivers; driver->next = tty_drivers;
tty_drivers->prev = driver; if (tty_drivers) tty_drivers->prev = driver;
tty_drivers = driver; tty_drivers = driver;
return error; return error;
} }
...@@ -1633,7 +1633,7 @@ int tty_unregister_driver(struct tty_driver *driver) ...@@ -1633,7 +1633,7 @@ int tty_unregister_driver(struct tty_driver *driver)
tty_drivers = driver->next; tty_drivers = driver->next;
if (driver->next) if (driver->next)
driver->next = driver->next->prev; driver->next->prev = driver->prev;
return 0; return 0;
} }
......
...@@ -52,6 +52,8 @@ extern void compute_shiftstate(void); ...@@ -52,6 +52,8 @@ extern void compute_shiftstate(void);
extern void change_console(unsigned int new_console); extern void change_console(unsigned int new_console);
extern void complete_change_console(unsigned int new_console); extern void complete_change_console(unsigned int new_console);
extern int vt_waitactive(void); extern int vt_waitactive(void);
extern void do_blank_screen(int nopowersave);
extern void do_unblank_screen(void);
extern unsigned int keymap_count; extern unsigned int keymap_count;
...@@ -208,11 +210,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -208,11 +210,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
* explicitly blank/unblank the screen if switching modes * explicitly blank/unblank the screen if switching modes
*/ */
if (arg == KD_TEXT) if (arg == KD_TEXT)
unblank_screen(); do_unblank_screen();
else { else
timer_active &= ~(1<<BLANK_TIMER); do_blank_screen(1);
blank_screen();
}
return 0; return 0;
case KDGETMODE: case KDGETMODE:
......
...@@ -6,4 +6,6 @@ MODULES = \ ...@@ -6,4 +6,6 @@ MODULES = \
apricot.o \ apricot.o \
eexpress.o \ eexpress.o \
plip.o \ plip.o \
8390.o 8390.o \
slip.o \
slhc.o
...@@ -307,7 +307,7 @@ init_i596_mem(struct device *dev) ...@@ -307,7 +307,7 @@ init_i596_mem(struct device *dev)
while (lp->scb.status, lp->scb.command) while (lp->scb.status, lp->scb.command)
if (--boguscnt == 0) if (--boguscnt == 0)
{ {
printk("%s: recieve unit start timed out with status %4.4x, cmd %4.4x.\n", printk("%s: receive unit start timed out with status %4.4x, cmd %4.4x.\n",
dev->name, lp->scb.status, lp->scb.command); dev->name, lp->scb.status, lp->scb.command);
break; break;
} }
...@@ -1016,7 +1016,7 @@ struct netdev_entry apricot_drv = ...@@ -1016,7 +1016,7 @@ struct netdev_entry apricot_drv =
#ifdef MODULE #ifdef MODULE
char kernel_version[] = UTS_RELEASE; char kernel_version[] = UTS_RELEASE;
static struct device dev_apricot = { static struct device dev_apricot = {
" ", /* device name inservted by /linux/drivers/net/net_init.c */ " ", /* device name inserted by /linux/drivers/net/net_init.c */
0, 0, 0, 0, 0, 0, 0, 0,
0x300, 10, 0x300, 10,
0, 0, 0, NULL, apricot_probe }; 0, 0, 0, NULL, apricot_probe };
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
DEPCA (the original) DEPCA (the original)
DE100 DE100
DE101
DE200 Turbo DE200 Turbo
DE201 Turbo DE201 Turbo
DE202 Turbo (TP BNC) DE202 Turbo (TP BNC)
...@@ -162,11 +163,13 @@ ...@@ -162,11 +163,13 @@
0.37 22-jul-94 Added MODULE support 0.37 22-jul-94 Added MODULE support
0.38 15-aug-94 Added DBR ROM switch in depca_close(). 0.38 15-aug-94 Added DBR ROM switch in depca_close().
Multi DEPCA bug fix. Multi DEPCA bug fix.
0.38axp 15-sep-94 Special version for Alpha AXP Linux V1.0
0.381 12-dec-94 Added DE101 recognition, fix multicast bug
========================================================================= =========================================================================
*/ */
static char *version = "depca.c:v0.38 8/15/94 davies@wanton.lkg.dec.com\n"; static char *version = "depca.c:v0.381 12/12/94 davies@wanton.lkg.dec.com\n";
#include <stdarg.h> #include <stdarg.h>
#include <linux/config.h> #include <linux/config.h>
...@@ -208,8 +211,10 @@ static int depca_debug = 1; ...@@ -208,8 +211,10 @@ static int depca_debug = 1;
#endif #endif
#ifndef DEPCA_SIGNATURE #ifndef DEPCA_SIGNATURE
#define DEPCA_SIGNATURE {"DEPCA","DE100",\ #define DEPCA_SIGNATURE {"DEPCA",\
"DE200","DE201","DE202","DE210",\ "DE100","DE101",\
"DE200","DE201","DE202",\
"DE210",\
"DE422",\ "DE422",\
""} ""}
#define DEPCA_NAME_LENGTH 8 #define DEPCA_NAME_LENGTH 8
...@@ -1237,35 +1242,28 @@ depca_get_stats(struct device *dev) ...@@ -1237,35 +1242,28 @@ depca_get_stats(struct device *dev)
** num_addrs > 0 Multicast mode, receive normal and MC packets, and do ** num_addrs > 0 Multicast mode, receive normal and MC packets, and do
** best-effort filtering. ** best-effort filtering.
*/ */
#define hash_filter lp->init_block.filter
static void static void
set_multicast_list(struct device *dev, int num_addrs, void *addrs) set_multicast_list(struct device *dev, int num_addrs, void *addrs)
{ {
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
struct depca_private *lp = (struct depca_private *)dev->priv; struct depca_private *lp = (struct depca_private *)dev->priv;
/* We take the simple way out and always enable promiscuous mode. */ if (irq2dev_map[dev->irq] != NULL) {
STOP_DEPCA; /* Temporarily stop the depca. */ STOP_DEPCA; /* Temporarily stop the depca. */
depca_init_ring(dev); /* Initialize the descriptor rings */
lp->init_block.mode = PROM; /* Set promiscuous mode */
if (num_addrs >= 0) { if (num_addrs >= 0) {
short multicast_table[4]; SetMulticastFilter(num_addrs, (char *)addrs, (char *)hash_filter);
int i;
SetMulticastFilter(num_addrs, (char *)addrs, (char *)multicast_table);
/* We don't use the multicast table, but rely on upper-layer filtering. */
memset(multicast_table, (num_addrs==0) ? 0 : -1, sizeof(multicast_table));
for (i = 0; i < 4; i++) {
lp->init_block.filter[i] = multicast_table[i];
}
lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */ lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
} else { } else {
lp->init_block.mode |= PROM; /* Set promiscuous mode */ lp->init_block.mode |= PROM; /* Set promiscuous mode */
} }
outw(CSR0, DEPCA_ADDR); LoadCSRs(dev); /* Reload CSR3 */
outw(IDON|INEA|STRT, DEPCA_DATA); /* Resume normal operation. */ InitRestartDepca(dev); /* Resume normal operation. */
}
} }
/* /*
......
...@@ -118,11 +118,12 @@ ...@@ -118,11 +118,12 @@
0.23 21-sep-94 Added transmit cut through 0.23 21-sep-94 Added transmit cut through
0.24 31-oct-94 Added uid checks in some ioctls 0.24 31-oct-94 Added uid checks in some ioctls
0.30 1-nov-94 BETA code release 0.30 1-nov-94 BETA code release
0.31 5-dec-94 Added check/snarf_region code.
========================================================================= =========================================================================
*/ */
static char *version = "ewrk3.c:v0.30 11/1/94 davies@wanton.lkg.dec.com\n"; static char *version = "ewrk3.c:v0.31 12/5/94 davies@wanton.lkg.dec.com\n";
#include <stdarg.h> #include <stdarg.h>
#include <linux/config.h> #include <linux/config.h>
...@@ -314,7 +315,7 @@ static struct device *isa_probe(struct device *dev); ...@@ -314,7 +315,7 @@ static struct device *isa_probe(struct device *dev);
static struct device *eisa_probe(struct device *dev); static struct device *eisa_probe(struct device *dev);
static struct device *alloc_device(struct device *dev, int iobase); static struct device *alloc_device(struct device *dev, int iobase);
static int num_ewrk3s = 0, num_eth = 0, autoprobed = 0; static int num_ewrk3s = 0, num_eth = 0;
static unsigned char irq[] = {5,0,10,3,11,9,15,12}; static unsigned char irq[] = {5,0,10,3,11,9,15,12};
#else #else
...@@ -323,6 +324,8 @@ void cleanup_module(void); ...@@ -323,6 +324,8 @@ void cleanup_module(void);
#endif /* MODULE */ #endif /* MODULE */
static int autoprobed = 0;
/* /*
** Miscellaneous defines... ** Miscellaneous defines...
*/ */
...@@ -344,14 +347,23 @@ int ewrk3_probe(struct device *dev) ...@@ -344,14 +347,23 @@ int ewrk3_probe(struct device *dev)
#endif #endif
if (base_addr > 0x0ff) { /* Check a single specified location. */ if (base_addr > 0x0ff) { /* Check a single specified location. */
if (((mem_chkd >> ((base_addr - EWRK3_IO_BASE)/ EWRK3_IOP_INC))&0x01)==0) { if (!autoprobed) { /* Module or fixed location */
if (!check_region(base_addr, EWRK3_IOP_INC)) {
if (((mem_chkd >> ((base_addr - EWRK3_IO_BASE)/ EWRK3_IOP_INC))&0x01)==1) {
if (DevicePresent(base_addr) == 0) { /* Is EWRK3 really here? */ if (DevicePresent(base_addr) == 0) { /* Is EWRK3 really here? */
snarf_region(base_addr, EWRK3_IOP_INC); /* Register I/O region */
status = ewrk3_hw_init(dev, base_addr); status = ewrk3_hw_init(dev, base_addr);
} else { } else {
printk("ewrk3_probe(): No device found\n"); printk("ewrk3_probe(): No device found\n");
mem_chkd &= ~(0x01 << ((base_addr - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
} }
} else { } else {
status = ewrk3_hw_init(dev, base_addr); /* Yes there is h/w */ printk("%s: ewrk3_probe(): Detected a device already registered at 0x%02x\n", dev->name, base_addr);
mem_chkd &= ~(0x01 << ((base_addr - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
} else { /* already know what ewrk3 h/w is here */
status = ewrk3_hw_init(dev, base_addr);
} }
} else if (base_addr > 0) { /* Don't probe at all. */ } else if (base_addr > 0) { /* Don't probe at all. */
status = -ENXIO; status = -ENXIO;
...@@ -1282,12 +1294,13 @@ static void SetMulticastFilter(struct device *dev, int num_addrs, char *addrs, c ...@@ -1282,12 +1294,13 @@ static void SetMulticastFilter(struct device *dev, int num_addrs, char *addrs, c
} }
} }
} }
hashcode = (crc & 0x01); /* hashcode is 9 LSb of CRC ... */ hashcode = ((crc >>= 23) & 0x01); /* hashcode is 9 MSb of CRC ... */
for (j=0;j<8;j++) { /* ... in reverse order. */ for (j=0;j<8;j++) { /* ... in reverse order. */
hashcode <<= 1; hashcode <<= 1;
crc >>= 1; crc >>= 1;
hashcode |= (crc & 0x01); hashcode |= (crc & 0x01);
} }
octet = hashcode >> 3; /* bit[3-8] -> octet in filter */ octet = hashcode >> 3; /* bit[3-8] -> octet in filter */
/* bit[0-2] -> bit in octet */ /* bit[0-2] -> bit in octet */
if (lp->shmem_length == IO_ONLY) { if (lp->shmem_length == IO_ONLY) {
...@@ -1323,11 +1336,14 @@ static struct device *isa_probe(struct device *dev) ...@@ -1323,11 +1336,14 @@ static struct device *isa_probe(struct device *dev)
i < 24; i < 24;
iobase += EWRK3_IOP_INC, i++) { iobase += EWRK3_IOP_INC, i++) {
if (tmp & 0x01) { if (tmp & 0x01) {
/* Anything else registered here? */
if (!check_region(iobase, EWRK3_IOP_INC)) {
if (DevicePresent(iobase) == 0) { if (DevicePresent(iobase) == 0) {
/* /*
** Device found. Mark its (I/O) location for future reference. Only 24 ** Device found. Mark its (I/O) location for future reference. Only 24
** EtherWORKS devices can exist between 0x100 and 0x3e0. ** EtherWORKS devices can exist between 0x100 and 0x3e0.
*/ */
snarf_region(iobase, EWRK3_IOP_INC);
if (num_ewrk3s > 0) { /* only gets here in autoprobe */ if (num_ewrk3s > 0) { /* only gets here in autoprobe */
dev = alloc_device(dev, iobase); dev = alloc_device(dev, iobase);
} else { } else {
...@@ -1339,6 +1355,10 @@ static struct device *isa_probe(struct device *dev) ...@@ -1339,6 +1355,10 @@ static struct device *isa_probe(struct device *dev)
} else { } else {
mem_chkd &= ~(0x01 << ((iobase - EWRK3_IO_BASE)/EWRK3_IOP_INC)); mem_chkd &= ~(0x01 << ((iobase - EWRK3_IO_BASE)/EWRK3_IOP_INC));
} }
} else {
printk("%s: ewrk3_probe(): Detected a device already registered at 0x%02x\n", dev->name, iobase);
mem_chkd &= ~(0x01 << ((iobase - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
} }
tmp >>= 1; tmp >>= 1;
} }
...@@ -1358,12 +1378,15 @@ static struct device *eisa_probe(struct device *dev) ...@@ -1358,12 +1378,15 @@ static struct device *eisa_probe(struct device *dev)
iobase+=EISA_SLOT_INC; /* get the first slot address */ iobase+=EISA_SLOT_INC; /* get the first slot address */
for (status = -ENODEV, i=1; i<MAX_EISA_SLOTS; i++, iobase+=EISA_SLOT_INC) { for (status = -ENODEV, i=1; i<MAX_EISA_SLOTS; i++, iobase+=EISA_SLOT_INC) {
/* Anything else registered here? */
if (!check_region(iobase, EWRK3_IOP_INC)) {
if (DevicePresent(iobase) == 0) { if (DevicePresent(iobase) == 0) {
/* /*
** Device found. Mark its slot location for future reference. Only 7 ** Device found. Mark its slot location for future reference. Only 7
** EtherWORKS devices can exist in EISA space.... ** EtherWORKS devices can exist in EISA space....
*/ */
mem_chkd |= (0x01 << (i + 24)); mem_chkd |= (0x01 << (i + 24));
snarf_region(iobase, EWRK3_IOP_INC);
if (num_ewrk3s > 0) { /* only gets here in autoprobe */ if (num_ewrk3s > 0) { /* only gets here in autoprobe */
dev = alloc_device(dev, iobase); dev = alloc_device(dev, iobase);
} else { } else {
...@@ -1374,6 +1397,7 @@ static struct device *eisa_probe(struct device *dev) ...@@ -1374,6 +1397,7 @@ static struct device *eisa_probe(struct device *dev)
num_eth++; num_eth++;
} }
} }
}
return dev; return dev;
} }
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
* status display * status display
* - Jul 1994 Dmitry Gorodchanin * - Jul 1994 Dmitry Gorodchanin
* Fixes for memory leaks. * Fixes for memory leaks.
* - Oct 1994 Dmitry Gorodchanin
* Modularization.
* *
* *
* This module is a difficult issue. Its clearly inet code but its also clearly * This module is a difficult issue. Its clearly inet code but its also clearly
...@@ -71,6 +73,11 @@ ...@@ -71,6 +73,11 @@
#include <linux/mm.h> #include <linux/mm.h>
#include "slhc.h" #include "slhc.h"
#ifdef MODULE
#include <linux/module.h>
#include <linux/version.h>
#endif
int last_retran; int last_retran;
static unsigned char *encode(unsigned char *cp, unsigned short n); static unsigned char *encode(unsigned char *cp, unsigned short n);
...@@ -145,6 +152,9 @@ slhc_init(int rslots, int tslots) ...@@ -145,6 +152,9 @@ slhc_init(int rslots, int tslots)
ts[0].next = &(ts[comp->tslot_limit]); ts[0].next = &(ts[comp->tslot_limit]);
ts[0].cs_this = 0; ts[0].cs_this = 0;
} }
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
return comp; return comp;
} }
...@@ -162,6 +172,9 @@ slhc_free(struct slcompress *comp) ...@@ -162,6 +172,9 @@ slhc_free(struct slcompress *comp)
if ( comp->tstate != NULLSLSTATE ) if ( comp->tstate != NULLSLSTATE )
kfree( comp->tstate ); kfree( comp->tstate );
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
kfree( comp ); kfree( comp );
} }
...@@ -715,4 +728,21 @@ void slhc_o_status(struct slcompress *comp) ...@@ -715,4 +728,21 @@ void slhc_o_status(struct slcompress *comp)
} }
} }
#ifdef MODULE
char kernel_version[] = UTS_RELEASE;
int init_module(void)
{
printk("CSLIP: code copyright 1989 Regents of the University of California\n");
return 0;
}
void cleanup_module(void)
{
if (MOD_IN_USE) {
printk("CSLIP: module in use, remove delayed");
}
return;
}
#endif /* MODULE */
#endif /* CONFIG_INET */ #endif /* CONFIG_INET */
This diff is collapsed.
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Alan Cox : Added slip mtu field. * Alan Cox : Added slip mtu field.
* Matt Dillon : Printable slip (borrowed from net2e) * Matt Dillon : Printable slip (borrowed from net2e)
* Alan Cox : Added SL_SLIP_LOTS * Alan Cox : Added SL_SLIP_LOTS
* Dmitry Gorodchanin : A lot of changes in the 'struct slip'
* *
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
*/ */
...@@ -33,44 +34,44 @@ ...@@ -33,44 +34,44 @@
struct slip { struct slip {
int magic; int magic;
/* Bitmapped flag fields. */
char inuse; /* are we allocated? */
char sending; /* "channel busy" indicator */
char escape; /* SLIP state machine */
char unused; /* fillers */
/* Various fields. */ /* Various fields. */
int line; /* SLIP channel number */
struct tty_struct *tty; /* ptr to TTY structure */ struct tty_struct *tty; /* ptr to TTY structure */
struct device *dev; /* easy for intr handling */ struct device *dev; /* easy for intr handling */
#if defined(CONFIG_INET)
struct slcompress *slcomp; /* for header compression */ struct slcompress *slcomp; /* for header compression */
unsigned char *cbuff; /* compression buffer */
#endif
/* These are pointers to the malloc()ed frame buffers. */ /* These are pointers to the malloc()ed frame buffers. */
unsigned char *rbuff; /* receiver buffer */ unsigned char *rbuff; /* receiver buffer */
int rcount; /* received chars counter */
unsigned char *xbuff; /* transmitter buffer */ unsigned char *xbuff; /* transmitter buffer */
unsigned char *cbuff; /* compression buffer */ unsigned char *xhead; /* pointer to next byte to XMIT */
int xleft; /* bytes left in XMIT queue */
/* These are the various pointers into the buffers. */
unsigned char *rhead; /* RECV buffer pointer (head) */
unsigned char *rend; /* RECV buffer pointer (end) */
int rcount; /* SLIP receive counter */
unsigned char *xhead; /* XMIT buffer pointer (head) */
unsigned char *xtail; /* XMIT buffer pointer (tail) */
/* SLIP interface statistics. */ /* SLIP interface statistics. */
unsigned long rpacket; /* inbound frame counter */ unsigned long rx_packets; /* inbound frames counter */
unsigned long roverrun; /* "buffer overrun" counter */ unsigned long tx_packets; /* outbound frames counter */
unsigned long spacket; /* outbound frames counter */ unsigned long rx_errors; /* Parity, etc. errors */
unsigned long sbusy; /* "transmitter busy" counter */ unsigned long tx_errors; /* Palnned stuff */
unsigned long errors; /* error count */ unsigned long rx_dropped; /* No memory for skb */
unsigned long tx_dropped; /* When MTU change */
unsigned long rx_over_errors; /* Frame bigger then SLIP buf. */
/* Detailed SLIP statistics. */
int mtu; /* Our mtu (to spot changes!) */ int mtu; /* Our mtu (to spot changes!) */
int buffsize; /* Max buffers sizes */
#ifdef CONFIG_SLIP_MODE_SLIP6
int xdata, xbits; /* 6 bit slip controls */
#endif
unsigned char flags; /* Flag values/ mode etc */ unsigned char flags; /* Flag values/ mode etc */
#define SLF_ESCAPE 2 #define SLF_INUSE 0 /* Channel in use */
#define SLF_ERROR 4 #define SLF_ESCAPE 1 /* ESC received */
#define SLF_COMP 16 #define SLF_ERROR 2 /* Parity, etc. error */
#define SLF_EXPN 32
#define SLF_XMIT_BUSY 64
unsigned char mode; /* SLIP mode */ unsigned char mode; /* SLIP mode */
#define SL_MODE_SLIP 0 #define SL_MODE_SLIP 0
#define SL_MODE_CSLIP 1 #define SL_MODE_CSLIP 1
...@@ -78,15 +79,25 @@ struct slip { ...@@ -78,15 +79,25 @@ struct slip {
#define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP) #define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
#define SL_MODE_AX25 4 #define SL_MODE_AX25 4
#define SL_MODE_ADAPTIVE 8 #define SL_MODE_ADAPTIVE 8
int xdata,xbits; /* 6 bit slip controls */
}; };
#ifdef CONFIG_INET
#ifdef CONFIG_SLIP_ADAPTIVE
#define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
#else /* !CONFIG_SLIP_ADAPTIVE */
#ifdef CONFIG_SLIP_COMPRESSED
#define SL_MODE_DEFAULT (SL_MODE_CSLIP | SL_MODE_ADAPTIVE)
#else /* !CONFIG_SLIP_COMPRESSED */
#define SL_MODE_DEFAULT SL_MODE_SLIP
#endif /* CONFIG_SLIP_COMPRESSED */
#endif /* CONFIG_SLIP_ADAPTIVE */
#else /* !CONFIG_INET */
#define SL_MODE_DEFAULT SL_MODE_SLIP
#endif /* CONFIG_INET */
#define SLIP_MAGIC 0x5302 #define SLIP_MAGIC 0x5302
extern int slip_init(struct device *dev); extern int slip_init(struct device *dev);
extern int slip_esc(unsigned char *s, unsigned char *d, int len);
extern int slip_esc6(unsigned char *s, unsigned char *d, int len);
extern void slip_unesc(struct slip *sl, unsigned char s);
extern void slip_unesc6(struct slip *sl, unsigned char s);
#endif /* _LINUX_SLIP.H */ #endif /* _LINUX_SLIP.H */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
static char *version = static char *version =
"smc-ultra.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n"; "smc-ultra.c:v1.11 11/21/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -226,16 +226,21 @@ ultra_block_input(struct device *dev, int count, char *buf, int ring_offset) ...@@ -226,16 +226,21 @@ ultra_block_input(struct device *dev, int count, char *buf, int ring_offset)
void *xfer_start = (void *)(dev->mem_start + ring_offset void *xfer_start = (void *)(dev->mem_start + ring_offset
- (START_PG<<8)); - (START_PG<<8));
/* Enable shared memory. */
outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);
if (xfer_start + count > (void*) dev->rmem_end) { if (xfer_start + count > (void*) dev->rmem_end) {
/* We must wrap the input move. */ /* We must wrap the input move. */
int semi_count = (void*)dev->rmem_end - xfer_start; int semi_count = (void*)dev->rmem_end - xfer_start;
memcpy(buf, xfer_start, semi_count); memcpy(buf, xfer_start, semi_count);
count -= semi_count; count -= semi_count;
memcpy(buf + semi_count, (char *)dev->rmem_start, count); memcpy(buf + semi_count, (char *)dev->rmem_start, count);
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
return dev->rmem_start + count; return dev->rmem_start + count;
} }
memcpy(buf, xfer_start, count); memcpy(buf, xfer_start, count);
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
return ring_offset + count; return ring_offset + count;
} }
...@@ -246,8 +251,12 @@ ultra_block_output(struct device *dev, int count, const unsigned char *buf, ...@@ -246,8 +251,12 @@ ultra_block_output(struct device *dev, int count, const unsigned char *buf,
unsigned char *shmem unsigned char *shmem
= (unsigned char *)dev->mem_start + ((start_page - START_PG)<<8); = (unsigned char *)dev->mem_start + ((start_page - START_PG)<<8);
/* Enable shared memory. */
outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);
memcpy(shmem, buf, count); memcpy(shmem, buf, count);
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
} }
static int static int
......
Tue Dec 6 12:34:20 1994 Eric Youngdale (eric@andante)
* Linux 1.1.72 released.
* sg.c: Bugfix - always use sg_free, since we might have big buff.
Fri Dec 2 11:24:53 1994 Eric Youngdale (eric@andante)
* Linux 1.1.71 released.
* sg.c: Clear buff field when not in use. Only call scsi_free if
non-null.
* scsi.h: Call wake_up(&wait_for_request) when done with a
command.
* scsi.c (scsi_times_out): Pass pid down so that we can protect
against race conditions.
* scsi.c (scsi_abort): Zero timeout field if we get the
NOT_RUNNING message back from low-level driver.
* scsi.c (scsi_done): Restore cmd_len, use_sg here.
* scsi.c (request_sense): Not here.
* hosts.h: Add new forbidden_addr, forbidden_size fields. Who
added these and why????
* hosts.c (scsi_mem_init): Mark pages as reserved if they fall in
the forbidden regions. I am not sure - I think this is so that
we can deal with boards that do incomplete decoding of their
address lines for the bios chips, but I am not entirely sure.
* buslogic.c: Set forbidden_addr stuff if using a buggy board.
* aha1740.c: Test for NULL pointer in SCtmp. This should not
occur, but a nice message is better than a kernel segfault.
* 53c7,8xx.c: Add new PCI chip ID for 815.
Fri Dec 2 11:24:53 1994 Eric Youngdale (eric@andante)
* Linux 1.1.70 released.
* ChangeLog, st.c: Spelling.
Tue Nov 29 18:48:42 1994 Eric Youngdale (eric@andante)
* Linux 1.1.69 released.
* u14-34f.h: Non-functional change. [Dario].
* u14-34f.c: Use block field in Scsi_Host to prevent commands from
being queued to more than one host at the same time (used when
motherboard does not deal with multiple bus-masters very well).
Only when SINGLE_HOST_OPERATIONS is defined.
Use new cmd_per_lun field. [Dario]
* eata.c: Likewise.
* st.c: More changes from Kai. Add ready flag to indicate drive
status.
* README.st: Document this.
* sr.c: Bugfix (do not subtract CD_BLOCK_OFFSET) for photo-cd
code.
* sg.c: Bugfix - fix problem where opcode is not correctly set up.
* seagate.[c,h]: Use #defines to set driver name.
* scsi_ioctl.c: Zero buffer before executing command.
* scsi.c: Use new cmd_per_lun field in Scsi_Hosts as appropriate.
Add Sony CDU55S to blacklist.
* hosts.h: Add new cmd_per_lun field to Scsi_Hosts.
* hosts.c: Initialize cmd_per_lun in Scsi_Hosts from template.
* buslogic.c: Use cmd_per_lun field - initialize to different
values depending upon bus type (i.e. use 1 if ISA, so we do not
hog memory). Use other patches which got lost from 1.1.68.
* aha1542.c: Spelling.
Tue Nov 29 15:43:50 1994 Eric Youngdale (eric@andante.aib.com) Tue Nov 29 15:43:50 1994 Eric Youngdale (eric@andante.aib.com)
* Linux 1.1.68 released. * Linux 1.1.68 released.
......
This diff is collapsed.
/* /*
* buslogic.h (C) 1993 David B. Gentzel * buslogic.h Copyright (C) 1993, 1994 David B. Gentzel
* Low-level scsi driver for BusLogic adapters * See buslogic.c for more information.
* by David B. Gentzel, Whitfield Software Services, Carnegie, PA
* (gentzel@nova.enet.dec.com)
* Thanks to BusLogic for providing the necessary documentation
*
* The original version of this driver was derived from aha1542.[ch] which
* is Copyright (C) 1992 Tommy Thorn. Much has been reworked, but most of
* basic structure and substantial chunks of code still remain.
*/ */
#ifndef _BUSLOGIC_H #ifndef _BUSLOGIC_H
......
/* fdomain.c -- Future Domain TMC-16x0 SCSI driver /* fdomain.c -- Future Domain TMC-16x0 SCSI driver
* Created: Sun May 3 18:53:19 1992 by faith@cs.unc.edu * Created: Sun May 3 18:53:19 1992 by faith@cs.unc.edu
* Revised: Wed Nov 2 16:37:58 1994 by faith@cs.unc.edu * Revised: Wed Dec 7 09:36:57 1994 by faith@cs.unc.edu
* Author: Rickard E. Faith, faith@cs.unc.edu * Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994 Rickard E. Faith * Copyright 1992, 1993, 1994 Rickard E. Faith
* *
* $Id: fdomain.c,v 5.20 1994/11/02 21:38:33 root Exp $ * $Id: fdomain.c,v 5.22 1994/12/07 15:15:46 root Exp $
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
The following BIOS versions are supported: 2.0, 3.0, 3.2, 3.4, and 3.5. The following BIOS versions are supported: 2.0, 3.0, 3.2, 3.4, and 3.5.
The following chips are supported: TMC-1800, TMC-18C50, TMC-18C30. The following chips are supported: TMC-1800, TMC-18C50, TMC-18C30.
Reports suggest that the driver will also work with the 36C70 chip. Reports suggest that the driver will also work with the 36C70 chip and
with the Quantum ISA-200S SCSI adapter.
Please note that the drive ordering that Future Domain implemented in BIOS Please note that the drive ordering that Future Domain implemented in BIOS
versions 3.4 and 3.5 is the opposite of the order (currently) used by the versions 3.4 and 3.5 is the opposite of the order (currently) used by the
...@@ -133,6 +134,9 @@ ...@@ -133,6 +134,9 @@
Thanks to Eric Kasten (tigger@petroglyph.cl.msu.edu) for providing the Thanks to Eric Kasten (tigger@petroglyph.cl.msu.edu) for providing the
patch for the version 3.5 BIOS. patch for the version 3.5 BIOS.
Thanks for Stephen Henson (shenson@nyx10.cs.du.edu) for providing the
patch for the Quantum ISA-200S SCSI adapter.
All of the alpha testers deserve much thanks. All of the alpha testers deserve much thanks.
...@@ -182,7 +186,7 @@ ...@@ -182,7 +186,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#define VERSION "$Revision: 5.20 $" #define VERSION "$Revision: 5.22 $"
/* START OF USER DEFINABLE OPTIONS */ /* START OF USER DEFINABLE OPTIONS */
...@@ -273,6 +277,7 @@ static void *bios_base = NULL; ...@@ -273,6 +277,7 @@ static void *bios_base = NULL;
static int bios_major = 0; static int bios_major = 0;
static int bios_minor = 0; static int bios_minor = 0;
static int PCI_bus = 0; static int PCI_bus = 0;
static int ISA_200S = 0; /* Quantum ISA-200S */
static int interrupt_level = 0; static int interrupt_level = 0;
static volatile int in_command = 0; static volatile int in_command = 0;
static Scsi_Cmnd *current_SC = NULL; static Scsi_Cmnd *current_SC = NULL;
...@@ -347,12 +352,13 @@ struct signature { ...@@ -347,12 +352,13 @@ struct signature {
int sig_length; int sig_length;
int major_bios_version; int major_bios_version;
int minor_bios_version; int minor_bios_version;
int PCI_bus; int flag; /* 1 == PCI_bus, 2 == ISA_200S */
} signatures[] = { } signatures[] = {
/* 1 2 3 4 5 6 */ /* 1 2 3 4 5 6 */
/* 123456789012345678901234567890123456789012345678901234567890 */ /* 123456789012345678901234567890123456789012345678901234567890 */
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 5, 50, 2, 0, 0 }, { "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 5, 50, 2, 0, 0 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V1.07/28/89", 5, 50, 2, 0, 0 }, { "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V1.07/28/89", 5, 50, 2, 0, 0 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 72, 50, 2, 0, 2 },
{ "FUTURE DOMAIN CORP. (C) 1992 V3.00.004/02/92", 5, 44, 3, 0, 0 }, { "FUTURE DOMAIN CORP. (C) 1992 V3.00.004/02/92", 5, 44, 3, 0, 0 },
{ "FUTURE DOMAIN TMC-18XX (C) 1993 V3.203/12/93", 5, 44, 3, 2, 0 }, { "FUTURE DOMAIN TMC-18XX (C) 1993 V3.203/12/93", 5, 44, 3, 2, 0 },
{ "Future Domain Corp. V1.0008/18/93", 5, 33, 3, 4, 0 }, { "Future Domain Corp. V1.0008/18/93", 5, 33, 3, 4, 0 },
...@@ -532,7 +538,8 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -532,7 +538,8 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
signatures[j].signature, signatures[j].sig_length )) { signatures[j].signature, signatures[j].sig_length )) {
bios_major = signatures[j].major_bios_version; bios_major = signatures[j].major_bios_version;
bios_minor = signatures[j].minor_bios_version; bios_minor = signatures[j].minor_bios_version;
PCI_bus = signatures[j].PCI_bus; PCI_bus = (signatures[j].flag == 1);
ISA_200S = (signatures[j].flag == 2);
bios_base = addresses[i]; bios_base = addresses[i];
} }
} }
...@@ -554,8 +561,13 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -554,8 +561,13 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
DOS (this geometry has nothing to do with physical geometry). DOS (this geometry has nothing to do with physical geometry).
*/ */
if (ISA_200S) { /* The Quantum board is slightly different. */
port_base = *((char *)bios_base + 0x1fa2)
+ (*((char *)bios_base + 0x1fa3) << 8);
} else {
port_base = *((char *)bios_base + 0x1fcc) port_base = *((char *)bios_base + 0x1fcc)
+ (*((char *)bios_base + 0x1fcd) << 8); + (*((char *)bios_base + 0x1fcd) << 8);
}
#if DEBUG_DETECT #if DEBUG_DETECT
printk( " %x,", port_base ); printk( " %x,", port_base );
...@@ -1540,6 +1552,17 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array ) ...@@ -1540,6 +1552,17 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array )
The table at 0x1fcc are I/O ports addresses for the various The table at 0x1fcc are I/O ports addresses for the various
operations. I calculate these by hand in this driver code. operations. I calculate these by hand in this driver code.
For the ISA-200S version of BIOS Version 2.0:
The drive parameter table starts at 0x1f33.
WARNING: Assume that the table entry is 25 bytes long. Someone needs
to check this for the Quantum ISA-200S card.
For BIOS Version 3.2: For BIOS Version 3.2:
The drive parameter table starts at 0x1f70. Each entry is The drive parameter table starts at 0x1f70. Each entry is
...@@ -1549,7 +1572,11 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array ) ...@@ -1549,7 +1572,11 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array )
drive = MINOR(dev) / 16; drive = MINOR(dev) / 16;
if (bios_major == 2) { if (bios_major == 2) {
if (ISA_200S) {
i = (struct drive_info *)( (char *)bios_base + 0x1f33 + drive * 25 );
} else {
i = (struct drive_info *)( (char *)bios_base + 0x1f31 + drive * 25 ); i = (struct drive_info *)( (char *)bios_base + 0x1f31 + drive * 25 );
}
info_array[0] = i->heads; info_array[0] = i->heads;
info_array[1] = i->sectors; info_array[1] = i->sectors;
info_array[2] = i->cylinders; info_array[2] = i->cylinders;
......
...@@ -336,15 +336,19 @@ void scsi_mem_init(unsigned long memory_end) ...@@ -336,15 +336,19 @@ void scsi_mem_init(unsigned long memory_end)
{ {
struct Scsi_Host *Host; struct Scsi_Host *Host;
long High8, Low24; long High8, Low24;
for (Host = scsi_hostlist; Host != NULL; Host = Host->next) for (Host = scsi_hostlist; Host != NULL; Host = Host->next) {
if (Host->forbidden_addr > 0 && Host->forbidden_size > 0) if (Host->forbidden_addr > 0 && Host->forbidden_size > 0) {
for (High8 = 1<<24; High8 < memory_end; High8 += 1<<24) for (High8 = 1<<24; High8 < memory_end; High8 += 1<<24) {
for (Low24 = Host->forbidden_addr; for (Low24 = Host->forbidden_addr;
Low24 < Host->forbidden_addr + Host->forbidden_size; Low24 < Host->forbidden_addr + Host->forbidden_size;
Low24 += PAGE_SIZE) Low24 += PAGE_SIZE) {
{
unsigned long ForbiddenAddress = High8 + Low24; unsigned long ForbiddenAddress = High8 + Low24;
if (ForbiddenAddress >= memory_end) break; if (ForbiddenAddress >= memory_end) goto next_host;
mem_map[MAP_NR(ForbiddenAddress)] = MAP_PAGE_RESERVED; mem_map[MAP_NR(ForbiddenAddress)] = MAP_PAGE_RESERVED;
} }
}
}
next_host:
continue;
}
} }
...@@ -14,19 +14,30 @@ ...@@ -14,19 +14,30 @@
Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994 Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
(you can reference it, but it is incomplete and inaccurate in places) (you can reference it, but it is incomplete and inaccurate in places)
Version 0.37 Version 0.38a
This also works with loadable SCSI as a module. Check configuration
options QL_INT_ACTIVE_HIGH and QL_TURBO_PDMA for PCMCIA usage (which
also requires an enabler).
Redistributable under terms of the GNU Public License Redistributable under terms of the GNU Public License
*/ */
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* Configuration */ /* Configuration */
/* Set the following to 2 to use normal interrupt (active high/totempole-
tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
drain */
#define QL_INT_ACTIVE_HIGH 2
/* Set the following to 1 to enable the use of interrupts. Note that 0 tends /* Set the following to 1 to enable the use of interrupts. Note that 0 tends
to be more stable, but slower (or ties up the system more) */ to be more stable, but slower (or ties up the system more) */
#define QL_USE_IRQ 1 #define QL_USE_IRQ 1
/* Set the following to max out the speed of the PIO PseudoDMA transfers, /* Set the following to max out the speed of the PIO PseudoDMA transfers,
again, 0 tends to be slower, but more stable */ again, 0 tends to be slower, but more stable. THIS SHOULD BE ZERO FOR
PCMCIA */
#define QL_TURBO_PDMA 1 #define QL_TURBO_PDMA 1
/* This will reset all devices when the driver is initialized (during bootup). /* This will reset all devices when the driver is initialized (during bootup).
...@@ -64,6 +75,8 @@ ...@@ -64,6 +75,8 @@
#include "../block/blk.h" /* to get disk capacity */ #include "../block/blk.h" /* to get disk capacity */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <unistd.h> #include <unistd.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -83,9 +96,9 @@ static Scsi_Cmnd *qlcmd; /* current command being processed */ ...@@ -83,9 +96,9 @@ static Scsi_Cmnd *qlcmd; /* current command being processed */
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
#define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd )) #define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
#define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb6 , qbase + 0xd )) #define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd ))
/* following is watchdog timeout - 0 is longest possible */ /* following is watchdog timeout */
#define WATCHDOG 5000000 #define WATCHDOG 5000000
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
...@@ -196,9 +209,9 @@ int j; ...@@ -196,9 +209,9 @@ int j;
static int ql_wai(void) static int ql_wai(void)
{ {
int i,k; int i,k;
i = WATCHDOG; i = jiffies + WATCHDOG;
while (--i && !qabort && !((k = inb(qbase + 4)) & 0xe0)); while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0));
if (!i) if (i <= jiffies)
return (DID_TIME_OUT); return (DID_TIME_OUT);
if (qabort) if (qabort)
return (qabort == 1 ? DID_ABORT : DID_RESET); return (qabort == 1 ? DID_ABORT : DID_RESET);
...@@ -291,7 +304,9 @@ unsigned int sgcount; /* sg counter */ ...@@ -291,7 +304,9 @@ unsigned int sgcount; /* sg counter */
j &= 7; /* j = inb( qbase + 7 ) >> 5; */ j &= 7; /* j = inb( qbase + 7 ) >> 5; */
/* correct status is supposed to be step 4 */ /* correct status is supposed to be step 4 */
/* it sometimes returns step 3 but with 0 bytes left to send */ /* it sometimes returns step 3 but with 0 bytes left to send */
if (j != 4 && (j != 3 || inb(qbase + 7) & 0x1f)) { /* We can try stuffing the FIFO with the max each time, but we will get a
sequence of 3 if any bytes are left (but we do flush the FIFO anyway */
if(j != 3 && j != 4) {
printk("Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n", j, i, inb( qbase+7 ) & 0x1f ); printk("Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n", j, i, inb( qbase+7 ) & 0x1f );
ql_zap(); ql_zap();
return (DID_ERROR << 16); return (DID_ERROR << 16);
...@@ -333,10 +348,10 @@ rtrc(2) ...@@ -333,10 +348,10 @@ rtrc(2)
k = inb(qbase + 5); /* should be 0x10, bus service */ k = inb(qbase + 5); /* should be 0x10, bus service */
} }
/*** Enter Status (and Message In) Phase ***/ /*** Enter Status (and Message In) Phase ***/
k = WATCHDOG; k = jiffies + WATCHDOG;
rtrc(4) rtrc(4)
while (--k && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */ while ( k > jiffies && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */
if (!k) { if ( k <= jiffies ) {
ql_zap(); ql_zap();
return (DID_TIME_OUT << 16); return (DID_TIME_OUT << 16);
} }
...@@ -465,6 +480,8 @@ struct Scsi_Host *hreg; /* registered host structure */ ...@@ -465,6 +480,8 @@ struct Scsi_Host *hreg; /* registered host structure */
*/ */
for (qbase = 0x230; qbase < 0x430; qbase += 0x100) { for (qbase = 0x230; qbase < 0x430; qbase += 0x100) {
if( check_region( qbase , 0x10 ) )
continue;
REG1; REG1;
if ( ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 ) if ( ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 )
&& ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 ) ) && ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 ) )
...@@ -498,25 +515,30 @@ struct Scsi_Host *hreg; /* registered host structure */ ...@@ -498,25 +515,30 @@ struct Scsi_Host *hreg; /* registered host structure */
outb(10, 0x20); /* access pending interrupt map */ outb(10, 0x20); /* access pending interrupt map */
outb(10, 0xa0); outb(10, 0xa0);
while (j--) { while (j--) {
outb(0xb2, qbase + 0xd); /* int pin off */ outb(0xb0 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin off */
i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */ i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */
outb(0xb6, qbase + 0xd); /* int pin on */ outb(0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin on */
i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */ i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */
} }
REG0; REG0;
while (inb(qbase + 5)); /* purge int */ while (inb(qbase + 5)); /* purge int */
while (i) /* find on bit */ while (i) /* find on bit */
i >>= 1, qlirq++; /* should check for exactly 1 on */ i >>= 1, qlirq++; /* should check for exactly 1 on */
if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogic")) if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, SA_INTERRUPT, "qlogic"))
host->can_queue = 1; host->can_queue = 1;
sti(); sti();
#endif #endif
snarf_region( qbase , 0x10 );
hreg = scsi_register( host , 0 ); /* no host data */ hreg = scsi_register( host , 0 ); /* no host data */
hreg->io_port = qbase; hreg->io_port = qbase;
hreg->n_io_port = 16;
if( qlirq != -1 )
hreg->irq = qlirq; hreg->irq = qlirq;
sprintf(qinfo, "Qlogic Driver version 0.36, chip %02X at %03X, IRQ %d", qltyp, qbase, qlirq); sprintf(qinfo, "Qlogic Driver version 0.38a, chip %02X at %03X, IRQ %d", qltyp, qbase, qlirq);
host->name = qinfo; host->name = qinfo;
return 1; return 1;
} }
...@@ -562,3 +584,10 @@ const char *qlogic_info(struct Scsi_Host * host) ...@@ -562,3 +584,10 @@ const char *qlogic_info(struct Scsi_Host * host)
{ {
return qinfo; return qinfo;
} }
#ifdef MODULE
/* Eventually this will go into an include file, but this will be later */
Scsi_Host_Template driver_template = QLOGIC;
#include "scsi_module.c"
#endif
This diff is collapsed.
...@@ -3052,7 +3052,6 @@ do_loop_irq (int voice) ...@@ -3052,7 +3052,6 @@ do_loop_irq (int voice)
pcm_active = 0; /* Signal to the play_next_pcm_block routine */ pcm_active = 0; /* Signal to the play_next_pcm_block routine */
case LMODE_PCM: case LMODE_PCM:
{ {
int orig_qlen = pcm_qlen;
int flag; /* 0 or 2 */ int flag; /* 0 or 2 */
pcm_qlen--; pcm_qlen--;
...@@ -3068,7 +3067,7 @@ do_loop_irq (int voice) ...@@ -3068,7 +3067,7 @@ do_loop_irq (int voice)
pcm_active = 0; pcm_active = 0;
} }
/* /*
* If the queue was full before this interrupt, the DMA transfer was * If the queue was full before this interrupt, the DMA transfer was
* suspended. Let it continue now. * suspended. Let it continue now.
*/ */
......
...@@ -549,7 +549,7 @@ load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) ...@@ -549,7 +549,7 @@ load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
elf_ppnt->p_vaddr & 0xfffff000, elf_ppnt->p_vaddr & 0xfffff000,
elf_ppnt->p_filesz + (elf_ppnt->p_vaddr & 0xfff), elf_ppnt->p_filesz + (elf_ppnt->p_vaddr & 0xfff),
PROT_READ | PROT_WRITE | PROT_EXEC, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE, MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
elf_ppnt->p_offset & 0xfffff000); elf_ppnt->p_offset & 0xfffff000);
#ifdef LOW_ELF_STACK #ifdef LOW_ELF_STACK
......
...@@ -777,7 +777,12 @@ void brelse(struct buffer_head * buf) ...@@ -777,7 +777,12 @@ void brelse(struct buffer_head * buf)
{ {
if (!buf) if (!buf)
return; return;
/*
* Hmm.. Leaving this in for now, as I'm a bit nervous about it..
*/
#if 0
wait_on_buffer(buf); wait_on_buffer(buf);
#endif
/* If dirty, mark the time this buffer should be written back */ /* If dirty, mark the time this buffer should be written back */
set_writetime(buf, 0); set_writetime(buf, 0);
......
...@@ -418,8 +418,11 @@ int do_open(const char * filename,int flags,int mode) ...@@ -418,8 +418,11 @@ int do_open(const char * filename,int flags,int mode)
if (flag & (O_TRUNC | O_CREAT)) if (flag & (O_TRUNC | O_CREAT))
flag |= 2; flag |= 2;
error = open_namei(filename,flag,mode,&inode,NULL); error = open_namei(filename,flag,mode,&inode,NULL);
if (!error && (f->f_mode & 2)) if (!error && (f->f_mode & 2)) {
error = get_write_access(inode); error = get_write_access(inode);
if (error)
iput(inode);
}
if (error) { if (error) {
current->files->fd[fd]=NULL; current->files->fd[fd]=NULL;
f->f_count--; f->f_count--;
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
* *
* Danny ter Haar : Some minor additions for cpuinfo * Danny ter Haar : Some minor additions for cpuinfo
* <danny@ow.nl> * <danny@ow.nl>
*
* Alessandro Rubini : profile extension.
* <rubini@ipvvis.unipv.it>
*/ */
#include <linux/types.h> #include <linux/types.h>
...@@ -95,6 +98,64 @@ struct inode_operations proc_kcore_inode_operations = { ...@@ -95,6 +98,64 @@ struct inode_operations proc_kcore_inode_operations = {
&proc_kcore_operations, &proc_kcore_operations,
}; };
#ifdef CONFIG_PROFILE
extern unsigned long prof_len;
extern unsigned long * prof_buffer;
/*
* This function accesses profiling information. The returned data is
* binary: the sampling step and the actual contents of the profile
* buffer. Use of the program readprofile is recommended in order to
* get meaningful info out of these data.
*/
static int read_profile(struct inode *inode, struct file *file, char *buf, int count)
{
unsigned long p = file->f_pos;
int read;
char * pnt;
unsigned long sample_step = 1 << CONFIG_PROFILE_SHIFT;
if (count < 0)
return -EINVAL;
if (p >= (prof_len+1)*sizeof(unsigned long))
return 0;
if (count > (prof_len+1)*sizeof(unsigned long) - p)
count = (prof_len+1)*sizeof(unsigned long) - p;
read = 0;
while (p < sizeof(unsigned long) && count > 0) {
put_fs_byte(*((char *)(&sample_step)+p),buf);
buf++; p++; count--; read++;
}
pnt = (char *)prof_buffer + p - sizeof(unsigned long);
memcpy_tofs(buf,(void *)pnt,count);
read += count;
file->f_pos += read;
return read;
}
/* Writing to /proc/profile resets the counters */
static int write_profile(struct inode * inode, struct file * file, char * buf, int count)
{
int i=prof_len;
while (i--)
prof_buffer[i]=0UL;
return count;
}
static struct file_operations proc_profile_operations = {
NULL, /* lseek */
read_profile,
write_profile,
};
struct inode_operations proc_profile_inode_operations = {
&proc_profile_operations,
};
#endif /* CONFIG_PROFILE */
static int get_loadavg(char * buffer) static int get_loadavg(char * buffer)
{ {
int a, b, c; int a, b, c;
...@@ -182,18 +243,47 @@ static int get_version(char * buffer) ...@@ -182,18 +243,47 @@ static int get_version(char * buffer)
static int get_cpuinfo(char * buffer) static int get_cpuinfo(char * buffer)
{ {
return sprintf(buffer,"cpu : %d86\n" /* to conserve memory, we define the strins yes and no in
"vid : %s\n" advance */
"fdiv_bug : %s\n" char *yes="yes";
"math : %s\n" char *no="no";
"hlt : %s\n" char *model[2][9]={{"DX","SX","DX/2","4","5","6",
"wp : %s\n", "7","DX/4"},
x86, {"Pentium 60/66","Pentium 90","3",
"4","5","6","7","8"}};
return sprintf(buffer,"cpu\t\t: %c86\n"
"model\t\t: %s\n"
"mask\t\t: %c\n"
"vid\t\t: %s\n"
"fdiv_bug\t: %s\n"
"math\t\t: %s\n"
"hlt\t\t: %s\n"
"wp\t\t: %s\n"
"Integrated NPU\t: %s\n"
"Enhanced VM86\t: %s\n"
"IO Breakpoints\t: %s\n"
"4MB Pages\t: %s\n"
"TS Counters\t: %s\n"
"Pentium MSR\t: %s\n"
"Mach. Ch. Exep.\t: %s\n"
"CMPXCHGB8B\t: %s\n",
x86+'0',
x86_model ? model[x86-4][x86_model-1] : "Unknown",
x86_mask+'@',
x86_vendor_id, x86_vendor_id,
fdiv_bug ? "yes" : "no", fdiv_bug ? yes : no,
hard_math ? "yes" : "no", hard_math ? yes : no,
hlt_works_ok ? "yes" : "no", hlt_works_ok ? yes : no,
wp_works_ok ? "yes" : "no"); wp_works_ok ? yes : no,
x86_capability & 1 ? yes : no,
x86_capability & 2 ? yes : no,
x86_capability & 4 ? yes : no,
x86_capability & 8 ? yes : no,
x86_capability & 16 ? yes : no,
x86_capability & 32 ? yes : no,
x86_capability & 128 ? yes : no,
x86_capability & 256 ? yes : no
);
} }
static struct task_struct ** get_task(pid_t pid) static struct task_struct ** get_task(pid_t pid)
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/segment.h> #include <asm/segment.h>
extern unsigned long prof_len;
void proc_put_inode(struct inode *inode) void proc_put_inode(struct inode *inode)
{ {
if (inode->i_nlink) if (inode->i_nlink)
...@@ -127,6 +129,13 @@ void proc_read_inode(struct inode * inode) ...@@ -127,6 +129,13 @@ void proc_read_inode(struct inode * inode)
inode->i_op = &proc_kcore_inode_operations; inode->i_op = &proc_kcore_inode_operations;
inode->i_size = high_memory + PAGE_SIZE; inode->i_size = high_memory + PAGE_SIZE;
break; break;
#ifdef CONFIG_PROFILE
case PROC_PROFILE:
inode->i_mode = S_IFREG | S_IRUGO | S_IWUSR;
inode->i_op = &proc_profile_inode_operations;
inode->i_size = (1+prof_len) * sizeof(unsigned long);
break;
#endif
default: default:
inode->i_mode = S_IFREG | S_IRUGO; inode->i_mode = S_IFREG | S_IRUGO;
inode->i_op = &proc_array_inode_operations; inode->i_op = &proc_array_inode_operations;
......
...@@ -74,6 +74,7 @@ static struct proc_dir_entry root_dir[] = { ...@@ -74,6 +74,7 @@ static struct proc_dir_entry root_dir[] = {
{ PROC_KSYMS, 5, "ksyms" }, { PROC_KSYMS, 5, "ksyms" },
{ PROC_DMA, 3, "dma" }, { PROC_DMA, 3, "dma" },
{ PROC_IOPORTS, 7, "ioports"}, { PROC_IOPORTS, 7, "ioports"},
{ PROC_PROFILE, 7, "profile"},
}; };
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0]))) #define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
......
...@@ -32,10 +32,14 @@ int UMSDOS_dir_read(struct inode *inode,struct file *filp,char *buf, ...@@ -32,10 +32,14 @@ int UMSDOS_dir_read(struct inode *inode,struct file *filp,char *buf,
{ {
return -EISDIR; return -EISDIR;
} }
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
#define ROUND_UP(x) (((x)+3) & ~3)
/* /*
Read count directory entries from directory filp Read count directory entries from directory filp
Return a negative value from linux/errno.h. Return a negative value from linux/errno.h.
Return > 0 if success (the length of the file name). Return > 0 if success (The amount of byte written in
dirent round_up to a word size (32 bits).
This function is used by the normal readdir VFS entry point and by This function is used by the normal readdir VFS entry point and by
some function who try to find out info on a file from a pure MSDOS some function who try to find out info on a file from a pure MSDOS
...@@ -72,7 +76,7 @@ static int umsdos_readdir_x( ...@@ -72,7 +76,7 @@ static int umsdos_readdir_x(
put_fs_byte(0,dirent->d_name+3); put_fs_byte(0,dirent->d_name+3);
put_fs_word (3,&dirent->d_reclen); put_fs_word (3,&dirent->d_reclen);
if (u_entry != NULL) u_entry->flags = 0; if (u_entry != NULL) u_entry->flags = 0;
ret = 3; ret = ROUND_UP(NAME_OFFSET(dirent) + 3 + 1);
filp->f_pos++; filp->f_pos++;
}else if (filp->f_pos < 2 }else if (filp->f_pos < 2
|| (dir != dir->i_sb->s_mounted && filp->f_pos == 32)){ || (dir != dir->i_sb->s_mounted && filp->f_pos == 32)){
...@@ -191,7 +195,7 @@ static int umsdos_readdir_x( ...@@ -191,7 +195,7 @@ static int umsdos_readdir_x(
dirent->d_reclen = entry.name_len; dirent->d_reclen = entry.name_len;
if (u_entry != NULL) *u_entry = entry; if (u_entry != NULL) *u_entry = entry;
} }
ret = entry.name_len; ret = ROUND_UP(NAME_OFFSET(dirent) + entry.name_len + 1);
iput (inode); iput (inode);
break; break;
} }
...@@ -219,7 +223,7 @@ static int umsdos_readdir_x( ...@@ -219,7 +223,7 @@ static int umsdos_readdir_x(
/* /*
Read count directory entries from directory filp Read count directory entries from directory filp
Return a negative value from linux/errno.h. Return a negative value from linux/errno.h.
Return > 0 if success (the length of the file name). Return > 0 if success (the amount of byte written to dirent)
*/ */
static int UMSDOS_readdir( static int UMSDOS_readdir(
struct inode *dir, /* Point to a description of the super block */ struct inode *dir, /* Point to a description of the super block */
......
...@@ -32,8 +32,10 @@ static int UMSDOS_rreaddir ( ...@@ -32,8 +32,10 @@ static int UMSDOS_rreaddir (
{ {
int ret = 0; int ret = 0;
while (1){ while (1){
int len = -1;
ret = msdos_readdir(dir,filp,dirent,count); ret = msdos_readdir(dir,filp,dirent,count);
if (ret == 5 if (ret > 0) len = get_fs_word(&dirent->d_reclen);
if (len == 5
&& pseudo_root != NULL && pseudo_root != NULL
&& dir->i_sb->s_mounted == pseudo_root->i_sb->s_mounted){ && dir->i_sb->s_mounted == pseudo_root->i_sb->s_mounted){
/* /*
...@@ -45,7 +47,7 @@ static int UMSDOS_rreaddir ( ...@@ -45,7 +47,7 @@ static int UMSDOS_rreaddir (
if (memcmp(name,UMSDOS_PSDROOT_NAME,UMSDOS_PSDROOT_LEN)!=0) break; if (memcmp(name,UMSDOS_PSDROOT_NAME,UMSDOS_PSDROOT_LEN)!=0) break;
}else{ }else{
if (pseudo_root != NULL if (pseudo_root != NULL
&& ret == 2 && len == 2
&& dir == dir->i_sb->s_mounted && dir == dir->i_sb->s_mounted
&& dir == pseudo_root->i_sb->s_mounted){ && dir == pseudo_root->i_sb->s_mounted){
char name[2]; char name[2];
......
...@@ -35,4 +35,13 @@ extern __inline__ void udelay(unsigned long usecs) ...@@ -35,4 +35,13 @@ extern __inline__ void udelay(unsigned long usecs)
__delay(usecs); __delay(usecs);
} }
/*
* 64-bit integers means we don't have to worry about overflow as
* on some other architectures..
*/
extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
{
return (a*b)/c;
}
#endif /* defined(__ALPHA_DELAY_H) */ #endif /* defined(__ALPHA_DELAY_H) */
...@@ -176,4 +176,7 @@ extern inline void writel(unsigned int b, unsigned long addr) ...@@ -176,4 +176,7 @@ extern inline void writel(unsigned int b, unsigned long addr)
*(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60) = b; *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60) = b;
} }
#define inb_p inb
#define outb_p outb
#endif #endif
#ifndef _ALPHA_TYPES_H #ifndef _ALPHA_TYPES_H
#define _ALPHA_TYPES_H #define _ALPHA_TYPES_H
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned long size_t;
#endif
#ifndef _SSIZE_T
#define _SSIZE_T
typedef long ssize_t;
#endif
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
typedef long ptrdiff_t;
#endif
/* /*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space * header files exported to user space
......
...@@ -12,83 +12,32 @@ ...@@ -12,83 +12,32 @@
#define _syscall0(type,name) \ #define _syscall0(type,name) \
type name(void) \ type name(void) \
{ \ { \
long __res; \
__asm__ __volatile__ (".long 131" \
: "=a" (__res) \
: "0" (__NR_##name)); \
if (__res >= 0) \
return (type) __res; \
errno = -__res; \
return -1; \
} }
#define _syscall1(type,name,type1,arg1) \ #define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) \ type name(type1 arg1) \
{ \ { \
long __res; \
__asm__ __volatile__ (".long 131" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1))); \
if (__res >= 0) \
return (type) __res; \
errno = -__res; \
return -1; \
} }
#define _syscall2(type,name,type1,arg1,type2,arg2) \ #define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) \ type name(type1 arg1,type2 arg2) \
{ \ { \
long __res; \
__asm__ __volatile__ (".long 131" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
if (__res >= 0) \
return (type) __res; \
errno = -__res; \
return -1; \
} }
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) \ type name(type1 arg1,type2 arg2,type3 arg3) \
{ \ { \
long __res; \
__asm__ __volatile__ (".long 131" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
"d" ((long)(arg3))); \
if (__res>=0) \
return (type) __res; \
errno=-__res; \
return -1; \
} }
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \ { \
long __res; \
__asm__ __volatile__ (".long 131" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
"d" ((long)(arg3)),"S" ((long)(arg4))); \
if (__res>=0) \
return (type) __res; \
errno=-__res; \
return -1; \
} }
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \ type5,arg5) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \ { \
long __res; \
__asm__ __volatile__ (".long 131" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
"d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
if (__res>=0) \
return (type) __res; \
errno=-__res; \
return -1; \
} }
#endif /* _ALPHA_UNISTD_H */ #endif /* _ALPHA_UNISTD_H */
...@@ -32,4 +32,15 @@ extern __inline__ void udelay(unsigned long usecs) ...@@ -32,4 +32,15 @@ extern __inline__ void udelay(unsigned long usecs)
__delay(usecs); __delay(usecs);
} }
extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
{
__asm__("mull %1 ; divl %2"
:"=a" (a)
:"d" (b),
"r" (c),
"0" (a)
:"dx");
return a;
}
#endif /* defined(_I386_DELAY_H) */ #endif /* defined(_I386_DELAY_H) */
...@@ -427,7 +427,7 @@ return s; ...@@ -427,7 +427,7 @@ return s;
} }
/* we might want to write optimized versions of these later */ /* we might want to write optimized versions of these later */
#define __constant_c_memset(s,c,count) __memset_generic((s),(c),(count)) #define __constant_c_memset(s,c,count) __memset_generic((s),(unsigned char)(c),(count))
#define __constant_count_memset(s,c,count) __memset_generic((s),(c),(count)) #define __constant_count_memset(s,c,count) __memset_generic((s),(c),(count))
/* /*
......
#ifndef _I386_TYPES_H #ifndef _I386_TYPES_H
#define _I386_TYPES_H #define _I386_TYPES_H
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t;
#endif
#ifndef _SSIZE_T
#define _SSIZE_T
typedef int ssize_t;
#endif
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
typedef int ptrdiff_t;
#endif
/* /*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space * header files exported to user space
......
#ifndef _SPARC_BITOPS_H
#define _SPARC_BITOPS_H
/*
* Copyright 1994, David S. Miller (davem@caip.rutgers.edu).
*/
/* Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0'
* is in the highest of the four bytes and bit '31' is the high bit
* within the first byte. Sparc is BIG-Endian. Unless noted otherwise
* all bit-ops return 0 is bit previously clear and != 0 otherwise.
*/
extern __inline__ unsigned int set_bit(unsigned int nr, void *addr)
{
__asm__ __volatile__(
"or %g0, %g0, %o2\n\t"
"or %g0, %g0, %o3\n\t"
"or %g0, %o0, %o4\n\t"
"srl %o4, 0x5, %o4\n\t"
"add %o1, %o4, %o1\n\t"
"or %g0, 0x1, %o5"
"or %g0, 0x1f, %o6"
"and %o6, %o5, %o6"
"sll %o5, %o6, %o2"
"ld [%o1], %o5\n\t"
"and %o5, %o2, %o0"
"or %o5, %o2, %o5"
"st %o5, [%o1]");
return nr; /* confuse gcc :-) */
}
extern __inline__ unsigned int clear_bit(unsigned int nr, void *addr)
{
__asm__ __volatile__(
"or %g0, %g0, %o2\n\t"
"or %g0, %g0, %o3\n\t"
"or %g0, %o0, %o4\n\t"
"srl %o4, 0x5, %o4\n\t"
"add %o1, %o4, %o1\n\t"
"or %g0, 0x1, %o5"
"or %g0, 0x1f, %o6"
"and %o6, %o5, %o6"
"sll %o5, %o6, %o2"
"ld [%o1], %o5\n\t"
"and %o5, %o2, %o0\n\t"
"xnor %g0, %o2, %o2\n\t"
"and %o5, %o2, %o5\n\t"
"st %o5, [%o1]\n\t");
return nr; /* confuse gcc ;-) */
}
extern __inline__ unsigned int test_bit(int nr, int *addr)
{
__asm__ __volatile__(
"or %g0, %o0, %o3\n\t"
"srl %o3, 0x5, %o3\n\t"
"add %o1, %o3, %o1\n\t"
"and %o0, 0x1f, %o0\n\t"
"or %g0, 0x1, %o2\n\t"
"sll %o2, %o0, %o0"
"ld [%o1], %o2\n\t"
"and %o0, %o2, %o0\n\t");
return nr; /* confuse gcc :> */
}
#endif /* defined(_SPARC_BITOPS_H) */
#ifndef __SPARC_DELAY_H
#define __SPARC_DELAY_H
extern unsigned long loops_per_sec;
/*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu).
*
* Delay quick inlined code using 'loops_per_second' which is
* calculated in calibrate_delay() in main.c (ie. BogoMIPS :-)
*/
extern __inline__ void __delay(unsigned int loops)
{
__asm__ __volatile__("\n1:\tcmp %0, 0\n\t"
"bne,a 1b\n\t"
"sub %0, 1, %0\n": "=r" (loops) : "0" (loops));
}
/* udelay(usecs) is used for very short delays up to 1 millisecond. */
extern __inline__ void udelay(unsigned int usecs)
{
usecs *= 0x000010c6; /* Sparc is 32-bit just like ix86 */
__asm__("sethi %hi(_loops_per_sec), %o1\n\t"
"ld [%o1 + %lo(_loops_per_sec)], %o1\n\t"
"call ___delay\n\t"
"umul %o1, %o0, %o0\n\t");
}
#endif /* defined(__SPARC_DELAY_H) */
This diff is collapsed.
/* string.h: External definitions for optimized assembly string
routines for the Linux Kernel.
Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
*/
extern int strlen(char* str);
extern int strcmp(char* str1, char* str2);
extern int strncmp(char* str1, char* str2, int strlen);
extern int strcpy(char* dest, char* source);
extern int strncpy(char* dest, char* source, int cpylen);
This diff is collapsed.
This diff is collapsed.
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#define IPOPT_TIMESTAMP 68 #define IPOPT_TIMESTAMP 68
#define MAXTTL 255
struct timestamp { struct timestamp {
__u8 len; __u8 len;
__u8 ptr; __u8 ptr;
......
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.
3c509.o de600.o de620.o 3c501.o apricot.o eexpress.o plip.o 8390.o 3c509.o de600.o de620.o 3c501.o apricot.o eexpress.o plip.o 8390.o slip.o slhc.o
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