diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-10-09 00:00:47 +0000 |
commit | d6434e1042f3b0a6dfe1b1f615af369486f9b1fa (patch) | |
tree | e2be02f33984c48ec019c654051d27964e42c441 /include/asm-mips | |
parent | 609d1e803baf519487233b765eb487f9ec227a18 (diff) |
Merge with 2.3.19.
Diffstat (limited to 'include/asm-mips')
-rw-r--r-- | include/asm-mips/cache.h | 24 | ||||
-rw-r--r-- | include/asm-mips/dma.h | 4 | ||||
-rw-r--r-- | include/asm-mips/hardirq.h | 13 | ||||
-rw-r--r-- | include/asm-mips/ide.h | 8 | ||||
-rw-r--r-- | include/asm-mips/init.h | 31 | ||||
-rw-r--r-- | include/asm-mips/io.h | 22 | ||||
-rw-r--r-- | include/asm-mips/mmu_context.h | 50 | ||||
-rw-r--r-- | include/asm-mips/offset.h | 15 | ||||
-rw-r--r-- | include/asm-mips/parport.h | 59 | ||||
-rw-r--r-- | include/asm-mips/pci.h | 42 | ||||
-rw-r--r-- | include/asm-mips/pgtable.h | 12 | ||||
-rw-r--r-- | include/asm-mips/processor.h | 13 | ||||
-rw-r--r-- | include/asm-mips/resource.h | 12 | ||||
-rw-r--r-- | include/asm-mips/semaphore.h | 10 | ||||
-rw-r--r-- | include/asm-mips/sgint23.h | 22 | ||||
-rw-r--r-- | include/asm-mips/smplock.h | 4 | ||||
-rw-r--r-- | include/asm-mips/spinlock.h | 77 | ||||
-rw-r--r-- | include/asm-mips/system.h | 12 | ||||
-rw-r--r-- | include/asm-mips/uaccess.h | 6 | ||||
-rw-r--r-- | include/asm-mips/unistd.h | 3 |
20 files changed, 224 insertions, 215 deletions
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h index 1ed0b0833..6cf5ce00b 100644 --- a/include/asm-mips/cache.h +++ b/include/asm-mips/cache.h @@ -1,8 +1,14 @@ -/* - * include/asm-mips/cache.h +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1997, 1998, 1999 Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. */ -#ifndef __ASM_MIPS_CACHE_H -#define __ASM_MIPS_CACHE_H +#ifndef _ASM_CACHE_H +#define _ASM_CACHE_H /* bytes per L1 cache line */ #define L1_CACHE_BYTES 32 /* a guess */ @@ -11,4 +17,12 @@ #define SMP_CACHE_BYTES L1_CACHE_BYTES -#endif /* __ASM_MIPS_CACHE_H */ +#ifdef MODULE +#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES))) +#else +#define __cacheline_aligned \ + __attribute__((__aligned__(L1_CACHE_BYTES), \ + __section__(".data.cacheline_aligned"))) +#endif + +#endif /* _ASM_CACHE_H */ diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h index 81868496a..493e0ec3d 100644 --- a/include/asm-mips/dma.h +++ b/include/asm-mips/dma.h @@ -1,4 +1,4 @@ -/* $Id: dma.h,v 1.2 1999/01/04 16:09:21 ralf Exp $ +/* $Id: dma.h,v 1.3 1999/08/20 21:59:08 ralf Exp $ * linux/include/asm/dma.h: Defines for using and allocating dma channels. * Written by Hennus Bergman, 1992. * High DMA channel support & info by Hannu Savolainen @@ -14,7 +14,7 @@ #include <linux/config.h> #include <asm/io.h> /* need byte IO */ -#include <asm/spinlock.h> /* And spinlocks */ +#include <linux/spinlock.h> /* And spinlocks */ #include <linux/delay.h> #include <asm/system.h> diff --git a/include/asm-mips/hardirq.h b/include/asm-mips/hardirq.h index 1c282b6e6..2ab5b95ba 100644 --- a/include/asm-mips/hardirq.h +++ b/include/asm-mips/hardirq.h @@ -1,15 +1,16 @@ -/* $Id: hardirq.h,v 1.3 1998/08/25 09:21:56 ralf Exp $ +/* $Id: hardirq.h,v 1.4 1998/09/19 19:19:37 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1997, 1998 by Ralf Baechle + * Copyright (C) 1997, 1998, 1999 by Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. */ -#ifndef __ASM_MIPS_HARDIRQ_H -#define __ASM_MIPS_HARDIRQ_H +#ifndef _ASM_HARDIRQ_H +#define _ASM_HARDIRQ_H -#include <linux/tasks.h> +#include <linux/threads.h> extern unsigned int local_irq_count[NR_CPUS]; @@ -35,4 +36,4 @@ extern unsigned int local_irq_count[NR_CPUS]; #error No habla MIPS SMP #endif /* __SMP__ */ -#endif /* __ASM_MIPS_HARDIRQ_H */ +#endif /* _ASM_HARDIRQ_H */ diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h index f81529537..43f33e4a2 100644 --- a/include/asm-mips/ide.h +++ b/include/asm-mips/ide.h @@ -1,4 +1,4 @@ -/* $Id: ide.h,v 1.4 1998/06/30 00:23:09 ralf Exp $ +/* $Id: ide.h,v 1.5 1999/06/17 13:30:36 ralf Exp $ * * linux/include/asm-mips/ide.h * @@ -14,6 +14,8 @@ #ifdef __KERNEL__ +#include <linux/config.h> + #ifndef MAX_HWIFS #define MAX_HWIFS 6 #endif @@ -62,7 +64,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, */ static __inline__ void ide_init_default_hwifs(void) { -#ifdef __DO_I_NEED_THIS +#ifndef CONFIG_BLK_DEV_IDEPCI hw_regs_t hw; int index; @@ -71,7 +73,7 @@ static __inline__ void ide_init_default_hwifs(void) hw.irq = ide_default_irq(ide_default_io_base(index)); ide_register_hw(&hw, NULL); } -#endif /* __DO_I_NEED_THIS */ +#endif /* CONFIG_BLK_DEV_IDEPCI */ } typedef union { diff --git a/include/asm-mips/init.h b/include/asm-mips/init.h index 0f99681b7..17d215574 100644 --- a/include/asm-mips/init.h +++ b/include/asm-mips/init.h @@ -1,30 +1 @@ -/* $Id: init.h,v 1.2 1998/04/05 11:25:06 ralf Exp $ - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright 1998, 1999 Ralf Baechle - */ -#ifndef __MIPS_INIT_H -#define __MIPS_INIT_H - -#define __init __attribute__ ((__section__ (".text.init"))) -#define __initdata __attribute__ ((__section__ (".data.init"))) -#define __initfunc(__arginit) \ - __arginit __init; \ - __arginit - -#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 8 -#define __initlocaldata __initdata -#else -#define __initlocaldata -#endif - -/* For assembly routines */ -#define __INIT .section .text.init,"ax" -#define __FINIT .previous -#define __INITDATA .section .data.init,"a" -#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES))) - -#endif /* __MIPS_INIT_H */ +#error "<asm/init.h> should never be used - use <linux/init.h> instead" diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index d13fe3f48..20bdbeb34 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h @@ -1,5 +1,15 @@ -#ifndef __ASM_MIPS_IO_H -#define __ASM_MIPS_IO_H +/* $Id$ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1994, 1995 Waldorf GmbH + * Copyright (C) 1994 - 1999 Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. + */ +#ifndef _ASM_IO_H +#define _ASM_IO_H /* * Slowdown I/O port space accesses for antique hardware. @@ -146,10 +156,16 @@ extern inline void iounmap(void *addr) #define readb(addr) (*(volatile unsigned char *) (0xa0000000 + (unsigned long)(addr))) #define readw(addr) (*(volatile unsigned short *) (0xa0000000 + (unsigned long)(addr))) #define readl(addr) (*(volatile unsigned int *) (0xa0000000 + (unsigned long)(addr))) +#define __raw_readb readb +#define __raw_readw readw +#define __raw_readl readl #define writeb(b,addr) (*(volatile unsigned char *) (0xa0000000 + (unsigned long)(addr)) = (b)) #define writew(b,addr) (*(volatile unsigned short *) (0xa0000000 + (unsigned long)(addr)) = (b)) #define writel(b,addr) (*(volatile unsigned int *) (0xa0000000 + (unsigned long)(addr)) = (b)) +#define __raw_writeb writeb +#define __raw_writew writew +#define __raw_writel writel #define memset_io(a,b,c) memset((void *)(0xa0000000 + (unsigned long)a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),(void *)(0xa0000000 + (unsigned long)(b)),(c)) @@ -398,4 +414,4 @@ extern void (*dma_cache_wback_inv)(unsigned long start, unsigned long size); extern void (*dma_cache_wback)(unsigned long start, unsigned long size); extern void (*dma_cache_inv)(unsigned long start, unsigned long size); -#endif /* __ASM_MIPS_IO_H */ +#endif /* _ASM_IO_H */ diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h index 473e9e2a3..1149bc03f 100644 --- a/include/asm-mips/mmu_context.h +++ b/include/asm-mips/mmu_context.h @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.3 1999/01/04 16:09:23 ralf Exp $ +/* $Id: mmu_context.h,v 1.4 1999/08/09 19:43:17 harald Exp $ * * Switch a MMU context. * @@ -6,10 +6,11 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1996, 1997, 1998 by Ralf Baechle + * Copyright (C) 1996, 1997, 1998, 1999 by Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. */ -#ifndef __ASM_MIPS_MMU_CONTEXT_H -#define __ASM_MIPS_MMU_CONTEXT_H +#ifndef _ASM_MMU_CONTEXT_H +#define _ASM_MMU_CONTEXT_H #include <linux/config.h> @@ -28,17 +29,17 @@ extern unsigned long asid_cache; #endif -/* - * All unused by hardware upper bits will be considered +/* + * All unused by hardware upper bits will be considered * as a software asid extension. */ -#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) +#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) #define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) -extern inline void get_new_mmu_context(struct mm_struct *mm, unsigned -long asid) +extern inline void +get_new_mmu_context(struct mm_struct *mm, unsigned long asid) { - if (! ((asid += ASID_INC) & ASID_MASK) ) { + if (! ((asid += ASID_INC) & ASID_MASK) ) { flush_tlb_all(); /* start new asid cycle */ if (!asid) /* fix version if needed */ asid = ASID_FIRST_VERSION; @@ -63,28 +64,45 @@ get_mmu_context(struct task_struct *p) * Initialize the context related info for a new mm_struct * instance. */ -extern inline void init_new_context(struct mm_struct *mm) +extern inline void +init_new_context(struct task_struct *tsk, struct mm_struct *mm) { mm->context = 0; } +extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, + struct task_struct *tsk, unsigned cpu) +{ + if (next) { + unsigned long asid = asid_cache; + /* Check if our ASID is of an older version and thus invalid */ + if ((next->context ^ asid) & ASID_VERSION_MASK) + get_new_mmu_context(next, asid); + } + + set_entryhi(next->context); +} + /* * Destroy context related info for an mm_struct that is about * to be put to rest. */ extern inline void destroy_context(struct mm_struct *mm) { - mm->context = 0; + /* Nothing to do. */ } /* * After we have set current->mm to a new value, this activates * the context for the new mm so we see the new mappings. */ -extern inline void activate_context(struct task_struct *tsk) +extern inline void +activate_mm(struct mm_struct *prev, struct mm_struct *next) { - get_mmu_context(tsk); - set_entryhi(tsk->mm->context); + /* Unconditionally get an new ASID. */ + get_new_mmu_context(next, asid_cache); + + set_entryhi(next->context); } -#endif /* __ASM_MIPS_MMU_CONTEXT_H */ +#endif /* _ASM_MMU_CONTEXT_H */ diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h index c07690bd7..69a32238a 100644 --- a/include/asm-mips/offset.h +++ b/include/asm-mips/offset.h @@ -51,7 +51,7 @@ #define TASK_NEED_RESCHED 20 #define TASK_COUNTER 24 #define TASK_PRIORITY 28 -#define TASK_MM 800 +#define TASK_MM 792 #define TASK_STRUCT_SIZE 856 /* MIPS specific thread_struct offsets. */ @@ -72,16 +72,15 @@ #define THREAD_BUADDR 756 #define THREAD_ECODE 760 #define THREAD_TRAPNO 764 -#define THREAD_PGDIR 768 -#define THREAD_MFLAGS 772 -#define THREAD_CURDS 776 -#define THREAD_TRAMP 780 -#define THREAD_OLDCTX 784 +#define THREAD_MFLAGS 768 +#define THREAD_CURDS 772 +#define THREAD_TRAMP 776 +#define THREAD_OLDCTX 780 /* Linux mm_struct offsets. */ -#define MM_COUNT 16 +#define MM_USERS 16 #define MM_PGD 12 -#define MM_CONTEXT 52 +#define MM_CONTEXT 56 /* Linux sigcontext offsets. */ #define SC_REGS 16 diff --git a/include/asm-mips/parport.h b/include/asm-mips/parport.h new file mode 100644 index 000000000..dcf0ff69d --- /dev/null +++ b/include/asm-mips/parport.h @@ -0,0 +1,59 @@ +/* $Id$ + * + * parport.h: ia32-specific parport initialisation + * + * Copyright (C) 1999 Tim Waugh <tim@cyberelk.demon.co.uk> + * + * This file should only be included by drivers/parport/parport_pc.c. + */ +#ifndef _ASM_PARPORT_H +#define _ASM_PARPORT_H 1 + +#include <linux/config.h> + +/* Maximum number of ports to support. It is useless to set this greater + than PARPORT_MAX (in <linux/parport.h>). */ +#define PARPORT_PC_MAX_PORTS 8 + +/* If parport_cs (PCMCIA) is managing ports for us, we'll need the + * probing routines forever; otherwise we can lose them at boot time. */ +#ifdef CONFIG_PARPORT_PC_PCMCIA +#define __maybe_initdata +#define __maybe_init +#else +#define __maybe_initdata __initdata +#define __maybe_init __init +#endif + +static int __maybe_init parport_pc_init_pci(int irq, int dma); + +static int user_specified __maybe_initdata = 0; +int __init +parport_pc_init(int *io, int *io_hi, int *irq, int *dma) +{ + int count = 0, i = 0; + + if (io && *io) { + /* Only probe the ports we were given. */ + user_specified = 1; + do { + if (!*io_hi) *io_hi = 0x400 + *io; + if (parport_pc_probe_port(*(io++), *(io_hi++), + *(irq++), *(dma++))) + count++; + } while (*io && (++i < PARPORT_PC_MAX_PORTS)); + } else { + /* Probe all the likely ports. */ + if (parport_pc_probe_port(0x3bc, 0x7bc, irq[0], dma[0])) + count++; + if (parport_pc_probe_port(0x378, 0x778, irq[0], dma[0])) + count++; + if (parport_pc_probe_port(0x278, 0x678, irq[0], dma[0])) + count++; + count += parport_pc_init_pci (irq[0], dma[0]); + } + + return count; +} + +#endif /* !(_ASM_PARPORT_H) */ diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index a8b7318fd..853e19b32 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -1,42 +1,16 @@ -/* $Id: pci.h,v 1.4 1998/08/25 09:21:59 ralf Exp $ +/* $Id: pci.h,v 1.5 1999/01/04 16:09:24 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. - * - * Declarations for the MIPS specific implementation of the PCI BIOS32 services. */ -#ifndef __ASM_MIPS_PCI_H -#define __ASM_MIPS_PCI_H +#ifndef _ASM_PCI_H +#define _ASM_PCI_H -struct pci_ops { - void (*pcibios_fixup) (void); - int (*pcibios_read_config_byte) (unsigned char bus, - unsigned char dev_fn, - unsigned char where, - unsigned char *val); - int (*pcibios_read_config_word) (unsigned char bus, - unsigned char dev_fn, - unsigned char where, - unsigned short *val); - int (*pcibios_read_config_dword) (unsigned char bus, - unsigned char dev_fn, - unsigned char where, - unsigned int *val); - int (*pcibios_write_config_byte) (unsigned char bus, - unsigned char dev_fn, - unsigned char where, - unsigned char val); - int (*pcibios_write_config_word) (unsigned char bus, - unsigned char dev_fn, - unsigned char where, - unsigned short val); - int (*pcibios_write_config_dword) (unsigned char bus, - unsigned char dev_fn, - unsigned char where, - unsigned int val); -}; +/* Can be used to override the logic in pci_scan_bus for skipping + already-configured bus numbers - to be used for buggy BIOSes + or architectures with incomplete PCI setup by the loader */ -extern struct pci_ops *pci_ops; +#define pcibios_assign_all_busses() 0 -#endif /* __ASM_MIPS_PCI_H */ +#endif /* _ASM_PCI_H */ diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 2a724ddde..1dc438914 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -1,10 +1,11 @@ -/* $Id: pgtable.h,v 1.23 1999/08/13 17:07:27 harald Exp $ +/* $Id: pgtable.h,v 1.24 1999/08/18 23:37:49 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1994 - 1998 by Ralf Baechle at alii + * Copyright (C) 1994 - 1999 by Ralf Baechle at alii + * Copyright (C) 1999 Silicon Graphics, Inc. */ #ifndef _ASM_PGTABLE_H #define _ASM_PGTABLE_H @@ -221,9 +222,6 @@ extern unsigned long zero_page_mask; extern void load_pgd(unsigned long pg_dir); -/* to set the page-dir */ -#define SET_PAGE_DIR(tsk,pgdir) (tsk)->tss.pg_dir = ((unsigned long) (pgdir)) - extern pmd_t invalid_pte_table[PAGE_SIZE/sizeof(pmd_t)]; /* @@ -568,7 +566,7 @@ extern inline void set_pgdir(unsigned long address, pgd_t entry) #ifdef __SMP__ int i; #endif - + read_lock(&tasklist_lock); for_each_task(p) { if (!p->mm) @@ -864,4 +862,6 @@ extern inline void set_context(unsigned long val) #endif /* !defined (_LANGUAGE_ASSEMBLY) */ +#define io_remap_page_range remap_page_range + #endif /* _ASM_PGTABLE_H */ diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 080f30c33..1df7cb200 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.18 1999/08/18 23:37:49 ralf Exp $ +/* $Id: processor.h,v 1.19 1999/09/28 22:27:17 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -19,6 +19,7 @@ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) #if !defined (_LANGUAGE_ASSEMBLY) +#include <linux/threads.h> #include <asm/cachectl.h> #include <asm/mipsregs.h> #include <asm/reg.h> @@ -135,7 +136,6 @@ struct thread_struct { unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ unsigned long error_code; unsigned long trap_no; - unsigned long pg_dir; /* used in tlb refill */ #define MF_FIXADE 1 /* Fix address errors in software */ #define MF_LOGADE 2 /* Log address errors to syslog */ unsigned long mflags; @@ -149,7 +149,7 @@ struct thread_struct { #define INIT_MMAP { &init_mm, KSEG0, KSEG1, NULL, PAGE_SHARED, \ VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } -#define INIT_TSS { \ +#define INIT_THREAD { \ /* \ * saved main processor registers \ */ \ @@ -166,7 +166,7 @@ struct thread_struct { /* \ * Other stuff associated with the process \ */ \ - 0, 0, 0, 0, (unsigned long) swapper_pg_dir, \ + 0, 0, 0, 0, \ /* \ * For now the default is to fix address errors \ */ \ @@ -185,7 +185,7 @@ struct thread_struct { extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); /* Copy and release all segment info associated with a VM */ -#define copy_segments(nr, p, mm) do { } while(0) +#define copy_segments(p, mm) do { } while(0) #define release_segments(mm) do { } while(0) #define forget_segments() do { } while (0) @@ -211,13 +211,14 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KSU_USER;\ regs->cp0_epc = new_pc; \ regs->regs[29] = new_sp; \ - current->tss.current_ds = USER_DS; \ + current->thread.current_ds = USER_DS; \ } while (0) /* Allocation and freeing of basic task resources. */ /* * NOTE! The task struct and the stack go together */ +#define THREAD_SIZE (2*PAGE_SIZE) #define alloc_task_struct() \ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1)) #define free_task_struct(p) free_pages((unsigned long)(p),1) diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h index 42eb9e66e..d02021e0d 100644 --- a/include/asm-mips/resource.h +++ b/include/asm-mips/resource.h @@ -1,4 +1,4 @@ -/* $Id: resource.h,v 1.2 1998/12/08 20:51:59 ralf Exp $ +/* $Id: resource.h,v 1.2 1999/01/04 16:09:25 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -6,8 +6,8 @@ * * Copyright (C) 1995, 1996, 1998 by Ralf Baechle */ -#ifndef __ASM_MIPS_RESOURCE_H -#define __ASM_MIPS_RESOURCE_H +#ifndef _ASM_RESOURCE_H +#define _ASM_RESOURCE_H /* * Resource limits @@ -34,13 +34,13 @@ { LONG_MAX, LONG_MAX }, \ { _STK_LIM, LONG_MAX }, \ { 0, LONG_MAX }, \ - { NR_OPEN, NR_OPEN }, \ + { INR_OPEN, INR_OPEN }, \ { LONG_MAX, LONG_MAX }, \ { LONG_MAX, LONG_MAX }, \ - { MAX_TASKS_PER_USER, MAX_TASKS_PER_USER }, \ + { 0, 0 }, \ { LONG_MAX, LONG_MAX }, \ } #endif /* __KERNEL__ */ -#endif /* __ASM_MIPS_RESOURCE_H */ +#endif /* _ASM_RESOURCE_H */ diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h index 789c797f0..0b283f4f4 100644 --- a/include/asm-mips/semaphore.h +++ b/include/asm-mips/semaphore.h @@ -1,4 +1,4 @@ -/* $Id: semaphore.h,v 1.8 1999/07/26 19:42:44 harald Exp $ +/* $Id: semaphore.h,v 1.9 1999/08/13 17:07:27 harald Exp $ * * SMP- and interrupt-safe semaphores.. * @@ -9,12 +9,12 @@ * (C) Copyright 1996 Linus Torvalds * (C) Copyright 1998, 1999 Ralf Baechle */ -#ifndef __ASM_MIPS_SEMAPHORE_H -#define __ASM_MIPS_SEMAPHORE_H +#ifndef _ASM_SEMAPHORE_H +#define _ASM_SEMAPHORE_H #include <asm/system.h> #include <asm/atomic.h> -#include <asm/spinlock.h> +#include <linux/spinlock.h> #include <linux/wait.h> #include <linux/config.h> @@ -190,4 +190,4 @@ extern inline void up(struct semaphore * sem) __up(sem); } -#endif /* __ASM_MIPS_SEMAPHORE_H */ +#endif /* _ASM_SEMAPHORE_H */ diff --git a/include/asm-mips/sgint23.h b/include/asm-mips/sgint23.h index d9a093861..ba889aee0 100644 --- a/include/asm-mips/sgint23.h +++ b/include/asm-mips/sgint23.h @@ -1,11 +1,12 @@ -/* $Id: sgint23.h,v 1.3 1999/05/07 22:35:37 ulfc Exp $ +/* $Id: sgint23.h,v 1.4 1999/08/11 20:26:49 andrewb Exp $ + * * sgint23.h: Defines for the SGI INT2 and INT3 chipsets. * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - INT2 corrections */ -#ifndef _MIPS_SGINT23_H -#define _MIPS_SGINT23_H +#ifndef _ASM_SGINT23_H +#define _ASM_SGINT23_H /* These are the virtual IRQ numbers, we divide all IRQ's into * 'spaces', the 'space' determines where and how to enable/disable @@ -33,6 +34,19 @@ #define SGI_KEYBOARD_IRQ SGINT_LOCAL2 + 4 /* keyboard */ #define SGI_SERIAL_IRQ SGINT_LOCAL2 + 5 /* onboard serial */ +/* Individual interrupt definitions for the INDY and Indigo2 + */ + +#define SGI_WD93_0_IRQ SGINT_LOCAL0 + 1 /* 1st onboard WD93 */ +#define SGI_WD93_1_IRQ SGINT_LOCAL0 + 2 /* 2nd onboard WD93 */ +#define SGI_ENET_IRQ SGINT_LOCAL0 + 3 /* onboard ethernet */ + +#define SGI_PANEL_IRQ SGINT_LOCAL1 + 1 /* front panel */ + +#define SGI_EISA_IRQ SGINT_LOCAL2 + 3 /* EISA interrupts */ +#define SGI_KEYBOARD_IRQ SGINT_LOCAL2 + 4 /* keyboard */ +#define SGI_SERIAL_IRQ SGINT_LOCAL2 + 5 /* onboard serial */ + /* INT2 occupies HPC PBUS slot 4, INT3 uses slot 6. */ #define SGI_INT2_BASE 0x1fbd9000 /* physical */ #define SGI_INT3_BASE 0x1fbd9880 /* physical */ @@ -197,4 +211,4 @@ extern volatile unsigned char *ioc_tclear; extern void sgint_init(void); extern void indy_timer_init(void); -#endif /* !(_MIPS_SGINT23_H) */ +#endif /* !(_ASM_SGINT23_H) */ diff --git a/include/asm-mips/smplock.h b/include/asm-mips/smplock.h index 61bf3ff9c..67a4bb617 100644 --- a/include/asm-mips/smplock.h +++ b/include/asm-mips/smplock.h @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: smplock.h,v 1.1 1998/08/25 09:22:02 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -7,7 +7,7 @@ * Default SMP lock implementation */ #include <linux/interrupt.h> -#include <asm/spinlock.h> +#include <linux/spinlock.h> extern spinlock_t kernel_flag; diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h index 63811c615..ece1f7ddd 100644 --- a/include/asm-mips/spinlock.h +++ b/include/asm-mips/spinlock.h @@ -1,77 +1,8 @@ -/* $Id: spinlock.h,v 1.5 1999/06/17 13:30:39 ralf Exp $ +/* $Id: spinlock.h,v 1.6 1999/06/22 23:49:12 ralf Exp $ */ -#ifndef __ASM_MIPS_SPINLOCK_H -#define __ASM_MIPS_SPINLOCK_H - -/* - * These are the generic versions of the spinlocks - * and read-write locks.. We should actually do a - * <linux/spinlock.h> with all of this. Oh, well. - */ -#define spin_lock_irqsave(lock, flags) do { local_irq_save(flags); spin_lock(lock); } while (0) -#define spin_lock_irq(lock) do { local_irq_disable(); spin_lock(lock); } while (0) -#define spin_lock_bh(lock) do { local_bh_disable(); spin_lock(lock); } while (0) - -#define read_lock_irqsave(lock, flags) do { local_irq_save(flags); read_lock(lock); } while (0) -#define read_lock_irq(lock) do { local_irq_disable(); read_lock(lock); } while (0) -#define read_lock_bh(lock) do { local_bh_disable(); read_lock(lock); } while (0) - -#define write_lock_irqsave(lock, flags) do { local_irq_save(flags); write_lock(lock); } while (0) -#define write_lock_irq(lock) do { local_irq_disable(); write_lock(lock); } while (0) -#define write_lock_bh(lock) do { local_bh_disable(); write_lock(lock); } while (0) - -#define spin_unlock_irqrestore(lock, flags) do { spin_unlock(lock); local_irq_restore(flags); } while (0) -#define spin_unlock_irq(lock) do { spin_unlock(lock); local_irq_enable(); } while (0) -#define spin_unlock_bh(lock) do { spin_unlock(lock); local_bh_enable(); } while (0) - -#define read_unlock_irqrestore(lock, flags) do { read_unlock(lock); local_irq_restore(flags); } while (0) -#define read_unlock_irq(lock) do { read_unlock(lock); local_irq_enable(); } while (0) -#define read_unlock_bh(lock) do { read_unlock(lock); local_bh_enable(); } while (0) - -#define write_unlock_irqrestore(lock, flags) do { write_unlock(lock); local_irq_restore(flags); } while (0) -#define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0) -#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0) - -#ifndef __SMP__ - -/* - * Gcc-2.7.x has a nasty bug with empty initializers. - */ -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) - typedef struct { } spinlock_t; - #define SPIN_LOCK_UNLOCKED (spinlock_t) { } -#else - typedef struct { int gcc_is_buggy; } spinlock_t; - #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } -#endif - -#define spin_lock_init(lock) do { } while(0) -#define spin_lock(lock) (void)(lock) /* Not "unused variable". */ -#define spin_trylock(lock) (1) -#define spin_unlock_wait(lock) do { } while(0) -#define spin_unlock(lock) (void)(lock) /* Not "unused variable". */ - -/* - * Read-write spinlocks, allowing multiple readers - * but only one writer. - * - * NOTE! it is quite common to have readers in interrupts - * but no interrupt writers. For those circumstances we - * can "mix" irq-safe locks - any writer needs to get a - * irq-safe write-lock, but readers can get non-irqsafe - * read-locks. - */ -typedef struct { } rwlock_t; -#define RW_LOCK_UNLOCKED (rwlock_t) { } - -#define read_lock(lock) (void)(lock) /* Not "unused variable". */ -#define read_unlock(lock) do { } while(0) -#define write_lock(lock) (void)(lock) /* Not "unused variable". */ -#define write_unlock(lock) do { } while(0) - -#else +#ifndef _ASM_SPINLOCK_H +#define _ASM_SPINLOCK_H #error "Nix SMP on MIPS" -#endif /* SMP */ -#endif /* __ASM_MIPS_SPINLOCK_H */ +#endif /* _ASM_SPINLOCK_H */ diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 5dff91cd7..80cbd08fc 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -1,4 +1,4 @@ -/* $Id: system.h,v 1.14 1999/08/09 19:43:18 harald Exp $ +/* $Id: system.h,v 1.15 1999/08/13 17:07:28 harald Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -140,6 +140,15 @@ __asm__ __volatile__( \ #define rmb() mb() #define wmb() mb() +#define set_mb(var, value) \ +do { var = value; mb(); } while (0) + +#define set_rmb(var, value) \ +do { var = value; rmb(); } while (0) + +#define set_wmb(var, value) \ +do { var = value; wmb(); } while (0) + #if !defined (_LANGUAGE_ASSEMBLY) /* * switch_to(n) should switch tasks to task nr n, first @@ -148,6 +157,7 @@ __asm__ __volatile__( \ extern asmlinkage void *resume(void *last, void *next); #endif /* !defined (_LANGUAGE_ASSEMBLY) */ +#define prepare_to_switch() do { } while(0) #define switch_to(prev,next,last) \ do { \ (last) = resume(prev, next); \ diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index e6750b4e5..a9b759313 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h @@ -7,7 +7,7 @@ * * Copyright (C) 1996, 1997, 1998 by Ralf Baechle * - * $Id: uaccess.h,v 1.7 1998/05/04 09:13:02 ralf Exp $ + * $Id: uaccess.h,v 1.8 1999/01/04 16:09:27 ralf Exp $ */ #ifndef __ASM_MIPS_UACCESS_H #define __ASM_MIPS_UACCESS_H @@ -31,9 +31,9 @@ #define VERIFY_READ 0 #define VERIFY_WRITE 1 -#define get_fs() (current->tss.current_ds) +#define get_fs() (current->thread.current_ds) #define get_ds() (KERNEL_DS) -#define set_fs(x) (current->tss.current_ds=(x)) +#define set_fs(x) (current->thread.current_ds=(x)) #define segment_eq(a,b) ((a).seg == (b).seg) diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index e003fa7b4..e25140af3 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.14 1999/04/01 23:24:00 ulfc Exp $ +/* $Id: unistd.h,v 1.15 1999/09/28 22:27:18 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -1419,7 +1419,6 @@ return -1; \ * some others too. */ #define __NR__exit __NR_exit -static inline _syscall0(int,idle) static inline _syscall0(int,sync) static inline _syscall0(pid_t,setsid) static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) |