Commit 1650f8d3 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.14

parent 98606bdd
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 13
SUBLEVEL = 14
all: Version zImage
......
......@@ -17,7 +17,9 @@ if [ "$CONFIG_NET" = "y" ]; then
comment 'Networking options'
bool 'TCP/IP networking' CONFIG_INET y
if [ "$CONFIG_INET" "=" "y" ]; then
bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n
comment '(it is safe to leave these untouched)'
bool 'PC/TCP compatibility mode' CONFIG_INET_PCTCP n
bool 'Reverse ARP' CONFIG_INET_RARP n
bool 'Assume subnets are local' CONFIG_INET_SNARL y
bool 'Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n
......@@ -26,11 +28,6 @@ bool 'The IPX protocol' CONFIG_IPX y
#bool 'Amateur Radio AX.25 Level 2' CONFIG_AX25 n
fi
comment 'Program binary formats'
bool 'Elf executables' CONFIG_BINFMT_ELF y
bool 'COFF executables' CONFIG_BINFMT_COFF y
comment 'SCSI support'
bool 'SCSI support?' CONFIG_SCSI n
......@@ -78,7 +75,7 @@ if [ "$CONFIG_SLIP" = "y" ]; then
bool ' CSLIP compressed headers' SL_COMPRESSED y
# bool ' SLIP debugging on' SL_DUMP y
fi
#bool 'PPP (point-to-point) support' CONFIG_PPP n
bool 'PPP (point-to-point) support' CONFIG_PPP n
bool 'Load balancing support (very experimental)' CONFIG_SLAVE_BALANCING n
bool 'PLIP (parallel port) support' CONFIG_PLIP n
bool 'NE2000/NE1000 support' CONFIG_NE2000 n
......
......@@ -881,9 +881,9 @@ mcd_init(unsigned long mem_start, unsigned long mem_end)
/* don't get the IRQ until we know for sure the drive is there */
if (irqaction(MCD_INTR_NR, &mcd_sigaction))
if (irqaction(mcd_irq, &mcd_sigaction))
{
printk("mcd: Unable to get IRQ%d for Mitsumi CD-ROM\n", MCD_INTR_NR);
printk("mcd: Unable to get IRQ%d for Mitsumi CD-ROM\n", mcd_irq);
return mem_start;
}
snarf_region(mcd_port, 4);
......
......@@ -123,7 +123,6 @@
#include <linux/signal.h>
#endif SBPCD_USE_IRQ
#include <linux/ddi.h>
#include <linux/major.h>
#include <asm/system.h>
......@@ -142,6 +141,11 @@
#error "SBPCD: \"make config\" again. File system iso9660 is necessary."
#endif
/*
* This may come back some day..
*/
#define DDIOCSDBG 0x9000
/*
* still testing around...
*/
......
......@@ -40,13 +40,6 @@ ifdef CONFIG_HPFS_FS
FS_SUBDIRS := $(FS_SUBDIRS) hpfs
endif
ifdef CONFIG_BINFMT_ELF
BINFMTS := $(BINFMTS) binfmt_elf.o
endif
ifdef CONFIG_BINFMT_COFF
BINFMTS := $(BINFMTS) binfmt_coff.o
endif
.c.s:
$(CC) $(CFLAGS) -S $<
.c.o:
......
......@@ -53,6 +53,47 @@ asmlinkage int sys_brk(unsigned long);
extern void shm_exit (void);
static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout_library(int fd);
/*
* Here are the actual binaries that will be accepted:
* add more with "register_binfmt()"..
*/
static struct linux_binfmt aout_format = { NULL, load_aout_binary, load_aout_library };
static struct linux_binfmt *formats = &aout_format;
int register_binfmt(struct linux_binfmt * fmt)
{
struct linux_binfmt ** tmp = &formats;
if (!fmt)
return -EINVAL;
if (fmt->next)
return -EBUSY;
while (*tmp) {
if (fmt == *tmp)
return -EBUSY;
tmp = &(*tmp)->next;
}
*tmp = fmt;
return 0;
}
int unregister_binfmt(struct linux_binfmt * fmt)
{
struct linux_binfmt ** tmp = &formats;
while (*tmp) {
if (fmt == *tmp) {
*tmp = fmt->next;
return 0;
}
tmp = &(*tmp)->next;
}
return -EINVAL;
}
int open_inode(struct inode * inode, int mode)
{
int error, fd;
......@@ -247,14 +288,14 @@ asmlinkage int sys_uselib(const char * library)
file = current->files->fd[fd];
retval = -ENOEXEC;
if (file && file->f_inode && file->f_op && file->f_op->read) {
fmt = formats;
do {
for (fmt = formats ; fmt ; fmt = fmt->next) {
int (*fn)(int) = fmt->load_shlib;
if (!fn)
break;
retval = fn(fd);
fmt++;
} while (retval == -ENOEXEC);
if (retval != -ENOEXEC)
break;
}
}
sys_close(fd);
return retval;
......@@ -530,13 +571,13 @@ void flush_old_exec(struct linux_binprm * bprm)
if (last_task_used_math == current)
last_task_used_math = NULL;
current->used_math = 0;
current->elf_executable = 0;
current->personality = 0;
}
/*
* sys_execve() executes a new program.
*/
static int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs)
int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs)
{
struct linux_binprm bprm;
struct linux_binfmt * fmt;
......@@ -684,8 +725,7 @@ static int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs
}
bprm.sh_bang = sh_bang;
fmt = formats;
do {
for (fmt = formats ; fmt ; fmt = fmt->next) {
int (*fn)(struct linux_binprm *, struct pt_regs *) = fmt->load_binary;
if (!fn)
break;
......@@ -695,8 +735,9 @@ static int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs
current->did_exec = 1;
return 0;
}
fmt++;
} while (retval == -ENOEXEC);
if (retval != -ENOEXEC)
break;
}
exec_error2:
iput(bprm.inode);
exec_error1:
......@@ -721,39 +762,6 @@ asmlinkage int sys_execve(struct pt_regs regs)
return error;
}
/*
* These are the prototypes for the functions in the dispatch table, as
* well as the dispatch table itself.
*/
extern int load_aout_binary(struct linux_binprm *,
struct pt_regs * regs);
extern int load_aout_library(int fd);
#ifdef CONFIG_BINFMT_ELF
extern int load_elf_binary(struct linux_binprm *,
struct pt_regs * regs);
extern int load_elf_library(int fd);
#endif
#ifdef CONFIG_BINFMT_COFF
extern int load_coff_binary(struct linux_binprm *,
struct pt_regs * regs);
extern int load_coff_library(int fd);
#endif
/* Here are the actual binaries that will be accepted */
struct linux_binfmt formats[] = {
{load_aout_binary, load_aout_library},
#ifdef CONFIG_BINFMT_ELF
{load_elf_binary, load_elf_library},
#endif
#ifdef CONFIG_BINFMT_COFF
{load_coff_binary, load_coff_library},
#endif
{NULL, NULL}
};
static void set_brk(unsigned long start, unsigned long end)
{
start = PAGE_ALIGN(start);
......@@ -770,7 +778,7 @@ static void set_brk(unsigned long start, unsigned long end)
* libraries. There is no binary dependent code anywhere else.
*/
int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
{
struct exec ex;
struct file * file;
......@@ -868,7 +876,7 @@ int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
}
int load_aout_library(int fd)
static int load_aout_library(int fd)
{
struct file * file;
struct exec ex;
......
......@@ -280,6 +280,8 @@ static int proc_readnet(struct inode * inode, struct file * file,
* the start pointer and we know the length..
*/
if (length <= 0)
break;
/*
* Copy the bytes
*/
......
......@@ -3,6 +3,11 @@
*
* Created for Linux based loosely upon Mathius Lattner's minix
* patches by Peter MacDonald. Heavily edited by Linus.
*
* 4 February 1994
* COFF/ELF binary emulation. If the process has the STICKY_TIMEOUTS
* flag set in its personality we do *not* modify the given timeout
* parameter to reflect time remaining.
*/
#include <linux/types.h>
......@@ -14,6 +19,7 @@
#include <linux/stat.h>
#include <linux/signal.h>
#include <linux/errno.h>
#include <linux/personality.h>
#include <asm/segment.h>
#include <asm/system.h>
......@@ -235,7 +241,7 @@ asmlinkage int sys_select( unsigned long *buffer )
else
timeout = 0;
current->timeout = 0;
if (tvp) {
if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
put_fs_long(timeout/HZ, (unsigned long *) &tvp->tv_sec);
timeout %= HZ;
timeout *= (1000000/HZ);
......
This diff is collapsed.
This diff is collapsed.
......@@ -14,25 +14,28 @@
* This structure is used to hold the arguments that are used when loading binaries.
*/
struct linux_binprm{
char buf[128];
unsigned long page[MAX_ARG_PAGES];
unsigned long p;
int sh_bang;
struct inode * inode;
int e_uid, e_gid;
int argc, envc;
char * filename; /* Name of binary */
char buf[128];
unsigned long page[MAX_ARG_PAGES];
unsigned long p;
int sh_bang;
struct inode * inode;
int e_uid, e_gid;
int argc, envc;
char * filename; /* Name of binary */
};
/* This structure defines the functions that are used to load the binary formats that
* linux accepts. */
struct linux_binfmt{
int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
int (*load_shlib)(int fd);
/*
* This structure defines the functions that are used to load the binary formats that
* linux accepts.
*/
struct linux_binfmt {
struct linux_binfmt * next;
int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
int (*load_shlib)(int fd);
};
extern struct linux_binfmt formats[];
extern int register_binfmt(struct linux_binfmt *);
extern int unregister_binfmt(struct linux_binfmt *);
extern int read_exec(struct inode *inode, unsigned long offset,
char * addr, unsigned long count);
......
/* Flags for bug emulation. These occupy the top three bytes. */
#define STICKY_TIMEOUTS 0x8000000
#define WHOLE_SECONDS 0x4000000
/* Personality types. These go in the low byte. */
#define PER_MASK (0x00ff)
#define PER_LINUX (0x0000)
#define PER_SVR4 (0x0001 | STICKY_TIMEOUTS)
#define PER_SVR3 (0x0002 | STICKY_TIMEOUTS)
#define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
#define PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS)
#define PER_ISCR4 (0x0005 | STICKY_TIMEOUTS)
......@@ -254,10 +254,12 @@ struct task_struct {
/* various fields */
struct task_struct *next_task, *prev_task;
struct sigaction sigaction[32];
unsigned long * signal_map;
unsigned long * signal_invmap;
unsigned long saved_kernel_stack;
unsigned long kernel_stack_page;
int exit_code, exit_signal;
int elf_executable:1;
unsigned long personality;
int dumpable:1;
int did_exec:1;
int pid,pgrp,session,leader;
......@@ -323,7 +325,7 @@ struct task_struct {
/* state etc */ { 0,15,15,0,0,0,0, \
/* debugregs */ { 0, }, \
/* schedlink */ &init_task,&init_task, \
/* signals */ {{ 0, },}, \
/* signals */ {{ 0, },}, ident_map, ident_map, \
/* stack */ 0,(unsigned long) &init_kernel_stack, \
/* ec,brk... */ 0,0,0,0,0, \
/* pid etc.. */ 0,0,0,0, \
......
......@@ -282,10 +282,12 @@ int kill_proc(int pid, int sig, int priv)
* POSIX specifies that kill(-1,sig) is unspecified, but what we have
* is probably wrong. Should make it like BSD or SYSV.
*/
asmlinkage int sys_kill(int pid,int sig)
asmlinkage int sys_kill(int pid, unsigned int sig)
{
int err, retval = 0, count = 0;
if (sig > 32)
return -EINVAL;
if (!pid)
return(kill_pg(current->pgrp,sig,0));
if (pid == -1) {
......
......@@ -15,6 +15,7 @@
#include <linux/sys.h>
#include <linux/utsname.h>
#include <linux/interrupt.h>
#include <linux/binfmts.h>
#ifdef CONFIG_INET
#include <linux/netdevice.h>
#endif
......@@ -28,20 +29,16 @@ extern char * ftape_big_buffer;
extern void (*do_floppy)(void);
#endif
#ifdef CONFIG_BINFMT_IBCS
extern int do_execve(char * filename, char ** argv, char ** envp,
struct pt_regs * regs);
extern void flush_old_exec(struct linux_binprm * bprm);
extern int open_inode(struct inode * inode, int mode);
extern int read_exec(struct inode *inode, unsigned long offset,
char * addr, unsigned long count);
extern void check_pending(int signum);
extern int do_signal(unsigned long oldmask, struct pt_regs * regs);
extern int (*ibcs_invmapsig)(int);
extern void (* iABI_hook)(struct pt_regs * regs);
#endif
#ifdef CONFIG_INET
extern int register_netdev(struct device *);
extern void unregister_netdev(struct device *);
......@@ -67,6 +64,8 @@ struct {
X(__verify_write),
X(do_mmap),
X(do_munmap),
X(insert_vm_struct),
X(zeromap_page_range),
/* internal kernel memory management */
X(__get_free_pages),
......@@ -94,6 +93,10 @@ struct {
X(register_filesystem),
X(unregister_filesystem),
/* executable format registration */
X(register_binfmt),
X(unregister_binfmt),
/* interrupt handling */
X(request_irq),
X(free_irq),
......@@ -115,24 +118,8 @@ struct {
X(system_utsname),
X(sys_call_table),
#ifdef CONFIG_FTAPE
/* The next labels are needed for ftape driver. */
X(ftape_big_buffer),
X(do_floppy),
#endif
#ifdef CONFIG_BINFMT_IBCS
/*
* The following are needed if iBCS support is modular rather than
* compiled in.
*/
/* Emulator hooks. */
X(iABI_hook),
X(ibcs_invmapsig),
/* Signal interfaces */
X(do_signal),
X(check_pending),
X(send_sig),
/* Program loader interfaces */
......@@ -141,16 +128,17 @@ struct {
X(create_tables),
X(do_execve),
X(flush_old_exec),
X(formats),
X(insert_vm_struct),
X(open_inode),
X(read_exec),
X(zeromap_page_range),
/* Miscellaneous access points */
X(si_meminfo),
#endif
#ifdef CONFIG_FTAPE
/* The next labels are needed for ftape driver. */
X(ftape_big_buffer),
X(do_floppy),
#endif
#ifdef CONFIG_INET
/* support for loadable net drivers */
X(register_netdev),
......
......@@ -87,6 +87,16 @@ extern void mem_use(void);
extern int timer_interrupt(void);
asmlinkage int system_call(void);
/*
* signal mapping: this is the default identity mapping used for normal
* linux binaries (it's both the reverse and the normal map, of course)
*/
static unsigned long ident_map[33] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32
};
static unsigned long init_kernel_stack[1024] = { STACK_MAGIC, };
struct task_struct init_task = INIT_TASK;
......
......@@ -135,7 +135,9 @@ asmlinkage int sys_signal(int signum, unsigned long handler)
{
struct sigaction tmp;
if (signum<1 || signum>32 || signum==SIGKILL || signum==SIGSTOP)
if (signum<1 || signum>32)
return -EINVAL;
if (signum==SIGKILL || signum==SIGSTOP)
return -EINVAL;
if (handler >= TASK_SIZE)
return -EFAULT;
......@@ -154,7 +156,9 @@ asmlinkage int sys_sigaction(int signum, const struct sigaction * action,
{
struct sigaction new_sa, *p;
if (signum<1 || signum>32 || signum==SIGKILL || signum==SIGSTOP)
if (signum<1 || signum>32)
return -EINVAL;
if (signum==SIGKILL || signum==SIGSTOP)
return -EINVAL;
p = signum - 1 + current->sigaction;
if (action) {
......@@ -242,7 +246,7 @@ static void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned lon
do_exit(SIGSEGV);
/* set up the "normal" stack seen by the signal handler (iBCS2) */
put_fs_long(__CODE,frame);
put_fs_long(signr, frame+1);
put_fs_long(current->signal_invmap[signr], frame+1);
put_fs_long(regs->gs, frame+2);
put_fs_long(regs->fs, frame+3);
put_fs_long(regs->es, frame+4);
......
......@@ -3,7 +3,6 @@
#include "datalink.h"
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/ddi.h>
static struct datalink_proto *p8022_list = NULL;
......
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