Commit d9723f6c authored by Linus Torvalds's avatar Linus Torvalds

[PATCH] Linux-0.97.6 (September 20, 1992)

Ted Ts'o did extensive serial driver changes, and fixed up some of the
tty layer to match.  Tty's now allocated dynamically.

[Original announcement below]

This patch does not contain any major bug-fixes: it corrects named pipes
that broke with pl5, and has some minor changes in the IO-instructions
and the hd-driver, but those shouldn't matter for most of you.

It does contain all the scsi-patches that I've gotten so far, so if the
bootup sequence died on you in the scsi code, pl6 should correct this.

The major part of the patch is tytso's serial line changes, making the
tty structures dynamic.  No more NR_PTY's - the number of pty's is now
bounded only by the minor number setup (max 64 pty's) or the amount of
memory available (opening a pty requires a page of memory for tty
queues).  Similarly for serial lines.

The above just means that while pl6 can be useful, the changes to pl5
aren't big enough to worry about.  Most people don't use named pipes, it
seems, and the other changes are either cosmetic or hardware-dependent.
I still hope people upgrade, if only so that I can get new bug-reports.

I had hoped to release 0.98 this weekend, but studies and the scsi/hd
problems put an end to that.  0.98 should be out next weekend or so.
Expect the tcp/ip subdirectory and possibly some mm changes.

                Linus
parent 06d9f6ff
......@@ -11,7 +11,7 @@ ROOT_DEV = /dev/hdb1
# granularity of the profiling (5 = 32-byte granularity)
#
#PROFILING = -DPROFILE_SHIFT=2
PROFILING = -DPROFILE_SHIFT=2
#
# uncomment the correct keyboard:
......@@ -45,12 +45,6 @@ KEYBOARD = -DKBD_FINNISH -DKBDFLAGS=0
# KEYBOARD = -DKBD_SG_LATIN1 -DKBDFLAGS=0x9F
# KEYBOARD = -DKDB_NO
#
# comment this line to turn off keyboard NUM LOCK
#
NUM_LOCK = -DKBD_NUMERIC_LOCK
#
# comment this line if you don't want the emulation-code
#
......@@ -79,7 +73,7 @@ LD86 =ld86 -0
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
#
#SVGA_MODE= -DSVGA_MODE=1
SVGA_MODE= -DSVGA_MODE=1
AS =as
LD =ld
......@@ -118,7 +112,7 @@ linuxsubdirs: dummy
Version:
@./makever.sh
@echo \#define UTS_RELEASE \"0.97.pl5-`cat .version`\" > tools/version.h
@echo \#define UTS_RELEASE \"0.97.pl6-`cat .version`\" > tools/version.h
@echo \#define UTS_VERSION \"`date +%D`\" >> tools/version.h
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
......@@ -196,14 +190,14 @@ depend dep:
dummy:
### Dependencies:
init/main.o : init/main.c /usr/src/linux/include/stdarg.h /usr/src/linux/include/time.h \
/usr/src/linux/include/asm/system.h /usr/src/linux/include/asm/io.h /usr/src/linux/include/linux/types.h \
/usr/src/linux/include/linux/fcntl.h /usr/src/linux/include/linux/config.h /usr/src/linux/include/linux/config_rel.h \
/usr/src/linux/include/linux/config_ver.h /usr/src/linux/include/linux/config.dist.h \
/usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h \
/usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/dirent.h \
/usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/tty.h /usr/src/linux/include/linux/termios.h /usr/src/linux/include/linux/unistd.h
init/main.o : init/main.c /usr/lib/gcc-lib/i386-linux/2.2.2d/include/stdarg.h /usr/include/asm/system.h \
/usr/include/asm/io.h /usr/include/linux/mktime.h /usr/include/linux/types.h \
/usr/include/linux/fcntl.h /usr/include/linux/config.h /usr/include/linux/config.dist.h \
/usr/include/linux/sched.h /usr/include/linux/head.h /usr/include/linux/fs.h \
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
/usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
/usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
/usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h \
/usr/include/linux/kernel.h /usr/include/linux/signal.h /usr/include/linux/time.h \
/usr/include/linux/param.h /usr/include/linux/resource.h /usr/include/linux/vm86.h \
/usr/include/linux/tty.h /usr/include/linux/termios.h /usr/include/linux/unistd.h
......@@ -61,6 +61,12 @@ start:
mov ax,#0x5019
cmp bl,#0x10
je novga
mov ax,#0x1a00 ! Added check for EGA/VGA discrimination
int 0x10
mov bx,ax
mov ax,#0x5019
cmp bl,#0x1a ! 1a means VGA, anything else EGA or lower
jne novga
call chsvga
novga: mov [14],ax
mov ah,#0x03 ! read cursor pos
......
This diff is collapsed.
This diff is collapsed.
/*
* linux/fs/ext/bitmap.c
*
* Copyright (C) 1992 Remy Card (card@masi.ibp.fr)
*
* from
*
* linux/fs/minix/bitmap.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
/* bitmap.c contains the code that handles the inode and block bitmaps */
#include <linux/sched.h>
#include <linux/ext_fs.h>
#include <linux/kernel.h>
#include <linux/string.h>
#ifdef EXTFS_BITMAP
#define clear_block(addr) \
__asm__("cld\n\t" \
"rep\n\t" \
"stosl" \
::"a" (0),"c" (BLOCK_SIZE/4),"D" ((long) (addr)):"cx","di")
#define set_bit(nr,addr) ({\
char res; \
__asm__ __volatile__("btsl %1,%2\n\tsetb %0": \
"=q" (res):"r" (nr),"m" (*(addr))); \
res;})
#define clear_bit(nr,addr) ({\
char res; \
__asm__ __volatile__("btrl %1,%2\n\tsetnb %0": \
"=q" (res):"r" (nr),"m" (*(addr))); \
res;})
#define find_first_zero(addr) ({ \
int __res; \
__asm__("cld\n" \
"1:\tlodsl\n\t" \
"notl %%eax\n\t" \
"bsfl %%eax,%%edx\n\t" \
"jne 2f\n\t" \
"addl $32,%%ecx\n\t" \
"cmpl $8192,%%ecx\n\t" \
"jl 1b\n\t" \
"xorl %%edx,%%edx\n" \
"2:\taddl %%edx,%%ecx" \
:"=c" (__res):"0" (0),"S" (addr):"ax","dx","si"); \
__res;})
static int nibblemap[] = { 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4 };
static unsigned long count_used(struct buffer_head *map[], unsigned numblocks,
unsigned numbits)
{
unsigned i, j, end, sum = 0;
struct buffer_head *bh;
for (i=0; (i<numblocks) && numbits; i++) {
if (!(bh=map[i]))
return(0);
if (numbits >= (8*BLOCK_SIZE)) {
end = BLOCK_SIZE;
numbits -= 8*BLOCK_SIZE;
} else {
int tmp;
end = numbits >> 3;
numbits &= 0x7;
tmp = bh->b_data[end] & ((1<<numbits)-1);
sum += nibblemap[tmp&0xf] + nibblemap[(tmp>>4)&0xf];
numbits = 0;
}
for (j=0; j<end; j++)
sum += nibblemap[bh->b_data[j] & 0xf]
+ nibblemap[(bh->b_data[j]>>4)&0xf];
}
return(sum);
}
int ext_free_block(int dev, int block)
{
struct super_block * sb;
struct buffer_head * bh;
unsigned int bit,zone;
if (!(sb = get_super(dev)))
panic("trying to free block on nonexistent device");
if (block < sb->s_firstdatazone || block >= sb->s_nzones)
panic("trying to free block not in datazone");
bh = get_hash_table(dev,block);
if (bh) {
if (bh->b_count > 1) {
brelse(bh);
return 0;
}
bh->b_dirt=0;
bh->b_uptodate=0;
if (bh->b_count)
brelse(bh);
}
zone = block - sb->s_firstdatazone + 1;
bit = zone & 8191;
zone >>= 13;
bh = sb->s_zmap[zone];
if (clear_bit(bit,bh->b_data))
printk("free_block (%04x:%d): bit already cleared\n",dev,block);
bh->b_dirt = 1;
return 1;
}
int ext_new_block(int dev)
{
struct buffer_head * bh;
struct super_block * sb;
int i,j;
if (!(sb = get_super(dev)))
panic("trying to get new block from nonexistant device");
j = 8192;
for (i=0 ; i<8 ; i++)
if (bh=sb->s_zmap[i])
if ((j=find_first_zero(bh->b_data))<8192)
break;
if (i>=8 || !bh || j>=8192)
return 0;
if (set_bit(j,bh->b_data))
panic("new_block: bit already set");
bh->b_dirt = 1;
j += i*8192 + sb->s_firstdatazone-1;
if (j >= sb->s_nzones)
return 0;
if (!(bh=getblk(dev,j)))
panic("new_block: cannot get block");
if (bh->b_count != 1)
panic("new block: count is != 1");
clear_block(bh->b_data);
bh->b_uptodate = 1;
bh->b_dirt = 1;
brelse(bh);
#ifdef EXTFS_DEBUG
printk("ext_new_block: allocating block %d\n", j);
#endif
return j;
}
unsigned long ext_count_free_blocks(struct super_block *sb)
{
return (sb->s_nzones - count_used(sb->s_zmap,sb->s_zmap_blocks,sb->s_nzones))
<< sb->s_log_zone_size;
}
void ext_free_inode(struct inode * inode)
{
struct buffer_head * bh;
if (!inode)
return;
if (!inode->i_dev) {
memset(inode,0,sizeof(*inode));
return;
}
if (inode->i_count>1) {
printk("free_inode: inode has count=%d\n",inode->i_count);
return;
}
if (inode->i_nlink) {
printk("free_inode: inode has nlink=%d\n",inode->i_nlink);
return;
}
if (!inode->i_sb) {
printk("free_inode: inode on nonexistent device\n");
return;
}
if (inode->i_ino < 1 || inode->i_ino > inode->i_sb->s_ninodes) {
printk("free_inode: inode 0 or nonexistent inode\n");
return;
}
if (!(bh=inode->i_sb->s_imap[inode->i_ino>>13])) {
printk("free_inode: nonexistent imap in superblock\n");
return;
}
if (clear_bit(inode->i_ino&8191,bh->b_data))
printk("free_inode: bit already cleared.\n\r");
bh->b_dirt = 1;
memset(inode,0,sizeof(*inode));
}
struct inode * ext_new_inode(int dev)
{
struct inode * inode;
struct buffer_head * bh;
int i,j;
if (!(inode=get_empty_inode()))
return NULL;
if (!(inode->i_sb = get_super(dev))) {
printk("new_inode: unknown device\n");
iput(inode);
return NULL;
}
inode->i_flags = inode->i_sb->s_flags;
j = 8192;
for (i=0 ; i<8 ; i++)
if (bh=inode->i_sb->s_imap[i])
if ((j=find_first_zero(bh->b_data))<8192)
break;
if (!bh || j >= 8192 || j+i*8192 > inode->i_sb->s_ninodes) {
iput(inode);
return NULL;
}
if (set_bit(j,bh->b_data)) { /* shouldn't happen */
printk("new_inode: bit already set");
iput(inode);
return NULL;
}
bh->b_dirt = 1;
inode->i_count = 1;
inode->i_nlink = 1;
inode->i_dev = dev;
inode->i_uid = current->euid;
inode->i_gid = current->egid;
inode->i_dirt = 1;
inode->i_ino = j + i*8192;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
inode->i_op = NULL;
#ifdef EXTFS_DEBUG
printk("ext_new_inode : allocating inode %d\n", inode->i_ino);
#endif
return inode;
}
unsigned long ext_count_free_inodes(struct super_block *sb)
{
return sb->s_ninodes - count_used(sb->s_imap,sb->s_imap_blocks,sb->s_ninodes);
}
#endif
......@@ -385,6 +385,7 @@ void ext_read_inode(struct inode * inode)
inode->i_pipe = 1;
PIPE_BASE(*inode) = NULL;
PIPE_HEAD(*inode) = PIPE_TAIL(*inode) = 0;
PIPE_READ_WAIT(*inode) = PIPE_WRITE_WAIT(*inode) = NULL;
PIPE_READERS(*inode) = PIPE_WRITERS(*inode) = 0;
}
}
......
......@@ -352,6 +352,7 @@ int ext_mknod(struct inode * dir, const char * name, int len, int mode, int rdev
inode->i_pipe = 1;
PIPE_BASE(*inode) = NULL;
PIPE_HEAD(*inode) = PIPE_TAIL(*inode) = 0;
PIPE_READ_WAIT(*inode) = PIPE_WRITE_WAIT(*inode) = NULL;
PIPE_READERS(*inode) = PIPE_WRITERS(*inode) = 0;
}
if (S_ISBLK(mode) || S_ISCHR(mode))
......
......@@ -194,6 +194,7 @@ struct inode * get_pipe_inode(void)
return NULL;
}
inode->i_count = 2; /* sum of readers/writers */
PIPE_READ_WAIT(*inode) = PIPE_WRITE_WAIT(*inode) = NULL;
PIPE_HEAD(*inode) = PIPE_TAIL(*inode) = 0;
PIPE_READERS(*inode) = PIPE_WRITERS(*inode) = 1;
inode->i_pipe = 1;
......
This diff is collapsed.
......@@ -344,6 +344,7 @@ void minix_read_inode(struct inode * inode)
inode->i_pipe = 1;
PIPE_BASE(*inode) = NULL;
PIPE_HEAD(*inode) = PIPE_TAIL(*inode) = 0;
PIPE_READ_WAIT(*inode) = PIPE_WRITE_WAIT(*inode) = NULL;
PIPE_READERS(*inode) = PIPE_WRITERS(*inode) = 0;
}
}
......
......@@ -261,6 +261,7 @@ int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rd
inode->i_pipe = 1;
PIPE_BASE(*inode) = NULL;
PIPE_HEAD(*inode) = PIPE_TAIL(*inode) = 0;
PIPE_READ_WAIT(*inode) = PIPE_WRITE_WAIT(*inode) = NULL;
PIPE_READERS(*inode) = PIPE_WRITERS(*inode) = 0;
}
if (S_ISBLK(mode) || S_ISCHR(mode))
......
......@@ -25,56 +25,59 @@ clean:
dep:
sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
for i in *.c;do $(CPP) -M $$i;done >> tmp_make
$(CPP) -M *.c >> tmp_make
cp tmp_make Makefile
### Dependencies:
dir.o : dir.c /usr/src/linux/include/asm/segment.h /usr/src/linux/include/linux/sched.h \
/usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h \
/usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h \
/usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/msdos_fs.h /usr/src/linux/include/linux/errno.h \
/usr/src/linux/include/linux/stat.h
fat.o : fat.c /usr/src/linux/include/linux/msdos_fs.h /usr/src/linux/include/linux/fs.h \
/usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h \
/usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/errno.h /usr/src/linux/include/linux/stat.h
file.o : file.c /usr/src/linux/include/asm/segment.h /usr/src/linux/include/asm/system.h \
/usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h \
/usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h \
/usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/msdos_fs.h /usr/src/linux/include/linux/errno.h \
/usr/src/linux/include/linux/fcntl.h /usr/src/linux/include/linux/stat.h
inode.o : inode.c /usr/src/linux/include/linux/msdos_fs.h /usr/src/linux/include/linux/fs.h \
/usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h \
/usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/signal.h /usr/src/linux/include/linux/time.h \
/usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/errno.h /usr/src/linux/include/linux/string.h /usr/src/linux/include/linux/stat.h \
/usr/src/linux/include/asm/segment.h
misc.o : misc.c /usr/src/linux/include/linux/msdos_fs.h /usr/src/linux/include/linux/fs.h \
/usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h \
/usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/mm.h \
/usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/errno.h /usr/src/linux/include/linux/string.h /usr/src/linux/include/linux/stat.h
namei.o : namei.c /usr/src/linux/include/asm/segment.h /usr/src/linux/include/linux/sched.h \
/usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h \
/usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h \
/usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/msdos_fs.h /usr/src/linux/include/linux/errno.h \
/usr/src/linux/include/linux/string.h /usr/src/linux/include/linux/stat.h
dir.o : dir.c /usr/include/asm/segment.h /usr/include/linux/sched.h /usr/include/linux/head.h \
/usr/include/linux/fs.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
/usr/include/linux/types.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h /usr/include/linux/kernel.h \
/usr/include/linux/signal.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/msdos_fs.h \
/usr/include/linux/errno.h /usr/include/linux/stat.h
fat.o : fat.c /usr/include/linux/msdos_fs.h /usr/include/linux/fs.h /usr/include/linux/limits.h \
/usr/include/linux/wait.h /usr/include/linux/types.h /usr/include/linux/dirent.h \
/usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
/usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
/usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/kernel.h \
/usr/include/linux/errno.h /usr/include/linux/stat.h
file.o : file.c /usr/include/asm/segment.h /usr/include/asm/system.h /usr/include/linux/sched.h \
/usr/include/linux/head.h /usr/include/linux/fs.h /usr/include/linux/limits.h \
/usr/include/linux/wait.h /usr/include/linux/types.h /usr/include/linux/dirent.h \
/usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
/usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
/usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h \
/usr/include/linux/kernel.h /usr/include/linux/signal.h /usr/include/linux/time.h \
/usr/include/linux/param.h /usr/include/linux/resource.h /usr/include/linux/vm86.h \
/usr/include/linux/msdos_fs.h /usr/include/linux/errno.h /usr/include/linux/fcntl.h \
/usr/include/linux/stat.h
inode.o : inode.c /usr/include/linux/msdos_fs.h /usr/include/linux/fs.h /usr/include/linux/limits.h \
/usr/include/linux/wait.h /usr/include/linux/types.h /usr/include/linux/dirent.h \
/usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
/usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
/usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/kernel.h \
/usr/include/linux/sched.h /usr/include/linux/head.h /usr/include/linux/mm.h \
/usr/include/linux/signal.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/errno.h \
/usr/include/linux/string.h /usr/include/linux/stat.h /usr/include/asm/segment.h
misc.o : misc.c /usr/include/linux/msdos_fs.h /usr/include/linux/fs.h /usr/include/linux/limits.h \
/usr/include/linux/wait.h /usr/include/linux/types.h /usr/include/linux/dirent.h \
/usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
/usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
/usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/sched.h \
/usr/include/linux/head.h /usr/include/linux/mm.h /usr/include/linux/kernel.h \
/usr/include/linux/signal.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/errno.h \
/usr/include/linux/string.h /usr/include/linux/stat.h
namei.o : namei.c /usr/include/asm/segment.h /usr/include/linux/sched.h /usr/include/linux/head.h \
/usr/include/linux/fs.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
/usr/include/linux/types.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h /usr/include/linux/kernel.h \
/usr/include/linux/signal.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/msdos_fs.h \
/usr/include/linux/errno.h /usr/include/linux/string.h /usr/include/linux/stat.h
This diff is collapsed.
......@@ -125,7 +125,7 @@ static struct super_block * read_super(int dev,char *name,int flags,void *data)
check_disk_change(dev);
if (s = get_super(dev))
return s;
if (!(type=get_fs_type(name))) {
if (!(type = get_fs_type(name))) {
printk("get fs type failed %s\n",name);
return NULL;
}
......@@ -137,13 +137,15 @@ static struct super_block * read_super(int dev,char *name,int flags,void *data)
}
s->s_dev = dev;
s->s_flags = flags;
if (!type->read_super(s,data))
return(NULL);
if (!type->read_super(s,data)) {
s->s_dev = 0;
return NULL;
}
s->s_dev = dev;
s->s_covered = NULL;
s->s_rd_only = 0;
s->s_dirt = 0;
return(s);
return s;
}
static int do_umount(int dev)
......
......@@ -15,7 +15,7 @@
#ifdef SLOW_IO_BY_JUMPING
#define __SLOW_DOWN_IO __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:")
#else
#define __SLOW_DOWN_IO __asm__ __volatile__("inb $0x80,%%al":::"ax")
#define __SLOW_DOWN_IO __asm__ __volatile__("inb $0x61,%%al":::"ax")
#endif
#ifdef REALLY_SLOW_IO
......
#ifndef _CONST_H
#define _CONST_H
#define BUFFER_END 0x200000
#define I_TYPE 0170000
#define I_DIRECTORY 0040000
#define I_REGULAR 0100000
#define I_BLOCK_SPECIAL 0060000
#define I_CHAR_SPECIAL 0020000
#define I_NAMED_PIPE 0010000
#define I_SET_UID_BIT 0004000
#define I_SET_GID_BIT 0002000
#endif
#define UTS_RELEASE "0.97-11"
#define UTS_RELEASE "0.97.pl2-44"
#define UTS_VERSION "08/01/92"
#define UTS_VERSION "08/23/92"
/*
* include/linux/serial.h
*
* Copyright (C) 1992 by Theodore Ts'o.
*
* Redistribution of this file is permitted under the terms of the GNU
* Public License (GPL)
*/
/*
* This our internal structure for keeping track of interrupt service
* routines.
*/
typedef struct struct_ISR *async_ISR;
struct struct_ISR {
int irq; /* The IRQ assigned for this device */
int port; /* The base port for this device */
/* (use is ISR specific) */
void (*ISR_proc)(async_ISR, int);
int line; /* The serial line (or base */
/* serial line) */
int refcnt; /* How many devices are depending on */
/* this interrupt (multiport boards) */
async_ISR next_ISR; /* For the linked list */
async_ISR prev_ISR;
};
/*
* This is our internal structure for each serial port's state.
*
* Many fields are paralleled by the structure used by the serial_struct
* structure.
*
* For definitions of the flags field, see tty.h
*/
struct async_struct {
int baud_base;
int port;
async_ISR ISR;
int flags;
int type;
struct tty_struct *tty;
unsigned long timer;
int timeout;
int xmit_fifo_size;
int custom_divisor;
int line;
};
/*
* These are the UART port assignments, expressed as offsets from the base
* register. These assignments should hold for any serial port based on
* a 8250, 16450, or 16550(A).
*/
#define UART_RX 0 /* In: Receive buffer (DLAB=0) */
#define UART_TX 0 /* Out: Transmit buffer (DLAB=0) */
#define UART_DLL 0 /* Out: Devisor Latch Low (DLAB=1) */
#define UART_DLM 1 /* Out: Devisor Latch High (DLAB=1) */
#define UART_IER 1 /* Out: Interrupt Enable Register */
#define UART_IIR 2 /* In: Interrupt ID Register */
#define UART_FCR 2 /* Out: FIFO Control Register */
#define UART_LCR 3 /* Out: Line Control Register */
#define UART_MCR 4 /* Out: Modem Control Register */
#define UART_LSR 5 /* In: Line Status Register */
#define UART_MSR 6 /* In: Modem Status Register */
#define UART_SCR 7 /* I/O: Scratch Register */
/*
* These are the definitions for the FIFO Control Register
*/
#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
#define UART_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range */
#define UART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
#define UART_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */
#define UART_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */
#define UART_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */
#define UART_FCR_CLEAR_CMD (UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT)
#define UART_FCR_SETUP_CMD (UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_14)
/*
* These are the definitions for the Line Control Register
*
* Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting
* UART_LCR_STOP will select 1.5 stop bits, not 2 stop bits.
*/
#define UART_LCR_DLAB 0x80 /* Devisor latch access bit */
#define UART_LCR_SBC 0x40 /* Set break control */
#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
#define UART_LCR_EPAR 0x10 /* Even paraity select */
#define UART_LCR_PARITY 0x08 /* Parity Enable */
#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
/*
* These are the definitions for the Line Status Register
*/
#define UART_LSR_TEMT 0x40 /* Transmitter empty */
#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
#define UART_LSR_BI 0x10 /* Break interrupt indicator */
#define UART_LSR_FE 0x08 /* Frame error indicator */
#define UART_LSR_PE 0x04 /* Parity error indicator */
#define UART_LSR_OE 0x02 /* Overrun error indicator */
#define UART_LSR_DR 0x01 /* Receiver data ready */
/*
* These are the definitions for the Interrupt Indentification Register
*/
#define UART_IIR_PEND 0x01 /* Interrupt pending */
#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
#define UART_IIR_MSI 0x00 /* Modem status interrupt */
#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
/*
* These are the definitions for the Interrupt Enable Register
*/
#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
/*
* These are the definitions for the Modem Control Register
*/
#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
#define UART_MCR_OUT2 0x08 /* Out2 complement */
#define UART_MCR_OUT1 0x04 /* Out1 complement */
#define UART_MCR_RTS 0x02 /* RTS complement */
#define UART_MCR_DTR 0x01 /* DTR complement */
/*
* These are the definitions for the Modem Status Register
*/
#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
#define UART_MSR_RI 0x40 /* Ring Indicator */
#define UART_MSR_DSR 0x20 /* Data Set Ready */
#define UART_MSR_CTS 0x10 /* Clear to Send */
#define UART_MSR_DDCD 0x08 /* Delta DCD */
#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
#define UART_MSR_DDSR 0x02 /* Delta DSR */
#define UART_MSR_DCTS 0x01 /* Delta CTS */
......@@ -13,10 +13,8 @@
*
* BEEP_TIMER console beep timer
*
* SERx_TIMER serial incoming characters timer
*
* SERx_TIMEOUT timeout for serial writes
*
* RS_TIMER timer for the RS-232 ports
*
* HD_TIMER harddisk timer
*
* FLOPPY_TIMER floppy disk timer (not used right now)
......@@ -28,16 +26,7 @@
#define BLANK_TIMER 0
#define BEEP_TIMER 1
#define SER1_TIMER 2
#define SER2_TIMER 3
#define SER3_TIMER 4
#define SER4_TIMER 5
#define SER1_TIMEOUT 8
#define SER2_TIMEOUT 9
#define SER3_TIMEOUT 10
#define SER4_TIMEOUT 11
#define RS_TIMER 2
#define HD_TIMER 16
#define FLOPPY_TIMER 17
......
......@@ -3,10 +3,6 @@
/*
* 'tty.h' defines some structures used by tty_io.c and some defines.
*
* NOTE! Don't touch this without checking that nothing in rs_io.s or
* con_io.s breaks. Some constants are hardwired into the system (mainly
* offsets into 'tty_queue'
*/
#include <linux/termios.h>
......@@ -14,8 +10,6 @@
#include <asm/system.h>
#define NR_CONSOLES 8
#define NR_SERIALS 4
#define NR_PTYS 4
/*
* These are set up by the setup-routine at boot-time:
......@@ -58,7 +52,13 @@ extern struct screen_info screen_info;
*/
#define __DISABLED_CHAR '\0'
#define TTY_BUF_SIZE 2048
/*
* See comment for the tty_struct structure before changing
* TTY_BUF_SIZE. Actually, there should be different sized tty_queue
* structures for different purposes. 1024 bytes for the transmit
* queue is way overkill. TYT, 9/14/92
*/
#define TTY_BUF_SIZE 1024 /* Must be a power of 2 */
struct tty_queue {
unsigned long data;
......@@ -69,11 +69,14 @@ struct tty_queue {
};
struct serial_struct {
unsigned short type;
unsigned short line;
unsigned short port;
unsigned short irq;
struct tty_struct * tty;
int type;
int line;
int port;
int irq;
int flags;
int xmit_fifo_size;
int custom_divisor;
int reserved[8];
};
/*
......@@ -85,6 +88,17 @@ struct serial_struct {
#define PORT_16550 3
#define PORT_16550A 4
/*
* Definitions for async_struct (and serial_struct) flags field
*/
#define ASYNC_NOSCRATCH 0x0001 /* 16XXX UART with no scratch register */
#define ASYNC_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */
#define ASYNC_SPD_MASK 0x0030
#define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */
#define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */
#define ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */
#define IS_A_CONSOLE(min) (((min) & 0xC0) == 0x00)
#define IS_A_SERIAL(min) (((min) & 0xC0) == 0x40)
#define IS_A_PTY(min) ((min) & 0x80)
......@@ -92,6 +106,9 @@ struct serial_struct {
#define IS_A_PTY_SLAVE(min) (((min) & 0xC0) == 0xC0)
#define PTY_OTHER(min) ((min) ^ 0x40)
#define SL_TO_DEV(line) ((line) | 0x40)
#define DEV_TO_SL(min) ((min) & 0x3F)
#define INC(a) ((a) = ((a)+1) & (TTY_BUF_SIZE-1))
#define DEC(a) ((a) = ((a)-1) & (TTY_BUF_SIZE-1))
#define EMPTY(a) ((a)->head == (a)->tail)
......@@ -103,18 +120,18 @@ struct serial_struct {
extern void put_tty_queue(char c, struct tty_queue * queue);
extern int get_tty_queue(struct tty_queue * queue);
#define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR])
#define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT])
#define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE])
#define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL])
#define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF])
#define START_CHAR(tty) ((tty)->termios.c_cc[VSTART])
#define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP])
#define SUSPEND_CHAR(tty) ((tty)->termios.c_cc[VSUSP])
#define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR])
#define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT])
#define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE])
#define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL])
#define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF])
#define START_CHAR(tty) ((tty)->termios->c_cc[VSTART])
#define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP])
#define SUSPEND_CHAR(tty) ((tty)->termios->c_cc[VSUSP])
#define _L_FLAG(tty,f) ((tty)->termios.c_lflag & f)
#define _I_FLAG(tty,f) ((tty)->termios.c_iflag & f)
#define _O_FLAG(tty,f) ((tty)->termios.c_oflag & f)
#define _L_FLAG(tty,f) ((tty)->termios->c_lflag & f)
#define _I_FLAG(tty,f) ((tty)->termios->c_iflag & f)
#define _O_FLAG(tty,f) ((tty)->termios->c_oflag & f)
#define L_CANON(tty) _L_FLAG((tty),ICANON)
#define L_ISIG(tty) _L_FLAG((tty),ISIG)
......@@ -139,36 +156,90 @@ extern int get_tty_queue(struct tty_queue * queue);
#define O_NLRET(tty) _O_FLAG((tty),ONLRET)
#define O_LCUC(tty) _O_FLAG((tty),OLCUC)
#define C_SPEED(tty) ((tty)->termios.c_cflag & CBAUD)
#define C_SPEED(tty) ((tty)->termios->c_cflag & CBAUD)
#define C_HUP(tty) (C_SPEED((tty)) == B0)
/*
* Where all of the state associated with a tty is kept while the tty
* is open. Since the termios state should be kept even if the tty
* has been closed --- for things like the baud rate, etc --- it is
* not stored here, but rather a pointer to the real state is stored
* here. Possible the winsize structure should have the same
* treatment, but (1) the default 80x24 is usually right and (2) it's
* most often used by a windowing system, which will set the correct
* size each time the window is created or resized anyway.
* IMPORTANT: since this structure is dynamically allocated, it must
* be no larger than 4096 bytes. Changing TTY_BUF_SIZE will change
* the size of this structure, and it needs to be done with care.
* - TYT, 9/14/92
*/
struct tty_struct {
struct termios termios;
struct termios *termios;
int pgrp;
int session;
unsigned char stopped:1, status_changed:1, packet:1;
unsigned char ctrl_status;
short unused; /* make everything a multiple of 4. */
short line;
int flags;
int count;
struct winsize winsize;
int (*open)(struct tty_struct * tty, struct file * filp);
void (*close)(struct tty_struct * tty, struct file * filp);
void (*write)(struct tty_struct * tty);
int (*ioctl)(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned int arg);
void (*throttle)(struct tty_struct * tty, int status);
struct tty_struct *link;
struct tty_queue *read_q;
struct tty_queue *write_q;
struct tty_queue *secondary;
struct tty_queue read_q;
struct tty_queue write_q;
struct tty_queue secondary;
};
/*
* These are the different types of thottle status which can be sent
* to the low-level tty driver. The tty_io.c layer is responsible for
* notifying the low-level tty driver of the following conditions:
* secondary queue full, secondary queue available, and read queue
* available. The low-level driver must send the read queue full
* command to itself, if it is interested in that condition.
*
* Note that the low-level tty driver may elect to ignore one or both
* of these conditions; normally, however, it will use ^S/^Q or some
* sort of hardware flow control to regulate the input to try to avoid
* overflow. While the low-level driver is responsible for all
* receiving flow control, note that the ^S/^Q handling (but not
* hardware flow control) is handled by the upper layer, in
* copy_to_cooked.
*/
#define TTY_THROTTLE_SQ_FULL 1
#define TTY_THROTTLE_SQ_AVAIL 2
#define TTY_THROTTLE_RQ_FULL 3
#define TTY_THROTTLE_RQ_AVAIL 4
/*
* This defines the low- and high-watermarks for the various conditions.
* Again, the low-level driver is free to ignore any of these, and has
* to implement RQ_THREHOLD_LW for itself if it wants it.
*/
#define SQ_THRESHOLD_LW 0
#define SQ_THRESHOLD_HW 768
#define RQ_THRESHOLD_LW 64
#define RQ_THRESHOLD_HW 768
/*
* so that interrupts won't be able to mess up the
* queues, copy_to_cooked must be atomic with repect
* to itself, as must tty->write. These are the flag
* bit-numbers. Use the set_bit() and clear_bit()
* macros to make it all atomic.
*
* These bits are used in the flags field of the tty structure.
*/
#define TTY_WRITE_BUSY 0
#define TTY_READ_BUSY 1
#define TTY_CR_PENDING 2
#define TTY_SQ_THROTTLED 3
#define TTY_RQ_THROTTLED 4
/*
* These have to be done with inline assembly: that way the bit-setting
......@@ -199,16 +270,15 @@ extern inline int clear_bit(int nr, int * addr)
extern void tty_write_flush(struct tty_struct *);
extern void tty_read_flush(struct tty_struct *);
extern struct tty_struct tty_table[];
extern struct serial_struct serial_table[];
extern struct tty_struct *tty_table[];
extern struct tty_struct * redirect;
extern int fg_console;
extern unsigned long video_num_columns;
extern unsigned long video_num_lines;
extern struct wait_queue * keypress_wait;
#define TTY_TABLE(nr) \
(tty_table + ((nr) ? (((nr) < 64)? (nr)-1:(nr)) : fg_console))
#define TTY_TABLE_IDX(nr) ((nr) ? (nr) : (fg_console+1))
#define TTY_TABLE(nr) (tty_table[TTY_TABLE_IDX(nr)])
/* intr=^C quit=^| erase=del kill=^U
eof=^D vtime=\0 vmin=\1 sxtc=\0
......@@ -243,24 +313,23 @@ extern void spty_write(struct tty_struct * tty);
/* serial.c */
extern int serial_open(unsigned int line, struct file * filp);
extern void serial_close(unsigned int line, struct file * filp);
extern int rs_open(struct tty_struct * tty, struct file * filp);
extern void change_speed(unsigned int line);
extern void send_break(unsigned int line);
extern int get_serial_info(unsigned int, struct serial_struct *);
extern int set_serial_info(unsigned int, struct serial_struct *);
extern int get_modem_info(unsigned int, unsigned int *);
extern int set_modem_info(unsigned int, unsigned int, unsigned int *);
/* pty.c */
extern int pty_open(unsigned int dev, struct file * filp);
extern void pty_close(unsigned int dev, struct file * filp);
extern int pty_open(struct tty_struct * tty, struct file * filp);
/* console.c */
void update_screen(int new_console);
void blank_screen(void);
void unblank_screen(void);
extern int con_open(struct tty_struct * tty, struct file * filp);
extern void update_screen(int new_console);
extern void blank_screen(void);
extern void unblank_screen(void);
/* vt.c */
extern int vt_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned int arg);
#endif
#ifndef _STDARG_H
#define _STDARG_H
typedef char *va_list;
/* Amount of space required in an argument list for an arg of type TYPE.
TYPE may alternatively be an expression whose type is used. */
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#ifndef __sparc__
#define va_start(AP, LASTARG) \
(AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
#else
#define va_start(AP, LASTARG) \
(__builtin_saveregs (), \
AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
#endif
void va_end (va_list); /* Defined in gnulib */
#define va_end(AP)
#define va_arg(AP, TYPE) \
(AP += __va_rounded_size (TYPE), \
*((TYPE *) (AP - __va_rounded_size (TYPE))))
#endif /* _STDARG_H */
#ifndef _KD_H
#define _KD_H
/* 0x4B is 'K', to avoid collision with termios and vt */
#define SWAPMONO 0x4B00 /* use mca as output device */
#define SWAPCGA 0x4B01 /* use cga as output device */
#define SWAPEGA 0x4B02 /* use ega as output device */
#define SWAPVGA 0x4B03 /* use vga as output device */
#define CONS_CURRENT 0x4B04 /* return current output device */
#define MONO 0x01
#define CGA 0x02
#define EGA 0x03
#define SW_B40x25 0x4B05 /* 40x25 mono text (cga/ega) */
#define SW_C40x25 0x4B06 /* 40x24 color text (cga/ega) */
#define SW_B80x25 0x4B07 /* 80x25 mono text (cga/ega) */
#define SW_C80x25 0x4B08 /* 80x25 color text (cga/ega) */
#define SW_BG320 0x4B09 /* 320x200 mono graphics (cga/ega) */
#define SW_CG320 0x4B0A /* 320x200 color graphics (cga/ega) */
#define SW_BG640 0x4B0B /* 640x200 mono graphics (cga/ega) */
#define SW_CG320_D 0x4B0C /* 320x200 graphics (ega mode d) */
#define SW_CG640_E 0x4B0D /* 640x200 graphics (ega mode e) */
#define SW_EGAMONOAPA 0x4B0E /* 640x350 graphics (ega mode f) */
#define SW_ENH_MONOAPA2 0x4B0F /* 640x350 graphics extd mem (ega mode f*) */
#define SW_CG640x350 0x4B10 /* 640x350 graphics (ega mode 10) */
#define SW_ENH_CG640 0x4B11 /* 640x350 graphics extd mem (ega mode 10*) */
#define SW_EGAMONO80x25 0x4B12 /* 80x25 mono text (ega mode 7) */
#define SW_ENHB40x25 0x4B13 /* enhanced 40x25 mono text (ega) */
#define SW_ENHC40x25 0x4B14 /* enhanced 40x25 color text (ega) */
#define SW_ENHB80x25 0x4B15 /* enhanced 80x25 mono text (ega) */
#define SW_ENHC80x25 0x4B16 /* enhanced 80x25 color text (ega) */
#define SW_ENHB80x43 0x4B17 /* enhanced 80x43 mono text (ega) */
#define SW_ENHC80x43 0x4B18 /* enhanced 80x43 color text (ega) */
#define SW_MCAMODE 0x4B19 /* reinit mca */
#define SW_ATT640 0x4B1A /* 640x400 16color */
/* should add more vga modes, etc */
#define CONS_GET 0x4B1B /* get current display mode */
#define M_B40x25 0 /* 40x25 mono (cga/ega) */
#define M_C40x25 1 /* 40x25 color (cga/ega) */
#define M_B80x25 2 /* 80x25 mono (cga/ega) */
#define M_C80x25 3 /* 80x25 color (cga/ega) */
#define M_BG320 4 /* 320x200 mono (cga/ega) */
#define M_CG320 5 /* 320x200 color (cga/ega) */
#define M_BG640 6 /* 640x200 mono (cga/ega) */
#define M_EGAMONO80x25 7 /* 80x25 mono (ega) */
#define M_CG320_D 13 /* ega mode d */
#define M_CG640_E 14 /* ega mode e */
#define M_EFAMONOAPA 15 /* ega mode f */
#define M_CG640x350 16 /* ega mode 10 */
#define M_ENHMONOAPA2 17 /* ega mode f with ext mem */
#define M_ENH_CG640 18 /* ega mode 10* */
#define M_ENH_B40x25 19 /* ega enh 40x25 mono */
#define M_ENH_C40x25 20 /* ega enh 40x25 color */
#define M_ENH_B80x25 21 /* ega enh 80x25 mono */
#define M_ENH_C80x25 22 /* ega enh 80x25 color */
#define M_ENH_B80x43 0x70 /* ega enh 80x43 mono */
#define M_ENH_C80x43 0x71 /* ega enh 80x43 color */
#define M_MCA_MODE 0xff /* monochrome adapter mode */
#define MCA_GET 0x4B1C /* get mca display mode */
#define CGA_GET 0x4B1D /* get cga display mode */
#define EGA_GET 0x4B1E /* get ega display mode */
#define MAPCONS 0x4B1F /* map current video mem into address space */
#define MAPMONO 0x4B20 /* map mca video mem into address space */
#define MAPCGA 0x4B21 /* map cga video mem into address space */
#define MAPEGA 0x4B22 /* map ega video mem into address space */
#define MAPVGA 0x4B23 /* map vga video mem into address space */
struct port_io_struc {
char dir; /* direction in vs out */
unsigned short port;
char data;
};
#define IN_ON_PORT 0x00
#define OUT_ON_PORT 0x01
struct port_io_arg {
struct port_io_struc args[4];
};
#define MCAIO 0x4B24 /* i/o to mca video board */
#define CGAIO 0x4B25 /* i/o to cga video board */
#define EGAIO 0x4B26 /* i/o to ega video board */
#define VGAIO 0x4B27 /* i/o to vga video board */
#define GIO_FONT8x8 0x4B28 /* gets current 8x8 font used */
#define PIO_FONT8x8 0x4B29 /* use supplied 8x8 font */
#define GIO_FONT8x14 0x4B2A /* gets current 8x14 font used */
#define PIO_FONT8x14 0x4B2B /* use supplied 8x14 font */
#define GIO_FONT8x16 0x4B2C /* gets current 8x16 font used */
#define PIO_FONT8x16 0x4B2D /* use supplied 8x16 font */
#define MKDIOADDR 32 /* io bitmap size from <linux/sched.h> */
struct kd_disparam {
long type; /* type of display */
char *addr; /* display mem address */
ushort ioaddr[MKDIOADDR]; /* valid i/o addresses */
};
#define KDDISPTYPE 0x4B2E /* gets display info */
#define KD_MONO 0x01
#define KD_HERCULES 0x02
#define KD_CGA 0x03
#define KD_EGA 0x04
#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
#define KDMKTONE 0x4B30 /* generate tone */
#define KDGETLED 0x4B31 /* return current led flags */
#define KDSETLED 0x4B32 /* set current led flags */
#define LED_SCR 0x01 /* scroll lock */
#define LED_CAP 0x04 /* caps lock */
#define LED_NUM 0x02 /* num lock */
#define KDGKBTYPE 0x4B33 /* get keyboard type */
#define KB_84 0x01
#define KB_101 0x02
#define KB_OTHER 0x03
#define KDADDIO 0x4B34 /* add i/o port as valid */
#define KDDELIO 0x4B35 /* del i/o port as valid */
#define KDENABIO 0x4B36 /* enable i/o to video board */
#define KDDISABIO 0x4B37 /* disable i/o to video board */
struct kd_quemode {
int qsize; /* desired # elem in queue */
int signo; /* signal to send when queue not empty */
char *qaddr; /* user virt addr of queue */
};
#define KDQUEMODE 0x4B38 /* enable/disable special queue mode */
#define KDSBORDER 0x4B39 /* set screen boarder in ega text mode */
#define KDSETMODE 0x4B3A /* set text/grahics mode */
#define KD_TEXT 0x00
#define KD_GRAPHICS 0x01
#define KD_TEXT0 0x02 /* ? */
#define KD_TEXT1 0x03 /* ? */
#define KDGETMODE 0x4B3B /* get current mode */
struct kd_memloc {
char *vaddr; /* virt addr to map to */
char *physaddr; /* phys addr to map from */
long length; /* number of bytes */
long ioflg; /* enable i/o if set */
};
#define KDMAPDISP 0x4B3C /* map display into address space */
#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
#define KDVDCTYPE 0x4B3E /* return vdc controller/display info */
#define KIOCINFO 0x4B3F /* tell what the device is */
typedef char scrnmap_t;
#define E_TABSZ 256
#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
#define GIO_ATTR 0x4B42 /* get screen attributes */
#define GIO_COLOR 0x4B43 /* return nonzero if display is color */
#define K_RAW 0x00
#define K_XLATE 0x01
#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
struct kbentry {
u_char kb_table;
u_char kb_index;
u_char kb_value;
};
#define K_NORMTAB 0x00
#define K_SHIFTTAB 0x01
#define K_ALTTAB 0x02
#define K_ALTSHIFTTAB 0x03
#define K_SRQTAB 0x04
#define KDGKBENT 0x4B46 /* gets one entry in translation table */
#define KDSKBENT 0x4B47 /* sets one entry in translation table */
#endif /* _KD_H */
#ifndef _MMAN_H
#define _MMAN_H
#define PROT_READ 0x1 /* page can be read */
#define PROT_WRITE 0x2 /* page can be written */
#define PROT_EXEC 0x4 /* page can be executed */
#define PROT_NONE 0x0 /* page can not be accessed */
#define MAP_SHARED 1 /* Share changes */
#define MAP_PRIVATE 2 /* Changes are private */
#define MAP_TYPE 0xf /* Mask for type of mapping */
#define MAP_FIXED 0x10 /* Interpret addr exactly */
extern caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd,
off_t off);
extern int munmap(caddr_t addr, size_t len);
#endif /* _MMAN_H */
#ifndef _VT_H
#define _VT_H
/* 0x56 is 'V', to avoid collision with termios and kd */
#define VT_OPENQRY 0x5600 /* find available vt */
struct vt_mode {
char mode; /* vt mode */
char waitv; /* if set, hang on writes if not active */
short relsig; /* signal to raise on release req */
short acqsig; /* signal to raise on acquisition */
short frsig; /* unused (set to 0) */
};
#define VT_GETMODE 0x5601 /* get mode of active vt */
#define VT_SETMODE 0x5602 /* set mode of active vt */
#define VT_AUTO 0x00 /* auto vt switching */
#define VT_PROCESS 0x01 /* process controls switching */
struct vt_stat {
ushort v_active; /* active vt */
ushort v_signal; /* signal to send */
ushort v_state; /* vt bitmask */
};
#define VT_GETSTATE 0x5603 /* get global vt state info */
#define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
#define VT_RELDISP 0x5605 /* release display */
#define VT_ACTIVATE 0x5606 /* make vt active */
#endif /* _VT_H */
#ifndef _TIME_H
#define _TIME_H
#ifndef _TIME_T
#define _TIME_T
typedef long time_t;
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t;
#endif
#ifndef NULL
#define NULL ((void *) 0)
#endif
#define CLOCKS_PER_SEC 100
#ifndef _CLOCK_T
#define _CLOCK_T
typedef long clock_t;
#endif
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
#define __isleap(year) \
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
#ifdef __cplusplus
extern "C" {
#endif
clock_t clock(void);
time_t time(time_t * tp);
double difftime(time_t time2, time_t time1);
time_t mktime(struct tm * tp);
char * asctime(const struct tm * tp);
char * ctime(const time_t * tp);
struct tm * gmtime(const time_t *tp);
struct tm *localtime(const time_t * tp);
size_t strftime(char * s, size_t smax, const char * fmt, const struct tm * tp);
void tzset(void);
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
......@@ -44,43 +44,41 @@ dep:
dummy:
### Dependencies:
floppy.o : floppy.c /usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h \
/usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h \
/usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h \
/usr/src/linux/include/linux/minix_fs_sb.h /usr/src/linux/include/linux/ext_fs_sb.h \
/usr/src/linux/include/linux/msdos_fs_sb.h /usr/src/linux/include/linux/mm.h \
/usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/timer.h /usr/src/linux/include/linux/fdreg.h /usr/src/linux/include/linux/fd.h \
/usr/src/linux/include/linux/errno.h /usr/src/linux/include/asm/system.h /usr/src/linux/include/asm/io.h \
/usr/src/linux/include/asm/segment.h blk.h
genhd.o : genhd.c /usr/src/linux/include/linux/config.h /usr/src/linux/include/linux/config_rel.h \
/usr/src/linux/include/linux/config_ver.h /usr/src/linux/include/linux/config.dist.h \
/usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h \
/usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h \
/usr/src/linux/include/linux/minix_fs_sb.h /usr/src/linux/include/linux/ext_fs_sb.h \
/usr/src/linux/include/linux/msdos_fs_sb.h /usr/src/linux/include/linux/genhd.h \
/usr/src/linux/include/linux/kernel.h
hd.o : hd.c /usr/src/linux/include/linux/config.h /usr/src/linux/include/linux/config_rel.h \
/usr/src/linux/include/linux/config_ver.h /usr/src/linux/include/linux/config.dist.h \
/usr/src/linux/include/linux/errno.h /usr/src/linux/include/linux/signal.h /usr/src/linux/include/linux/sched.h \
/usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h \
/usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h \
/usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/time.h \
/usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/timer.h /usr/src/linux/include/linux/hdreg.h /usr/src/linux/include/linux/genhd.h \
/usr/src/linux/include/asm/system.h /usr/src/linux/include/asm/io.h /usr/src/linux/include/asm/segment.h \
floppy.o : floppy.c /usr/include/linux/sched.h /usr/include/linux/head.h /usr/include/linux/fs.h \
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/types.h \
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h \
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h \
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
/usr/include/linux/mm.h /usr/include/linux/kernel.h /usr/include/linux/signal.h \
/usr/include/linux/time.h /usr/include/linux/param.h /usr/include/linux/resource.h \
/usr/include/linux/vm86.h /usr/include/linux/timer.h /usr/include/linux/fdreg.h \
/usr/include/linux/fd.h /usr/include/linux/errno.h /usr/include/asm/system.h \
/usr/include/asm/io.h /usr/include/asm/segment.h blk.h
genhd.o : genhd.c /usr/include/linux/config.h /usr/include/linux/config.dist.h \
/usr/include/linux/fs.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
/usr/include/linux/types.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/genhd.h /usr/include/linux/kernel.h
hd.o : hd.c /usr/include/linux/config.h /usr/include/linux/config.dist.h /usr/include/linux/errno.h \
/usr/include/linux/signal.h /usr/include/linux/sched.h /usr/include/linux/head.h \
/usr/include/linux/fs.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
/usr/include/linux/types.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h /usr/include/linux/kernel.h \
/usr/include/linux/time.h /usr/include/linux/param.h /usr/include/linux/resource.h \
/usr/include/linux/vm86.h /usr/include/linux/timer.h /usr/include/linux/hdreg.h \
/usr/include/linux/genhd.h /usr/include/asm/system.h /usr/include/asm/io.h /usr/include/asm/segment.h \
blk.h
ll_rw_blk.o : ll_rw_blk.c /usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h \
/usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h \
/usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h \
/usr/src/linux/include/linux/minix_fs_sb.h /usr/src/linux/include/linux/ext_fs_sb.h \
/usr/src/linux/include/linux/msdos_fs_sb.h /usr/src/linux/include/linux/mm.h \
/usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/linux/time.h /usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/errno.h /usr/src/linux/include/linux/string.h /usr/src/linux/include/asm/system.h \
blk.h
ramdisk.o : ramdisk.c /usr/src/linux/include/linux/config.h /usr/src/linux/include/linux/config_rel.h \
/usr/src/linux/include/linux/config_ver.h /usr/src/linux/include/linux/config.dist.h
ll_rw_blk.o : ll_rw_blk.c /usr/include/linux/sched.h /usr/include/linux/head.h \
/usr/include/linux/fs.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
/usr/include/linux/types.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h /usr/include/linux/kernel.h \
/usr/include/linux/signal.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/errno.h \
/usr/include/linux/string.h /usr/include/linux/config.h /usr/include/linux/config.dist.h \
/usr/include/asm/system.h blk.h
ramdisk.o : ramdisk.c /usr/include/linux/config.h /usr/include/linux/config.dist.h
......@@ -355,8 +355,8 @@ static void recal_intr(void)
*/
static void hd_times_out(void)
{
sti();
DEVICE_INTR = NULL;
sti();
reset = 1;
if (!CURRENT)
return;
......@@ -385,8 +385,9 @@ static void do_hd_request(void)
unsigned int sec,head,cyl,track;
unsigned int nsect;
if (DEVICE_INTR)
return;
repeat:
DEVICE_INTR = NULL;
timer_active &= ~(1<<HD_TIMER);
sti();
INIT_REQUEST;
......
This diff is collapsed.
......@@ -72,6 +72,18 @@ static int aha1542_out(unchar *cmdp, int len)
return 1;
}
static int aha1542_in(unchar *cmdp, int len)
{
while (len--)
{
WAIT(STATUS, DF, DF, 0);
*cmdp++ = inb(DATA);
}
return 0;
fail:
printk("aha1542_in failed(%d): ", len+1); aha1542_stat();
return 1;
}
int makecode(unsigned hosterr, unsigned scsierr)
{
switch (hosterr) {
......@@ -259,6 +271,7 @@ void aha1542_intr_handle(void)
int aha1542_queuecommand(unchar target, const void *cmnd, void *buff, int bufflen, void (*done)(int, int))
{
unchar ahacmd = CMD_START_SCSI;
unchar direction;
unchar *cmd = (unchar *) cmnd;
DEB(int i);
......@@ -289,12 +302,18 @@ int aha1542_queuecommand(unchar target, const void *cmnd, void *buff, int buffle
return 0; /* we are still testing, so *don't* write */
#endif
memset(&ccb, 0, sizeof ccb);
ccb.cdblen = (*cmd<=0x1f)?6:10; /* SCSI Command Descriptor Block Length */
direction = 0;
if (*cmd == READ_10 || *cmd == READ_6)
direction = 8;
else if (*cmd == WRITE_10 || *cmd == WRITE_6)
direction = 16;
memcpy(ccb.cdb, cmd, ccb.cdblen);
ccb.op = 0; /* SCSI Initiator Command */
ccb.idlun = (target&7)<<5; /* SCSI Target Id */
ccb.idlun = (target&7)<<5 | direction; /* SCSI Target Id */
ccb.rsalen = 12;
any2scsi(ccb.datalen, bufflen);
any2scsi(ccb.dataptr, buff);
......@@ -369,6 +388,28 @@ void call_buh()
set_intr_gate(0x2b,&aha1542_interrupt);
}
/* Query the board to find out if it is a 1542 or a 1740, or whatever. */
static void aha1542_query()
{
static unchar inquiry_cmd[] = {CMD_INQUIRY };
static unchar inquiry_result[4];
int i;
i = inb(STATUS);
if (i & DF) {
i = inb(DATA);
printk("Stale data:%x ");
};
aha1542_out(inquiry_cmd, 1);
aha1542_in(inquiry_result, 4);
WAIT(INTRFLAGS, INTRMASK, HACC, 0);
while (0) {
fail:
printk("aha1542_detect: query card type\n");
}
aha1542_intr_reset();
printk("Inquiry:");
for(i=0;i<4;i++) printk("%x ",inquiry_result[i]);
}
/* return non-zero on detection */
int aha1542_detect(int hostnum)
{
......@@ -397,6 +438,7 @@ int aha1542_detect(int hostnum)
}
aha1542_intr_reset();
}
aha1542_query();
DEB(aha1542_stat());
setup_mailboxes();
......
......@@ -627,6 +627,27 @@ static int check_sense (int host)
return SUGGEST_RETRY;
}
/* This function is the mid-level interrupt routine, which decides how
* to handle error conditions. Each invocation of this function must
* do one and *only* one of the following:
*
* (1) Call last_cmnd[host].done. This is done for fatal errors and
* normal completion, and indicates that the handling for this
* request is complete.
* (2) Call internal_cmnd to requeue the command. This will result in
* scsi_done being called again when the retry is complete.
* (3) Call scsi_request_sense. This asks the host adapter/drive for
* more information about the error condition. When the information
* is available, scsi_done will be called again.
* (4) Call reset(). This is sort of a last resort, and the idea is that
* this may kick things loose and get the drive working again. reset()
* automatically calls scsi_request_sense, and thus scsi_done will be
* called again once the reset is complete.
*
* If none of the above actions are taken, the drive in question
* will hang. If more than one of the above actions are taken by
* scsi_done, then unpredictable behavior will result.
*/
static void scsi_done (int host, int result)
{
int status=0;
......@@ -670,8 +691,11 @@ static void scsi_done (int host, int result)
internal_timeout[host] &= ~SENSE_TIMEOUT;
sti();
if (!(last_cmnd[host].flags & WAS_RESET))
if (!(last_cmnd[host].flags & WAS_RESET))
{
reset(host);
return;
}
else
{
exit = (DRIVER_HARD | SUGGEST_ABORT);
......@@ -768,9 +792,12 @@ static void scsi_done (int host, int result)
case RESERVATION_CONFLICT:
reset(host);
return;
#if 0
exit = DRIVER_SOFT | SUGGEST_ABORT;
status = MAYREDO;
break;
#endif
default:
printk ("Internal error %s %s \n"
"status byte = %d \n", __FILE__,
......@@ -839,11 +866,13 @@ static void scsi_done (int host, int result)
if ((++last_cmnd[host].retries) < last_cmnd[host].allowed)
{
if ((last_cmnd[host].retries >= (last_cmnd[host].allowed >> 1))
if ((last_cmnd[host].retries >= (last_cmnd[host].allowed >> 1))
&& !(last_cmnd[host].flags & WAS_RESET))
reset(host);
break;
{
reset(host);
break;
}
}
else
{
......
*** aha1542.c.~1~ Sat Sep 12 15:29:26 1992
--- aha1542.c Thu Sep 17 22:11:55 1992
***************
*** 72,77 ****
--- 72,90 ----
return 1;
}
+ static int aha1542_in(unchar *cmdp, int len)
+ {
+ while (len--)
+ {
+ WAIT(STATUS, DF, DF, 0);
+ *cmdp++ = inb(DATA);
+ }
+ return 0;
+ fail:
+ printk("aha1542_in failed(%d): ", len+1); aha1542_stat();
+ return 1;
+ }
+
int makecode(unsigned hosterr, unsigned scsierr)
{
switch (hosterr) {
***************
*** 259,264 ****
--- 272,278 ----
int aha1542_queuecommand(unchar target, const void *cmnd, void *buff, int bufflen, void (*done)(int, int))
{
unchar ahacmd = CMD_START_SCSI;
+ unchar direction;
unchar *cmd = (unchar *) cmnd;
DEB(int i);
***************
*** 292,300 ****
ccb.cdblen = (*cmd<=0x1f)?6:10; /* SCSI Command Descriptor Block Length */
memcpy(ccb.cdb, cmd, ccb.cdblen);
ccb.op = 0; /* SCSI Initiator Command */
! ccb.idlun = (target&7)<<5; /* SCSI Target Id */
ccb.rsalen = 12;
any2scsi(ccb.datalen, bufflen);
any2scsi(ccb.dataptr, buff);
--- 306,318 ----
ccb.cdblen = (*cmd<=0x1f)?6:10; /* SCSI Command Descriptor Block Length */
direction = 0;
if (*cmd == READ_10 || *cmd == READ_6) direction = 8;
else if (*cmd == WRITE_10 || *cmd == WRITE_6) direction = 16;
memcpy(ccb.cdb, cmd, ccb.cdblen);
ccb.op = 0; /* SCSI Initiator Command */
! ccb.idlun = (target&7)<<5 | direction; /* SCSI Target Id */
ccb.rsalen = 12;
any2scsi(ccb.datalen, bufflen);
any2scsi(ccb.dataptr, buff);
***************
*** 369,374 ****
--- 387,416 ----
set_intr_gate(0x2b,&aha1542_interrupt);
}
+
+ /* Query the board to find out if it is a 1542 or a 1740, or whatever. */
+ static void aha1542_query()
+ {
+ static unchar inquiry_cmd[] = {CMD_INQUIRY };
+ static unchar inquiry_result[4];
+ int i;
+ i = inb(STATUS);
+ if (i & DF) {
+ i = inb(DATA);
+ printk("Stale data:%x ");
+ };
+ aha1542_out(inquiry_cmd, 1);
+ aha1542_in(inquiry_result, 4);
+ WAIT(INTRFLAGS, INTRMASK, HACC, 0);
+ while (0) {
+ fail:
+ printk("aha1542_detect: query card type\n");
+ }
+ aha1542_intr_reset();
+ printk("Inquiry:");
+ for(i=0;i<4;i++) printk("%x ",inquiry_result[i]);
+ }
+
/* return non-zero on detection */
int aha1542_detect(int hostnum)
{
***************
*** 397,402 ****
--- 439,446 ----
}
aha1542_intr_reset();
}
+
+ aha1542_query();
DEB(aha1542_stat());
setup_mailboxes();
*** scsi.c.~1~ Sat Sep 12 15:29:26 1992
--- scsi.c Wed Sep 16 01:00:44 1992
***************
*** 671,677 ****
--- 671,680 ----
sti();
if (!(last_cmnd[host].flags & WAS_RESET))
+ {
reset(host);
+ return;
+ }
else
{
exit = (DRIVER_HARD | SUGGEST_ABORT);
***************
*** 768,773 ****
--- 771,777 ----
case RESERVATION_CONFLICT:
reset(host);
+ return;
exit = DRIVER_SOFT | SUGGEST_ABORT;
status = MAYREDO;
break;
***************
*** 841,848 ****
--- 845,854 ----
{
if ((last_cmnd[host].retries >= (last_cmnd[host].allowed >> 1))
&& !(last_cmnd[host].flags & WAS_RESET))
+ {
reset(host);
break;
+ };
}
else
*** sd.c.~1~ Sat Sep 12 15:29:26 1992
--- sd.c Thu Sep 17 23:04:40 1992
***************
*** 39,45 ****
int NR_SD=0;
Scsi_Disk rscsi_disks[MAX_SD];
static int sd_sizes[MAX_SD << 4] = {0, };
! static int this_count;
static int the_result;
static char sense_buffer[255];
--- 39,45 ----
int NR_SD=0;
Scsi_Disk rscsi_disks[MAX_SD];
static int sd_sizes[MAX_SD << 4] = {0, };
! static int this_count, total_count = 0;
static int the_result;
static char sense_buffer[255];
***************
*** 108,113 ****
--- 108,120 ----
if (!result) {
CURRENT->nr_sectors -= this_count;
+ total_count -= this_count;
+ if(total_count){
+ CURRENT->sector += this_count;
+ CURRENT->buffer += (this_count << 9);
+ do_sd_request();
+ return;
+ };
#ifdef DEBUG
printk("sd%d : %d sectors remain.\n", MINOR(CURRENT->dev), CURRENT->nr_sectors);
***************
*** 248,253 ****
--- 255,266 ----
this_count = CURRENT->nr_sectors;
else
this_count = (BLOCK_SIZE / 512);
+
+
+ /* This is a temporary hack for the AHA1742. */
+ if(total_count == 0)
+ total_count = this_count;
+ this_count = 1; /* Take only 512 bytes at a time */
#ifdef DEBUG
printk("sd%d : %s %d/%d 512 byte blocks.\n", MINOR(CURRENT->dev),
......@@ -39,7 +39,7 @@ struct hd_struct sd[MAX_SD << 4];
int NR_SD=0;
Scsi_Disk rscsi_disks[MAX_SD];
static int sd_sizes[MAX_SD << 4] = {0, };
static int this_count;
static int this_count, total_count = 0;
static int the_result;
static char sense_buffer[255];
......@@ -108,6 +108,13 @@ static void rw_intr (int host, int result)
if (!result) {
CURRENT->nr_sectors -= this_count;
total_count -= this_count;
if(total_count){
CURRENT->sector += this_count;
CURRENT->buffer += (this_count << 9);
do_sd_request();
return;
};
#ifdef DEBUG
printk("sd%d : %d sectors remain.\n", MINOR(CURRENT->dev), CURRENT->nr_sectors);
......@@ -248,6 +255,10 @@ static void do_sd_request (void)
this_count = CURRENT->nr_sectors;
else
this_count = (BLOCK_SIZE / 512);
/* This is a temporary hack for the AHA1742. */
if(total_count == 0)
total_count = this_count;
this_count = 1; /* Take only 512 bytes at a time */
#ifdef DEBUG
printk("sd%d : %s %d/%d 512 byte blocks.\n", MINOR(CURRENT->dev),
......
This diff is collapsed.
......@@ -7,9 +7,14 @@
/*
* console.c
*
* This module implements the console io functions
* This module exports the console io functions:
*
* 'long con_init(long)'
* 'void con_write(struct tty_queue * queue)'
* 'void con_open(struct tty_queue * queue, struct )'
* 'void update_screen(int new_console)'
* 'void blank_screen(void)'
* 'void unblank_screen(void)'
*
* Hopefully this will be a rather complete VT102 implementation.
*
* Beeping thanks to John T Kohl.
......@@ -55,6 +60,7 @@ extern void set_leds(void);
extern unsigned char kapplic;
extern unsigned char ckmode;
extern unsigned char krepeat;
extern unsigned char default_kleds;
extern unsigned char kleds;
extern unsigned char kmode;
extern unsigned char kraw;
......@@ -187,13 +193,6 @@ static int console_blanked = 0;
#define kbdleds (vt_cons[currcons].vc_kbdleds)
#define vtmode (vt_cons[currcons].vt_mode)
#if defined KBD_NUMERIC_LOCK
#define NUMLED_DEFAULT 0x02
#else
#define NUMLED_DEFAULT 0
#endif
#define SET(mode,fg,v) \
(mode) = (v); \
if (currcons == fg_console) \
......@@ -612,7 +611,7 @@ static inline void set_cursor(int currcons)
static void respond_string(char * p, int currcons, struct tty_struct * tty)
{
while (*p) {
put_tty_queue(*p,tty->read_q);
put_tty_queue(*p, &tty->read_q);
p++;
}
TTY_READ_FLUSH(tty);
......@@ -628,19 +627,19 @@ static void respond_num(unsigned int n, int currcons, struct tty_struct * tty)
n /= 10;
} while(n && i < 3); /* We'll take no chances */
while (i--) {
put_tty_queue(buff[i],tty->read_q);
put_tty_queue(buff[i], &tty->read_q);
}
/* caller must flush */
}
static void cursor_report(int currcons, struct tty_struct * tty)
{
put_tty_queue('\033', tty->read_q);
put_tty_queue('[', tty->read_q);
put_tty_queue('\033', &tty->read_q);
put_tty_queue('[', &tty->read_q);
respond_num(y + (decom ? top+1 : 1), currcons, tty);
put_tty_queue(';', tty->read_q);
put_tty_queue(';', &tty->read_q);
respond_num(x+1, currcons, tty);
put_tty_queue('R', tty->read_q);
put_tty_queue('R', &tty->read_q);
TTY_READ_FLUSH(tty);
}
......@@ -873,7 +872,7 @@ static void reset_terminal(int currcons, int do_clear)
ckmode = 0;
kapplic = 0;
lfnlmode = 0;
kleds = NUMLED_DEFAULT;
kleds = default_kleds;
kmode = 0;
set_leds();
} else {
......@@ -881,7 +880,7 @@ static void reset_terminal(int currcons, int do_clear)
decckm = 0;
kbdapplic = 0;
lnm = 0;
kbdleds = NUMLED_DEFAULT;
kbdleds = default_kleds;
kbdmode = 0;
}
......@@ -906,13 +905,13 @@ void con_write(struct tty_struct * tty)
int c;
unsigned int currcons;
wake_up(&tty->write_q->proc_list);
currcons = tty - tty_table;
wake_up(&tty->write_q.proc_list);
currcons = tty->line - 1;
if (currcons >= NR_CONSOLES) {
printk("con_write: illegal tty\n\r");
printk("con_write: illegal tty (%d)\n", currcons);
return;
}
while (!tty->stopped && (c = get_tty_queue(tty->write_q)) >= 0) {
while (!tty->stopped && (c = get_tty_queue(&tty->write_q)) >= 0) {
if (state == ESnormal && translate[c]) {
if (need_wrap) {
cr(currcons);
......@@ -1507,3 +1506,14 @@ void console_print(const char * b)
timer_active |= 1<<BLANK_TIMER;
}
}
/*
* All we do is set the write and ioctl subroutines; later on maybe we'll
* dynamically allocate the console screen memory.
*/
int con_open(struct tty_struct *tty, struct file * filp)
{
tty->write = con_write;
tty->ioctl = vt_ioctl;
return 0;
}
This diff is collapsed.
......@@ -7,9 +7,9 @@
/*
* pty.c
*
* This module implements the pty functions
* void mpty_write(struct tty_struct * queue);
* void spty_write(struct tty_struct * queue);
* This module exports the following pty function:
*
* int pty_open(struct tty_struct * tty, struct file * filp);
*/
#include <linux/errno.h>
......@@ -20,31 +20,32 @@
#include <asm/system.h>
#include <asm/io.h>
int pty_open(unsigned int dev, struct file * filp)
{
struct tty_struct * tty;
static void pty_close(struct tty_struct * tty, struct file * filp);
tty = tty_table + dev;
if (!tty->link)
int pty_open(struct tty_struct *tty, struct file * filp)
{
if (!tty || !tty->link)
return -ENODEV;
wake_up(&tty->read_q->proc_list);
if (IS_A_PTY_MASTER(tty->line))
tty->write = mpty_write;
else
tty->write = spty_write;
tty->close = pty_close;
wake_up(&tty->read_q.proc_list);
if (filp->f_flags & O_NDELAY)
return 0;
while (!tty->link->count && !(current->signal & ~current->blocked))
interruptible_sleep_on(&tty->link->read_q->proc_list);
interruptible_sleep_on(&tty->link->read_q.proc_list);
if (!tty->link->count)
return -ERESTARTSYS;
return 0;
}
void pty_close(unsigned int dev, struct file * filp)
static void pty_close(struct tty_struct * tty, struct file * filp)
{
struct tty_struct * tty;
tty = tty_table + dev;
wake_up(&tty->read_q->proc_list);
wake_up(&tty->link->write_q->proc_list);
if (IS_A_PTY_MASTER(dev)) {
wake_up(&tty->read_q.proc_list);
wake_up(&tty->link->write_q.proc_list);
if (IS_A_PTY_MASTER(tty->line)) {
if (tty->link->pgrp > 0)
kill_pg(tty->link->pgrp,SIGHUP,1);
}
......@@ -54,20 +55,20 @@ static inline void pty_copy(struct tty_struct * from, struct tty_struct * to)
{
int c;
while (!from->stopped && !EMPTY(from->write_q)) {
if (FULL(to->read_q)) {
if (FULL(to->secondary))
while (!from->stopped && !EMPTY(&from->write_q)) {
if (FULL(&to->read_q)) {
if (FULL(&to->secondary))
break;
TTY_READ_FLUSH(to);
continue;
}
c = get_tty_queue(from->write_q);
put_tty_queue(c,to->read_q);
c = get_tty_queue(&from->write_q);
put_tty_queue(c, &to->read_q);
if (current->signal & ~current->blocked)
break;
}
TTY_READ_FLUSH(to);
wake_up(&from->write_q->proc_list);
wake_up(&from->write_q.proc_list);
}
/*
......
This diff is collapsed.
This diff is collapsed.
......@@ -19,7 +19,6 @@
extern int session_of_pgrp(int pgrp);
extern int do_screendump(int arg);
extern int kill_pg(int pgrp, int sig, int priv);
extern int vt_ioctl(struct tty_struct *tty, int dev, int cmd, int arg);
static void flush(struct tty_queue * queue)
{
......@@ -35,17 +34,14 @@ void flush_input(struct tty_struct * tty)
{
tty->status_changed = 1;
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
if (tty->read_q) {
flush(tty->read_q);
wake_up(&tty->read_q->proc_list);
}
if (tty->secondary) {
flush(tty->secondary);
tty->secondary->data = 0;
}
if ((tty = tty->link) && tty->write_q) {
flush(tty->write_q);
wake_up(&tty->write_q->proc_list);
flush(&tty->read_q);
wake_up(&tty->read_q.proc_list);
flush(&tty->secondary);
tty->secondary.data = 0;
if (tty = tty->link) {
flush(&tty->write_q);
wake_up(&tty->write_q.proc_list);
}
}
......@@ -53,32 +49,27 @@ void flush_output(struct tty_struct * tty)
{
tty->status_changed = 1;
tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
if (tty->write_q) {
flush(tty->write_q);
wake_up(&tty->write_q->proc_list);
}
flush(&tty->write_q);
wake_up(&tty->write_q.proc_list);
if (tty = tty->link) {
if (tty->read_q) {
flush(tty->read_q);
wake_up(&tty->read_q->proc_list);
}
if (tty->secondary) {
flush(tty->secondary);
tty->secondary->data = 0;
}
flush(&tty->read_q);
wake_up(&tty->read_q.proc_list);
flush(&tty->secondary);
tty->secondary.data = 0;
}
}
void wait_until_sent(struct tty_struct * tty)
{
while (!(current->signal & ~current->blocked) && !EMPTY(tty->write_q)) {
while (!(current->signal & ~current->blocked) &&
!EMPTY(&tty->write_q)) {
TTY_WRITE_FLUSH(tty);
current->counter = 0;
cli();
if (EMPTY(tty->write_q))
if (EMPTY(&tty->write_q))
break;
else
interruptible_sleep_on(&tty->write_q->proc_list);
interruptible_sleep_on(&tty->write_q.proc_list);
sti();
}
sti();
......@@ -118,7 +109,7 @@ static int get_termios(struct tty_struct * tty, struct termios * termios)
verify_area(termios, sizeof (*termios));
for (i=0 ; i< (sizeof (*termios)) ; i++)
put_fs_byte( ((char *)&tty->termios)[i] , i+(char *)termios );
put_fs_byte( ((char *)tty->termios)[i] , i+(char *)termios );
return 0;
}
......@@ -126,7 +117,7 @@ static int set_termios(struct tty_struct * tty, struct termios * termios,
int channel)
{
int i;
unsigned short old_cflag = tty->termios.c_cflag;
unsigned short old_cflag = tty->termios->c_cflag;
/* If we try to set the state of terminal and we're not in the
foreground, send a SIGTTOU. If the signal is blocked or
......@@ -135,18 +126,20 @@ static int set_termios(struct tty_struct * tty, struct termios * termios,
(tty->pgrp != current->pgrp)) {
if (is_orphaned_pgrp(current->pgrp))
return -EIO;
if (!is_ignored(SIGTTOU))
return tty_signal(SIGTTOU, tty);
if (!is_ignored(SIGTTOU)) {
(void) kill_pg(current->pgrp,SIGTTOU,1);
return -ERESTARTSYS;
}
}
for (i=0 ; i< (sizeof (*termios)) ; i++)
((char *)&tty->termios)[i]=get_fs_byte(i+(char *)termios);
if (IS_A_SERIAL(channel) && tty->termios.c_cflag != old_cflag)
((char *)tty->termios)[i]=get_fs_byte(i+(char *)termios);
if (IS_A_SERIAL(channel) && tty->termios->c_cflag != old_cflag)
change_speed(channel-64);
/* puting mpty's into echo mode is very bad, and I think under
some situations can cause the kernel to do nothing but
copy characters back and forth. -RAB */
if (IS_A_PTY_MASTER(channel)) tty->termios.c_lflag &= ~ECHO;
if (IS_A_PTY_MASTER(channel)) tty->termios->c_lflag &= ~ECHO;
return 0;
}
......@@ -157,13 +150,13 @@ static int get_termio(struct tty_struct * tty, struct termio * termio)
struct termio tmp_termio;
verify_area(termio, sizeof (*termio));
tmp_termio.c_iflag = tty->termios.c_iflag;
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;
tmp_termio.c_iflag = tty->termios->c_iflag;
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];
tmp_termio.c_cc[i] = tty->termios->c_cc[i];
for (i=0 ; i< (sizeof (*termio)) ; i++)
put_fs_byte( ((char *)&tmp_termio)[i] , i+(char *)termio );
return 0;
......@@ -177,42 +170,44 @@ static int set_termio(struct tty_struct * tty, struct termio * termio,
{
int i;
struct termio tmp_termio;
unsigned short old_cflag = tty->termios.c_cflag;
unsigned short old_cflag = tty->termios->c_cflag;
if ((current->tty == channel) &&
(tty->pgrp > 0) &&
(tty->pgrp != current->pgrp)) {
if (is_orphaned_pgrp(current->pgrp))
return -EIO;
if (!is_ignored(SIGTTOU))
return tty_signal(SIGTTOU, tty);
if (!is_ignored(SIGTTOU)) {
(void) kill_pg(current->pgrp,SIGTTOU,1);
return -ERESTARTSYS;
}
}
for (i=0 ; i< (sizeof (*termio)) ; i++)
((char *)&tmp_termio)[i]=get_fs_byte(i+(char *)termio);
/* take care of the packet stuff. */
if ((tmp_termio.c_iflag & IXON) &&
~(tty->termios.c_iflag & IXON))
~(tty->termios->c_iflag & IXON))
{
tty->status_changed = 1;
tty->ctrl_status |= TIOCPKT_DOSTOP;
}
if (~(tmp_termio.c_iflag & IXON) &&
(tty->termios.c_iflag & IXON))
(tty->termios->c_iflag & IXON))
{
tty->status_changed = 1;
tty->ctrl_status |= TIOCPKT_NOSTOP;
}
*(unsigned short *)&tty->termios.c_iflag = tmp_termio.c_iflag;
*(unsigned short *)&tty->termios.c_oflag = tmp_termio.c_oflag;
*(unsigned short *)&tty->termios.c_cflag = tmp_termio.c_cflag;
*(unsigned short *)&tty->termios.c_lflag = tmp_termio.c_lflag;
tty->termios.c_line = tmp_termio.c_line;
*(unsigned short *)&tty->termios->c_iflag = tmp_termio.c_iflag;
*(unsigned short *)&tty->termios->c_oflag = tmp_termio.c_oflag;
*(unsigned short *)&tty->termios->c_cflag = tmp_termio.c_cflag;
*(unsigned short *)&tty->termios->c_lflag = tmp_termio.c_lflag;
tty->termios->c_line = tmp_termio.c_line;
for(i=0 ; i < NCC ; i++)
tty->termios.c_cc[i] = tmp_termio.c_cc[i];
if (IS_A_SERIAL(channel) && tty->termios.c_cflag != old_cflag)
tty->termios->c_cc[i] = tmp_termio.c_cc[i];
if (IS_A_SERIAL(channel) && tty->termios->c_cflag != old_cflag)
change_speed(channel-64);
return 0;
}
......@@ -265,15 +260,15 @@ int tty_ioctl(struct inode * inode, struct file * file,
return -EINVAL;
}
dev = MINOR(file->f_rdev);
tty = tty_table + (dev ? ((dev < 64)? dev-1:dev) : fg_console);
tty = TTY_TABLE(dev);
if (!tty)
return -EINVAL;
if (IS_A_PTY(dev))
other_tty = tty_table + PTY_OTHER(dev);
other_tty = tty_table[PTY_OTHER(dev)];
else
other_tty = NULL;
if (!(tty->write_q && tty->read_q && tty->secondary && tty->write))
return -EINVAL;
switch (cmd) {
case TCGETS:
return get_termios(tty,(struct termios *) arg);
......@@ -294,13 +289,6 @@ int tty_ioctl(struct inode * inode, struct file * file,
wait_until_sent(tty); /* fallthrough */
case TCSETA:
return set_termio(tty,(struct termio *) arg, dev);
case TCSBRK:
if (!IS_A_SERIAL(dev))
return -EINVAL;
wait_until_sent(tty);
if (!arg)
send_break(dev-64);
return 0;
case TCXONC:
switch (arg) {
case TCOOFF:
......@@ -313,11 +301,13 @@ int tty_ioctl(struct inode * inode, struct file * file,
return 0;
case TCIOFF:
if (STOP_CHAR(tty))
put_tty_queue(STOP_CHAR(tty),tty->write_q);
put_tty_queue(STOP_CHAR(tty),
&tty->write_q);
return 0;
case TCION:
if (START_CHAR(tty))
put_tty_queue(START_CHAR(tty),tty->write_q);
put_tty_queue(START_CHAR(tty),
&tty->write_q);
return 0;
}
return -EINVAL; /* not implemented */
......@@ -356,14 +346,15 @@ int tty_ioctl(struct inode * inode, struct file * file,
return 0;
case TIOCOUTQ:
verify_area((void *) arg,4);
put_fs_long(CHARS(tty->write_q),(unsigned long *) arg);
put_fs_long(CHARS(&tty->write_q),
(unsigned long *) arg);
return 0;
case TIOCINQ:
verify_area((void *) arg,4);
if (L_CANON(tty) && !tty->secondary->data)
if (L_CANON(tty) && !tty->secondary.data)
put_fs_long(0, (unsigned long *) arg);
else
put_fs_long(CHARS(tty->secondary),
put_fs_long(CHARS(&tty->secondary),
(unsigned long *) arg);
return 0;
case TIOCSTI:
......@@ -374,17 +365,6 @@ int tty_ioctl(struct inode * inode, struct file * file,
if (IS_A_PTY_MASTER(dev))
set_window_size(other_tty,(struct winsize *) arg);
return set_window_size(tty,(struct winsize *) arg);
case TIOCMGET:
if (!IS_A_SERIAL(dev))
return -EINVAL;
verify_area((void *) arg,sizeof(unsigned int *));
return get_modem_info(dev-64,(unsigned int *) arg);
case TIOCMBIS:
case TIOCMBIC:
case TIOCMSET:
if (!IS_A_SERIAL(dev))
return -EINVAL;
return set_modem_info(dev-64,cmd,(unsigned int *) arg);
case TIOCGSOFTCAR:
return -EINVAL; /* not implemented */
case TIOCSSOFTCAR:
......@@ -411,15 +391,6 @@ int tty_ioctl(struct inode * inode, struct file * file,
else
redirect = tty;
return 0;
case TIOCGSERIAL:
if (!IS_A_SERIAL(dev))
return -EINVAL;
verify_area((void *) arg,sizeof(struct serial_struct));
return get_serial_info(dev-64,(struct serial_struct *) arg);
case TIOCSSERIAL:
if (!IS_A_SERIAL(dev))
return -EINVAL;
return set_serial_info(dev-64,(struct serial_struct *) arg);
case FIONBIO:
if (arg)
file->f_flags |= O_NONBLOCK;
......@@ -453,6 +424,9 @@ int tty_ioctl(struct inode * inode, struct file * file,
}
default:
return vt_ioctl(tty, dev, cmd, arg);
if (tty->ioctl)
return (tty->ioctl)(tty, file, cmd, arg);
else
return -EINVAL;
}
}
......@@ -63,16 +63,18 @@ kiocsound(unsigned int freq)
}
/*
* all the vt ioctls affect only consoles, so we reject all other ttys.
* we also have the capability to modify any console, not just the fg_console.
* We handle the console-specific ioctl's here. We allow the
* capability to modify any console, not just the fg_console.
*/
int
vt_ioctl(struct tty_struct *tty, int dev, int cmd, int arg)
int vt_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned int arg)
{
int console = dev ? dev - 1 : fg_console;
int console;
unsigned char ucval;
if (!IS_A_CONSOLE(dev) || console < 0 || console >= NR_CONSOLES)
console = tty->line - 1;
if (console < 0 || console >= NR_CONSOLES)
return -EINVAL;
switch (cmd) {
......
This diff is collapsed.
......@@ -26,24 +26,24 @@ clean:
dep:
sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
for i in *.c;do $(CPP) -M $$i;done >> tmp_make
$(CPP) -M *.c >> tmp_make
cp tmp_make Makefile
### Dependencies:
_exit.o : _exit.c /usr/src/linux/include/linux/unistd.h
close.o : close.c /usr/src/linux/include/linux/unistd.h
ctype.o : ctype.c /usr/src/linux/include/linux/ctype.h
dup.o : dup.c /usr/src/linux/include/linux/unistd.h
_exit.o : _exit.c /usr/include/linux/unistd.h
close.o : close.c /usr/include/linux/unistd.h
ctype.o : ctype.c /usr/include/linux/ctype.h
dup.o : dup.c /usr/include/linux/unistd.h
errno.o : errno.c
execve.o : execve.c /usr/src/linux/include/linux/unistd.h
malloc.o : malloc.c /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/mm.h \
/usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h \
/usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h \
/usr/src/linux/include/linux/minix_fs_sb.h /usr/src/linux/include/linux/ext_fs_sb.h \
/usr/src/linux/include/linux/msdos_fs_sb.h /usr/src/linux/include/linux/signal.h \
/usr/src/linux/include/asm/system.h
open.o : open.c /usr/src/linux/include/linux/unistd.h /usr/src/linux/include/stdarg.h
setsid.o : setsid.c /usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/unistd.h
string.o : string.c /usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/string.h
wait.o : wait.c /usr/src/linux/include/linux/unistd.h /usr/src/linux/include/linux/types.h
write.o : write.c /usr/src/linux/include/linux/unistd.h /usr/src/linux/include/linux/types.h
execve.o : execve.c /usr/include/linux/unistd.h
malloc.o : malloc.c /usr/include/linux/kernel.h /usr/include/linux/mm.h /usr/include/linux/fs.h \
/usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/types.h \
/usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h \
/usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h \
/usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
/usr/include/asm/system.h
open.o : open.c /usr/include/linux/unistd.h /usr/lib/gcc-lib/i386-linux/2.2.2d/include/stdarg.h
setsid.o : setsid.c /usr/include/linux/types.h /usr/include/linux/unistd.h
string.o : string.c /usr/include/linux/types.h /usr/include/linux/string.h
wait.o : wait.c /usr/include/linux/unistd.h /usr/include/linux/types.h
write.o : write.c /usr/include/linux/unistd.h /usr/include/linux/types.h
/*
* malloc.c --- a general purpose kernel memory allocator for Linux.
*
*
* Written by Theodore Ts'o (tytso@mit.edu), 11/29/91
*
* This routine is written to be as fast as possible, so that it
......@@ -15,14 +15,14 @@
* called, it looks for the smallest bucket size which will fulfill its
* request, and allocate a piece of memory from that bucket pool.
*
* Each bucket has as its control block a bucket descriptor which keeps
* Each bucket has as its control block a bucket descriptor which keeps
* track of how many objects are in use on that page, and the free list
* for that page. Like the buckets themselves, bucket descriptors are
* stored on pages requested from get_free_page(). However, unlike buckets,
* pages devoted to bucket descriptor pages are never released back to the
* system. Fortunately, a system should probably only need 1 or 2 bucket
* descriptor pages, since a page can hold 256 bucket descriptors (which
* corresponds to 1 megabyte worth of bucket pages.) If the kernel is using
* corresponds to 1 megabyte worth of bucket pages.) If the kernel is using
* that much allocated memory, it's probably doing something wrong. :-)
*
* Note: malloc() and free() both call get_free_page() and free_page()
......@@ -36,11 +36,11 @@
* "pre-allocated" so that it can safely draw upon those pages if
* it is called from an interrupt routine.
*
* Another concern is that get_free_page() should not sleep; if it
* does, the code is carefully ordered so as to avoid any race
* conditions. The catch is that if malloc() is called re-entrantly,
* there is a chance that unecessary pages will be grabbed from the
* system. Except for the pages for the bucket descriptor page, the
* Another concern is that get_free_page() should not sleep; if it
* does, the code is carefully ordered so as to avoid any race
* conditions. The catch is that if malloc() is called re-entrantly,
* there is a chance that unecessary pages will be grabbed from the
* system. Except for the pages for the bucket descriptor page, the
* extra pages will eventually get released back to the system, though,
* so it isn't all that bad.
*/
......@@ -72,7 +72,7 @@ struct _bucket_dir { /* 8 bytes */
/*
* The following is the where we store a pointer to the first bucket
* descriptor for a given size.
* descriptor for a given size.
*
* If it turns out that the Linux kernel allocates a lot of objects of a
* specific size, then we may want to add that specific size to this list,
......
This diff is collapsed.
......@@ -42,24 +42,24 @@ dep:
dummy:
### Dependencies:
socket.o : socket.c /usr/src/linux/include/linux/signal.h /usr/src/linux/include/linux/errno.h \
/usr/src/linux/include/linux/sched.h /usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h \
/usr/src/linux/include/linux/limits.h /usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h \
/usr/src/linux/include/linux/dirent.h /usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/time.h \
/usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/stat.h /usr/src/linux/include/linux/socket.h /usr/src/linux/include/linux/fcntl.h \
/usr/src/linux/include/linux/termios.h /usr/src/linux/include/asm/system.h /usr/src/linux/include/asm/segment.h \
kern_sock.h socketcall.h
unix.o : unix.c /usr/src/linux/include/linux/signal.h /usr/src/linux/include/linux/sched.h \
/usr/src/linux/include/linux/head.h /usr/src/linux/include/linux/fs.h /usr/src/linux/include/linux/limits.h \
/usr/src/linux/include/linux/wait.h /usr/src/linux/include/linux/types.h /usr/src/linux/include/linux/dirent.h \
/usr/src/linux/include/linux/vfs.h /usr/src/linux/include/linux/minix_fs_sb.h \
/usr/src/linux/include/linux/ext_fs_sb.h /usr/src/linux/include/linux/msdos_fs_sb.h \
/usr/src/linux/include/linux/mm.h /usr/src/linux/include/linux/kernel.h /usr/src/linux/include/linux/time.h \
/usr/src/linux/include/linux/param.h /usr/src/linux/include/linux/resource.h \
/usr/src/linux/include/linux/errno.h /usr/src/linux/include/linux/string.h /usr/src/linux/include/linux/stat.h \
/usr/src/linux/include/linux/socket.h /usr/src/linux/include/linux/un.h /usr/src/linux/include/linux/fcntl.h \
/usr/src/linux/include/linux/termios.h /usr/src/linux/include/asm/system.h /usr/src/linux/include/asm/segment.h \
kern_sock.h
socket.o : socket.c /usr/include/linux/signal.h /usr/include/linux/errno.h /usr/include/linux/sched.h \
/usr/include/linux/head.h /usr/include/linux/fs.h /usr/include/linux/limits.h \
/usr/include/linux/wait.h /usr/include/linux/types.h /usr/include/linux/dirent.h \
/usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
/usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
/usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h \
/usr/include/linux/kernel.h /usr/include/linux/time.h /usr/include/linux/param.h \
/usr/include/linux/resource.h /usr/include/linux/vm86.h /usr/include/linux/stat.h \
/usr/include/linux/socket.h /usr/include/linux/fcntl.h /usr/include/linux/termios.h \
/usr/include/asm/system.h /usr/include/asm/segment.h kern_sock.h socketcall.h
unix.o : unix.c /usr/include/linux/signal.h /usr/include/linux/sched.h /usr/include/linux/head.h \
/usr/include/linux/fs.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
/usr/include/linux/types.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
/usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
/usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
/usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h /usr/include/linux/kernel.h \
/usr/include/linux/time.h /usr/include/linux/param.h /usr/include/linux/resource.h \
/usr/include/linux/vm86.h /usr/include/linux/errno.h /usr/include/linux/string.h \
/usr/include/linux/stat.h /usr/include/linux/socket.h /usr/include/linux/un.h \
/usr/include/linux/fcntl.h /usr/include/linux/termios.h /usr/include/asm/system.h \
/usr/include/asm/segment.h kern_sock.h
#define UTS_RELEASE "0.97.pl3-34"
#define UTS_VERSION "09/05/92"
#define LINUX_COMPILE_TIME "17:58:09"
#define UTS_RELEASE "0.97.pl5-15"
#define UTS_VERSION "09/19/92"
#define LINUX_COMPILE_TIME "13:29:53"
#define LINUX_COMPILE_BY "root"
#define LINUX_COMPILE_HOST "home"
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