summaryrefslogtreecommitdiff
path: root/sys/arch/arc/include
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-30 20:24:33 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-30 20:24:33 +0000
commit5a4b8571aa88ae3650f87ddb399045f4b797437a (patch)
tree2ff63e4224014580be9b160fe825eb87ba03555a /sys/arch/arc/include
parentb039b90135b7419709f2766cbede80c1acf288a8 (diff)
Cleanup, endian and abi stuff fixies. Some stuff added for MIPS Magnum.
(PICA and Magnum uses very similar core chipsets).
Diffstat (limited to 'sys/arch/arc/include')
-rw-r--r--sys/arch/arc/include/asm.h94
-rw-r--r--sys/arch/arc/include/bus.h3
-rw-r--r--sys/arch/arc/include/float.h8
-rw-r--r--sys/arch/arc/include/kbdreg.h31
-rw-r--r--sys/arch/arc/include/pcb.h4
-rw-r--r--sys/arch/arc/include/pio.h4
-rw-r--r--sys/arch/arc/include/proc.h4
-rw-r--r--sys/arch/arc/include/profile.h52
-rw-r--r--sys/arch/arc/include/reloc.h39
-rw-r--r--sys/arch/arc/include/stdarg.h8
-rw-r--r--sys/arch/arc/include/varargs.h8
-rw-r--r--sys/arch/arc/include/vmparam.h17
12 files changed, 138 insertions, 134 deletions
diff --git a/sys/arch/arc/include/asm.h b/sys/arch/arc/include/asm.h
index 81cc88408c5..c1c95942cfe 100644
--- a/sys/arch/arc/include/asm.h
+++ b/sys/arch/arc/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.2 1996/07/18 17:00:09 pefo Exp $ */
+/* $OpenBSD: asm.h,v 1.3 1996/07/30 20:24:23 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -49,31 +49,48 @@
#include <machine/regdef.h>
-#define ABICALLS
+#define ABICALLS .abicalls
+
+#if defined(ABICALLS) && !defined(_KERNEL)
+ ABICALLS
+#endif
#define RCSID(x)
#define _C_LABEL(x) x
/*
- * Define how to access unaligned data word
+ * Define how to access unaligned data word (LITTLE Endian mode)
*/
-#define LWLO lwr
-#define LWHI lwl
-#define SWLO swr
-#define SWHI swl
+#define LWLO lwl
+#define LWHI lwr
+#define SWLO swl
+#define SWHI swr
+
+/*
+ * Code for setting gp reg if abicalls are used.
+ */
+#if defined(ABICALLS) && !defined(_KERNEL)
+#define ABISETUP \
+ .set noreorder; \
+ .cpload t9; \
+ .set reorder;
+#else
+#define ABISETUP
+#endif
/*
* Define -pg profile entry code.
*/
#if defined(GPROF) || defined(PROF)
-#define MCOUNT .set noreorder; \
- .set noat; \
- move $1,$31; \
- jal _mcount; \
- subu sp,sp,8; \
- .set reorder; \
- .set at;
+#define MCOUNT \
+ .set noreorder; \
+ .set noat; \
+ move $1,$31; \
+ jal _mcount; \
+ subu sp,sp,8; \
+ .set reorder; \
+ .set at;
#else
#define MCOUNT
#endif
@@ -83,30 +100,29 @@
*
* Declare a leaf routine.
*/
-#define LEAF(x) \
- .globl x; \
- .ent x, 0; \
-x: ; \
- .frame sp, 0, ra; \
+#define LEAF(x) \
+ .globl x; \
+ .ent x, 0; \
+x: ; \
+ .frame sp, 0, ra; \
+ ABISETUP \
MCOUNT
+#define ALEAF(x) \
+ .globl x; \
+x:
+
/*
* NLEAF(x)
*
* Declare a non-profiled leaf routine.
*/
-#define NLEAF(x) \
- .globl x; \
- .ent x, 0; \
-x: ; \
- .frame sp, 0, ra
-
-/*
- * ALEAF -- declare alternate entry to a leaf routine.
- */
-#define ALEAF(x) \
- .globl x; \
-x:
+#define NLEAF(x) \
+ .globl x; \
+ .ent x, 0; \
+x: ; \
+ .frame sp, 0, ra; \
+ ABISETUP
/*
* NON_LEAF(x)
@@ -114,10 +130,11 @@ x:
* Declare a non-leaf routine (a routine that makes other C calls).
*/
#define NON_LEAF(x, fsize, retpc) \
- .globl x; \
- .ent x, 0; \
-x: ; \
+ .globl x; \
+ .ent x, 0; \
+x: ; \
.frame sp, fsize, retpc; \
+ ABISETUP \
MCOUNT
/*
@@ -127,10 +144,11 @@ x: ; \
* (a routine that makes other C calls).
*/
#define NNON_LEAF(x, fsize, retpc) \
- .globl x; \
- .ent x, 0; \
-x: ; \
- .frame sp, fsize, retpc
+ .globl x; \
+ .ent x, 0; \
+x: ; \
+ .frame sp, fsize, retpc \
+ ABISETUP
/*
* END(x)
diff --git a/sys/arch/arc/include/bus.h b/sys/arch/arc/include/bus.h
index 49203479164..c9ab54932a2 100644
--- a/sys/arch/arc/include/bus.h
+++ b/sys/arch/arc/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.2 1996/06/24 20:05:36 pefo Exp $ */
+/* $OpenBSD: bus.h,v 1.3 1996/07/30 20:24:24 pefo Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -119,6 +119,7 @@ struct arc_isa_busmap {
((void)(*(volatile u_int64_t *)((h) + (o)) = (v)))
/* These are extensions to the general NetBSD bus interface. */
+/* XXX Check endianess */
#define bus_to_host_2(t, v) (v)
#define bus_to_host_4(t, v) (v)
#define bus_to_host_8(t, v) (v)
diff --git a/sys/arch/arc/include/float.h b/sys/arch/arc/include/float.h
index db2c3da071f..27f365d9a17 100644
--- a/sys/arch/arc/include/float.h
+++ b/sys/arch/arc/include/float.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: float.h,v 1.1 1996/06/24 09:07:17 pefo Exp $ */
+/* $OpenBSD: float.h,v 1.2 1996/07/30 20:24:25 pefo Exp $ */
/* $NetBSD: float.h,v 1.7 1995/06/20 20:45:50 jtc Exp $ */
/*
@@ -36,8 +36,8 @@
* @(#)float.h 8.1 (Berkeley) 6/10/93
*/
-#ifndef _PMAX_FLOAT_H_
-#define _PMAX_FLOAT_H_
+#ifndef _MIPS_FLOAT_H_
+#define _MIPS_FLOAT_H_
#include <sys/cdefs.h>
@@ -78,4 +78,4 @@ __END_DECLS
#define LDBL_MAX DBL_MAX
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
-#endif /* _PMAX_FLOAT_H_ */
+#endif /* _MIPS_FLOAT_H_ */
diff --git a/sys/arch/arc/include/kbdreg.h b/sys/arch/arc/include/kbdreg.h
index 36f7c430398..fe61cd72d3c 100644
--- a/sys/arch/arc/include/kbdreg.h
+++ b/sys/arch/arc/include/kbdreg.h
@@ -1,6 +1,35 @@
-/* $OpenBSD: kbdreg.h,v 1.1 1996/06/24 09:07:17 pefo Exp $ */
+/* $OpenBSD: kbdreg.h,v 1.2 1996/07/30 20:24:25 pefo Exp $ */
/*
+ * Copyright (c) 1996 Per Fogelstrom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Per Fogelstrom.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
* Keyboard definitions
*
*/
diff --git a/sys/arch/arc/include/pcb.h b/sys/arch/arc/include/pcb.h
index 8181602c1ab..871e651335b 100644
--- a/sys/arch/arc/include/pcb.h
+++ b/sys/arch/arc/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.1 1996/06/24 09:07:17 pefo Exp $ */
+/* $OpenBSD: pcb.h,v 1.2 1996/07/30 20:24:26 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -42,7 +42,7 @@
*/
/*
- * PICA process control block
+ * ARC process control block
*/
struct pcb
{
diff --git a/sys/arch/arc/include/pio.h b/sys/arch/arc/include/pio.h
index 04db5b11f34..39ddf216ce4 100644
--- a/sys/arch/arc/include/pio.h
+++ b/sys/arch/arc/include/pio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pio.h,v 1.1 1996/06/24 09:07:17 pefo Exp $ */
+/* $OpenBSD: pio.h,v 1.2 1996/07/30 20:24:27 pefo Exp $ */
/*
* Copyright (c) 1995 Per Fogelstrom. All rights reserved.
@@ -13,7 +13,7 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by Charles M. Hannum.
+ * This product includes software developed by Per Fogelstrom.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
diff --git a/sys/arch/arc/include/proc.h b/sys/arch/arc/include/proc.h
index b9b2b81c76d..2db639d145b 100644
--- a/sys/arch/arc/include/proc.h
+++ b/sys/arch/arc/include/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.1 1996/06/24 09:07:17 pefo Exp $ */
+/* $OpenBSD: proc.h,v 1.2 1996/07/30 20:24:27 pefo Exp $ */
/* $NetBSD: proc.h,v 1.4 1994/10/26 21:09:52 cgd Exp $ */
/*
@@ -40,7 +40,7 @@
*/
/*
- * Machine-dependent part of the proc structure for DEC Station.
+ * Machine-dependent part of the proc structure.
*/
struct mdproc {
int *md_regs; /* registers on current frame */
diff --git a/sys/arch/arc/include/profile.h b/sys/arch/arc/include/profile.h
index 911da1370f9..b00430cd56c 100644
--- a/sys/arch/arc/include/profile.h
+++ b/sys/arch/arc/include/profile.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: profile.h,v 1.1 1996/06/24 09:07:18 pefo Exp $ */
+/* $OpenBSD: profile.h,v 1.2 1996/07/30 20:24:28 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -41,36 +41,38 @@
#define _MCOUNT_DECL static void ___mcount
#define MCOUNT \
- __asm(".globl _mcount;" \
- "_mcount:;" \
- ".set noreorder;" \
- ".set noat;" \
- "sw $4,8($29);" \
- "sw $5,12($29);" \
- "sw $6,16($29);" \
- "sw $7,20($29);" \
- "sw $1,0($29);" \
- "sw $31,4($29);" \
- "move $5,$31;" \
- "jal ___mcount;" \
- "move $4,$1;" \
- "lw $4,8($29);" \
- "lw $5,12($29);" \
- "lw $6,16($29);" \
- "lw $7,20($29);" \
- "lw $31,4($29);" \
- "lw $1,0($29);" \
- "addu $29,$29,8;" \
- "j $31;" \
- "move $31,$1;" \
- ".set reorder;" \
+ __asm(".globl _mcount;" \
+ ".type _mcount,@function;" \
+ "_mcount:;" \
+ ".set noreorder;" \
+ ".set noat;" \
+ ".cpload $25;" \
+ "sw $4,8($29);" \
+ "sw $5,12($29);" \
+ "sw $6,16($29);" \
+ "sw $7,20($29);" \
+ "sw $1,0($29);" \
+ "sw $31,4($29);" \
+ "move $5,$31;" \
+ "jal ___mcount;" \
+ "move $4,$1;" \
+ "lw $4,8($29);" \
+ "lw $5,12($29);" \
+ "lw $6,16($29);" \
+ "lw $7,20($29);" \
+ "lw $31,4($29);" \
+ "lw $1,0($29);" \
+ "addu $29,$29,8;" \
+ "j $31;" \
+ "move $31,$1;" \
+ ".set reorder;" \
".set at");
#ifdef _KERNEL
/*
* The following two macros do splhigh and splx respectively.
* They have to be defined this way because these are real
- * functions on the PICA, and we do not want to invoke mcount
+ * functions on the MIPS, and we do not want to invoke mcount
* recursively.
*/
#define MCOUNT_ENTER s = _splhigh()
diff --git a/sys/arch/arc/include/reloc.h b/sys/arch/arc/include/reloc.h
index bba5426b18a..48d74df6751 100644
--- a/sys/arch/arc/include/reloc.h
+++ b/sys/arch/arc/include/reloc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: reloc.h,v 1.1 1996/06/24 09:07:18 pefo Exp $ */
+/* $OpenBSD: reloc.h,v 1.2 1996/07/30 20:24:28 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -36,40 +36,3 @@
* from: Header: reloc.h,v 1.6 92/06/20 09:59:37 torek Exp
*/
-#if 0
-/*
- * MIPS relocation types.
- */
-enum reloc_type {
- MIPS_RELOC_32, /* 32-bit absolute */
- MIPS_RELOC_JMP, /* 26-bit absolute << 2 | high 4 bits of pc */
- MIPS_RELOC_WDISP16, /* 16-bit signed pc-relative << 2 */
- MIPS_RELOC_HI16, /* 16-bit absolute << 16 */
- MIPS_RELOC_HI16_S, /* 16-bit absolute << 16 (+1 if needed) */
- MIPS_RELOC_LO16, /* 16-bit absolute */
-};
-
-/*
- * MIPS relocation info.
- *
- * Symbol-relative relocation is done by:
- * 1. start with the value r_addend,
- * 2. locate the appropriate symbol and if defined, add symbol value,
- * 3. if pc relative, subtract pc,
- * 4. if the reloc_type is MIPS_RELOC_HI16_S and the result bit 15 is set,
- * add 0x00010000,
- * 5. shift down 2 or 16 if necessary.
- * The resulting value is then to be stuffed into the appropriate bits
- * in the object (the low 16, or the low 26 bits).
- */
-struct reloc_info_pica {
- u_long r_address; /* relocation addr (offset in segment) */
- u_int r_index:24, /* segment (r_extern==0) or symbol index */
- r_extern:1, /* if set, r_index is symbol index */
- :2; /* unused */
- enum reloc_type r_type:5; /* relocation type, from above */
- long r_addend; /* value to add to symbol value */
-};
-
-#define relocation_info reloc_info_pica
-#endif
diff --git a/sys/arch/arc/include/stdarg.h b/sys/arch/arc/include/stdarg.h
index f2416324434..ac6cd07e268 100644
--- a/sys/arch/arc/include/stdarg.h
+++ b/sys/arch/arc/include/stdarg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdarg.h,v 1.1 1996/06/24 09:07:18 pefo Exp $ */
+/* $OpenBSD: stdarg.h,v 1.2 1996/07/30 20:24:29 pefo Exp $ */
/* $NetBSD: stdarg.h,v 1.7 1995/03/28 18:19:28 jtc Exp $ */
/*-
@@ -36,8 +36,8 @@
* @(#)stdarg.h 8.1 (Berkeley) 6/10/93
*/
-#ifndef _PMAX_STDARG_H_
-#define _PMAX_STDARG_H_
+#ifndef _MIPS_STDARG_H_
+#define _MIPS_STDARG_H_
#include <machine/ansi.h>
@@ -62,4 +62,4 @@ typedef _BSD_VA_LIST_ va_list;
#define va_end(ap) ((void) 0)
-#endif /* !_PMAX_STDARG_H_ */
+#endif /* !_MIPS_STDARG_H_ */
diff --git a/sys/arch/arc/include/varargs.h b/sys/arch/arc/include/varargs.h
index eca413161e8..e35ce16f8be 100644
--- a/sys/arch/arc/include/varargs.h
+++ b/sys/arch/arc/include/varargs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: varargs.h,v 1.1 1996/06/24 09:07:18 pefo Exp $ */
+/* $OpenBSD: varargs.h,v 1.2 1996/07/30 20:24:29 pefo Exp $ */
/* $NetBSD: varargs.h,v 1.8 1995/03/28 18:19:30 jtc Exp $ */
/*-
@@ -41,8 +41,8 @@
* @(#)varargs.h 8.2 (Berkeley) 3/22/94
*/
-#ifndef _PMAX_VARARGS_H_
-#define _PMAX_VARARGS_H_
+#ifndef _MIPS_VARARGS_H_
+#define _MIPS_VARARGS_H_
#include <machine/ansi.h>
@@ -66,4 +66,4 @@ typedef _BSD_VA_LIST_ va_list;
#define va_end(ap) ((void) 0)
-#endif /* !_PMAX_VARARGS_H_ */
+#endif /* !_MIPS_VARARGS_H_ */
diff --git a/sys/arch/arc/include/vmparam.h b/sys/arch/arc/include/vmparam.h
index 539b024441d..4615bd8d68e 100644
--- a/sys/arch/arc/include/vmparam.h
+++ b/sys/arch/arc/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.1 1996/06/24 09:07:18 pefo Exp $ */
+/* $OpenBSD: vmparam.h,v 1.2 1996/07/30 20:24:30 pefo Exp $ */
/* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */
/*
@@ -43,20 +43,14 @@
*/
/*
- * Machine dependent constants for DEC Station 3100.
+ * Machine dependent constants.
*/
/*
* USRTEXT is the start of the user text/data space, while USRSTACK
- * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are
- * the number of pages from the beginning of the P0 region to the
- * beginning of the text and from the beginning of the P1 region to the
- * beginning of the stack respectively.
+ * is the top (end) of the user stack.
*/
-#define USRTEXT 0x00001000
+#define USRTEXT 0x00400000
#define USRSTACK 0x80000000 /* Start of user stack */
-#define BTOPUSRSTACK 0x80000 /* btop(USRSTACK) */
-#define LOWPAGES 0x00001
-#define HIGHPAGES 0
/*
* Virtual memory related constants, all in bytes
@@ -218,9 +212,6 @@
*/
#define LOTSOFMEM 2
-#define mapin(pte, v, pfnum, prot) \
- (*(int *)(pte) = ((pfnum) << PG_SHIFT) | (prot), MachTLBFlushAddr(v))
-
/*
* Mach derived constants
*/