summaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-09-12 01:29:55 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-09-12 01:29:55 +0000
commit545f435ebcfd94a1e7c20b46efe81b4d6ac4e698 (patch)
treee9ce4bc598d06374bda906f18365984bf22a526a /include/asm-mips
parent4291a610eef89d0d5c69d9a10ee6560e1aa36c74 (diff)
Merge with Linux 2.1.55. More bugfixes and goodies from my private
CVS archive.
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/bootinfo.h21
-rw-r--r--include/asm-mips/bugs.h32
-rw-r--r--include/asm-mips/elf.h7
-rw-r--r--include/asm-mips/floppy.h4
-rw-r--r--include/asm-mips/irq.h9
-rw-r--r--include/asm-mips/namei.h59
-rw-r--r--include/asm-mips/pgtable.h1
-rw-r--r--include/asm-mips/posix_types.h2
-rw-r--r--include/asm-mips/sigcontext.h6
-rw-r--r--include/asm-mips/signal.h44
-rw-r--r--include/asm-mips/socket.h21
-rw-r--r--include/asm-mips/stackframe.h6
-rw-r--r--include/asm-mips/string.h22
13 files changed, 120 insertions, 114 deletions
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index e723cae21..4d8c0e171 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -7,6 +7,8 @@
* 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:$
*/
#ifndef __ASM_MIPS_BOOTINFO_H
#define __ASM_MIPS_BOOTINFO_H
@@ -29,7 +31,8 @@
#define MACH_DECSTATION 5 /* DECStation 5000/2x for now */
#define MACH_SNI_RM200_PCI 6 /* RM200/RM300/RM400 PCI series */
#define MACH_SGI_INDY 7 /* R4?K and R5K Indy workstaions */
-#define MACH_LAST 7
+#define MACH_RESERVED 8 /* Erlkoenig ... */
+#define MACH_LAST 8
#define MACH_NAMES {"unknown", "Deskstation rPC44", "Deskstation Tyne", \
"Acer PICA 61", "Mips Magnum 4000", "DECStation", "RM200 PCI", \
@@ -46,8 +49,10 @@
#define MACH_GROUP_SNI_RM 4 /* Siemens Nixdorf RM series */
#define MACH_GROUP_ACN 5
#define MACH_GROUP_SGI 6 /* Silicon Graphics workstations and servers */
+#define MACH_GROUP_RESERVED 7 /* Erlkoenig ... */
-#define GROUP_NAMES { "unknown", "Jazz", "Digital", "ARC", "SNI", "ACN" }
+#define GROUP_NAMES { "unknown", "Jazz", "Digital", "ARC", \
+ "SNI", "ACN", "You'd like to know" }
/*
* Valid machtype values for group unknown (low order halfword of mips_machtype)
@@ -102,6 +107,13 @@
#define MACH_SGI_INDY 0 /* R4?K and R5K Indy workstaions */
/*
+ * Valid machtype for group RESERVED
+ */
+#define MACH_RESERVED 0 /* Proto "27" hardware */
+
+#define GROUP_RESERVED { "You'd like to know" }
+
+/*
* Valid cputype values
*/
#define CPU_UNKNOWN 0
@@ -131,13 +143,14 @@
#define CPU_R5000 24
#define CPU_R5000A 25
#define CPU_R4640 26
-#define CPU_LAST 27
+#define CPU_NEVADA 27 /* RM5230, RM5260 */
+#define CPU_LAST 27
#define CPU_NAMES { "unknown", "R2000", "R3000", "R3000A", "R3041", "R3051", \
"R3052", "R3081", "R3081E", "R4000PC", "R4000SC", "R4000MC", \
"R4200", "R4400PC", "R4400SC", "R4400MC", "R4600", "R6000", \
"R6000A", "R8000", "R10000", "R4300", "R4650", "R4700", "R5000", \
- "R5000A", "R4640" }
+ "R5000A", "R4640", "Nevada" }
#define CL_SIZE (80)
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h
index 5f00d4508..15fe291f4 100644
--- a/include/asm-mips/bugs.h
+++ b/include/asm-mips/bugs.h
@@ -2,7 +2,9 @@
* include/asm-mips/bugs.h
*
* Copyright (C) 1995 Waldorf Electronics
- * written by Ralf Baechle
+ * Copyright (C) 1997 Ralf Baechle
+ *
+ * $Id:$
*/
#include <asm/bootinfo.h>
@@ -14,21 +16,25 @@
*/
-static void check_wait(void)
+static inline void check_wait(void)
{
printk("Checking for 'wait' instruction... ");
switch(mips_cputype) {
- case CPU_R4200:
- case CPU_R4300:
- case CPU_R4600:
- case CPU_R5000:
- wait_available = 1;
- printk(" available.\n");
- break;
- default:
- printk(" unavailable.\n");
- break;
- }
+ case CPU_R4200:
+ case CPU_R4300:
+ case CPU_R4600:
+ case CPU_R4640:
+ case CPU_R4650:
+ case CPU_R4700:
+ case CPU_R5000:
+ case CPU_NEVADA:
+ wait_available = 1;
+ printk(" available.\n");
+ break;
+ default:
+ printk(" unavailable.\n");
+ break;
+ }
}
static void check_bugs(void)
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index 97e670510..87dae378f 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -40,4 +40,11 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
*/
#define ELF_PLAT_INIT(_r) _r->regs[2] = 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
+ the loader. We need to make sure that it is out of the way of the program
+ that it will "exec", and that there is sufficient room for the brk. */
+
+#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+
#endif /* __ASM_MIPS_ELF_H */
diff --git a/include/asm-mips/floppy.h b/include/asm-mips/floppy.h
index 4409b538e..412057a0b 100644
--- a/include/asm-mips/floppy.h
+++ b/include/asm-mips/floppy.h
@@ -6,6 +6,8 @@
* for more details.
*
* Copyright (C) 1995
+ *
+ * $Id:$
*/
#ifndef __ASM_MIPS_FLOPPY_H
#define __ASM_MIPS_FLOPPY_H
@@ -95,6 +97,8 @@ static int FDC2=-1;
#define N_FDC 1 /* do you *really* want a second controller? */
#define N_DRIVE 8
+#define FLOPPY_MOTOR_MASK 0xf0
+
/*
* The DMA channel used by the floppy controller cannot access data at
* addresses >= 16MB
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index b09ca61a4..f544d741f 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -24,4 +24,13 @@ extern int setup_x86_irq(int irq, struct irqaction * new);
extern void disable_irq(unsigned int);
extern void enable_irq(unsigned int);
+extern unsigned int local_irq_count[];
+
+#ifdef __SMP__
+#error Send superfluous SMP boxes to ralf@uni-koblenz.de
+#else
+#define irq_enter(cpu, irq) (++local_irq_count[cpu])
+#define irq_exit(cpu, irq) (--local_irq_count[cpu])
+#endif
+
#endif /* __ASM_MIPS_IRQ_H */
diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h
index b9c0aea15..56dd5c690 100644
--- a/include/asm-mips/namei.h
+++ b/include/asm-mips/namei.h
@@ -8,50 +8,45 @@
#include <linux/config.h>
-#ifdef CONFIG_BINFMT_IRIX
-
/* Only one at this time. */
#define IRIX32_EMUL "usr/gnemul/irix/"
-#if 0 /* XXX FIXME */
-
-extern int __namei(int, const char *, struct inode *, char *, struct inode **,
- struct inode **, struct qstr *, struct dentry **, int *);
-
-static __inline__ int
-__prefix_namei(int retrieve_mode, const char * name, struct inode * base,
- char * buf, struct inode ** res_dir, struct inode ** res_inode,
- struct qstr * last_name, struct dentry ** last_entry,
- int * last_error)
+static inline struct dentry *
+__mips_lookup_dentry(const char *name, int follow_link)
{
int error;
+ struct dentry *base;
if (current->personality != PER_IRIX32)
- return -EINVAL;
-
- while (*name == '/')
- name++;
-
- atomic_inc(&current->fs->root->i_count);
- error = __namei(NAM_FOLLOW_LINK, IRIX32_EMUL, current->fs->root,
- buf, NULL, &base, NULL, NULL, NULL);
- if (error)
- return error;
-
- error = __namei(retrieve_mode, name, base, buf, res_dir, res_inode,
- last_name, last_entry, last_error);
- if (error)
- return error;
-
- return 0;
+ return ERR_PTR(-ENOENT);
+
+ base = lookup_dentry (IRIX32_EMUL,
+ dget (current->fs->root), 1);
+
+ if (IS_ERR (base)) return base;
+
+ base = lookup_dentry (name, base, follow_link);
+
+ if (IS_ERR (base)) return base;
+
+ if (!base->d_inode) {
+ dput(base);
+ return ERR_PTR(-ENOENT);
+ }
+
+ return base;
}
-#endif /* XXX FIXME */
+#ifdef CONFIG_BINFMT_IRIX
+
+#define __prefix_lookup_dentry(name, follow_link) \
+ dentry = __mips_lookup_dentry (name, follow_link); \
+ if (!IS_ERR (dentry)) return dentry;
#else /* !defined(CONFIG_BINFMT_IRIX) */
-#define __prefix_namei(retrieve_mode, name, base, buf, res_dir, res_inode, \
- last_name, last_entry, last_error) 1
+#define __prefix_lookup_dentry(name, follow_link) \
+ do {} while (0)
#endif /* !defined(CONFIG_BINFMT_IRIX) */
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 3717bb398..c0b3a4d86 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -25,6 +25,7 @@ extern void (*flush_cache_range)(struct mm_struct *mm, unsigned long start,
extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page);
extern void (*flush_cache_sigtramp)(unsigned long addr);
extern void (*flush_page_to_ram)(unsigned long page);
+#define flush_icache_range(start, end) flush_cache_all()
/* TLB flushing:
*
diff --git a/include/asm-mips/posix_types.h b/include/asm-mips/posix_types.h
index deffcf200..21217ebae 100644
--- a/include/asm-mips/posix_types.h
+++ b/include/asm-mips/posix_types.h
@@ -36,7 +36,7 @@ typedef long __kernel_time_t;
typedef long __kernel_clock_t;
typedef long __kernel_daddr_t;
typedef char * __kernel_caddr_t;
-/* typedef unsigned long __kernel_sigset_t; anybody using this type? */
+typedef unsigned long __kernel_sigset_t;
#ifdef __GNUC__
typedef long long __kernel_loff_t;
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
index a3af51c4e..bdd80fd01 100644
--- a/include/asm-mips/sigcontext.h
+++ b/include/asm-mips/sigcontext.h
@@ -7,11 +7,13 @@
*
* Copyright (C) 1996, 1997 by Ralf Baechle
*
- * $Id: sigcontext.h,v 1.2 1997/06/25 14:50:02 ralf Exp $
+ * $Id: sigcontext.h,v 1.2 1997/06/25 20:49:07 ralf Exp $
*/
#ifndef __ASM_MIPS_SIGCONTEXT_H
#define __ASM_MIPS_SIGCONTEXT_H
+#include <linux/posix_types.h>
+
/*
* Keep this struct definition in sync with the sigcontext fragment
* in arch/mips/tools/offset.c
@@ -32,7 +34,7 @@ struct sigcontext {
unsigned int sc_cause; /* Unused */
unsigned int sc_badvaddr; /* Unused */
- sigset_t sc_sigset;
+ __kernel_sigset_t sc_sigset; /* DANGER: kernel vs. libc sigset_t ... */
unsigned long __pad0[3]; /* pad for constant size */
};
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
index d21105928..d7fe49864 100644
--- a/include/asm-mips/signal.h
+++ b/include/asm-mips/signal.h
@@ -5,40 +5,20 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1995, 1996 by Ralf Baechle
+ * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
+ *
+ * $Id:$
*/
#ifndef __ASM_MIPS_SIGNAL_H
+#define __ASM_MIPS_SIGNAL_H
#include <asm/sgidefs.h>
-/* Any one of these symbols __need_* means that GNU libc
- wants us just to define one data type. So don't define
- the symbols that indicate this file's entire job has been done. */
-#if !defined(__need_signums) && !defined(__need_fake_sigfuns) && \
- !defined(__need__nsig)
-#define __ASM_MIPS_SIGNAL_H
-#endif
-
-#ifdef __ASM_MIPS_SIGNAL_H
typedef unsigned long sigset_t;
-#endif /* __ASM_MIPS_SIGNAL_H */
-#if !defined (___nsig_defined) && \
- (defined (__ASM_MIPS_SIGNAL_H) || defined (__need__nsig))
-#define ___nsig_defined
-#define _NSIG 65
-#endif
-#undef __need__nsig
-#ifdef __KERNEL__
+#define _NSIG 32
#define NSIG _NSIG
-#endif
-#if !defined (__signums_defined) && \
- (defined (__ASM_MIPS_SIGNAL_H) || defined (__need_signums))
-#define __signums_defined
-/*
- * For 1.3.0 Linux/MIPS changed the signal numbers to be compatible the ABI.
- */
#define SIGHUP 1 /* Hangup (POSIX). */
#define SIGINT 2 /* Interrupt (ANSI). */
#define SIGQUIT 3 /* Quit (POSIX). */
@@ -73,10 +53,7 @@ typedef unsigned long sigset_t;
#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
-#endif /* need signums */
-#undef __need_signums
-#ifdef __ASM_MIPS_SIGNAL_H
/*
* sa_flags values: SA_STACK is not currently supported, but will allow the
* usage of signal stacks by using the (now obsolete) sa_restorer field in
@@ -113,24 +90,14 @@ typedef unsigned long sigset_t;
#define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility:
set only the low 32 bit of the sigset. */
-#ifndef __sighandler_t_defined
-#define __sighandler_t_defined
/* Type of a signal handler. */
typedef void (*__sighandler_t)(int);
-#endif
-#endif
-#if !defined (__fake_sigfuns_defined) && \
- (defined (__ASM_MIPS_SIGNAL_H) || defined (__need_fake_sigfuns))
-#define __fake_sigfuns_defined
/* Fake signal functions */
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
-#endif
-#undef __need_fake_sigfuns
-#ifdef __ASM_MIPS_SIGNAL_H
struct sigaction {
unsigned int sa_flags;
__sighandler_t sa_handler;
@@ -173,6 +140,5 @@ struct sigaction {
#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */
#define BRK_MULOVF 1023 /* Multiply overflow */
#endif /* defined (__KERNEL__) || defined (__USE_MISC) */
-#endif /* defined (__ASM_MIPS_SIGNAL_H) */
#endif /* !defined (__ASM_MIPS_SIGNAL_H) */
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
index f0f0e9ff8..4e627d6b0 100644
--- a/include/asm-mips/socket.h
+++ b/include/asm-mips/socket.h
@@ -48,19 +48,16 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
#define SO_SECURITY_ENCRYPTION_NETWORK 24
/* Types of sockets. */
-enum __socket_type
-{
- SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
- of fixed maximum length. */
- SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
- byte streams. */
- SOCK_RAW = 3, /* Raw protocol interface. */
- SOCK_RDM = 4, /* Reliably-delivered messages. */
- SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
- datagrams of fixed maximum length. */
- SOCK_PACKET = 10, /* linux specific way of getting packets at
+#define SOCK_DGRAM 1 /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_STREAM 2 /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_RAW 3 /* Raw protocol interface. */
+#define SOCK_RDM 4 /* Reliably-delivered messages. */
+#define SOCK_SEQPACKET 5 /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_PACKET 10 /* Linux specific way of getting packets at
the dev level. For writing rarp and
other similar things on the user level. */
-};
#endif /* __ASM_MIPS_SOCKET_H */
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 4a110338a..1481c667d 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -10,8 +10,11 @@
#include <asm/offset.h>
#define SAVE_ALL \
+ .set push; \
+ .set reorder; \
mfc0 k0, CP0_STATUS; \
sll k0, 3; /* extract cu0 bit */ \
+ .set pop; \
bltz k0, 8f; \
move k1, sp; \
/* Called from user mode, new stack. */ \
@@ -68,7 +71,10 @@
* that a modified IE mask will be nullified.
*/
#define RESTORE_ALL \
+ .set push; \
+ .set reorder; \
mfc0 t0, CP0_STATUS; \
+ .set pop; \
ori t0, 0x1f; \
xori t0, 0x1f; \
mtc0 t0, CP0_STATUS; \
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h
index daf1045ed..bc9007010 100644
--- a/include/asm-mips/string.h
+++ b/include/asm-mips/string.h
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, 1995, 1996, 1997 by Ralf Baechle
*
- * $Id: string.h,v 1.2 1997/07/23 14:40:10 ralf Exp $
+ * $Id: string.h,v 1.2 1997/07/24 01:49:29 ralf Exp $
*/
#ifndef __ASM_MIPS_STRING_H
#define __ASM_MIPS_STRING_H
@@ -94,25 +94,25 @@ extern __inline__ int strcmp(__const__ char *__cs, __const__ char *__ct)
#define __HAVE_ARCH_STRNCMP
extern __inline__ int strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
{
- char __res;
+ int __res;
__asm__ __volatile__(
".set\tnoreorder\n\t"
".set\tnoat\n"
- "1:\tlbu\t%3,(%0)\n\t"
+ "1:\tlbu\t%3,(%0)\n\t"
"beqz\t%2,2f\n\t"
- "lbu\t$1,(%1)\n\t"
- "subu\t%2,1\n\t"
- "bne\t$1,%3,3f\n\t"
- "addiu\t%0,1\n\t"
- "bnez\t%3,1b\n\t"
- "addiu\t%1,1\n"
+ "lbu\t$1,(%1)\n\t"
+ "subu\t%2,1\n\t"
+ "bne\t$1,%3,3f\n\t"
+ "addiu\t%0,1\n\t"
+ "bnez\t%3,1b\n\t"
+ "addiu\t%1,1\n"
"2:\tmove\t%3,$1\n"
"3:\tsubu\t%3,$1\n\t"
".set\tat\n\t"
".set\treorder"
- : "=r" (__cs), "=r" (__ct), "=r" (__count), "=r" (__res)
- : "0" (__cs), "1" (__ct), "2" (__count)
+ : "=r" (__cs), "=r" (__ct), "=r" (__count), "=r" (__res)
+ : "0" (__cs), "1" (__ct), "2" (__count)
: "$1");
return __res;