Commit 917a96ae authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.87

parent fd46db1c
...@@ -505,7 +505,7 @@ S: 00200 Helsinki ...@@ -505,7 +505,7 @@ S: 00200 Helsinki
S: Finland S: Finland
N: Kai M"akisara N: Kai M"akisara
E: Kai.Makisara@vtt.fi E: Kai.Makisara@metla.fi
D: SCSI Tape Driver D: SCSI Tape Driver
N: Hamish Macdonald N: Hamish Macdonald
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 86 SUBLEVEL = 87
ARCH = i386 ARCH = i386
......
...@@ -162,42 +162,17 @@ static inline long load(long dev, unsigned long addr, unsigned long count) ...@@ -162,42 +162,17 @@ static inline long load(long dev, unsigned long addr, unsigned long count)
} }
/* /*
* Start the kernel: * Start the kernel.
* - switch to the proper PCB structure
* - switch to the proper ptbr
* - switch to the new kernel stack
*/ */
static void runkernel(void) static void runkernel(void)
{ {
struct pcb_struct * init_pcb = (struct pcb_struct *) INIT_PCB;
unsigned long oldptbr, *oldL1;
unsigned long newptbr, *newL1;
oldptbr = pcb_va->ptbr;
oldL1 = (unsigned long *) (PAGE_OFFSET + (oldptbr << PAGE_SHIFT));
newptbr = (SWAPPER_PGD - PAGE_OFFSET) >> PAGE_SHIFT;
newL1 = (unsigned long *) SWAPPER_PGD;
memcpy(newL1, oldL1, PAGE_SIZE);
newL1[1023] = (newptbr << 32) | pgprot_val(PAGE_KERNEL);
*init_pcb = *pcb_va;
init_pcb->ksp = PAGE_SIZE + INIT_STACK;
init_pcb->ptbr = newptbr;
__asm__ __volatile__( __asm__ __volatile__(
"bis %1,%1,$30\n\t"
"bis %0,%0,$26\n\t" "bis %0,%0,$26\n\t"
"bis %1,%1,$16\n\t"
".long %2\n\t"
"lda $16,-2($31)\n\t"
".long 51\n\t"
"ret ($26)" "ret ($26)"
: /* no outputs: it doesn't even return */ : /* no outputs: it doesn't even return */
: "r" (START_ADDR), : "r" (START_ADDR),
"r" (init_pcb), "r" (PAGE_SIZE + INIT_STACK));
"i" (PAL_swpctx)
: "$16","$26");
} }
void start_kernel(void) void start_kernel(void)
......
...@@ -47,6 +47,9 @@ void trap_init(void) ...@@ -47,6 +47,9 @@ void trap_init(void)
{ {
unsigned long gptr; unsigned long gptr;
/*
* Tell PAL-code what global pointer we want in the kernel..
*/
__asm__("br %0,___tmp\n" __asm__("br %0,___tmp\n"
"___tmp:\tldgp %0,0(%0)" "___tmp:\tldgp %0,0(%0)"
: "=r" (gptr)); : "=r" (gptr));
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.c.o: .c.o:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
OBJS = __divqu.o __remqu.o __divlu.o __remlu.o OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o
lib.a: $(OBJS) lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS) $(AR) rcs lib.a $(OBJS)
......
/*
* linux/arch/alpha/lib/memset.c
*
* Copyright (C) 1995 Linus Torvalds
*/
/*
* These are only slightly optimized so far..
*/
#include <linux/types.h>
void * __constant_c_memset(void * s, unsigned long c, long count)
{
unsigned long xs = (unsigned long) s;
/*
* the first and last parts could be done with just one
* unaligned load/store, but I don't want to think about it
*/
while (count > 0 && (xs & 7)) {
*(char *) xs = c;
count--; xs++;
}
while (count > 7) {
*(unsigned long *) xs = c;
count -=8; xs += 8;
}
while (count > 0) {
*(char *) xs = c;
count--; xs++;
}
return s;
}
void * __memset(void * s,char c,size_t count)
{
char *xs = (char *) s;
while (count--)
*xs++ = c;
return s;
}
...@@ -86,17 +86,25 @@ void show_mem(void) ...@@ -86,17 +86,25 @@ void show_mem(void)
extern unsigned long free_area_init(unsigned long, unsigned long); extern unsigned long free_area_init(unsigned long, unsigned long);
static void load_PCB(struct thread_struct * pcb)
{
__asm__ __volatile__(
"stq $30,0(%0)\n\t"
"bis %0,%0,$16\n\t"
".long %1"
: /* no outputs */
: "r" (pcb), "i" (PAL_swpctx)
: "$0", "$1", "$16", "$22", "$23", "$24", "$25");
}
/* /*
* paging_init() sets up the page tables: in the alpha version this actually * paging_init() sets up the page tables: in the alpha version this actually
* unmaps the bootup page table (as we're now in KSEG, so we don't need it). * unmaps the bootup page table (as we're now in KSEG, so we don't need it).
*
* The bootup sequence put the virtual page table into high memory: that
* means that we can change the L1 page table by just using VL1p below.
*/ */
#define VL1p ((unsigned long *) 0xffffffffffffe000)
unsigned long paging_init(unsigned long start_mem, unsigned long end_mem) unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)
{ {
int i; int i;
unsigned long newptbr;
struct memclust_struct * cluster; struct memclust_struct * cluster;
struct memdesc_struct * memdesc; struct memdesc_struct * memdesc;
...@@ -122,8 +130,14 @@ unsigned long paging_init(unsigned long start_mem, unsigned long end_mem) ...@@ -122,8 +130,14 @@ unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)
} }
/* unmap the console stuff: we don't need it, and we don't want it */ /* unmap the console stuff: we don't need it, and we don't want it */
for (i = 0; i < 1023; i++) /* Also set up the real kernel PCB while we're at it.. */
VL1p[i] = 0; memset((void *) ZERO_PGE, 0, PAGE_SIZE);
memset(swapper_pg_dir, 0, PAGE_SIZE);
newptbr = ((unsigned long) swapper_pg_dir - PAGE_OFFSET) >> PAGE_SHIFT;
pgd_val(swapper_pg_dir[1023]) = (newptbr << 32) | pgprot_val(PAGE_KERNEL);
init_task.tss.ptbr = newptbr;
load_PCB(&init_task.tss);
invalidate_all(); invalidate_all();
return start_mem; return start_mem;
} }
......
...@@ -31,5 +31,11 @@ head.s: head.S $(TOPDIR)/include/linux/tasks.h ...@@ -31,5 +31,11 @@ head.s: head.S $(TOPDIR)/include/linux/tasks.h
piggy.o: $(SYSTEM) xtract piggyback piggy.o: $(SYSTEM) xtract piggyback
./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o ./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
xtract: xtract.c
$(HOSTCC) $(CFLAGS) -o xtract xtract.c
piggyback: xtract.c
$(HOSTCC) $(CFLAGS) -o piggyback piggyback.c
clean: clean:
rm -f xtract piggyback vmlinux rm -f xtract piggyback vmlinux
...@@ -41,7 +41,7 @@ bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS n ...@@ -41,7 +41,7 @@ bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS n
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
if [ "$CONFIG_INET" "=" "y" ]; then if [ "$CONFIG_INET" = "y" ]; then
bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n
bool 'IP multicasting (ALPHA)' CONFIG_IP_MULTICAST n bool 'IP multicasting (ALPHA)' CONFIG_IP_MULTICAST n
bool 'IP firewalling' CONFIG_IP_FIREWALL n bool 'IP firewalling' CONFIG_IP_FIREWALL n
......
...@@ -21,8 +21,13 @@ ...@@ -21,8 +21,13 @@
# In the future, some of these should be built conditionally. # In the future, some of these should be built conditionally.
# #
OBJS := ll_rw_blk.o floppy.o ramdisk.o genhd.o OBJS := ll_rw_blk.o ramdisk.o genhd.o
SRCS := ll_rw_blk.c floppy.c ramdisk.c genhd.c SRCS := ll_rw_blk.c ramdisk.c genhd.c
ifdef CONFIG_BLK_DEV_FD
OBJS := $(OBJS) floppy.o
SRCS := $(SRCS) floppy.c
endif
ifdef CONFIG_CDU31A ifdef CONFIG_CDU31A
OBJS := $(OBJS) cdu31a.o OBJS := $(OBJS) cdu31a.o
......
...@@ -92,8 +92,6 @@ ...@@ -92,8 +92,6 @@
#include <linux/config.h> #include <linux/config.h>
#ifdef CONFIG_BLK_DEV_FD
#ifndef FD_MODULE #ifndef FD_MODULE
/* the following is the mask of allowed drives. By default units 2 and /* the following is the mask of allowed drives. By default units 2 and
* 3 of both floppy controllers are disabled, because switching on the * 3 of both floppy controllers are disabled, because switching on the
...@@ -3393,4 +3391,3 @@ static void floppy_release_irq_and_dma(void) ...@@ -3393,4 +3391,3 @@ static void floppy_release_irq_and_dma(void)
#endif #endif
} }
#endif
This diff is collapsed.
...@@ -94,9 +94,9 @@ endif ...@@ -94,9 +94,9 @@ endif
dep: dep:
$(CPP) -M $(SRCS) > .depend $(CPP) -M $(SRCS) > .depend
#ifdef MODULES ifdef MODULES
$(CPP) -M -DMODULE $(MODULES:.o=.c) >> .depend $(CPP) -M -DMODULE $(MODULES:.o=.c) >> .depend
#endif endif
dummy: dummy:
......
...@@ -304,11 +304,16 @@ static void rw_intr (Scsi_Cmnd * SCpnt) ...@@ -304,11 +304,16 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
* kraxel@cs.tu-berlin.de (Gerd Knorr) * kraxel@cs.tu-berlin.de (Gerd Knorr)
*/ */
#define DEBUG
static void sr_photocd(struct inode *inode) static void sr_photocd(struct inode *inode)
{ {
unsigned long sector,min,sec,frame; unsigned long sector,min,sec,frame;
unsigned char buf[40]; unsigned char buf[40]; /* the buffer for the ioctl */
int rc; unsigned char *cmd; /* the scsi-command */
unsigned char *send; /* the data we send to the drive ... */
unsigned char *rec; /* ... and get back */
int rc,is_xa;
if (!suser()) { if (!suser()) {
/* I'm not the superuser, so SCSI_IOCTL_SEND_COMMAND isn't allowed for me. /* I'm not the superuser, so SCSI_IOCTL_SEND_COMMAND isn't allowed for me.
...@@ -321,7 +326,8 @@ static void sr_photocd(struct inode *inode) ...@@ -321,7 +326,8 @@ static void sr_photocd(struct inode *inode)
scsi_CDs[MINOR(inode->i_rdev)].mpcd_sector = 0; scsi_CDs[MINOR(inode->i_rdev)].mpcd_sector = 0;
return; return;
} }
cmd = rec = &buf[8];
switch(scsi_CDs[MINOR(inode->i_rdev)].device->manufacturer) { switch(scsi_CDs[MINOR(inode->i_rdev)].device->manufacturer) {
case SCSI_MAN_NEC: case SCSI_MAN_NEC:
...@@ -329,22 +335,24 @@ static void sr_photocd(struct inode *inode) ...@@ -329,22 +335,24 @@ static void sr_photocd(struct inode *inode)
printk("sr_photocd: use NEC code\n"); printk("sr_photocd: use NEC code\n");
#endif #endif
memset(buf,0,40); memset(buf,0,40);
*((unsigned long*)buf) = 0; *((unsigned long*)buf) = 0x0; /* we send nothing... */
*((unsigned long*)buf+1) = 0x16; *((unsigned long*)buf+1) = 0x16; /* and receive 0x16 bytes */
buf[8+0] = 0xde; cmd[0] = 0xde;
buf[8+1] = 0x03; cmd[1] = 0x03;
buf[8+2] = 0xb0; cmd[2] = 0xb0;
rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device, rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
SCSI_IOCTL_SEND_COMMAND, buf); SCSI_IOCTL_SEND_COMMAND, buf);
if (rc != 0) { if (rc != 0) {
printk("sr_photocd: ioctl error (NEC): 0x%x\n",rc); printk("sr_photocd: ioctl error (NEC): 0x%x\n",rc);
sector = 0; sector = 0;
} else { } else {
min = (unsigned long)buf[8+15]/16*10 + (unsigned long)buf[8+15]%16; min = (unsigned long) rec[15]/16*10 + (unsigned long) rec[15]%16;
sec = (unsigned long)buf[8+16]/16*10 + (unsigned long)buf[8+16]%16; sec = (unsigned long) rec[16]/16*10 + (unsigned long) rec[16]%16;
frame = (unsigned long)buf[8+17]/16*10 + (unsigned long)buf[8+17]%16; frame = (unsigned long) rec[17]/16*10 + (unsigned long) rec[17]%16;
sector = min*60*75 + sec*75 + frame; /* if rec[14] is'nt 0xb0, the drive does not support multisession CD's, use zero */
sector = (0xb0 == rec[14]) ? min*CD_SECS*CD_FRAMES + sec*CD_FRAMES + frame : 0;
#ifdef DEBUG #ifdef DEBUG
printk("NEC: (%2x) %2li:%02li:%02li = %li\n",buf[8+14],min,sec,frame,sector);
if (sector) { if (sector) {
printk("sr_photocd: multisession CD detected. start: %lu\n",sector); printk("sr_photocd: multisession CD detected. start: %lu\n",sector);
} }
...@@ -357,43 +365,71 @@ static void sr_photocd(struct inode *inode) ...@@ -357,43 +365,71 @@ static void sr_photocd(struct inode *inode)
printk("sr_photocd: use TOSHIBA code\n"); printk("sr_photocd: use TOSHIBA code\n");
#endif #endif
/* first I do a set_density-call (for reading XA-sectors) ... */ /* we request some disc information (is it a XA-CD ?,
where starts the last session ?) */
memset(buf,0,40); memset(buf,0,40);
*((unsigned long*)buf) = 12; *((unsigned long*)buf) = 0;
*((unsigned long*)buf+1) = 12; *((unsigned long*)buf+1) = 4; /* we receive 4 bytes from the drive */
buf[8+0] = 0x15; cmd[0] = 0xc7;
buf[8+1] = (1 << 4); cmd[1] = 3;
buf[8+4] = 12;
buf[14+ 3] = 0x08;
buf[14+ 4] = 0x83;
buf[14+10] = 0x08;
rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device, rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
SCSI_IOCTL_SEND_COMMAND, buf); SCSI_IOCTL_SEND_COMMAND, buf);
if (rc != 0) { if (rc != 0) {
printk("sr_photocd: ioctl error (TOSHIBA #1): 0x%x\n",rc); printk("sr_photocd: ioctl error (TOSHIBA #1): 0x%x\n",rc);
sector = 0;
break; /* if the first ioctl fails, we don't call the secound one */
}
is_xa = (rec[0] == 0x20);
#ifdef DEBUG
printk("sr_photocd: TOSHIBA %x\n",rec[0]);
#endif
min = (unsigned long) rec[1]/16*10 + (unsigned long) rec[1]%16;
sec = (unsigned long) rec[2]/16*10 + (unsigned long) rec[2]%16;
frame = (unsigned long) rec[3]/16*10 + (unsigned long) rec[3]%16;
sector = min*CD_SECS*CD_FRAMES + sec*CD_FRAMES + frame;
if (sector) {
sector -= CD_BLOCK_OFFSET;
#ifdef DEBUG
printk("sr_photocd: multisession CD detected: start: %lu\n",sector);
#endif
} }
/* ... and then I ask, if there is a multisession-Disk */ /* now we do a get_density... */
memset(buf,0,40); memset(buf,0,40);
*((unsigned long*)buf) = 0; *((unsigned long*)buf) = 0;
*((unsigned long*)buf+1) = 4; *((unsigned long*)buf+1) = 12;
buf[8+0] = 0xc7; cmd[0] = 0x1a;
buf[8+1] = 3; cmd[2] = 1;
cmd[4] = 12;
rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device, rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
SCSI_IOCTL_SEND_COMMAND, buf); SCSI_IOCTL_SEND_COMMAND, buf);
if (rc != 0) { if (rc != 0) {
printk("sr_photocd: ioctl error (TOSHIBA #2): 0x%x\n",rc); printk("sr_photocd: ioctl error (TOSHIBA #2): 0x%x\n",rc);
sector = 0; break;
} else { }
min = (unsigned long)buf[8+1]/16*10 + (unsigned long)buf[8+1]%16; #ifdef DEBUG
sec = (unsigned long)buf[8+2]/16*10 + (unsigned long)buf[8+2]%16; printk("sr_photocd: get_density: 0x%x\n",rec[4]);
frame = (unsigned long)buf[8+3]/16*10 + (unsigned long)buf[8+3]%16; #endif
sector = min*60*75 + sec*75 + frame;
if (sector) { /* ...and only if nessesary a set_density */
sector -= CD_BLOCK_OFFSET; if ((rec[4] != 0x81 && is_xa) || (rec[4] != 0 && !is_xa)) {
#ifdef DEBUG #ifdef DEBUG
printk("sr_photocd: multisession CD detected: start: %lu\n",sector); printk("sr_photocd: doing set_density\n");
#endif #endif
memset(buf,0,40);
*((unsigned long*)buf) = 12; /* sending 12 bytes... */
*((unsigned long*)buf+1) = 0;
cmd[0] = 0x15;
cmd[1] = (1 << 4);
cmd[4] = 12;
send = &cmd[6]; /* this is a 6-Byte command */
send[ 3] = 0x08; /* the data for the command */
send[ 4] = (is_xa) ? 0x81 : 0; /* density 0x81 for XA-CD's, 0 else */
send[10] = 0x08;
rc = kernel_scsi_ioctl(scsi_CDs[MINOR(inode->i_rdev)].device,
SCSI_IOCTL_SEND_COMMAND, buf);
if (rc != 0) {
printk("sr_photocd: ioctl error (TOSHIBA #3): 0x%x\n",rc);
} }
} }
break; break;
...@@ -412,6 +448,8 @@ static void sr_photocd(struct inode *inode) ...@@ -412,6 +448,8 @@ static void sr_photocd(struct inode *inode)
return; return;
} }
#undef DEBUG
static int sr_open(struct inode * inode, struct file * filp) static int sr_open(struct inode * inode, struct file * filp)
{ {
if(MINOR(inode->i_rdev) >= sr_template.nr_dev || if(MINOR(inode->i_rdev) >= sr_template.nr_dev ||
...@@ -427,9 +465,7 @@ static int sr_open(struct inode * inode, struct file * filp) ...@@ -427,9 +465,7 @@ static int sr_open(struct inode * inode, struct file * filp)
if (scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count) if (scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)
(*scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)++; (*scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)++;
#if 1 /* don't use for now - it doesn't seem to work for everybody */
sr_photocd(inode); sr_photocd(inode);
#endif
/* If this device did not have media in the drive at boot time, then /* If this device did not have media in the drive at boot time, then
we would have been unable to get the sector size. Check to see if we would have been unable to get the sector size. Check to see if
...@@ -587,15 +623,6 @@ work around the fact that the buffer cache has a block size of 1024, ...@@ -587,15 +623,6 @@ work around the fact that the buffer cache has a block size of 1024,
and we have 2048 byte sectors. This code should work for buffers that and we have 2048 byte sectors. This code should work for buffers that
are any multiple of 512 bytes long. */ are any multiple of 512 bytes long. */
#if 1
/* Here we redirect the volume descriptor block of the CD-ROM.
* Necessary for multisession CD's, until the isofs-routines
* handle this via the CDROMMULTISESSION_SYS call
*/
if (block >= 64 && block < 68) {
block += scsi_CDs[dev].mpcd_sector*4; }
#endif
SCpnt->use_sg = 0; SCpnt->use_sg = 0;
if (SCpnt->host->sg_tablesize > 0 && if (SCpnt->host->sg_tablesize > 0 &&
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Copyright 1992, 1993, 1994, 1995 Kai Makisara Copyright 1992, 1993, 1994, 1995 Kai Makisara
email Kai.Makisara@metla.fi email Kai.Makisara@metla.fi
Last modified: Wed Jan 11 22:02:20 1995 by root@kai.home Last modified: Thu Jan 19 23:28:05 1995 by makisara@kai.home
*/ */
#include <linux/fs.h> #include <linux/fs.h>
...@@ -1546,7 +1546,7 @@ st_int_ioctl(struct inode * inode,struct file * file, ...@@ -1546,7 +1546,7 @@ st_int_ioctl(struct inode * inode,struct file * file,
STp->moves_after_eof = 0; STp->moves_after_eof = 0;
else else
STp->moves_after_eof = 1; STp->moves_after_eof = 1;
if (!ioctl_result) { if (!ioctl_result) { /* SCSI command successful */
if (cmd_in != MTSEEK) { if (cmd_in != MTSEEK) {
STp->drv_block = blkno; STp->drv_block = blkno;
(STp->mt_status)->mt_fileno = fileno; (STp->mt_status)->mt_fileno = fileno;
...@@ -1587,9 +1587,11 @@ st_int_ioctl(struct inode * inode,struct file * file, ...@@ -1587,9 +1587,11 @@ st_int_ioctl(struct inode * inode,struct file * file,
STp->eof = ST_NOEOF; STp->eof = ST_NOEOF;
STp->eof_hit = 0; STp->eof_hit = 0;
} }
} else { } else { /* SCSI command was not completely successful */
if (SCpnt->sense_buffer[2] & 0x40) { if (SCpnt->sense_buffer[2] & 0x40) {
STp->eof = ST_EOM_OK; if (cmd_in != MTBSF && cmd_in != MTBSFM &&
cmd_in != MTBSR && cmd_in != MTBSS)
STp->eof = ST_EOM_OK;
STp->eof_hit = 0; STp->eof_hit = 0;
STp->drv_block = 0; STp->drv_block = 0;
} }
...@@ -1884,7 +1886,6 @@ static void st_init() ...@@ -1884,7 +1886,6 @@ static void st_init()
{ {
int i; int i;
Scsi_Tape * STp; Scsi_Tape * STp;
Scsi_Device * SDp;
static int st_registered = 0; static int st_registered = 0;
if (st_template.dev_noticed == 0) return; if (st_template.dev_noticed == 0) return;
......
...@@ -901,6 +901,7 @@ static struct { ...@@ -901,6 +901,7 @@ static struct {
{ NFSERR_NOENT, ENOENT }, { NFSERR_NOENT, ENOENT },
{ NFSERR_IO, errno_NFSERR_IO }, { NFSERR_IO, errno_NFSERR_IO },
{ NFSERR_NXIO, ENXIO }, { NFSERR_NXIO, ENXIO },
{ NFSERR_EAGAIN, EAGAIN },
{ NFSERR_ACCES, EACCES }, { NFSERR_ACCES, EACCES },
{ NFSERR_EXIST, EEXIST }, { NFSERR_EXIST, EEXIST },
{ NFSERR_NODEV, ENODEV }, { NFSERR_NODEV, ENODEV },
......
...@@ -16,15 +16,22 @@ __asm__ __volatile__( \ ...@@ -16,15 +16,22 @@ __asm__ __volatile__( \
: : :"$1", "$16", "$17", "$22","$23","$24","$25") : : :"$1", "$16", "$17", "$22","$23","$24","$25")
/* PAGE_SHIFT determines the page size */ /* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 13 #define PAGE_SHIFT 13
#define PGDIR_SHIFT 23 #define PMD_SHIFT 23
#define PAGE_SIZE (1UL << PAGE_SHIFT) #define PGDIR_SHIFT 33
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PMD_SIZE (1UL << PMD_SHIFT)
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#define PMD_MASK (~(PMD_SIZE-1))
#define PGDIR_MASK (~(PGDIR_SIZE-1))
#ifdef __KERNEL__ #ifdef __KERNEL__
#define PAGE_OFFSET 0xFFFFFC0000000000 #define PAGE_OFFSET 0xFFFFFC0000000000
#define MAP_NR(addr) (((addr) - PAGE_OFFSET) >> PAGE_SHIFT) #define MAP_NR(addr) ((((unsigned long) (addr)) - PAGE_OFFSET) >> PAGE_SHIFT)
#define MAP_PAGE_RESERVED (1<<31) #define MAP_PAGE_RESERVED (1<<31)
typedef unsigned int mem_map_t; typedef unsigned int mem_map_t;
...@@ -37,10 +44,12 @@ typedef unsigned int mem_map_t; ...@@ -37,10 +44,12 @@ typedef unsigned int mem_map_t;
* These are used to make use of C type-checking.. * These are used to make use of C type-checking..
*/ */
typedef struct { unsigned long pte; } pte_t; typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pgd; } pgd_t; typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t; typedef struct { unsigned long pgprot; } pgprot_t;
#define pte_val(x) ((x).pte) #define pte_val(x) ((x).pte)
#define pmd_val(x) ((x).pmd)
#define pgd_val(x) ((x).pgd) #define pgd_val(x) ((x).pgd)
#define pgprot_val(x) ((x).pgprot) #define pgprot_val(x) ((x).pgprot)
...@@ -53,10 +62,12 @@ typedef struct { unsigned long pgprot; } pgprot_t; ...@@ -53,10 +62,12 @@ typedef struct { unsigned long pgprot; } pgprot_t;
* .. while these make it easier on the compiler * .. while these make it easier on the compiler
*/ */
typedef unsigned long pte_t; typedef unsigned long pte_t;
typedef unsigned long pmd_t;
typedef unsigned long pgd_t; typedef unsigned long pgd_t;
typedef unsigned long pgprot_t; typedef unsigned long pgprot_t;
#define pte_val(x) (x) #define pte_val(x) (x)
#define pmd_val(x) (x)
#define pgd_val(x) (x) #define pgd_val(x) (x)
#define pgprot_val(x) (x) #define pgprot_val(x) (x)
...@@ -141,7 +152,7 @@ typedef unsigned long pgprot_t; ...@@ -141,7 +152,7 @@ typedef unsigned long pgprot_t;
* for zero-mapped memory areas etc.. * for zero-mapped memory areas etc..
*/ */
extern pte_t __bad_page(void); extern pte_t __bad_page(void);
extern pte_t * __bad_pagetable(void); extern pmd_t * __bad_pagetable(void);
extern unsigned long __zero_page(void); extern unsigned long __zero_page(void);
...@@ -152,12 +163,6 @@ extern unsigned long __zero_page(void); ...@@ -152,12 +163,6 @@ extern unsigned long __zero_page(void);
/* number of bits that fit into a memory pointer */ /* number of bits that fit into a memory pointer */
#define BITS_PER_PTR (8*sizeof(unsigned long)) #define BITS_PER_PTR (8*sizeof(unsigned long))
/* to mask away the intra-page address bits */
#define PAGE_MASK (~(PAGE_SIZE-1))
/* to mask away the intra-page address bits */
#define PGDIR_MASK (~(PGDIR_SIZE-1))
/* to align the pointer to the (next) page boundary */ /* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
...@@ -171,23 +176,12 @@ extern unsigned long __zero_page(void); ...@@ -171,23 +176,12 @@ extern unsigned long __zero_page(void);
#define PAGE_PTR(address) \ #define PAGE_PTR(address) \
((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK) ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
/* the no. of pointers that fit on a page */ /* This one will go away */
#define PTRS_PER_PAGE (PAGE_SIZE/sizeof(void*)) #define PTRS_PER_PAGE 1024
/* to set the page-dir */
extern inline void SET_PAGE_DIR(struct task_struct * tsk, pgd_t * pgdir)
{
tsk->tss.ptbr = ((unsigned long) pgdir - PAGE_OFFSET) >> PAGE_SHIFT;
if (tsk == current)
invalidate();
}
/* to find an entry in a page-table-directory */ #define PTRS_PER_PTE 1024
extern inline pgd_t * PAGE_DIR_OFFSET(struct task_struct * tsk, unsigned long address) #define PTRS_PER_PMD 1024
{ #define PTRS_PER_PGD 1024
return (pgd_t *) ((tsk->tss.ptbr << PAGE_SHIFT) + PAGE_OFFSET) +
((address >> 33) & PTR_MASK);
}
extern unsigned long high_memory; extern unsigned long high_memory;
...@@ -196,23 +190,37 @@ extern unsigned long high_memory; ...@@ -196,23 +190,37 @@ extern unsigned long high_memory;
* and a page entry and page directory to the page they refer to. * and a page entry and page directory to the page they refer to.
*/ */
extern inline pte_t mk_pte(unsigned long page, pgprot_t pgprot) extern inline pte_t mk_pte(unsigned long page, pgprot_t pgprot)
{ pte_t pte; pte_val(pte) = (page << (32-PAGE_SHIFT)) | pgprot_val(pgprot); return pte; } { pte_t pte; pte_val(pte) = ((page-PAGE_OFFSET) << (32-PAGE_SHIFT)) | pgprot_val(pgprot); return pte; }
extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } { pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
extern inline void pgd_set(pgd_t * pgdp, pte_t * ptep) extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
{ pgd_val(*pgdp) = _PAGE_TABLE | (((unsigned long) ptep) << (32-PAGE_SHIFT)); } { pmd_val(*pmdp) = _PAGE_TABLE | ((((unsigned long) ptep) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
{ pgd_val(*pgdp) = _PAGE_TABLE | ((((unsigned long) pmdp) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
extern inline unsigned long pte_page(pte_t pte) { return (pte_val(pte) & _PFN_MASK) >> (32-PAGE_SHIFT); } extern inline unsigned long pte_page(pte_t pte)
extern inline unsigned long pgd_page(pgd_t pgd) { return (pgd_val(pgd) & _PFN_MASK) >> (32-PAGE_SHIFT); } { return PAGE_OFFSET + ((pte_val(pte) & _PFN_MASK) >> (32-PAGE_SHIFT)); }
extern inline pte_t * pmd_page(pmd_t pmd)
{ return (pte_t *) (PAGE_OFFSET + ((pmd_val(pmd) & _PFN_MASK) >> (32-PAGE_SHIFT))); }
extern inline pmd_t * pgd_page(pgd_t pgd)
{ return (pmd_t *) (PAGE_OFFSET + ((pgd_val(pgd) & _PFN_MASK) >> (32-PAGE_SHIFT))); }
extern inline int pte_none(pte_t pte) { return !pte_val(pte); } extern inline int pte_none(pte_t pte) { return !pte_val(pte); }
extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_VALID; } extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_VALID; }
extern inline void pte_clear(pte_t *ptep) { pte_val(*ptep) = 0; } extern inline void pte_clear(pte_t *ptep) { pte_val(*ptep) = 0; }
extern inline int pmd_none(pmd_t pmd) { return !pmd_val(pmd); }
extern inline int pmd_bad(pmd_t pmd) { return (pmd_val(pmd) & ~_PFN_MASK) != _PAGE_TABLE || (unsigned long) pmd_page(pmd) > high_memory; }
extern inline int pmd_present(pmd_t pmd) { return pmd_val(pmd) & _PAGE_VALID; }
extern inline void pmd_clear(pmd_t * pmdp) { pmd_val(*pmdp) = 0; }
extern inline int pgd_none(pgd_t pgd) { return !pgd_val(pgd); } extern inline int pgd_none(pgd_t pgd) { return !pgd_val(pgd); }
extern inline int pgd_bad(pgd_t pgd) { return (pgd_val(pgd) & ~_PFN_MASK) != _PAGE_TABLE || pgd_page(pgd) > high_memory; } extern inline int pgd_bad(pgd_t pgd) { return (pgd_val(pgd) & ~_PFN_MASK) != _PAGE_TABLE || (unsigned long) pgd_page(pgd) > high_memory; }
extern inline int pgd_present(pgd_t pgd) { return pgd_val(pgd) & _PAGE_VALID; } extern inline int pgd_present(pgd_t pgd) { return pgd_val(pgd) & _PAGE_VALID; }
extern inline void pgd_clear(pgd_t * pgdp) { pgd_val(*pgdp) = 0; } extern inline void pgd_clear(pgd_t * pgdp) { pgd_val(*pgdp) = 0; }
...@@ -240,6 +248,83 @@ extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; retur ...@@ -240,6 +248,83 @@ extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; retur
extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; } extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; }
extern inline pte_t pte_mkcow(pte_t pte) { pte_val(pte) |= _PAGE_COW; return pte; } extern inline pte_t pte_mkcow(pte_t pte) { pte_val(pte) |= _PAGE_COW; return pte; }
/* to set the page-dir */
extern inline void SET_PAGE_DIR(struct task_struct * tsk, pgd_t * pgdir)
{
tsk->tss.ptbr = ((unsigned long) pgdir - PAGE_OFFSET) >> PAGE_SHIFT;
if (tsk == current)
invalidate();
}
/* to find an entry in a page-table-directory */
extern inline pgd_t * PAGE_DIR_OFFSET(struct task_struct * tsk, unsigned long address)
{
return (pgd_t *) ((tsk->tss.ptbr << PAGE_SHIFT) + PAGE_OFFSET) +
((address >> 33) & (PTRS_PER_PGD - 1));
}
/* to find an entry in the second-level page-table-directory */
extern inline pmd_t * PAGE_MIDDLE_OFFSET(pgd_t * dir, unsigned long address)
{
return pgd_page(*dir) + ((address >> 23) & (PTRS_PER_PMD - 1));
}
/* to find an entry in the third-level page-table-directory */
extern inline pte_t * PAGE_ENTRY_OFFSET(pmd_t * dir, unsigned long address)
{
return pmd_page(*dir) + ((address >> 13) & (PTRS_PER_PTE - 1));
}
extern inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address)
{
unsigned long page;
address = (address >> 13) & (PTRS_PER_PTE - 1);
if (pmd_none(*pmd)) {
pte_t *page = (pte_t *) get_free_page(GFP_KERNEL);
if (pmd_none(*pmd)) {
if (page) {
pmd_set(pmd, page);
return page + address;
}
pmd_set(pmd, BAD_PAGETABLE);
return NULL;
}
free_page((unsigned long) page);
}
if (pmd_bad(*pmd)) {
printk("pte_alloc: bad pmd\n");
pmd_set(pmd, BAD_PAGETABLE);
return NULL;
}
return pmd_page(*pmd) + address;
}
extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address)
{
unsigned long page;
address = (address >> 23) & (PTRS_PER_PMD - 1);
if (pgd_none(*pgd)) {
pmd_t *page = (pmd_t *) get_free_page(GFP_KERNEL);
if (pgd_none(*pgd)) {
if (page) {
pgd_set(pgd, page);
return page + address;
}
pgd_set(pgd, BAD_PAGETABLE);
return NULL;
}
free_page((unsigned long) page);
}
if (pgd_bad(*pgd)) {
printk("pmd_alloc: bad pgd\n");
pgd_set(pgd, BAD_PAGETABLE);
return NULL;
}
return pgd_page(*pgd) + address;
}
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ALPHA_PAGE_H */ #endif /* _ALPHA_PAGE_H */
#ifndef __ALPHA_STRING_H #ifndef __ALPHA_STRING_H
#define __ALPHA_STRING_H #define __ALPHA_STRING_H
extern void * __constant_c_memset(void *, unsigned long, long);
extern void * __memset(void *, char, size_t);
#define memset(s, c, count) \
(__builtin_constant_p(c) ? \
__constant_c_memset((s),(0x01010101UL*(unsigned char)c),(count)) : \
__memset((s),(c),(count)))
#endif #endif
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
#define BOOT_SIZE (16*1024) #define BOOT_SIZE (16*1024)
#define KERNEL_START 0xfffffc0000300000 #define KERNEL_START 0xfffffc0000300000
#define INIT_PCB 0xfffffc0000300000 #define SWAPPER_PGD 0xfffffc0000300000
#define INIT_STACK 0xfffffc0000302000 #define INIT_STACK 0xfffffc0000302000
#define EMPTY_PGT 0xfffffc0000304000 #define EMPTY_PGT 0xfffffc0000304000
#define EMPTY_PGE 0xfffffc0000308000 #define EMPTY_PGE 0xfffffc0000308000
#define ZERO_PGE 0xfffffc000030A000 #define ZERO_PGE 0xfffffc000030A000
#define SWAPPER_PGD 0xfffffc000030C000
#define START_ADDR 0xfffffc0000310000 #define START_ADDR 0xfffffc0000310000
#define START_SIZE (1024*1024) #define START_SIZE (1024*1024)
......
...@@ -67,6 +67,7 @@ enum nfs_stat { ...@@ -67,6 +67,7 @@ enum nfs_stat {
NFSERR_NOENT = 2, NFSERR_NOENT = 2,
NFSERR_IO = 5, NFSERR_IO = 5,
NFSERR_NXIO = 6, NFSERR_NXIO = 6,
NFSERR_EAGAIN = 11,
NFSERR_ACCES = 13, NFSERR_ACCES = 13,
NFSERR_EXIST = 17, NFSERR_EXIST = 17,
NFSERR_NODEV = 19, NFSERR_NODEV = 19,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS) #define PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS)
#define PER_ISCR4 (0x0005 | STICKY_TIMEOUTS) #define PER_ISCR4 (0x0005 | STICKY_TIMEOUTS)
#define PER_BSD (0x0006) #define PER_BSD (0x0006)
#define PER_XENIX (0x0007 | STICKY_TIMEOUTS)
/* Prototype for an lcall7 syscall handler. */ /* Prototype for an lcall7 syscall handler. */
typedef asmlinkage void (*lcall7_func)(struct pt_regs *); typedef asmlinkage void (*lcall7_func)(struct pt_regs *);
......
...@@ -526,7 +526,6 @@ Read XA Parameter: ...@@ -526,7 +526,6 @@ Read XA Parameter:
*/ */
#define CMD1_RESET 0x0a #define CMD1_RESET 0x0a
#define CMD2_RESET 0x01 #define CMD2_RESET 0x01
#define CMDL_RESET 0x0a
#define CMDT_RESET 0xc0 #define CMDT_RESET 0xc0
#define CMD1_LOCK_CTL 0x0c #define CMD1_LOCK_CTL 0x0c
#define CMD2_LOCK_CTL 0x1e #define CMD2_LOCK_CTL 0x1e
...@@ -537,7 +536,6 @@ Read XA Parameter: ...@@ -537,7 +536,6 @@ Read XA Parameter:
#define CMDL_TRAY_CTL 0x0d #define CMDL_TRAY_CTL 0x0d
#define CMDT_TRAY_CTL 0x1b #define CMDT_TRAY_CTL 0x1b
#define CMD1_MULTISESS 0x8d #define CMD1_MULTISESS 0x8d
#define CMD2_MULTISESS 0x43
#define CMDL_MULTISESS 0x8c #define CMDL_MULTISESS 0x8c
#define CMD1_SUBCHANINF 0x11 #define CMD1_SUBCHANINF 0x11
#define CMD2_SUBCHANINF 0x #define CMD2_SUBCHANINF 0x
...@@ -628,7 +626,7 @@ Read XA Parameter: ...@@ -628,7 +626,7 @@ Read XA Parameter:
#define CMD0_DISKCODE 0x8a #define CMD0_DISKCODE 0x8a
#define CMD0_DISKINFO 0x8b #define CMD0_DISKINFO 0x8b
#define CMD1_DISKINFO 0x8b #define CMD1_DISKINFO 0x8b
#define CMD2_DISKINFO 0x #define CMD2_DISKINFO 0x43
#define CMDL_DISKINFO 0x8b #define CMDL_DISKINFO 0x8b
#define CMDT_DISKINFO 0x43 #define CMDT_DISKINFO 0x43
#define CMD0_READTOC 0x8c #define CMD0_READTOC 0x8c
......
...@@ -68,7 +68,7 @@ __res; }) ...@@ -68,7 +68,7 @@ __res; })
static char * number(char * str, long num, int base, int size, int precision static char * number(char * str, long num, int base, int size, int precision
,int type) ,int type)
{ {
char c,sign,tmp[36]; char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
int i; int i;
......
...@@ -162,9 +162,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, unsigned long info, s ...@@ -162,9 +162,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, unsigned long info, s
icmph->type == ICMP_PARAMETERPROB) icmph->type == ICMP_PARAMETERPROB)
return; return;
} }
return;
} }
icmp_statistics.IcmpOutMsgs++; icmp_statistics.IcmpOutMsgs++;
......
...@@ -63,6 +63,7 @@ static void igmp_start_timer(struct ip_mc_list *im) ...@@ -63,6 +63,7 @@ static void igmp_start_timer(struct ip_mc_list *im)
return; return;
tv=random()%(10*HZ); /* Pick a number any number 8) */ tv=random()%(10*HZ); /* Pick a number any number 8) */
im->timer.expires=tv; im->timer.expires=tv;
im->tm_running=1;
add_timer(&im->timer); add_timer(&im->timer);
} }
......
...@@ -606,6 +606,7 @@ static int tcp_write_timeout(struct sock *sk) ...@@ -606,6 +606,7 @@ static int tcp_write_timeout(struct sock *sk)
if (sk->retransmits > TCP_RETR2) if (sk->retransmits > TCP_RETR2)
{ {
sk->err = ETIMEDOUT; sk->err = ETIMEDOUT;
sk->error_report(sk);
/* /*
* Time wait the socket * Time wait the socket
*/ */
......
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