Commit f38a2456 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.96

parent 8e16a50d
......@@ -647,11 +647,11 @@ S: Atlanta, Georgia 30332
S: USA
N: Angelo Haritsis
E: ah@doc.ic.ac.uk
E: ah@computer.org
D: kernel patches (serial, watchdog)
D: xringd, vuzkern, greekXfonts
S: 58 Henfield Close
S: London N19 3UL
S: 77 Clarence Mews
S: London SE16 1GD
S: United Kingdom
N: Kai Harrekilde-Petersen
......
......@@ -3,7 +3,6 @@
*
* Copyright (C) 1998 Russell King
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/init.h>
......
......@@ -18,7 +18,7 @@
static int read_ldt(void * ptr, unsigned long bytecount)
{
void * address = current->ldt;
void * address = current->mm->segments;
unsigned long size;
if (!ptr)
......@@ -37,6 +37,7 @@ static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
{
struct modify_ldt_ldt_s ldt_info;
unsigned long *lp;
struct mm_struct * mm;
int error, i;
if (bytecount != sizeof(ldt_info))
......@@ -48,19 +49,32 @@ static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
if ((ldt_info.contents == 3 && (oldmode || ldt_info.seg_not_present == 0)) || ldt_info.entry_number >= LDT_ENTRIES)
return -EINVAL;
if (!current->ldt) {
mm = current->mm;
/*
* Horrible dependencies! Try to get rid of this. This is wrong,
* as it only reloads the ldt for the first process with this
* mm. The implications are that you should really make sure that
* you have a ldt before you do the first clone(), otherwise
* you get strange behaviour (the kernel is safe, it's just user
* space strangeness).
*
* For no good reason except historical, the GDT index of the LDT
* is chosen to follow the index number in the task[] array.
*/
if (!mm->segments) {
for (i=1 ; i<NR_TASKS ; i++) {
if (task[i] == current) {
if (!(current->ldt = (struct desc_struct*) vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE)))
if (task[i]->mm == mm) {
if (!(mm->segments = (void *) vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE)))
return -ENOMEM;
memset(current->ldt, 0, LDT_ENTRIES*LDT_ENTRY_SIZE);
set_ldt_desc(gdt+(i<<1)+FIRST_LDT_ENTRY, current->ldt, LDT_ENTRIES);
memset(mm->segments, 0, LDT_ENTRIES*LDT_ENTRY_SIZE);
set_ldt_desc(gdt+(i<<1)+FIRST_LDT_ENTRY, mm->segments, LDT_ENTRIES);
load_ldt(i);
}
}
}
lp = (unsigned long *) &current->ldt[ldt_info.entry_number];
lp = (unsigned long *) (LDT_ENTRY_SIZE * ldt_info.entry_number + (unsigned long) mm->segments);
/* Allow LDTs to be cleared by the user. */
if (ldt_info.base_addr == 0 && ldt_info.limit == 0
&& (oldmode ||
......
......@@ -418,43 +418,37 @@ void show_regs(struct pt_regs * regs)
0xffff & regs->xds,0xffff & regs->xes);
}
/*
* Free current thread data structures etc..
*/
void exit_thread(void)
void release_segments(struct mm_struct *mm)
{
/* forget lazy i387 state */
if (last_task_used_math == current)
last_task_used_math = NULL;
void * ldt;
/* forget local segments */
__asm__ __volatile__("movl %w0,%%fs ; movl %w0,%%gs ; lldt %w0"
: /* no outputs */
: "r" (0));
current->tss.ldt = 0;
if (current->ldt) {
void * ldt = current->ldt;
current->ldt = NULL;
ldt = mm->segments;
if (ldt) {
mm->segments = NULL;
vfree(ldt);
}
}
/*
* Free current thread data structures etc..
*/
void exit_thread(void)
{
/* forget lazy i387 state */
if (last_task_used_math == current)
last_task_used_math = NULL;
}
void flush_thread(void)
{
int i;
if (current->ldt) {
free_page((unsigned long) current->ldt);
current->ldt = NULL;
for (i=1 ; i<NR_TASKS ; i++) {
if (task[i] == current) {
set_ldt_desc(gdt+(i<<1)+
FIRST_LDT_ENTRY,&default_ldt, 1);
load_ldt(i);
}
}
}
for (i=0 ; i<8 ; i++)
current->debugreg[i] = 0;
......@@ -479,13 +473,30 @@ void release_thread(struct task_struct *dead_task)
{
}
void copy_segments(int nr, struct task_struct *p, struct mm_struct *new_mm)
{
int ldt_size = 1;
void * ldt = &default_ldt;
struct mm_struct * old_mm = current->mm;
p->tss.ldt = _LDT(nr);
if (old_mm->segments) {
new_mm->segments = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
if (new_mm->segments) {
ldt = new_mm->segments;
ldt_size = LDT_ENTRIES;
memcpy(ldt, old_mm->segments, LDT_ENTRIES*LDT_ENTRY_SIZE);
}
}
set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY, ldt, LDT_ENTRIES);
}
int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
struct task_struct * p, struct pt_regs * regs)
{
struct pt_regs * childregs;
p->tss.tr = _TSS(nr);
p->tss.ldt = _LDT(nr);
p->tss.es = __KERNEL_DS;
p->tss.cs = __KERNEL_CS;
p->tss.ss = __KERNEL_DS;
......@@ -508,16 +519,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
childregs->eax = 0;
childregs->esp = esp;
p->tss.back_link = 0;
if (p->ldt) {
p->ldt = (struct desc_struct*) vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
if (p->ldt != NULL)
memcpy(p->ldt, current->ldt, LDT_ENTRIES*LDT_ENTRY_SIZE);
}
set_tss_desc(gdt+(nr<<1)+FIRST_TSS_ENTRY,&(p->tss));
if (p->ldt)
set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,p->ldt, 512);
else
set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,&default_ldt, 1);
/*
* a bitmap offset pointing outside of the TSS limit causes a nicely
* controllable SIGSEGV. The first sys_ioperm() call sets up the
......
......@@ -123,6 +123,8 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
unsigned int csum_partial_copy_generic (const char *src, char *dst,
int len, int sum, int *src_err_ptr, int *dst_err_ptr)
{
__u32 tmp_var;
__asm__ __volatile__ ( "
testl $2, %%edi # Check alignment.
jz 2f # Jump if alignment is ok.
......@@ -137,7 +139,7 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst,
addw %%bx, %%ax
adcl $0, %%eax
2:
pushl %%ecx
movl %%ecx, %8
shrl $5, %%ecx
jz 2f
testl %%esi, %%esi
......@@ -174,7 +176,7 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst,
dec %%ecx
jne 1b
adcl $0, %%eax
2: popl %%edx
2: movl %8, %%edx
movl %%edx, %%ecx
andl $0x1c, %%edx
je 4f
......@@ -231,9 +233,10 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst,
################################################
"
: "=a" (sum), "=m" (src_err_ptr), "=m" (dst_err_ptr)
: "0" (sum), "c" (len), "S" (src), "D" (dst),
"i" (-EFAULT)
: "=a" (sum)
: "m" (src_err_ptr), "m" (dst_err_ptr),
"0" (sum), "c" (len), "S" (src), "D" (dst),
"i" (-EFAULT), "m"(tmp_var)
: "bx", "cx", "dx", "si", "di" );
return(sum);
......
......@@ -20,7 +20,7 @@
of the stack frame of math_emulate() */
#define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg
#define LDT_DESCRIPTOR(s) (current->ldt[(s) >> 3])
#define LDT_DESCRIPTOR(s) (((struct ldt_struct *)current->mm->segments)[(s) >> 3])
#define SEG_D_SIZE(x) ((x).b & (3 << 21))
#define SEG_G_BIT(x) ((x).b & (1 << 23))
#define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1)
......
......@@ -149,11 +149,6 @@ void unplug_device(void * data)
}
}
if (queue_new_request)
/*
* request functions are smart enough to notice a change
* in the request queue, calling them without the spinlock
* is OK, i think. <-- FIXME: [is this true? --mingo]
*/
(dev->request_fn)();
spin_unlock_irqrestore(&io_request_lock,flags);
......@@ -348,10 +343,6 @@ void add_request(struct blk_dev_struct * dev, struct request * req)
if (scsi_blk_major(MAJOR(req->rq_dev)))
queue_new_request = 1;
out:
/*
* request_fn() is usually a quite complex and slow function,
* we want to call it with no spinlocks held
*/
if (queue_new_request)
(dev->request_fn)();
spin_unlock_irqrestore(&io_request_lock,flags);
......
......@@ -34,7 +34,6 @@
#include <linux/module.h>
#include <linux/bios32.h>
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/fs.h>
......
......@@ -17,7 +17,7 @@
#define KBD_INIT_TIMEOUT HZ /* Timeout in jiffies for initializing the keyboard */
#define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */
#define KBD_TIMEOUT 250 /* Timeout in ms for keyboard command acknowledge */
#define KBD_TIMEOUT 1000 /* Timeout in ms for keyboard command acknowledge */
/*
* Internal variables of the driver
......
......@@ -3613,6 +3613,7 @@ __initfunc(static int serial_console_setup(struct console *co, char *options))
* Disable UART interrupts, set DTR and RTS high
* and set speed.
*/
outb(cval, ser->port + UART_LCR); /* don't assume that DLAB is clear */
outb(0, ser->port + UART_IER);
outb(UART_MCR_DTR | UART_MCR_RTS, ser->port + UART_MCR);
outb(cval | UART_LCR_DLAB, ser->port + UART_LCR); /* set DLAB */
......
......@@ -162,9 +162,9 @@ void parport_pc_release_resources(struct parport *p)
int parport_pc_claim_resources(struct parport *p)
{
/* FIXME check that resources are free */
int err;
if (p->irq != PARPORT_IRQ_NONE)
request_irq(p->irq, parport_pc_null_intr_func, 0, p->name, NULL);
if ((err = request_irq(p->irq, parport_pc_null_intr_func, 0, p->name, NULL)) != 0) return err;
request_region(p->base, p->size, p->name);
if (p->modes & PARPORT_MODE_PCECR)
request_region(p->base+0x400, 3, p->name);
......
......@@ -6,11 +6,11 @@
#include <linux/pci.h>
#include <linux/string.h>
#include <linux/blk.h>
#incldue <asm/spinlock.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/spinlock.h>
#include "scsi.h"
#include "hosts.h"
......
......@@ -3844,8 +3844,11 @@ STATIC int asc_proc_copy(off_t, off_t, char *, int , char *, int);
#endif /* version >= v1.3.0 */
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,70)
STATIC void advansys_interrupt(int, struct pt_regs *);
#else /* version >= v1.3.70 */
#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,95)
STATIC void advansys_interrupt(int, void *, struct pt_regs *);
#else /* version >= 2.1.95 */
STATIC void advansys_interrupt(int, void *, struct pt_regs *);
STATIC void do_advansys_interrupt(int, void *, struct pt_regs *);
#endif /* version >= v1.3.70 */
#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,89)
STATIC void advansys_select_queue_depths(struct Scsi_Host *,
......
......@@ -209,7 +209,7 @@ struct proc_dir_entry proc_scsi_aic7xxx = {
0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
#define AIC7XXX_C_VERSION "5.0.12"
#define AIC7XXX_C_VERSION "5.0.13"
#define NUMBER(arr) (sizeof(arr) / sizeof(arr[0]))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
......@@ -270,18 +270,24 @@ struct proc_dir_entry proc_scsi_aic7xxx = {
# include <asm/spinlock.h>
# include <linux/smp.h>
# define cpuid smp_processor_id()
# define DRIVER_LOCK_INIT \
spin_lock_init(&p->spin_lock);
# define DRIVER_LOCK \
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
# define DRIVER_LOCK_INIT \
spin_lock_init(&p->spin_lock);
# define DRIVER_LOCK \
if(!p->cpu_lock_count[cpuid]) { \
spin_lock_irqsave(&p->spin_lock, cpu_flags); \
p->cpu_lock_count[cpuid]++; \
} else { \
p->cpu_lock_count[cpuid]++; \
}
# define DRIVER_UNLOCK \
if(--p->cpu_lock_count[cpuid] == 0) \
spin_unlock_irqrestore(&p->spin_lock, cpu_flags);
# define DRIVER_UNLOCK \
if(--p->cpu_lock_count[cpuid] == 0) \
spin_unlock_irqrestore(&p->spin_lock, cpu_flags);
# else
# define DRIVER_LOCK_INIT
# define DRIVER_LOCK
# define DRIVER_UNLOCK
# endif
#else
# define cpuid 0
# define DRIVER_LOCK_INIT
......@@ -2159,7 +2165,9 @@ static inline void
aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
{
Scsi_Cmnd *cmd;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
unsigned int cpu_flags = 0;
#endif
DRIVER_LOCK
while (p->completeq.head != NULL)
......@@ -3193,7 +3201,9 @@ aic7xxx_run_waiting_queues(struct aic7xxx_host *p)
struct aic7xxx_scb *scb;
int tindex;
int sent;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
unsigned long cpu_flags = 0;
#endif
if (p->waiting_scbs.head == NULL)
......@@ -3261,8 +3271,12 @@ aic7xxx_timer(struct aic7xxx_host *p)
int i;
unsigned long cpu_flags = 0;
struct aic7xxx_scb *scb;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
DRIVER_LOCK
#else
spin_lock_irqsave(&io_request_lock, cpu_flags);
#endif
for(i=0; i<MAX_TARGETS; i++)
{
if ( (p->dev_timer[i].expires) &&
......@@ -3282,7 +3296,11 @@ aic7xxx_timer(struct aic7xxx_host *p)
}
}
aic7xxx_run_waiting_queues(p);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
DRIVER_UNLOCK
#else
spin_unlock_irqrestore(&io_request_lock, cpu_flags);
#endif
}
/*+F*************************************************************************
......@@ -4893,7 +4911,6 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
{
struct aic7xxx_host *p;
unsigned char intstat;
unsigned long cpu_flags = 0;
p = (struct aic7xxx_host *)dev_id;
......@@ -4924,6 +4941,7 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
p->spurious_int++;
}
#endif
return;
}
else if (p->flags & AHC_IN_ISR)
{
......@@ -4934,7 +4952,6 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
* Handle all the interrupt sources - especially for SCSI
* interrupts, we won't get a second chance at them.
*/
DRIVER_LOCK
intstat = aic_inb(p, INTSTAT);
p->spurious_int = 0;
......@@ -4943,24 +4960,6 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
*/
p->isr_count++;
p->flags |= AHC_IN_ISR;
if (!(p->flags & AHC_A_SCANNED) && (p->isr_count == 1))
{
/*
* We must only have one card at this IRQ and it must have been
* added to the board data before the spurious interrupt occurred.
* It is sufficient that we check isr_count and not the spurious
* interrupt count.
*/
if (intstat)
{
/* Try clearing all interrupts. */
aic_outb(p, CLRBRKADRINT | CLRSCSIINT | CLRCMDINT | CLRSEQINT, CLRINT);
unpause_sequencer(p, TRUE);
}
DRIVER_UNLOCK
printk("scsi%d: Encountered spurious interrupt.\n", p->host_no);
return;
}
/*
* Indicate that we're in the interrupt handler.
......@@ -5069,7 +5068,6 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
{
aic7xxx_handle_scsiint(p, intstat);
}
DRIVER_UNLOCK
if(!(p->flags & (AHC_IN_ABORT | AHC_IN_RESET)))
{
aic7xxx_done_cmds_complete(p);
......@@ -5080,7 +5078,7 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
/*+F*************************************************************************
* Function:
* aic7xxx_isr
* do_aic7xxx_isr
*
* Description:
* This is a gross hack to solve a problem in linux kernels 2.1.85 and
......@@ -5090,14 +5088,16 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
static void
do_aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,93)
unsigned long flags;
unsigned long cpu_flags;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,95)
spin_lock_irqsave(&io_request_lock, flags);
spin_lock_irqsave(&io_request_lock, cpu_flags);
aic7xxx_isr(irq, dev_id, regs);
spin_unlock_irqrestore(&io_request_lock, flags);
spin_unlock_irqrestore(&io_request_lock, cpu_flags);
#else
DRIVER_LOCK
aic7xxx_isr(irq, dev_id, regs);
DRIVER_UNLOCK
#endif
}
......@@ -8007,7 +8007,9 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
struct aic7xxx_host *p;
struct aic7xxx_scb *scb;
int tindex = TARGET_INDEX(cmd);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
unsigned long cpu_flags = 0;
#endif
p = (struct aic7xxx_host *) cmd->host->hostdata;
/*
......@@ -8327,7 +8329,9 @@ aic7xxx_abort(Scsi_Cmnd *cmd)
struct aic7xxx_host *p;
int result, found=0;
unsigned char tmp_char, saved_hscbptr, next_hscbptr, prev_hscbptr;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
unsigned long cpu_flags = 0;
#endif
Scsi_Cmnd *cmd_next, *cmd_prev;
p = (struct aic7xxx_host *) cmd->host->hostdata;
......@@ -8646,7 +8650,9 @@ aic7xxx_reset(Scsi_Cmnd *cmd, unsigned int flags)
struct aic7xxx_host *p;
int tindex;
int result = -1;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
unsigned long cpu_flags = 0;
#endif
#define DEVICE_RESET 0x01
#define BUS_RESET 0x02
#define HOST_RESET 0x04
......
......@@ -25,7 +25,7 @@
#define AIC7XXX_H_VERSION "3.2.4"
#ifndef LINUX_KERNEL_VERSION
#ifndef LINUX_VERSION_CODE
#include <linux/version.h>
#endif
......
......@@ -9789,18 +9789,15 @@ printk("ncr53c8xx : command successfully queued\n");
#if LINUX_VERSION_CODE >= LinuxVersionCode(1,3,70)
static void ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
{
unsigned long flags;
#ifdef DEBUG_NCR53C8XX
printk("ncr53c8xx : interrupt received\n");
#endif
if (DEBUG_FLAGS & DEBUG_TINY) printf ("[");
spin_lock_irqsave(&io_request_lock, flags);
ncr_exception((ncb_p) dev_id);
spin_unlock_irqrestore(&io_request_lock, flags);
if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n");
}
static void do_ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long flags;
......
......@@ -228,7 +228,6 @@ static ssize_t sg_read(struct file *filp, char *buf,
struct inode *inode = filp->f_dentry->d_inode;
int dev=MINOR(inode->i_rdev);
int i;
unsigned long flags;
struct scsi_generic *device=&scsi_generics[dev];
/*
......@@ -252,22 +251,18 @@ static ssize_t sg_read(struct file *filp, char *buf,
/*
* Wait until the command is actually done.
*/
spin_lock_irqsave(&io_request_lock, flags);
while(!device->pending || !device->complete)
{
if (filp->f_flags & O_NONBLOCK)
{
spin_unlock_irqrestore(&io_request_lock, flags);
return -EAGAIN;
}
interruptible_sleep_on(&device->read_wait);
if (signal_pending(current))
{
spin_unlock_irqrestore(&io_request_lock, flags);
return -ERESTARTSYS;
}
}
spin_unlock_irqrestore(&io_request_lock, flags);
/*
* Now copy the result back to the user buffer.
......
......@@ -427,7 +427,6 @@ static void do_sr_request (void)
Scsi_Cmnd * SCpnt = NULL;
struct request * req = NULL;
Scsi_Device * SDev;
unsigned long flags;
int flag = 0;
while (1==1){
......
......@@ -30,6 +30,7 @@
#include <asm/uaccess.h>
#include <asm/dma.h>
#include <asm/system.h>
#include <asm/spinlock.h>
/* The driver prints some debugging information on the console if DEBUG
is defined and non-zero. */
......@@ -250,6 +251,9 @@ st_sleep_done (Scsi_Cmnd * SCpnt)
st_do_scsi(Scsi_Cmnd *SCpnt, Scsi_Tape *STp, unsigned char *cmd, int bytes,
int timeout, int retries)
{
unsigned long flags;
spin_lock_irqsave(&io_request_lock, flags);
if (SCpnt == NULL)
if ((SCpnt = scsi_allocate_device(NULL, STp->device, 1)) == NULL) {
printk(KERN_ERR "st%d: Can't get SCSI request.\n", TAPE_NR(STp->devt));
......@@ -264,6 +268,7 @@ st_do_scsi(Scsi_Cmnd *SCpnt, Scsi_Tape *STp, unsigned char *cmd, int bytes,
scsi_do_cmd(SCpnt, (void *)cmd, (STp->buffer)->b_data, bytes,
st_sleep_done, timeout, retries);
spin_unlock_irqrestore(&io_request_lock, flags);
down(SCpnt->request.sem);
......@@ -976,6 +981,7 @@ st_write(struct file * filp, const char * buf, size_t count, loff_t *ppos)
ST_mode * STm;
ST_partstat * STps;
int dev = TAPE_NR(inode->i_rdev);
unsigned long flags;
STp = &(scsi_tapes[dev]);
......@@ -1271,10 +1277,12 @@ st_write(struct file * filp, const char * buf, size_t count, loff_t *ppos)
STp->write_pending = 1;
#endif
spin_lock_irqsave(&io_request_lock, flags);
scsi_do_cmd (SCpnt,
(void *) cmd, (STp->buffer)->b_data,
(STp->buffer)->writing,
st_sleep_done, STp->timeout, MAX_WRITE_RETRIES);
spin_unlock_irqrestore(&io_request_lock, flags);
}
else if (SCpnt != NULL)
{
......
......@@ -6,11 +6,9 @@
* Copyright (C) 1997 by Russell King <rmk@arm.uk.linux.org>
*/
#include <linux/config.h>
#include <asm/io.h>
#include <asm/dma.h>
#include "sound_config.h"
#include "vidc.h"
int vidc_busy;
......
......@@ -6,11 +6,9 @@
* Copyright (C) 1997 Russell King <rmk@arm.uk.linux.org>
*/
#include <linux/config.h>
#include "sound_config.h"
#include <asm/hardware.h>
#include <asm/io.h>
#include "sound_config.h"
#include "vidc.h"
/*
......
......@@ -6,9 +6,7 @@
* Copyright (C) 1997 Russell King <rmk@arm.uk.linux.org>
*/
#include <linux/config.h>
#include "sound_config.h"
#include "vidc.h"
int vidc_volume;
......
......@@ -5,9 +5,8 @@
*
* Copyright (C) 1997 Russell King <rmk@arm.uk.linux.org>
*/
#include <linux/config.h>
#include "sound_config.h"
#include "sound_config.h"
#include "vidc.h"
static struct synth_info vidc_info =
......
......@@ -92,6 +92,9 @@ extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
/* Free all resources held by a thread. */
extern void release_thread(struct task_struct *);
#define copy_segments(nr, tsk, mm) do { } while (0)
#define release_segments(mm) do { } while (0)
/* NOTE: The task struct and the stack go together! */
#define alloc_task_struct() \
((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
......
......@@ -6,6 +6,8 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <linux/config.h>
#ifdef CONFIG_ARCH_ARC
#define cliIF() \
......
......@@ -6,6 +6,7 @@
* (C) 1998 Russell King
*/
#include <linux/config.h>
#include <asm/irq.h>
#define NR_SCANCODES 128
......
......@@ -189,9 +189,16 @@ struct thread_struct {
regs->esp = new_esp; \
} while (0)
/* Forward declaration, a strange C thing */
struct mm_struct;
/* Free all resources held by a thread. */
extern void release_thread(struct task_struct *);
/* Copy and release all segment info associated with a VM */
extern void copy_segments(int nr, struct task_struct *p, struct mm_struct * mm);
extern void release_segments(struct mm_struct * mm);
/*
* Return saved PC of a blocked thread.
*/
......
......@@ -69,10 +69,10 @@ asmlinkage int printk(const char * fmt, ...)
*/
#define NIPQUAD(addr) \
(((addr) >> 0) & 0xff), \
(((addr) >> 8) & 0xff), \
(((addr) >> 16) & 0xff), \
(((addr) >> 24) & 0xff)
(int)(((addr) >> 0) & 0xff), \
(int)(((addr) >> 8) & 0xff), \
(int)(((addr) >> 16) & 0xff), \
(int)(((addr) >> 24) & 0xff)
#endif /* __KERNEL__ */
......
......@@ -168,6 +168,11 @@ struct mm_struct {
unsigned long rss, total_vm, locked_vm;
unsigned long def_flags;
unsigned long cpu_vm_mask;
/*
* This is an architecture-specific pointer: the portable
* part of Linux does not know about any segments.
*/
void * segments;
};
#define INIT_MM { \
......@@ -178,7 +183,7 @@ struct mm_struct {
0, 0, 0, \
0, 0, 0, 0, \
0, 0, 0, \
0, 0 }
0, 0, NULL }
struct signal_struct {
atomic_t count;
......@@ -267,8 +272,6 @@ struct task_struct {
/* ipc stuff */
struct sem_undo *semundo;
struct sem_queue *semsleeping;
/* ldt for this task - used by Wine. If NULL, default_ldt is used */
struct desc_struct *ldt;
/* tss for this task */
struct thread_struct tss;
/* filesystem information */
......@@ -357,7 +360,6 @@ struct task_struct {
/* comm */ "swapper", \
/* fs info */ 0,NULL, \
/* ipc */ NULL, NULL, \
/* ldt */ NULL, \
/* tss */ INIT_TSS, \
/* fs */ &init_fs, \
/* files */ &init_files, \
......
......@@ -1093,7 +1093,7 @@ __initfunc(asmlinkage void start_kernel(void))
* Like idlers init is an unlocked kernel thread, which will
* make syscalls (and thus be locked).
*/
kernel_thread(init, NULL, 0);
kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
/*
* task[0] is meant to be used as an "idle" task: it may not sleep, but
* it might do some general things like count free pages or it could be
......@@ -1132,16 +1132,16 @@ static int init(void * unused)
#endif
/* Launch bdflush from here, instead of the old syscall way. */
kernel_thread(bdflush, NULL, 0);
kernel_thread(bdflush, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
/* Start the background pageout daemon. */
kswapd_setup();
kernel_thread(kswapd, NULL, 0);
kernel_thread(kswapd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
#if CONFIG_AP1000
/* Start the async paging daemon. */
{
extern int asyncd(void *);
kernel_thread(asyncd, NULL, 0);
kernel_thread(asyncd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
}
#endif
......
......@@ -300,13 +300,14 @@ struct mm_struct * mm_alloc(void)
void mmput(struct mm_struct *mm)
{
if (!--mm->count) {
release_segments(mm);
exit_mmap(mm);
free_page_tables(mm);
kmem_cache_free(mm_cachep, mm);
}
}
static inline int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
static inline int copy_mm(int nr, unsigned long clone_flags, struct task_struct * tsk)
{
struct mm_struct * mm;
int retval;
......@@ -326,6 +327,7 @@ static inline int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
tsk->min_flt = tsk->maj_flt = 0;
tsk->cmin_flt = tsk->cmaj_flt = 0;
tsk->nswap = tsk->cnswap = 0;
copy_segments(nr, tsk, mm);
retval = new_page_tables(tsk);
if (retval)
goto free_mm;
......@@ -542,7 +544,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
goto bad_fork_cleanup_files;
if (copy_sighand(clone_flags, p))
goto bad_fork_cleanup_fs;
if (copy_mm(clone_flags, p))
if (copy_mm(nr, clone_flags, p))
goto bad_fork_cleanup_sighand;
error = copy_thread(nr, clone_flags, usp, p, regs);
if (error)
......
......@@ -108,7 +108,12 @@ int kmod_init(void)
{
printk("Starting kmod\n");
kernel_thread(kmod_thread, NULL, 0);
/*
* CLONE_FS means that our "cwd" will follow that of init.
* CLONE_FILES just saves some space (we don't need any
* new file descriptors). Ditto for CLONE_SIGHAND.
*/
kernel_thread(kmod_thread, NULL, CLONE_FILES |CLONE_FS | CLONE_SIGHAND);
kmod_unload_timer.next = NULL;
kmod_unload_timer.prev = NULL;
......
......@@ -358,7 +358,8 @@ void register_console(struct console * console)
if (console->index >= 0 &&
console->index != console_cmdline[i].index)
continue;
if (console->index < 0) console->index = 0;
if (console->index < 0)
console->index = console_cmdline[i].index;
if (console->setup &&
console->setup(console, console_cmdline[i].options) != 0)
break;
......
......@@ -788,6 +788,7 @@ do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
if (act) {
*k = *act;
sigdelsetmask(&k->sa.sa_mask, sigmask(SIGKILL) | sigmask(SIGSTOP));
/*
* POSIX 3.3.1.3:
......
......@@ -64,6 +64,9 @@ extern struct datalink_proto *make_EII_client(void);
extern struct datalink_proto *make_8023_client(void);
extern void destroy_EII_client(struct datalink_proto *);
extern void destroy_8023_client(struct datalink_proto *);
#endif
#ifdef CONFIG_IPV6_MODULE
#ifdef CONFIG_SYSCTL
extern int sysctl_max_syn_backlog;
#endif
......
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