summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-03-25 23:40:36 +0000
committer <ralf@linux-mips.org>1997-03-25 23:40:36 +0000
commit7206675c40394c78a90e74812bbdbf8cf3cca1be (patch)
tree251895cf5a0008e2b4ce438cb01ad4d55fb5b97b /fs
parentbeb116954b9b7f3bb56412b2494b562f02b864b1 (diff)
Import of Linux/MIPS 2.1.14.2
Diffstat (limited to 'fs')
-rw-r--r--fs/.cvsignore1
-rw-r--r--fs/affs/.cvsignore1
-rw-r--r--fs/binfmt_elf.c81
-rw-r--r--fs/exec.c11
-rw-r--r--fs/ext/.cvsignore1
-rw-r--r--fs/ext2/.cvsignore1
-rw-r--r--fs/fat/.cvsignore1
-rw-r--r--fs/fat/inode.c8
-rw-r--r--fs/hpfs/.cvsignore1
-rw-r--r--fs/inode.c3
-rw-r--r--fs/isofs/.cvsignore1
-rw-r--r--fs/minix/.cvsignore1
-rw-r--r--fs/msdos/.cvsignore1
-rw-r--r--fs/namei.c9
-rw-r--r--fs/ncpfs/.cvsignore1
-rw-r--r--fs/nfs/.cvsignore1
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/nfsroot.c1
-rw-r--r--fs/nfs/sock.c8
-rw-r--r--fs/proc/.cvsignore1
-rw-r--r--fs/proc/array.c19
-rw-r--r--fs/smbfs/.cvsignore1
-rw-r--r--fs/sysv/.cvsignore1
-rw-r--r--fs/ufs/.cvsignore1
-rw-r--r--fs/umsdos/.cvsignore1
-rw-r--r--fs/vfat/.cvsignore1
-rw-r--r--fs/xiafs/.cvsignore1
27 files changed, 124 insertions, 36 deletions
diff --git a/fs/.cvsignore b/fs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/affs/.cvsignore b/fs/affs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/affs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 689c52f0d..9af62dafc 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -37,6 +37,8 @@
#include <linux/elf.h>
+#undef DEBUG_ELF
+
static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
static int load_elf_library(int fd);
extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
@@ -63,6 +65,27 @@ static struct linux_binfmt elf_format = {
#endif
};
+#ifdef DEBUG_ELF
+/* Debugging routines. */
+static void print_elf_p_type(Elf32_Word p_type)
+{
+ int i = (int) p_type;
+
+ switch(i) {
+ case PT_NULL: printk("<PT_NULL> "); break;
+ case PT_LOAD: printk("<PT_LOAD> "); break;
+ case PT_DYNAMIC: printk("<PT_DYNAMIC> "); break;
+ case PT_INTERP: printk("<PT_INTERP> "); break;
+ case PT_NOTE: printk("<PT_NOTE> "); break;
+ case PT_SHLIB: printk("<PT_SHLIB> "); break;
+ case PT_PHDR: printk("<PT_PHDR> "); break;
+ case PT_LOPROC: printk("<PT_LOPROC/REGINFO> "); break;
+ case PT_HIPROC: printk("<PT_HIPROC> "); break;
+ default: printk("<whee %08lx> ", (unsigned long) i); break;
+ }
+}
+#endif /* (DEBUG_ELF) */
+
static void set_brk(unsigned long start, unsigned long end)
{
start = PAGE_ALIGN(start);
@@ -99,11 +122,23 @@ unsigned long * create_elf_tables(char *p, int argc, int envc,
{
char **argv, **envp;
unsigned long *sp;
+#ifdef __mips__
+ unsigned long * csp;
+#endif
/*
* Force 16 byte alignment here for generality.
*/
sp = (unsigned long *) (~15UL & (unsigned long) p);
+#ifdef __mips__
+ /* Make sure we will be aligned properly at the end of this. */
+ csp = sp;
+ csp -= exec ? DLINFO_ITEMS*2 : 2;
+ csp -= envc + 1;
+ csp -= argc+1;
+ if (!(((unsigned long) csp) & 4))
+ sp--;
+#endif
/*
* Put the ELF interpreter info on the stack
@@ -171,7 +206,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
struct file * file;
struct elf_phdr *elf_phdata = NULL;
struct elf_phdr *eppnt;
- unsigned long load_addr, load_off;
+ unsigned long load_addr;
int load_addr_set = 0;
int elf_exec_fileno;
int retval;
@@ -181,14 +216,21 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
elf_bss = 0;
last_bss = 0;
- error = load_off = load_addr = 0;
+ error = load_addr = 0;
+#ifdef DEBUG_ELF
+ printk("[load_elf_interp] ");
+#endif
+
/* First of all, some simple consistency checks */
if ((interp_elf_ex->e_type != ET_EXEC &&
interp_elf_ex->e_type != ET_DYN) ||
!elf_check_arch(interp_elf_ex->e_machine) ||
(!interpreter_inode->i_op ||
!interpreter_inode->i_op->default_file_ops->mmap)){
+#ifdef DEBUG_ELF
+ printk("bad e_type %d ", interp_elf_ex->e_type);
+#endif
return ~0UL;
}
@@ -253,7 +295,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
}
error = do_mmap(file,
- ELF_PAGESTART(vaddr) + load_off,
+ load_addr + ELF_PAGESTART(vaddr),
eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr),
elf_prot,
elf_type,
@@ -266,24 +308,21 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
return ~0UL;
}
- if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
- load_off = error - ELF_PAGESTART(vaddr);
- load_addr = error;
- load_addr_set = 1;
- }
+ if (!load_addr && interp_elf_ex->e_type == ET_DYN)
+ load_addr = (vaddr & 0xfffff000) - error;
/*
* Find the end of the file mapping for this phdr, and keep
* track of the largest address we see for this.
*/
- k = load_off + eppnt->p_vaddr + eppnt->p_filesz;
+ k = load_addr + eppnt->p_vaddr + eppnt->p_filesz;
if (k > elf_bss) elf_bss = k;
/*
* Do the same thing for the memory mapping - between
* elf_bss and last_bss is the bss section.
*/
- k = load_off + eppnt->p_memsz + eppnt->p_vaddr;
+ k = load_addr + eppnt->p_memsz + eppnt->p_vaddr;
if (k > last_bss) last_bss = k;
}
@@ -308,7 +347,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
kfree(elf_phdata);
*interp_load_addr = load_addr;
- return ((unsigned long) interp_elf_ex->e_entry) + load_off;
+ return ((unsigned long) interp_elf_ex->e_entry) + load_addr;
}
static unsigned long load_aout_interp(struct exec * interp_ex,
@@ -405,8 +444,13 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
return -ENOEXEC;
}
+#ifdef __mips__
+ /* IRIX binaries handled elsewhere. */
+ if(elf_ex.e_flags & EF_MIPS_ARCH)
+ return -ENOEXEC;
+#endif
+
/* Now read in all of the header information */
-
elf_phdata = (struct elf_phdr *) kmalloc(elf_ex.e_phentsize *
elf_ex.e_phnum, GFP_KERNEL);
if (elf_phdata == NULL) {
@@ -475,8 +519,13 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
#if 0
printk("Using ELF interpreter %s\n", elf_interpreter);
#endif
- if (retval >= 0)
- retval = knamei(elf_interpreter, &interpreter_inode);
+ if (retval >= 0) {
+ old_fs = get_fs(); /* This could probably be optimized */
+ set_fs(get_ds());
+ retval = open_namei(elf_interpreter, 0, 0,
+ &interpreter_inode, NULL);
+ set_fs(old_fs);
+ }
if (retval >= 0)
retval = read_exec(interpreter_inode,0,bprm->buf,128, 1);
@@ -529,7 +578,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
sprintf(passed_fileno, "%d", elf_exec_fileno);
passed_p = passed_fileno;
- if (elf_interpreter) {
+ if(elf_interpreter) {
bprm->p = copy_strings(1,&passed_p,bprm->page,bprm->p,2);
bprm->argc++;
}
@@ -677,7 +726,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
padzero(elf_bss);
-#if 0
+#ifdef DEBUG_ELF
printk("(start_brk) %x\n" , current->mm->start_brk);
printk("(end_code) %x\n" , current->mm->end_code);
printk("(start_code) %x\n" , current->mm->start_code);
diff --git a/fs/exec.c b/fs/exec.c
index 421300b05..878c65dd6 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -67,6 +67,10 @@ void binfmt_setup(void)
init_elf_binfmt();
#endif
+#ifdef CONFIG_BINFMT_IRIX
+ init_irix_binfmt();
+#endif
+
#ifdef CONFIG_BINFMT_AOUT
init_aout_binfmt();
#endif
@@ -399,7 +403,7 @@ static inline void flush_old_signals(struct signal_struct *sig)
struct sigaction * sa = sig->action;
for (i=32 ; i != 0 ; i--) {
- u_sigemptyset(&current->sig->action[i].sa_mask);
+ u_sigemptyset(&sa->sa_mask);
sa->sa_flags = 0;
if (sa->sa_handler != SIG_IGN)
sa->sa_handler = NULL;
@@ -454,8 +458,9 @@ void flush_old_exec(struct linux_binprm * bprm)
if (bprm->e_uid != current->euid || bprm->e_gid != current->egid ||
permission(bprm->inode,MAY_READ))
current->dumpable = 0;
- flush_old_signals(current->sig);
- flush_old_files(current->files);
+
+ flush_old_signals(current->sig);
+ flush_old_files(current->files);
}
/*
diff --git a/fs/ext/.cvsignore b/fs/ext/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/ext/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/ext2/.cvsignore b/fs/ext2/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/ext2/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/fat/.cvsignore b/fs/fat/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/fat/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 55d91ba2b..311907407 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -3,8 +3,6 @@
*
* Written 1992,1993 by Werner Almesberger
* VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner
- *
- * 3 May 1996 Fixed alignment problems for RISC architectures.
*/
#define __NO_VERSION__
@@ -246,7 +244,6 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
#define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
/* don't divide by zero */
- logical_sector_size = b->sector_size[0] | (b->sector_size[1] << 8);
logical_sector_size =
CF_LE_W(get_unaligned((unsigned short *) &b->sector_size));
sector_mult = logical_sector_size >> SECTOR_BITS;
@@ -261,9 +258,6 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
MSDOS_SB(sb)->data_start = MSDOS_SB(sb)->dir_start+ROUND_TO_MULTIPLE((
MSDOS_SB(sb)->dir_entries << MSDOS_DIR_BITS) >> SECTOR_BITS,
sector_mult);
- data_sectors = ((b->sectors[0] | (b->sectors[1] << 8)) ?
- (b->sectors[0] | (b->sectors[1] << 8)) :
- CF_LE_L(b->total_sect))*sector_mult-MSDOS_SB(sb)->data_start;
data_sectors = CF_LE_W(get_unaligned((unsigned short *) &b->sectors));
if (!data_sectors) {
data_sectors = CF_LE_L(b->total_sect);
@@ -304,7 +298,7 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
MSDOS_SB(sb)->fats,MSDOS_SB(sb)->fat_start,MSDOS_SB(sb)->fat_length,
MSDOS_SB(sb)->dir_start,MSDOS_SB(sb)->dir_entries,
MSDOS_SB(sb)->data_start,
- (b->sectors[0] | (b->sectors[1] << 8)),
+ CF_LE_W(*(unsigned short *) &b->sectors),
(unsigned long)b->total_sect,logical_sector_size);
printk ("Transaction block size = %d\n",blksize);
}
diff --git a/fs/hpfs/.cvsignore b/fs/hpfs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/hpfs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/inode.c b/fs/inode.c
index a304b55c9..724e8c4cd 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -422,8 +422,7 @@ void iput(struct inode * inode)
if (!inode->i_count) {
printk("VFS: iput: trying to free free inode\n");
printk("VFS: device %s, inode %lu, mode=0%07o\n",
- kdevname(inode->i_rdev), inode->i_ino,
- (unsigned int) inode->i_mode);
+ kdevname(inode->i_rdev), inode->i_ino, (int) inode->i_mode);
return;
}
if (inode->i_pipe)
diff --git a/fs/isofs/.cvsignore b/fs/isofs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/isofs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/minix/.cvsignore b/fs/minix/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/minix/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/msdos/.cvsignore b/fs/msdos/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/msdos/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/namei.c b/fs/namei.c
index a50881bc8..2b456c72f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -240,8 +240,8 @@ static int dir_namei(const char *pathname, int *namelen, const char **name,
return 0;
}
-int _namei(const char * pathname, struct inode * base,
- int follow_links, struct inode ** res_inode)
+static int _namei(const char * pathname, struct inode * base,
+ int follow_links, struct inode ** res_inode)
{
const char *basename;
int namelen,error;
@@ -313,8 +313,13 @@ int namei(const char *pathname, struct inode **res_inode)
* which is a lot more logical, and also allows the "no perm" needed
* for symlinks (where the permissions are checked later).
*/
+#ifdef __mips__
+int do_open_namei(const char * pathname, int flag, int mode,
+ struct inode ** res_inode, struct inode * base)
+#else
int open_namei(const char * pathname, int flag, int mode,
struct inode ** res_inode, struct inode * base)
+#endif
{
const char * basename;
int namelen,error;
diff --git a/fs/ncpfs/.cvsignore b/fs/ncpfs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/ncpfs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/nfs/.cvsignore b/fs/nfs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/nfs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index de77a5a6c..5ec19b0c2 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -118,7 +118,7 @@ static long nfs_file_write(struct inode *inode, struct file *file,
}
if (!S_ISREG(inode->i_mode)) {
printk("nfs_file_write: write to non-file, mode %07o\n",
- (unsigned int) inode->i_mode);
+ (unsigned int) inode->i_mode);
return -EINVAL;
}
if (count == 0)
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index c72685800..2f12cae9b 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -72,7 +72,6 @@
#include <linux/fcntl.h>
#include <asm/param.h>
-#include <asm/segment.h>
#include <linux/utsname.h>
#include <linux/in.h>
#include <linux/if.h>
diff --git a/fs/nfs/sock.c b/fs/nfs/sock.c
index 745a33639..6191cfeb3 100644
--- a/fs/nfs/sock.c
+++ b/fs/nfs/sock.c
@@ -102,9 +102,17 @@ nfs_rpc_doio(struct nfs_server *server, struct rpc_ioreq *req, int async)
break;
}
if (!major_timeout_seen) {
+#if defined(CONFIG_SGISEEQ) && 1
+ extern void sgiseeq_dump_rings(void);
+ extern void sgiseeq_my_reset(void);
+#endif
printk("NFS server %s not responding, "
"still trying.\n", server->hostname);
major_timeout_seen = 1;
+#if defined(CONFIG_SGISEEQ) && 1
+ sgiseeq_dump_rings();
+ sgiseeq_my_reset();
+#endif
}
if ((timeout.to_initval <<= 1) >= maxtimeo) {
timeout.to_initval = maxtimeo;
diff --git a/fs/proc/.cvsignore b/fs/proc/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/proc/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/proc/array.c b/fs/proc/array.c
index f0bf55221..20cac345a 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -408,9 +408,6 @@ static int get_arg(int pid, char * buffer)
return get_array(p, (*p)->mm->arg_start, (*p)->mm->arg_end, buffer);
}
-#ifdef __mips__
-extern unsigned long (*get_wchan)(struct task_struct *p);
-#else
static unsigned long get_wchan(struct task_struct *p)
{
if (!p || p == current || p->state == TASK_RUNNING)
@@ -456,11 +453,25 @@ static unsigned long get_wchan(struct task_struct *p)
}
return pc;
}
+#elif defined(__mips__)
+ /*
+ * The same comment as on the Alpha applies here, too ...
+ */
+ {
+ unsigned long schedule_frame;
+ unsigned long pc;
+
+ pc = thread_saved_pc(&p->tss);
+ if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) {
+ schedule_frame = ((unsigned long *)(long)p->tss.reg30)[15];
+ return (unsigned long)((unsigned long *)schedule_frame)[11];
+ }
+ return pc;
+ }
#endif
return 0;
}
-#endif
#if defined(__i386__)
# define KSTK_EIP(tsk) (((unsigned long *)tsk->kernel_stack_page)[1019])
diff --git a/fs/smbfs/.cvsignore b/fs/smbfs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/smbfs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/sysv/.cvsignore b/fs/sysv/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/sysv/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/ufs/.cvsignore b/fs/ufs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/ufs/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/umsdos/.cvsignore b/fs/umsdos/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/umsdos/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/vfat/.cvsignore b/fs/vfat/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/vfat/.cvsignore
@@ -0,0 +1 @@
+.depend
diff --git a/fs/xiafs/.cvsignore b/fs/xiafs/.cvsignore
new file mode 100644
index 000000000..4671378ae
--- /dev/null
+++ b/fs/xiafs/.cvsignore
@@ -0,0 +1 @@
+.depend