summaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /include/asm-mips
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/elf.h16
-rw-r--r--include/asm-mips/init.h6
-rw-r--r--include/asm-mips/ipc.h3
-rw-r--r--include/asm-mips/offset.h6
-rw-r--r--include/asm-mips/pgtable.h8
-rw-r--r--include/asm-mips/processor.h7
-rw-r--r--include/asm-mips/semaphore.h2
-rw-r--r--include/asm-mips/softirq.h13
-rw-r--r--include/asm-mips/system.h7
-rw-r--r--include/asm-mips/termbits.h19
-rw-r--r--include/asm-mips/termios.h2
-rw-r--r--include/asm-mips/timex.h23
12 files changed, 82 insertions, 30 deletions
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index ffdd577cd..af1a8f171 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -1,5 +1,5 @@
/*
- * $Id: elf.h,v 1.4 1997/12/16 05:36:40 ralf Exp $
+ * $Id: elf.h,v 1.5 1998/03/17 22:16:13 ralf Exp $
*/
#ifndef __ASM_MIPS_ELF_H
#define __ASM_MIPS_ELF_H
@@ -53,10 +53,20 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#define ELF_PLATFORM (NULL)
-/* See comments in asm-alpha/elf.h, this is the same thing
+/*
+ * See comments in asm-alpha/elf.h, this is the same thing
* on the MIPS.
*/
-#define ELF_PLAT_INIT(_r) _r->regs[2] = 0;
+#define ELF_PLAT_INIT(_r) do { \
+ _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0; \
+ _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0; \
+ _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0; \
+ _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0; \
+ _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0; \
+ _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0; \
+ _r->regs[25] = _r->regs[26] = _r->regs[27] = _r->regs[28] = 0; \
+ _r->regs[30] = _r->regs[31] = 0; \
+} while (0)
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
diff --git a/include/asm-mips/init.h b/include/asm-mips/init.h
index 3dd2f614d..0f99681b7 100644
--- a/include/asm-mips/init.h
+++ b/include/asm-mips/init.h
@@ -1,11 +1,10 @@
-/*
- * include/asm-mips/init.h
+/* $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.
*
- * $Id: init.h,v 1.2 1998/03/27 08:54:04 ralf Exp $
+ * Copyright 1998, 1999 Ralf Baechle
*/
#ifndef __MIPS_INIT_H
#define __MIPS_INIT_H
@@ -26,5 +25,6 @@
#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 */
diff --git a/include/asm-mips/ipc.h b/include/asm-mips/ipc.h
index 3288c1e28..006d47307 100644
--- a/include/asm-mips/ipc.h
+++ b/include/asm-mips/ipc.h
@@ -24,6 +24,9 @@ struct ipc_kludge {
#define SHMGET 23
#define SHMCTL 24
+/* Used by the DIPC package, try and avoid reusing it */
+#define DIPC 25
+
#define IPCCALL(version,op) ((version)<<16 | (op))
#endif /* __ASM_MIPS_IPC_H */
diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h
index 6f7a5b019..73ec088ba 100644
--- a/include/asm-mips/offset.h
+++ b/include/asm-mips/offset.h
@@ -78,9 +78,9 @@
#define THREAD_OLDCTX 912
/* Linux mm_struct offsets. */
-#define MM_COUNT 12
-#define MM_PGD 8
-#define MM_CONTEXT 32
+#define MM_COUNT 16
+#define MM_PGD 12
+#define MM_CONTEXT 36
/* Linux sigcontext offsets. */
#define SC_REGMASK 0
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 3cc620222..e21766bb0 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.16 1998/08/28 23:24:03 tsbogend Exp $
+/* $Id: pgtable.h,v 1.17 1998/09/16 21:37:38 tsbogend 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
@@ -580,9 +580,9 @@ extern void (*update_mmu_cache)(struct vm_area_struct *vma,
/*
* Kernel with 32 bit address space
*/
-#define SWP_TYPE(entry) (((entry) >> 8) & 0x7f)
-#define SWP_OFFSET(entry) ((entry) >> 15)
-#define SWP_ENTRY(type,offset) (((type) << 8) | ((offset) << 15))
+#define SWP_TYPE(entry) (((entry) >> 1) & 0x3f)
+#define SWP_OFFSET(entry) ((entry) >> 8)
+#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
#define module_map vmalloc
#define module_unmap vfree
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index a1e8aa831..96dd34c91 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.13 1998/10/14 23:40:47 ralf Exp $
+/* $Id: processor.h,v 1.14 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
@@ -139,8 +139,8 @@ struct thread_struct {
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
-#define INIT_MMAP { &init_mm, KSEG0, KSEG1, PAGE_SHARED, \
- VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+#define INIT_MMAP { &init_mm, KSEG0, KSEG1, NULL, PAGE_SHARED, \
+ VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
#define INIT_TSS { \
/* \
@@ -179,6 +179,7 @@ extern pid_t 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 release_segments(mm) do { } while(0)
+#define forget_segments() do { } while (0)
/*
* Return saved PC of a blocked thread.
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h
index aff081776..b1ac4ecce 100644
--- a/include/asm-mips/semaphore.h
+++ b/include/asm-mips/semaphore.h
@@ -43,7 +43,7 @@ static inline void wake_one_more(struct semaphore * sem)
atomic_inc(&sem->waking);
}
-static inline int waking_non_zero(struct semaphore *sem)
+static inline int waking_non_zero(struct semaphore *sem, struct task_struct *tsk)
{
int ret, tmp;
diff --git a/include/asm-mips/softirq.h b/include/asm-mips/softirq.h
index fa72d0d78..3c38ecf7b 100644
--- a/include/asm-mips/softirq.h
+++ b/include/asm-mips/softirq.h
@@ -1,10 +1,10 @@
-/* $Id: softirq.h,v 1.3 1998/03/22 23:27:19 ralf Exp $
+/* $Id: softirq.h,v 1.4 1998/09/19 19:19:39 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
*/
#ifndef __ASM_MIPS_SOFTIRQ_H
#define __ASM_MIPS_SOFTIRQ_H
@@ -37,14 +37,15 @@ static inline void clear_active_bhs(unsigned long x)
extern inline void init_bh(int nr, void (*routine)(void))
{
bh_base[nr] = routine;
- bh_mask_count[nr] = 0;
+ atomic_set(&bh_mask_count[nr], 0);
bh_mask |= 1 << nr;
}
extern inline void remove_bh(int nr)
{
- bh_base[nr] = NULL;
bh_mask &= ~(1 << nr);
+ mb();
+ bh_base[nr] = NULL;
}
extern inline void mark_bh(int nr)
@@ -59,12 +60,12 @@ extern inline void mark_bh(int nr)
extern inline void disable_bh(int nr)
{
bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
+ atomic_inc(&bh_mask_count[nr]);
}
extern inline void enable_bh(int nr)
{
- if (!--bh_mask_count[nr])
+ if (atomic_dec_and_test(&bh_mask_count[nr]))
bh_mask |= 1 << nr;
}
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index c16163a32..49f5f2aad 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.8 1998/07/20 17:52:21 ralf Exp $
+/* $Id: system.h,v 1.7 1998/08/25 09:22:03 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
@@ -107,6 +107,9 @@ __restore_flags(int flags)
#define save_and_cli(x) __save_and_cli(x)
#define restore_flags(x) __restore_flags(x)
+/*
+ * These are probably defined overly paranoid ...
+ */
#define mb() \
__asm__ __volatile__( \
"# prevent instructions being moved around\n\t" \
@@ -117,6 +120,8 @@ __asm__ __volatile__( \
: /* no output */ \
: /* no input */ \
: "memory")
+#define rmb() mb()
+#define wmb() mb()
#if !defined (_LANGUAGE_ASSEMBLY)
/*
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h
index fbce44aee..ccf5e85ec 100644
--- a/include/asm-mips/termbits.h
+++ b/include/asm-mips/termbits.h
@@ -153,10 +153,21 @@ struct termios {
#define CLOCAL 0004000 /* Ignore modem status lines. */
#if defined (__USE_BSD) || defined (__KERNEL__)
#define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CMSPAR 010000000000 /* mark or space (stick) parity */
#define CRTSCTS 020000000000 /* flow control */
diff --git a/include/asm-mips/termios.h b/include/asm-mips/termios.h
index 4a6553c17..62e3882a3 100644
--- a/include/asm-mips/termios.h
+++ b/include/asm-mips/termios.h
@@ -96,6 +96,8 @@ struct termio {
#define N_MASC 8 /* Reserved fo Mobitex module <kaz@cafe.net> */
#define N_R3964 9 /* Reserved for Simatic R3964 module */
#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
+#define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */
+#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
#ifdef __KERNEL__
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h
index dd4aea511..2bec751a4 100644
--- a/include/asm-mips/timex.h
+++ b/include/asm-mips/timex.h
@@ -1,10 +1,10 @@
-/* $Id: timex.h,v 1.1 1998/08/17 10:20:18 ralf Exp $
+/* $Id: timex.h,v 1.1 1998/08/25 09:22:03 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) 1998 by Ralf Baechle
+ * Copyright (C) 1998, 1999 by Ralf Baechle
*
* FIXME: For some of the supported machines this is dead wrong.
*/
@@ -17,4 +17,23 @@
(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
<< (SHIFT_SCALE-SHIFT_HZ)) / HZ)
+/*
+ * Standard way to access the cycle counter.
+ * Currently only used on SMP for scheduling.
+ *
+ * Only the low 32 bits are available as a continuously counting entity.
+ * But this only means we'll force a reschedule every 8 seconds or so,
+ * which isn't an evil thing.
+ *
+ * We know that all SMP capable CPUs have cycle counters.
+ */
+
+typedef unsigned int cycles_t;
+extern cycles_t cacheflush_time;
+
+static inline cycles_t get_cycles (void)
+{
+ return read_32bit_cp0_register(CP0_COUNT);
+}
+
#endif /* __ASM_MIPS_TIMEX_H */