Commit 9a8f8b7c authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.106pre1

parent 37cd23b4
......@@ -4941,6 +4941,20 @@ CONFIG_ETH16I
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
PCI NE2000 Support
CONFIG_NE2K_PCI
This driver is for NE2000 compatible PCI cards. It will not work
with ISA NE2000 cards. If you have a network (Ethernet) card of
this type, say Y and read the Ethernet-HOWTO, available via FTP
(user: anonymous) in ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called ne2k-pci.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
TI ThunderLAN support (EXPERIMENTAL)
CONFIG_TLAN
If you have a TLAN based network card which is supported by this
......
Turtle Beach Multisound support is not yet integrated. If you'd like
to test it or help out in finishing the module please see
http://www.rpi.edu/~veliaa/pinlinux.html
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 105
SUBLEVEL = 106
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
......@@ -189,9 +189,14 @@ else
endif
$(MODINCL)/%.ver: %.c
$(CC) $(CFLAGS) -E -D__GENKSYMS__ $<\
| $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
mv $@.tmp $@
@if [ ! -r $(MODINCL)/$*.stamp -o $(MODINCL)/$*.stamp -ot $< ]; then \
echo '$(CC) $(CFLAGS) -E -D__GENKSYMS__ $<'; \
echo '| $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp'; \
$(CC) $(CFLAGS) -E -D__GENKSYMS__ $< \
| $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp; \
if [ -r $@ ] && cmp -s $@ $@.tmp; then echo $@ is unchanged; rm -f $@.tmp; \
else echo mv $@.tmp $@; mv -f $@.tmp $@; fi; \
fi; touch $(MODINCL)/$*.stamp
$(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h
......
......@@ -924,7 +924,7 @@ sys_call_table:
.quad alpha_ni_syscall
.quad alpha_ni_syscall /* 110 */
.quad sys_sigsuspend
.quad sys_ni_syscall
.quad osf_sigstack
.quad sys_recvmsg
.quad sys_sendmsg
.quad alpha_ni_syscall /* 115 */
......@@ -1047,7 +1047,7 @@ sys_call_table:
.quad alpha_ni_syscall
.quad sys_getpgid
.quad sys_getsid
.quad alpha_ni_syscall /* 235 */
.quad sys_sigaltstack /* 235 */
.quad alpha_ni_syscall
.quad alpha_ni_syscall
.quad alpha_ni_syscall
......@@ -1181,5 +1181,6 @@ sys_call_table:
.quad sys_wait4 /* 365 */
.quad sys_adjtimex
.quad sys_getcwd
.quad sys_ni_syscall
.quad sys_ni_syscall /* 369 */
.quad sys_capget
.quad sys_capset
.quad sys_ni_syscall /* 370 */
......@@ -743,6 +743,50 @@ asmlinkage long osf_proplist_syscall(enum pl_code code, union pl_args *args)
return error;
}
asmlinkage int osf_sigstack(struct sigstack *uss, struct sigstack *uoss)
{
unsigned long usp = rdusp();
unsigned long oss_sp, oss_os;
int error;
if (uoss) {
oss_sp = current->sas_ss_sp + current->sas_ss_size;
oss_os = on_sig_stack(usp);
}
if (uss) {
unsigned long ss_sp;
error = -EFAULT;
if (get_user(ss_sp, &uss->ss_sp))
goto out;
/* If the current stack was set with sigaltstack, don't
swap stacks while we are on it. */
error = -EPERM;
if (current->sas_ss_sp && on_sig_stack(usp))
goto out;
/* Since we don't know the extent of the stack, and we don't
track onstack-ness, but rather calculate it, we must
presume a size. Ho hum this interface is lossy. */
current->sas_ss_sp = ss_sp - SIGSTKSZ;
current->sas_ss_size = SIGSTKSZ;
}
if (uoss) {
error = -EFAULT;
if (! access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))
|| __put_user(oss_sp, &uoss->ss_sp)
|| __put_user(oss_os, &uoss->ss_onstack))
goto out;
}
error = 0;
out:
return error;
}
/*
* The Linux kernel isn't good at returning values that look
* like negative longs (they are mistaken as error values).
......
This diff is collapsed.
......@@ -114,8 +114,8 @@ asmlinkage void do_page_fault(unsigned long address, unsigned long mmcsr,
(or is suppressed by the PALcode). Support that for older cpu's
by ignoring such an instruction. */
if (cause == 0) {
/* No need for get_user.. we know the insn is there. */
unsigned int insn = *(unsigned int *)regs->pc;
unsigned int insn;
__get_user(insn, (unsigned int *)regs->pc);
if ((insn >> 21 & 0x1f) == 0x1f &&
/* ldq ldl ldt lds ldg ldf ldwu ldbu */
(1ul << (insn >> 26) & 0x30f00001400ul)) {
......@@ -124,8 +124,8 @@ asmlinkage void do_page_fault(unsigned long address, unsigned long mmcsr,
}
}
lock_kernel();
down(&mm->mmap_sem);
lock_kernel();
vma = find_vma(mm, address);
if (!vma)
goto bad_area;
......
......@@ -546,7 +546,8 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_getcwd)
.long SYMBOL_NAME(sys_capget)
.long SYMBOL_NAME(sys_capset) /* 185 */
.long SYMBOL_NAME(sys_sigaltstack)
.rept NR_syscalls-185
.rept NR_syscalls-186
.long SYMBOL_NAME(sys_ni_syscall)
.endr
This diff is collapsed.
......@@ -63,6 +63,7 @@ asmlinkage int old_mmap(struct mmap_arg_struct *arg)
struct file * file = NULL;
struct mmap_arg_struct a;
down(&current->mm->mmap_sem);
lock_kernel();
if (copy_from_user(&a, arg, sizeof(a)))
goto out;
......@@ -73,11 +74,13 @@ asmlinkage int old_mmap(struct mmap_arg_struct *arg)
goto out;
}
a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
error = do_mmap(file, a.addr, a.len, a.prot, a.flags, a.offset);
if (file)
fput(file);
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return error;
}
......
......@@ -677,14 +677,15 @@ void math_abort(struct info * info, unsigned int signal)
#define sstatus_word() \
((S387->swd & ~SW_Top & 0xffff) | ((S387->ftop << SW_Top_Shift) & SW_Top))
void restore_i387_soft(void *s387, struct _fpstate *buf)
int restore_i387_soft(void *s387, struct _fpstate *buf)
{
u_char *d = (u_char *)buf;
int offset, other, i, tags, regnr, tag, newtop;
RE_ENTRANT_CHECK_OFF;
FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
__copy_from_user(&S387->cwd, d, 7*4);
if (__copy_from_user(&S387->cwd, d, 7*4))
return -1;
RE_ENTRANT_CHECK_ON;
d += 7*4;
......@@ -695,9 +696,11 @@ void restore_i387_soft(void *s387, struct _fpstate *buf)
RE_ENTRANT_CHECK_OFF;
/* Copy all registers in stack order. */
__copy_from_user(((u_char *)&S387->st_space)+offset, d, other);
if (__copy_from_user(((u_char *)&S387->st_space)+offset, d, other))
return -1;
if ( offset )
__copy_from_user((u_char *)&S387->st_space, d+other, offset);
if (__copy_from_user((u_char *)&S387->st_space, d+other, offset))
return -1;
RE_ENTRANT_CHECK_ON;
/* The tags may need to be corrected now. */
......@@ -716,10 +719,11 @@ void restore_i387_soft(void *s387, struct _fpstate *buf)
}
S387->twd = tags;
return 0;
}
struct _fpstate * save_i387_soft(void *s387, struct _fpstate * buf)
int save_i387_soft(void *s387, struct _fpstate * buf)
{
u_char *d = (u_char *)buf;
int offset = (S387->ftop & 7) * 10, other = 80 - offset;
......@@ -742,10 +746,12 @@ struct _fpstate * save_i387_soft(void *s387, struct _fpstate * buf)
RE_ENTRANT_CHECK_OFF;
/* Copy all registers in stack order. */
__copy_to_user(d, ((u_char *)&S387->st_space)+offset, other);
if (__copy_to_user(d, ((u_char *)&S387->st_space)+offset, other))
return -1;
if ( offset )
__copy_to_user(d+other, (u_char *)&S387->st_space, offset);
if (__copy_to_user(d+other, (u_char *)&S387->st_space, offset))
return -1
RE_ENTRANT_CHECK_ON;
return buf;
return 1;
}
......@@ -102,11 +102,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (local_irq_count[smp_processor_id()])
die_if_kernel("page fault from irq handler",regs,error_code);
lock_kernel();
tsk = current;
mm = tsk->mm;
down(&mm->mmap_sem);
vma = find_vma(mm, address);
if (!vma)
goto bad_area;
......@@ -151,7 +151,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
goto bad_area;
}
handle_mm_fault(tsk, vma, address, write);
up(&mm->mmap_sem);
/*
* Did it hit the DOS screen memory VA from vm86 mode?
*/
......@@ -160,7 +160,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (bit < 32)
tsk->tss.screen_bitmap |= 1 << bit;
}
goto out;
up(&mm->mmap_sem);
return;
/*
* Something tried to access memory that isn't in our memory map..
......@@ -175,7 +176,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
tsk->tss.error_code = error_code;
tsk->tss.trap_no = 14;
force_sig(SIGSEGV, tsk);
goto out;
return;
}
/*
......@@ -187,7 +188,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
nr = (address - (unsigned long) idt) >> 3;
if (nr == 6) {
unlock_kernel();
do_invalid_op(regs, 0);
return;
}
......@@ -196,7 +196,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
/* Are we prepared to handle this kernel fault? */
if ((fixup = search_exception_table(regs->eip)) != 0) {
regs->eip = fixup;
goto out;
return;
}
/*
......@@ -215,7 +215,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
* CPU state on certain buggy processors.
*/
printk("Ok");
goto out;
return;
}
if (address < PAGE_SIZE)
......@@ -234,8 +234,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
printk(KERN_ALERT "*pte = %08lx\n", page);
}
lock_kernel();
die_if_kernel("Oops", regs, error_code);
do_exit(SIGKILL);
out:
unlock_kernel();
}
......@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := amiga.o
O_OBJS := config.o amiints.o cia.o chipram.o amisound.o zorro.o
O_OBJS := config.o amiints.o cia.o chipram.o amisound.o
OX_OBJS := amiga_ksyms.o
include $(TOPDIR)/Rules.make
......@@ -68,11 +68,11 @@
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/amifdreg.h>
#include <linux/amifd.h>
#include <asm/setup.h>
#include <asm/uaccess.h>
#include <asm/amifdreg.h>
#include <asm/amifd.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
#include <asm/irq.h>
......
......@@ -3,6 +3,7 @@
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 1993, 1994 Alain Knaff
* Copyright (C) 1998 Alan Cox
*/
/*
* 02.12.91 - Changed to static variables to indicate need for reset
......@@ -95,7 +96,11 @@
* 1995/10/18 -- Ralf Baechle -- Portability cleanup; move machine dependent
* features to asm/floppy.h.
*/
/*
* 1998/06/07 -- Alan Cox -- Merged the 2.0.34 fixes for resource allocation
* failures.
*/
#define FLOPPY_SANITY_CHECK
#undef FLOPPY_SILENT_DCL_CLEAR
......@@ -114,9 +119,11 @@ static int print_unex=1;
* motor of these drives causes system hangs on some PCI computers. drive
* 0 is the low bit (0x1), and drive 7 is the high bit (0x80). Bits are on if
* a drive is allowed. */
static int FLOPPY_IRQ=6;
static int FLOPPY_DMA=2;
static int allowed_drive_mask = 0x33;
static int irqdma_allocated = 0;
#include <linux/sched.h>
......@@ -759,6 +766,11 @@ static int set_dor(int fdc, char mask, char data)
UDRS->select_date = jiffies;
}
}
/*
* We should propogate failures to grab the resources back
* nicely from here. Actually we ought to rewrite the fd
* driver some day too.
*/
if (newdor & FLOPPY_MOTOR_MASK)
floppy_grab_irq_and_dma();
if (olddor & FLOPPY_MOTOR_MASK)
......@@ -818,10 +830,11 @@ static int lock_fdc(int drive, int interruptible)
unsigned long flags;
if (!usage_count){
printk("trying to lock fdc while usage count=0\n");
printk(KERN_ERR "Trying to lock fdc while usage count=0\n");
return -1;
}
floppy_grab_irq_and_dma();
if(floppy_grab_irq_and_dma()==-1)
return -EBUSY;
INT_OFF;
while (fdc_busy && NO_SIGNAL)
interruptible_sleep_on(&fdc_wait);
......@@ -4208,7 +4221,12 @@ static int floppy_grab_irq_and_dma(void)
for (fdc = 0; fdc < N_FDC; fdc++)
if (FDCS->address != -1)
fd_outb(FDCS->dor, FD_DOR);
/*
* The driver will try and free resources and relies on us
* to know if they were allocated or not.
*/
fdc = 0;
irqdma_allocated = 1;
return 0;
}
......@@ -4230,10 +4248,13 @@ static void floppy_release_irq_and_dma(void)
return;
}
INT_ON;
fd_disable_dma();
fd_free_dma();
fd_free_irq();
if(irqdma_allocated)
{
fd_disable_dma();
fd_free_dma();
fd_free_irq();
irqdma_allocated=0;
}
set_dor(0, ~0, 8);
#if N_FDC > 1
set_dor(1, ~8, 0);
......@@ -4384,10 +4405,12 @@ void floppy_eject(void)
int dummy;
if(have_no_fdc)
return;
floppy_grab_irq_and_dma();
lock_fdc(MAXTIMEOUT,0);
dummy=fd_eject(0);
process_fd_request();
floppy_release_irq_and_dma();
if(floppy_grab_irq_and_dma()==0)
{
lock_fdc(MAXTIMEOUT,0);
dummy=fd_eject(0);
process_fd_request();
floppy_release_irq_and_dma();
}
}
#endif
......@@ -157,6 +157,7 @@ int mitsumi_bug_93_wait = 0;
static short mcd_port = MCD_BASE_ADDR; /* used as "mcd" by "insmod" */
static int mcd_irq = MCD_INTR_NR; /* must directly follow mcd_port */
MODULE_PARM(mcd, "1-2i");
static int McdTimeout, McdTries;
static struct wait_queue *mcd_waitq = NULL;
......
......@@ -1254,18 +1254,16 @@ static void setterm_command(int currcons)
}
}
static void insert_char(int currcons)
static void insert_char(int currcons, unsigned int nr)
{
unsigned int i = x;
unsigned short tmp, old = video_erase_char;
unsigned short * p = (unsigned short *) pos;
unsigned short * p, * q = (unsigned short *) pos;
while (i++ < video_num_columns) {
tmp = scr_readw(p);
scr_writew(old, p);
old = tmp;
while (i++ <= video_num_columns - nr) {
scr_writew(scr_readw(p), p + nr);
p++;
}
memsetw(q, video_erase_char, nr*2);
need_wrap = 0;
}
......@@ -1275,16 +1273,16 @@ static void insert_line(int currcons, unsigned int nr)
need_wrap = 0;
}
static void delete_char(int currcons)
static void delete_char(int currcons, unsigned int nr)
{
unsigned int i = x;
unsigned short * p = (unsigned short *) pos;
while (++i < video_num_columns) {
scr_writew(scr_readw(p+1), p);
while (++i <= video_num_columns - nr) {
scr_writew(scr_readw(p+nr), p);
p++;
}
scr_writew(video_erase_char, p);
memsetw(p, video_erase_char, nr*2);
need_wrap = 0;
}
......@@ -1300,8 +1298,7 @@ static void csi_at(int currcons, unsigned int nr)
nr = video_num_columns;
else if (!nr)
nr = 1;
while (nr--)
insert_char(currcons);
insert_char(currcons, nr);
}
static void csi_L(int currcons, unsigned int nr)
......@@ -1319,8 +1316,7 @@ static void csi_P(int currcons, unsigned int nr)
nr = video_num_columns;
else if (!nr)
nr = 1;
while (nr--)
delete_char(currcons);
delete_char(currcons, nr);
}
static void csi_M(int currcons, unsigned int nr)
......@@ -1583,7 +1579,7 @@ static int do_con_write(struct tty_struct * tty, int from_user,
lf(currcons);
}
if (decim)
insert_char(currcons);
insert_char(currcons, 1);
scr_writew( video_mode_512ch ?
((attr & 0xf7) << 8) + ((tc & 0x100) << 3) +
(tc & 0x0ff) : (attr << 8) + tc,
......
......@@ -916,7 +916,7 @@ static int msp3400c_attach(struct i2c_device *device)
if (-1 == msp3400c_reset(msp->bus)) {
UNLOCK_I2C_BUS(msp->bus);
kfree(msp);
return -1;
return -EIO;
}
msp3400c_setmode(msp, MSP_MODE_FM_TERRA);
......@@ -1089,6 +1089,8 @@ struct i2c_driver i2c_driver_msp = {
msp3400c_command
};
EXPORT_NO_SYMBOLS;
#ifdef MODULE
int init_module(void)
#else
......
......@@ -243,6 +243,8 @@ struct i2c_driver i2c_driver_tuner =
tuner_command
};
EXPORT_NO_SYMBOLS;
#ifdef MODULE
int init_module(void)
#else
......
......@@ -850,8 +850,11 @@ static void set_multicast_list(struct device *dev)
outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR);
}
/* Initialize the rest of the 8390 device structure. */
__initfunc(int ethdev_init(struct device *dev))
/*
* Initialize the rest of the 8390 device structure. Do NOT __initfunc
* this, as it is used by 8390 based modular drivers too.
*/
int ethdev_init(struct device *dev)
{
if (ei_debug > 1)
printk(version);
......
This diff is collapsed.
......@@ -390,7 +390,7 @@ static int etherdev_get_index(struct device *dev)
for (i = 0; i < MAX_ETH_CARDS; ++i) {
if (ethdev_index[i] == NULL) {
sprintf(dev->name, "eth%d", i);
printk("loading device '%s'...\n", dev->name);
/* printk("loading device '%s'...\n", dev->name);*/
ethdev_index[i] = dev;
return i;
}
......
......@@ -8,7 +8,9 @@
* Dynamic PPP devices by Jim Freeman <jfree@caldera.com>.
* ppp_tty_receive ``noisy-raise-bug'' fixed by Ove Ewerlid <ewerlid@syscon.uu.se>
*
* ==FILEVERSION 980501==
* Machine hang caused by NULLing a live wait queue fix. <Alan.Cox@linux.org>
*
* ==FILEVERSION 980607==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the number above to the
......@@ -415,8 +417,6 @@ ppp_init_ctrl_blk (register struct ppp *ppp)
ppp->ubuf = NULL;
ppp->cbuf = NULL;
ppp->slcomp = NULL;
ppp->read_wait = NULL;
ppp->write_wait = NULL;
ppp->last_xmit = jiffies - flag_time;
ppp->last_recv = jiffies;
......
......@@ -223,7 +223,7 @@ static int aha1542_in(unsigned int base, unchar *cmdp, int len)
/* Similar to aha1542_in, except that we wait a very short period of time.
We use this if we know the board is alive and awake, but we are not sure
if the board will respond the command we are about to send or not */
if the board will respond to the command we are about to send or not */
static int aha1542_in1(unsigned int base, unchar *cmdp, int len)
{
unsigned long flags;
......
......@@ -369,8 +369,8 @@ static void unmap_pci_mem(vm_offset_t vaddr, u_long size)
static void DELAY(long us)
{
if (us/1000) mdelay(us/1000);
if (us%1000) udelay(us%1000);
for (;us>1000;us-=1000) udelay(1000);
if (us) udelay(us);
}
/*
......
#
# Makefile for the linux/drivers/zorro/ directory.
#
SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS)
L_OBJS := zorro.o
L_TARGET := zorro.a
include $(TOPDIR)/Rules.make
......@@ -519,6 +519,10 @@ BEGIN_PROD(ARMAX)
PROD("OmniBus", GFX, ARMAX_OMNIBUS)
END
BEGIN_PROD(ZEUS)
PROD("Spider", VIDEO, ZEUS_SPIDER)
END
BEGIN_PROD(NEWTEK)
PROD("VideoToaster", VIDEO, NEWTEK_VIDEOTOASTER)
END
......@@ -634,6 +638,7 @@ BEGIN_PROD(PHASE5)
PROD("CyberVision64-3D Prototype", GFX, PHASE5_CYBERVISION64_3D_PROTOTYPE)
PROD("CyberVision64-3D", GFX, PHASE5_CYBERVISION64_3D)
PROD("CyberStorm Mk III", TURBO_SCSI, PHASE5_CYBERSTORM_MK_III)
PROD("Blizzard 603e+", TURBO_SCSI, PHASE5_BLIZZARD_603E_PLUS)
END
BEGIN_PROD(DPS)
......@@ -659,6 +664,10 @@ BEGIN_PROD(UWE_GERLACH)
PROD("RAM/ROM", MISC, UWE_GERLACH_RAM_ROM)
END
BEGIN_PROD(ACT)
PROD("Prelude", AUDIO, ACT_PRELUDE)
END
BEGIN_PROD(MACROSYSTEMS_GERMANY)
PROD("Maestro", AUDIO, MACROSYSTEMS_MAESTRO)
PROD("VLab", VIDEO, MACROSYSTEMS_VLAB)
......@@ -780,6 +789,7 @@ BEGIN_MANUF
MANUF("Utilities Unlimited", UTILITIES_UNLIMITED)
MANUF("Amitrix", AMITRIX)
MANUF("ArMax", ARMAX)
MANUF("ZEUS Electronic Development", ZEUS)
MANUF("NewTek", NEWTEK)
MANUF("M-Tech Germany", M_TECH_GERMANY)
MANUF("Great Valley Products", GREAT_VALLEY_PRODUCTS_4)
......@@ -806,6 +816,7 @@ BEGIN_MANUF
MANUF("Apollo", APOLLO_3)
MANUF("Petsoff LP", PETSOFF_LP)
MANUF("Uwe Gerlach", UWE_GERLACH)
MANUF("ACT", ACT)
MANUF("MacroSystems Germany", MACROSYSTEMS_GERMANY)
MANUF("Combitec", COMBITEC)
MANUF("SKI Peripherals", SKI_PERIPHERALS)
......
......@@ -76,7 +76,7 @@ typedef unsigned long sigset_t;
/*
* SA_FLAGS values:
*
* SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
* SA_ONSTACK indicates that a registered stack_t will be used.
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
* SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
......@@ -100,6 +100,16 @@ typedef unsigned long sigset_t;
#define SA_NOMASK SA_NODEFER
#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 4096
#define SIGSTKSZ 16384
#ifdef __KERNEL__
/*
* These values of sa_flags are used only by the kernel as part of the
......@@ -164,6 +174,15 @@ typedef struct sigaltstack {
size_t ss_size;
} stack_t;
/* sigstack(2) is deprecated, and will be withdrawn in a future version
of the X/Open CAE Specification. Use sigaltstack instead. It is only
implemented here for OSF/1 compatability. */
struct sigstack {
void *ss_sp;
int ss_onstack;
};
#ifdef __KERNEL__
#include <asm/sigcontext.h>
#endif
......
......@@ -113,7 +113,7 @@
#define __NR_osf_old_sigblock 109 /* not implemented */
#define __NR_osf_old_sigsetmask 110 /* not implemented */
#define __NR_sigsuspend 111
#define __NR_osf_sigstack 112 /* not implemented */
#define __NR_osf_sigstack 112
#define __NR_recvmsg 113
#define __NR_sendmsg 114
#define __NR_osf_old_vtrace 115 /* not implemented */
......@@ -205,7 +205,7 @@
#define __NR_getpgid 233
#define __NR_getsid 234
#define __NR_osf_sigaltstack 235 /* not implemented */
#define __NR_sigaltstack 235
#define __NR_osf_waitid 236 /* not implemented */
#define __NR_osf_priocntlset 237 /* not implemented */
#define __NR_osf_sigsendset 238 /* not implemented */
......@@ -305,7 +305,8 @@
#define __NR_wait4 365
#define __NR_adjtimex 366
#define __NR_getcwd 367
#define __NR_capget 368
#define __NR_capset 369
#if defined(__LIBRARY__) && defined(__GNUC__)
......
......@@ -3,8 +3,8 @@
#include <asm/sigcontext.h>
void restore_i387_soft(void *s387, struct _fpstate *buf);
struct _fpstate * save_i387_soft(void *s387, struct _fpstate * buf);
int restore_i387_soft(void *s387, struct _fpstate *buf);
int save_i387_soft(void *s387, struct _fpstate * buf);
/* This structure matches the layout of the data saved to the stack
following a device-not-present interrupt, part of it saved
......
......@@ -72,7 +72,7 @@ typedef unsigned long sigset_t;
/*
* SA_FLAGS values:
*
* SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
* SA_ONSTACK indicates that a registered stack_t will be used.
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
* SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
......@@ -97,6 +97,15 @@ typedef unsigned long sigset_t;
#define SA_RESTORER 0x04000000
/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
#ifdef __KERNEL__
/*
......
......@@ -47,6 +47,7 @@ struct termio {
#define N_AX25 5
#define N_X25 6 /* X.25 async */
#define N_6PACK 7
#define N_MASC 8 /* Reserved fo Mobitex module <kaz@cafe.net> */
#ifdef __KERNEL__
......
......@@ -191,6 +191,7 @@
#define __NR_getcwd 183
#define __NR_capget 184
#define __NR_capset 185
#define __NR_sigaltstack 186
/* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */
......
#ifndef _ASM_M68K_AMIFD_H
#define _ASM_M68K_AMIFD_H
/* Definitions for the Amiga floppy driver */
#include <linux/fd.h>
#define FD_MAX_UNITS 4 /* Max. Number of drives */
#define FLOPPY_MAX_SECTORS 22 /* Max. Number of sectors per track */
#ifndef ASSEMBLER
struct fd_data_type {
char *name; /* description of data type */
int sects; /* sectors per track */
#ifdef __STDC__
int (*read_fkt)(int);
void (*write_fkt)(int);
#else
int (*read_fkt)(); /* read whole track */
void (*write_fkt)(); /* write whole track */
#endif
};
/*
** Floppy type descriptions
*/
struct fd_drive_type {
unsigned long code; /* code returned from drive */
char *name; /* description of drive */
unsigned int tracks; /* number of tracks */
unsigned int heads; /* number of heads */
unsigned int read_size; /* raw read size for one track */
unsigned int write_size; /* raw write size for one track */
unsigned int sect_mult; /* sectors and gap multiplier (HD = 2) */
unsigned int precomp1; /* start track for precomp 1 */
unsigned int precomp2; /* start track for precomp 2 */
unsigned int step_delay; /* time (in ms) for delay after step */
unsigned int settle_time; /* time to settle after dir change */
unsigned int side_time; /* time needed to change sides */
};
struct amiga_floppy_struct {
struct fd_drive_type *type; /* type of floppy for this unit */
struct fd_data_type *dtype; /* type of floppy for this unit */
int track; /* current track (-1 == unknown) */
unsigned char *trackbuf; /* current track (kmaloc()'d */
int blocks; /* total # blocks on disk */
int changed; /* true when not known */
int disk; /* disk in drive (-1 == unknown) */
int motor; /* true when motor is at speed */
int busy; /* true when drive is active */
int dirty; /* true when trackbuf is not on disk */
int status; /* current error code for unit */
};
#endif
#endif
#ifndef _LINUX_AMIFDREG_H
#define _LINUX_AMIFDREG_H
/*
** CIAAPRA bits (read only)
*/
#define DSKRDY (0x1<<5) /* disk ready when low */
#define DSKTRACK0 (0x1<<4) /* head at track zero when low */
#define DSKPROT (0x1<<3) /* disk protected when low */
#define DSKCHANGE (0x1<<2) /* low when disk removed */
/*
** CIAAPRB bits (read/write)
*/
#define DSKMOTOR (0x1<<7) /* motor on when low */
#define DSKSEL3 (0x1<<6) /* select drive 3 when low */
#define DSKSEL2 (0x1<<5) /* select drive 2 when low */
#define DSKSEL1 (0x1<<4) /* select drive 1 when low */
#define DSKSEL0 (0x1<<3) /* select drive 0 when low */
#define DSKSIDE (0x1<<2) /* side selection: 0 = upper, 1 = lower */
#define DSKDIREC (0x1<<1) /* step direction: 0=in, 1=out (to trk 0) */
#define DSKSTEP (0x1) /* pulse low to step head 1 track */
/*
** DSKBYTR bits (read only)
*/
#define DSKBYT (1<<15) /* register contains valid byte when set */
#define DMAON (1<<14) /* disk DMA enabled */
#define DISKWRITE (1<<13) /* disk write bit in DSKLEN enabled */
#define WORDEQUAL (1<<12) /* DSKSYNC register match when true */
/* bits 7-0 are data */
/*
** ADKCON/ADKCONR bits
*/
#ifndef SETCLR
#define ADK_SETCLR (1<<15) /* control bit */
#endif
#define ADK_PRECOMP1 (1<<14) /* precompensation selection */
#define ADK_PRECOMP0 (1<<13) /* 00=none, 01=140ns, 10=280ns, 11=500ns */
#define ADK_MFMPREC (1<<12) /* 0=GCR precomp., 1=MFM precomp. */
#define ADK_WORDSYNC (1<<10) /* enable DSKSYNC auto DMA */
#define ADK_MSBSYNC (1<<9) /* when 1, enable sync on MSbit (for GCR) */
#define ADK_FAST (1<<8) /* bit cell: 0=2us (GCR), 1=1us (MFM) */
/*
** DSKLEN bits
*/
#define DSKLEN_DMAEN (1<<15)
#define DSKLEN_WRITE (1<<14)
/*
** INTENA/INTREQ bits
*/
#define DSKINDEX (0x1<<4) /* DSKINDEX bit */
/*
** Misc
*/
#define MFM_SYNC 0x4489 /* standard MFM sync value */
/* Values for FD_COMMAND */
#define FD_RECALIBRATE 0x07 /* move to track 0 */
#define FD_SEEK 0x0F /* seek track */
#define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */
#define FD_WRITE 0xC5 /* write with MT, MFM */
#define FD_SENSEI 0x08 /* Sense Interrupt Status */
#define FD_SPECIFY 0x03 /* specify HUT etc */
#define FD_FORMAT 0x4D /* format one track */
#define FD_VERSION 0x10 /* get version code */
#define FD_CONFIGURE 0x13 /* configure FIFO operation */
#define FD_PERPENDICULAR 0x12 /* perpendicular r/w mode */
#endif /* _LINUX_AMIFDREG_H */
#ifndef _LINUX_AMIGARDB_H
#define _LINUX_AMIGARDB_H 1
#define ULONG u_long
#define LONG long
#define UBYTE u_char
/* definitions for the Amiga RigidDiskBlock layout, which always starts in
cylinder 0 of a medium. Taken from page 254f of the RKM: Devices */
struct RigidDiskBlock {
ULONG rdb_ID; /* 4 character identifier */
ULONG rdb_SummedLongs; /* size of this checksummed structure */
LONG rdb_ChkSum; /* block checksum (longword sum to zero) */
ULONG rdb_HostID; /* SCSI Target ID of host */
ULONG rdb_BlockBytes; /* size of disk blocks */
ULONG rdb_Flags; /* see below for defines */
/* block list heads */
ULONG rdb_BadBlockList; /* optional bad block list */
ULONG rdb_PartitionList; /* optional first partition block */
ULONG rdb_FileSysHeaderList; /* optional file system header block */
ULONG rdb_DriveInit; /* optional drive-specific init code */
/* DriveInit(lun,rdb,ior): "C" stk & d0/a0/a1 */
ULONG rdb_Reserved1[6]; /* set to $ffffffff */
/* physical drive characteristics */
ULONG rdb_Cylinders; /* number of drive cylinders */
ULONG rdb_Sectors; /* sectors per track */
ULONG rdb_Heads; /* number of drive heads */
ULONG rdb_Interleave; /* interleave */
ULONG rdb_Park; /* landing zone cylinder */
ULONG rdb_Reserved2[3];
ULONG rdb_WritePreComp; /* starting cylinder: write precompensation */
ULONG rdb_ReducedWrite; /* starting cylinder: reduced write current */
ULONG rdb_StepRate; /* drive step rate */
ULONG rdb_Reserved3[5];
/* logical drive characteristics */
ULONG rdb_RDBBlocksLo; /* low block of range reserved for hardblocks */
ULONG rdb_RDBBlocksHi; /* high block of range for these hardblocks */
ULONG rdb_LoCylinder; /* low cylinder of partitionable disk area */
ULONG rdb_HiCylinder; /* high cylinder of partitionable data area */
ULONG rdb_CylBlocks; /* number of blocks available per cylinder */
ULONG rdb_AutoParkSeconds; /* zero for no auto park */
ULONG rdb_HighRDSKBlock; /* highest block used by RDSK */
/* (not including replacement bad blocks) */
ULONG rdb_Reserved4;
/* drive identification */
char rdb_DiskVendor[8];
char rdb_DiskProduct[16];
char rdb_DiskRevision[4];
char rdb_ControllerVendor[8];
char rdb_ControllerProduct[16];
char rdb_ControllerRevision[4];
ULONG rdb_Reserved5[10];
};
#define IDNAME_RIGIDDISK 0x5244534B /* 'RDSK' */
#define RDB_LOCATION_LIMIT 16
#define RDBFB_LAST 0 /* no disks exist to be configured after */
#define RDBFF_LAST 0x01L /* this one on this controller */
#define RDBFB_LASTLUN 1 /* no LUNs exist to be configured greater */
#define RDBFF_LASTLUN 0x02L /* than this one at this SCSI Target ID */
#define RDBFB_LASTTID 2 /* no Target IDs exist to be configured */
#define RDBFF_LASTTID 0x04L /* greater than this one on this SCSI bus */
#define RDBFB_NORESELECT 3 /* don't bother trying to perform reselection */
#define RDBFF_NORESELECT 0x08L /* when talking to this drive */
#define RDBFB_DISKID 4 /* rdb_Disk... identification valid */
#define RDBFF_DISKID 0x10L
#define RDBFB_CTRLRID 5 /* rdb_Controller... identification valid */
#define RDBFF_CTRLRID 0x20L
/* added 7/20/89 by commodore: */
#define RDBFB_SYNCH 6 /* drive supports scsi synchronous mode */
#define RDBFF_SYNCH 0x40L /* CAN BE DANGEROUS TO USE IF IT DOESN'T! */
struct PartitionBlock {
ULONG pb_ID; /* 4 character identifier */
ULONG pb_SummedLongs; /* size of this checksummed structure */
LONG pb_ChkSum; /* block checksum (longword sum to zero) */
ULONG pb_HostID; /* SCSI Target ID of host */
ULONG pb_Next; /* block number of the next PartitionBlock */
ULONG pb_Flags; /* see below for defines */
ULONG pb_Reserved1[2];
ULONG pb_DevFlags; /* preferred flags for OpenDevice */
UBYTE pb_DriveName[32]; /* preferred DOS device name: BSTR form */
/* (not used if this name is in use) */
ULONG pb_Reserved2[15]; /* filler to 32 longwords */
ULONG pb_Environment[17]; /* environment vector for this partition */
ULONG pb_EReserved[15]; /* reserved for future environment vector */
};
#define IDNAME_PARTITION 0x50415254 /* 'PART' */
#define PBFB_BOOTABLE 0 /* this partition is intended to be bootable */
#define PBFF_BOOTABLE 1L /* (expected directories and files exist) */
#define PBFB_NOMOUNT 1 /* do not mount this partition (e.g. manually */
#define PBFF_NOMOUNT 2L /* mounted, but space reserved here) */
/* this is from <dos/filehandler.h> */
#define DE_TABLESIZE 0 /* minimum value is 11 (includes NumBuffers) */
#define DE_SIZEBLOCK 1 /* in longwords: standard value is 128 */
#define DE_SECORG 2 /* not used; must be 0 */
#define DE_NUMHEADS 3 /* # of heads (surfaces). drive specific */
#define DE_SECSPERBLK 4 /* not used; must be 1 */
#define DE_BLKSPERTRACK 5 /* blocks per track. drive specific */
#define DE_RESERVEDBLKS 6 /* unavailable blocks at start. usually 2 */
#define DE_PREFAC 7 /* not used; must be 0 */
#define DE_INTERLEAVE 8 /* usually 0 */
#define DE_LOWCYL 9 /* starting cylinder. typically 0 */
#define DE_UPPERCYL 10 /* max cylinder. drive specific */
#define DE_NUMBUFFERS 11 /* starting # of buffers. typically 5 */
#define DE_MEMBUFTYPE 12 /* type of mem to allocate for buffers. */
#define DE_BUFMEMTYPE 12 /* same as above, better name
* 1 is public, 3 is chip, 5 is fast */
#define DE_MAXTRANSFER 13 /* Max number bytes to transfer at a time */
#define DE_MASK 14 /* Address Mask to block out certain memory */
#define DE_BOOTPRI 15 /* Boot priority for autoboot */
#define DE_DOSTYPE 16 /* ASCII (HEX) string showing filesystem type;
* 0X444F5300 is old filesystem,
* 0X444F5301 is fast file system */
#define DE_BAUD 17 /* Baud rate for serial handler */
#define DE_CONTROL 18 /* Control word for handler/filesystem */
#define DE_BOOTBLOCKS 19 /* Number of blocks containing boot code */
#endif /* _LINUX_AMIGARDB_H */
......@@ -72,6 +72,7 @@
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
/*
* This is an Ethernet frame header.
......
......@@ -299,14 +299,15 @@ extern void si_meminfo(struct sysinfo * val);
/* mmap.c */
extern void vma_init(void);
extern unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long off);
extern void merge_segments(struct mm_struct *, unsigned long, unsigned long);
extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
extern void exit_mmap(struct mm_struct *);
extern int do_munmap(unsigned long, size_t);
extern unsigned long get_unmapped_area(unsigned long, unsigned long);
extern unsigned long do_mmap(struct file *, unsigned long, unsigned long,
unsigned long, unsigned long, unsigned long);
extern int do_munmap(unsigned long, size_t);
/* filemap.c */
extern unsigned long page_unuse(unsigned long);
extern int shrink_mmap(int, int);
......
......@@ -284,6 +284,8 @@ struct task_struct {
struct signal_struct *sig;
sigset_t signal, blocked;
struct signal_queue *sigqueue, **sigqueue_tail;
unsigned long sas_ss_sp;
size_t sas_ss_size;
/* SMP state */
int has_cpu;
int processor;
......@@ -365,6 +367,7 @@ struct task_struct {
/* files */ &init_files, \
/* mm */ &init_mm, \
/* signals */ &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, \
0, 0, \
/* SMP */ 0,0,0,0, \
/* locks */ INIT_LOCKS \
}
......@@ -480,6 +483,7 @@ extern int kill_sl(pid_t, int, int);
extern int kill_proc(pid_t, int, int);
extern int do_sigaction(int sig, const struct k_sigaction *act,
struct k_sigaction *oact);
extern int do_sigaltstack(const stack_t *ss, stack_t *oss, unsigned long sp);
extern inline int signal_pending(struct task_struct *p)
{
......@@ -517,6 +521,19 @@ static inline void recalc_sigpending(struct task_struct *t)
t->sigpending = (ready != 0);
}
/* True if we are on the alternate signal stack. */
static inline int on_sig_stack(unsigned long sp)
{
return (sp >= current->sas_ss_sp
&& sp < current->sas_ss_sp + current->sas_ss_size);
}
static inline int sas_ss_flags(unsigned long sp)
{
return (current->sas_ss_size == 0 ? SS_DISABLE
: on_sig_stack(sp) ? SS_ONSTACK : 0);
}
extern int request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
......
......@@ -87,7 +87,7 @@ enum Zorro_Classes {
#define ZORRO_ID(manuf, prod, epc) \
((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
typedef u32 zorro_id;
typedef __u32 zorro_id;
#define ZORRO_MANUF_PACIFIC_PERIPHERALS 0x00D3
......@@ -462,6 +462,9 @@ typedef u32 zorro_id;
#define ZORRO_MANUF_ARMAX 0x0885
#define ZORRO_PROD_ARMAX_OMNIBUS ZORRO_ID(ARMAX, 0x00, 0)
#define ZORRO_MANUF_ZEUS 0x088d
#define ZORRO_PROD_ZEUS_SPIDER ZORRO_ID(ZEUS, 0x04, 0)
#define ZORRO_MANUF_NEWTEK 0x088F
#define ZORRO_PROD_NEWTEK_VIDEOTOASTER ZORRO_ID(NEWTEK, 0x00, 0)
......@@ -558,6 +561,7 @@ typedef u32 zorro_id;
#define ZORRO_PROD_PHASE5_CYBERVISION64_3D_PROTOTYPE ZORRO_ID(PHASE5, 0x32, 0)
#define ZORRO_PROD_PHASE5_CYBERVISION64_3D ZORRO_ID(PHASE5, 0x43, 0)
#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_III ZORRO_ID(PHASE5, 0x64, 0)
#define ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS ZORRO_ID(PHASE5, 0x6e, 0)
#define ZORRO_MANUF_DPS 0x2169
#define ZORRO_PROD_DPS_PERSONAL_ANIMATION_RECORDER ZORRO_ID(DPS, 0x01, 0)
......@@ -577,6 +581,9 @@ typedef u32 zorro_id;
#define ZORRO_MANUF_UWE_GERLACH 0x3FF7
#define ZORRO_PROD_UWE_GERLACH_RAM_ROM ZORRO_ID(UWE_GERLACH, 0xd4, 0)
#define ZORRO_MANUF_ACT 0x4231
#define ZORRO_PROD_ACT_PRELUDE ZORRO_ID(ACT, 0x01, 0)
#define ZORRO_MANUF_MACROSYSTEMS_GERMANY 0x4754
#define ZORRO_PROD_MACROSYSTEMS_MAESTRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x03, 0)
#define ZORRO_PROD_MACROSYSTEMS_VLAB ZORRO_ID(MACROSYSTEMS_GERMANY, 0x04, 0)
......
......@@ -378,6 +378,17 @@ static struct dev_name_struct {
{ "sdc", 0x0820 },
{ "sdd", 0x0830 },
{ "sde", 0x0840 },
{ "sdf", 0x0850 },
{ "sdg", 0x0860 },
{ "sdh", 0x0870 },
{ "sdi", 0x0880 },
{ "sdj", 0x0890 },
{ "sdk", 0x08a0 },
{ "sdl", 0x08b0 },
{ "sdm", 0x08c0 },
{ "sdn", 0x08d0 },
{ "sdo", 0x08e0 },
{ "sdp", 0x08f0 },
#endif
#ifdef CONFIG_ATARI_ACSI
{ "ada", 0x1c00 },
......@@ -667,7 +678,7 @@ static struct kernel_param cooked_params[] __initdata = {
#ifdef CONFIG_ISP16_CDI
{ "isp16=", isp16_setup },
#endif CONFIG_ISP16_CDI
#ifdef CONFIG_SOUND
#ifdef CONFIG_SOUND_OSS
{ "sound=", sound_setup },
#endif
#ifdef CONFIG_ISDN_DRV_ICN
......
......@@ -136,6 +136,7 @@ asmlinkage int sys_shmget (key_t key, int size, int shmflg)
struct shmid_ds *shp;
int err, id = 0;
down(&current->mm->mmap_sem);
lock_kernel();
if (size < 0 || size > SHMMAX) {
err = -EINVAL;
......@@ -160,6 +161,7 @@ asmlinkage int sys_shmget (key_t key, int size, int shmflg)
err = (int) shp->shm_perm.seq * SHMMNI + id;
}
unlock_kernel();
up(&current->mm->mmap_sem);
return err;
}
......@@ -484,6 +486,7 @@ asmlinkage int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
unsigned long addr;
unsigned long len;
down(&current->mm->mmap_sem);
lock_kernel();
if (shmid < 0) {
/* printk("shmat() -> EINVAL because shmid = %d < 0\n",shmid); */
......@@ -584,6 +587,7 @@ asmlinkage int sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
err = 0;
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return err;
}
......@@ -634,6 +638,7 @@ asmlinkage int sys_shmdt (char *shmaddr)
{
struct vm_area_struct *shmd, *shmdnext;
down(&current->mm->mmap_sem);
lock_kernel();
for (shmd = current->mm->mmap; shmd; shmd = shmdnext) {
shmdnext = shmd->vm_next;
......@@ -642,6 +647,7 @@ asmlinkage int sys_shmdt (char *shmaddr)
do_munmap(shmd->vm_start, shmd->vm_end - shmd->vm_start);
}
unlock_kernel();
up(&current->mm->mmap_sem);
return 0;
}
......
......@@ -204,7 +204,6 @@ static inline int dup_mmap(struct mm_struct * mm)
int retval;
flush_cache_mm(current->mm);
down(&current->mm->mmap_sem);
pprev = &mm->mmap;
for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) {
struct file *file;
......@@ -254,7 +253,6 @@ static inline int dup_mmap(struct mm_struct * mm)
fail_nomem:
flush_tlb_mm(current->mm);
up(&current->mm->mmap_sem);
return retval;
}
......@@ -466,6 +464,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
int error = -ENOMEM;
struct task_struct *p;
down(&current->mm->mmap_sem);
lock_kernel();
p = alloc_task_struct();
if (!p)
......@@ -570,6 +569,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
++total_forks;
error = p->pid;
bad_fork:
up(&current->mm->mmap_sem);
unlock_kernel();
return error;
......
......@@ -93,6 +93,13 @@ int request_module(const char * module_name)
int pid;
int waitpid_result;
/* Don't allow request_mode() before the root fs is mounted! */
if ( ! current->fs->root ) {
printk(KERN_ERR "request_module[%s]: Root fs not mounted\n",
module_name);
return -EPERM;
}
pid = kernel_thread(exec_modprobe, (void*) module_name, CLONE_FS);
if (pid < 0) {
printk(KERN_ERR "kmod: fork failed, errno %d\n", -pid);
......
......@@ -840,6 +840,62 @@ do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
return 0;
}
int
do_sigaltstack (const stack_t *uss, stack_t *uoss, unsigned long sp)
{
stack_t oss;
int error;
if (uoss) {
oss.ss_sp = (void *) current->sas_ss_sp;
oss.ss_size = current->sas_ss_size;
oss.ss_flags = sas_ss_flags(sp);
}
if (uss) {
void *ss_sp;
size_t ss_size;
int ss_flags;
error = -EFAULT;
if (verify_area(VERIFY_READ, uss, sizeof(*uss))
|| __get_user(ss_sp, &uss->ss_sp)
|| __get_user(ss_flags, &uss->ss_flags)
|| __get_user(ss_size, &uss->ss_size))
goto out;
error = -EPERM;
if (on_sig_stack (sp))
goto out;
error = -EINVAL;
if (ss_flags & ~SS_DISABLE)
goto out;
if (ss_flags & SS_DISABLE) {
ss_size = 0;
ss_sp = NULL;
} else {
error = -ENOMEM;
if (ss_size < MINSIGSTKSZ)
goto out;
}
current->sas_ss_sp = (unsigned long) ss_sp;
current->sas_ss_size = ss_size;
}
if (uoss) {
error = -EFAULT;
if (copy_to_user(uoss, &oss, sizeof(oss)))
goto out;
}
error = 0;
out:
return error;
}
#if !defined(__alpha__)
/* Alpha has its own versions with special arguments. */
......@@ -908,6 +964,7 @@ sys_sigpending(old_sigset_t *set)
return error;
}
#ifndef __sparc__
asmlinkage int
sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact,
size_t sigsetsize)
......@@ -933,6 +990,7 @@ sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact,
out:
return ret;
}
#endif /* __sparc__ */
#endif
#if !defined(__alpha__)
......
......@@ -1256,6 +1256,7 @@ asmlinkage int sys_msync(unsigned long start, size_t len, int flags)
struct vm_area_struct * vma;
int unmapped_error, error = -EINVAL;
down(&current->mm->mmap_sem);
lock_kernel();
if (start & ~PAGE_MASK)
goto out;
......@@ -1303,6 +1304,7 @@ asmlinkage int sys_msync(unsigned long start, size_t len, int flags)
}
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return error;
}
......
......@@ -895,6 +895,9 @@ static inline void handle_pte_fault(struct task_struct *tsk,
do_wp_page(tsk, vma, address, write_access, pte);
}
/*
* By the time we get here, we already hold the mm semaphore
*/
void handle_mm_fault(struct task_struct *tsk, struct vm_area_struct * vma,
unsigned long address, int write_access)
{
......@@ -909,7 +912,9 @@ void handle_mm_fault(struct task_struct *tsk, struct vm_area_struct * vma,
pte = pte_alloc(pmd, address);
if (!pte)
goto no_memory;
lock_kernel();
handle_pte_fault(tsk, vma, address, write_access, pte);
unlock_kernel();
update_mmu_cache(vma, address, *pte);
return;
no_memory:
......
......@@ -127,13 +127,25 @@ static int mlock_fixup(struct vm_area_struct * vma,
pages = -pages;
vma->vm_mm->locked_vm += pages;
if (newflags & VM_LOCKED)
#if 0
/*
* This is horribly broken. See the comment on the same
* brokenness in mm/mmap.c (essentially, this doesn't
* work anyway for PROT_NONE and writable pages, and now
* that we properly get the mmap semaphore it would just
* lock up on us).
*
* Fix the same way.
*/
if (newflags & VM_LOCKED) {
while (start < end) {
int c;
get_user(c,(int *) start);
__asm__ __volatile__("": :"r" (c));
start += PAGE_SIZE;
}
}
#endif
}
return retval;
}
......@@ -192,6 +204,7 @@ asmlinkage int sys_mlock(unsigned long start, size_t len)
unsigned long lock_limit;
int error = -ENOMEM;
down(&current->mm->mmap_sem);
lock_kernel();
len = (len + (start & ~PAGE_MASK) + ~PAGE_MASK) & PAGE_MASK;
start &= PAGE_MASK;
......@@ -214,6 +227,7 @@ asmlinkage int sys_mlock(unsigned long start, size_t len)
error = do_mlock(start, len, 1);
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return error;
}
......@@ -221,11 +235,13 @@ asmlinkage int sys_munlock(unsigned long start, size_t len)
{
int ret;
down(&current->mm->mmap_sem);
lock_kernel();
len = (len + (start & ~PAGE_MASK) + ~PAGE_MASK) & PAGE_MASK;
start &= PAGE_MASK;
ret = do_mlock(start, len, 0);
unlock_kernel();
up(&current->mm->mmap_sem);
return ret;
}
......@@ -263,6 +279,7 @@ asmlinkage int sys_mlockall(int flags)
unsigned long lock_limit;
int ret = -EINVAL;
down(&current->mm->mmap_sem);
lock_kernel();
if (!flags || (flags & ~(MCL_CURRENT | MCL_FUTURE)))
goto out;
......@@ -282,6 +299,7 @@ asmlinkage int sys_mlockall(int flags)
ret = do_mlockall(flags);
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return ret;
}
......@@ -289,8 +307,10 @@ asmlinkage int sys_munlockall(void)
{
int ret;
down(&current->mm->mmap_sem);
lock_kernel();
ret = do_mlockall(0);
unlock_kernel();
up(&current->mm->mmap_sem);
return ret;
}
......@@ -92,6 +92,7 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
unsigned long newbrk, oldbrk;
struct mm_struct *mm = current->mm;
down(&mm->mmap_sem);
lock_kernel();
if (brk < mm->end_code)
goto out;
......@@ -132,6 +133,7 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
out:
retval = mm->brk;
unlock_kernel();
up(&mm->mmap_sem);
return retval;
}
......@@ -316,9 +318,21 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
merge_segments(mm, vma->vm_start, vma->vm_end);
mm->total_vm += len >> PAGE_SHIFT;
if ((flags & VM_LOCKED) && !(flags & VM_IO)) {
unsigned long start = addr;
if (flags & VM_LOCKED) {
mm->locked_vm += len >> PAGE_SHIFT;
/*
* This used to be just slightly broken, now it's just completely
* buggered. We can't take a page fault here, because we already
* hold the mm semaphore (as is proper). We should do this by hand
* by calling the appropriate fault-in routine.
*
* That would also fix this routine wrt writes and PROT_NONE
* areas, both of which can't be handled by the page fault
* approach anyway.
*/
#if 0
unsigned long start = addr;
do {
char c;
get_user(c,(char *) start);
......@@ -326,6 +340,7 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
start += PAGE_SIZE;
__asm__ __volatile__("": :"r" (c));
} while (len > 0);
#endif
}
return addr;
......@@ -442,16 +457,6 @@ static int unmap_fixup(struct vm_area_struct *area, unsigned long addr,
return 1;
}
asmlinkage int sys_munmap(unsigned long addr, size_t len)
{
int ret;
lock_kernel();
ret = do_munmap(addr, len);
unlock_kernel();
return ret;
}
/* Munmap is split into 2 main parts -- this part which finds
* what needs doing, and the areas themselves, which do the
* work. This now handles partial unmappings.
......@@ -555,6 +560,18 @@ int do_munmap(unsigned long addr, size_t len)
return 0;
}
asmlinkage int sys_munmap(unsigned long addr, size_t len)
{
int ret;
down(&current->mm->mmap_sem);
lock_kernel();
ret = do_munmap(addr, len);
unlock_kernel();
up(&current->mm->mmap_sem);
return ret;
}
/* Release all mmaps. */
void exit_mmap(struct mm_struct * mm)
{
......@@ -630,13 +647,13 @@ void insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vmp)
* This assumes that the list is ordered by address.
* We don't need to traverse the entire list, only those segments
* which intersect or are adjacent to a given interval.
*
* We must already hold the mm semaphore when we get here..
*/
void merge_segments (struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
{
struct vm_area_struct *prev, *mpnt, *next;
down(&mm->mmap_sem);
prev = NULL;
mpnt = mm->mmap;
while(mpnt && mpnt->vm_end <= start_addr) {
......@@ -644,7 +661,7 @@ void merge_segments (struct mm_struct * mm, unsigned long start_addr, unsigned l
mpnt = mpnt->vm_next;
}
if (!mpnt)
goto no_vma;
return;
next = mpnt->vm_next;
......@@ -700,8 +717,6 @@ void merge_segments (struct mm_struct * mm, unsigned long start_addr, unsigned l
mpnt = prev;
}
mm->mmap_cache = NULL; /* Kill the cache. */
no_vma:
up(&mm->mmap_sem);
}
__initfunc(void vma_init(void))
......
......@@ -208,18 +208,20 @@ asmlinkage int sys_mprotect(unsigned long start, size_t len, unsigned long prot)
struct vm_area_struct * vma, * next;
int error = -EINVAL;
lock_kernel();
if (start & ~PAGE_MASK)
goto out;
return -EINVAL;
len = (len + ~PAGE_MASK) & PAGE_MASK;
end = start + len;
if (end < start)
goto out;
return -EINVAL;
if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC))
goto out;
error = 0;
return -EINVAL;
if (end == start)
goto out;
return 0;
down(&current->mm->mmap_sem);
lock_kernel();
vma = find_vma(current->mm, start);
error = -EFAULT;
if (!vma || vma->vm_start > start)
......@@ -256,5 +258,6 @@ asmlinkage int sys_mprotect(unsigned long start, size_t len, unsigned long prot)
merge_segments(current->mm, start, end);
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return error;
}
......@@ -167,6 +167,7 @@ asmlinkage unsigned long sys_mremap(unsigned long addr,
struct vm_area_struct *vma;
unsigned long ret = -EINVAL;
down(&current->mm->mmap_sem);
lock_kernel();
if (addr & ~PAGE_MASK)
goto out;
......@@ -233,5 +234,6 @@ asmlinkage unsigned long sys_mremap(unsigned long addr,
ret = -ENOMEM;
out:
unlock_kernel();
up(&current->mm->mmap_sem);
return ret;
}
......@@ -56,7 +56,7 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
if [ "$CONFIG_NET_SCHED" = "y" ]; then
source net/sched/Config.in
fi
bool 'Network code profiler' CONFIG_NET_PROFILE
# bool 'Network code profiler' CONFIG_NET_PROFILE
fi
fi
endmenu
......@@ -277,7 +277,7 @@ __initfunc(int net_profile_init(void))
printk("Evaluating net profiler cost ...");
#if CPU == 586 || CPU == 686
if (!(boot_cpu_data.x86_capability & 16)) {
panic("Sorry, you CPU does not support tsc. I am dying...\n");
printk(KERN_ERR "Sorry, you CPU does not support tsc. Net profiler is dying...\n");
return -1;
}
#endif
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment