summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-11-20 23:55:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-11-20 23:55:21 +0000
commit92c358bbe7006a60d056b1db12474c359addb656 (patch)
treefed601aaff55107d6e01b275ffe70ef68026aed9 /sys
parent5d608bcf19f973f1f28ddb9410e6df8175cf4dcf (diff)
Prevent more symbol clashes when compiling userland.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mvme88k/include/asm.h319
-rw-r--r--sys/arch/mvme88k/include/asm_macro.h3
2 files changed, 150 insertions, 172 deletions
diff --git a/sys/arch/mvme88k/include/asm.h b/sys/arch/mvme88k/include/asm.h
index 00336ad80c3..811acecee89 100644
--- a/sys/arch/mvme88k/include/asm.h
+++ b/sys/arch/mvme88k/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.15 2001/10/28 00:58:29 miod Exp $ */
+/* $OpenBSD: asm.h,v 1.16 2001/11/20 23:55:20 miod Exp $ */
/*
* Mach Operating System
@@ -62,72 +62,83 @@
#define ASBSS(name, size) \
.comm _ASM_LABEL(name), size
-#define RTE NOP ; rte
+#define PANIC(message) \
+ or.u r2, r0, hi16(9f); \
+ bsr.n _C_LABEL(panic); \
+ or r2, r2, lo16(9f); \
+9: \
+ .string message
+
+#ifdef _KERNEL
+
+/*
+ * Control register symbolic names
+ */
-#define PID cr0
-#define PSR cr1
-#define EPSR cr2
-#define SSBR cr3
-#define SXIP cr4
-#define SNIP cr5
-#define SFIP cr6
-#define VBR cr7
-#define DMT0 cr8
-#define DMD0 cr9
-#define DMA0 cr10
-#define DMT1 cr11
-#define DMD1 cr12
-#define DMA1 cr13
-#define DMT2 cr14
-#define DMD2 cr15
-#define DMA2 cr16
-#define SRX cr16
-#define SR0 cr17
-#define SR1 cr18
-#define SR2 cr19
-#define SR3 cr20
+#define PID cr0
+#define PSR cr1
+#define EPSR cr2
+#define SSBR cr3
+#define SXIP cr4
+#define SNIP cr5
+#define SFIP cr6
+#define VBR cr7
+#define DMT0 cr8
+#define DMD0 cr9
+#define DMA0 cr10
+#define DMT1 cr11
+#define DMD1 cr12
+#define DMA1 cr13
+#define DMT2 cr14
+#define DMD2 cr15
+#define DMA2 cr16
+#define SRX cr16
+#define SR0 cr17
+#define SR1 cr18
+#define SR2 cr19
+#define SR3 cr20
/* MVME197 only */
-#define SRX cr16
-#define EXIP cr4
-#define ENIP cr5
-#define ICMD cr25
-#define ICTL cr26
-#define ISAR cr27
-#define ISAP cr28
-#define IUAP cr29
-#define IIR cr30
-#define IBP cr31
-#define IPPU cr32
-#define IPPL cr33
-#define ISR cr34
-#define ILAR cr35
-#define IPAR cr36
-#define DCMD cr40
-#define DCTL cr41
-#define DSAR cr42
-#define DSAP cr43
-#define DUAP cr44
-#define DIR cr45
-#define DBP cr46
-#define DPPU cr47
-#define DPPL cr48
-#define DSR cr49
-#define DLAR cr50
-#define DPAR cr51
+#define SRX cr16
+#define EXIP cr4
+#define ENIP cr5
+#define ICMD cr25
+#define ICTL cr26
+#define ISAR cr27
+#define ISAP cr28
+#define IUAP cr29
+#define IIR cr30
+#define IBP cr31
+#define IPPU cr32
+#define IPPL cr33
+#define ISR cr34
+#define ILAR cr35
+#define IPAR cr36
+#define DCMD cr40
+#define DCTL cr41
+#define DSAR cr42
+#define DSAP cr43
+#define DUAP cr44
+#define DIR cr45
+#define DBP cr46
+#define DPPU cr47
+#define DPPL cr48
+#define DSR cr49
+#define DLAR cr50
+#define DPAR cr51
/* end MVME197 only */
-#define FPECR fcr0
-#define FPHS1 fcr1
-#define FPLS1 fcr2
-#define FPHS2 fcr3
-#define FPLS2 fcr4
-#define FPPT fcr5
-#define FPRH fcr6
-#define FPRL fcr7
-#define FPIT fcr8
-#define FPSR fcr62
-#define FPCR fcr63
+#define FPECR fcr0
+#define FPHS1 fcr1
+#define FPLS1 fcr2
+#define FPHS2 fcr3
+#define FPLS2 fcr4
+#define FPPT fcr5
+#define FPRH fcr6
+#define FPRL fcr7
+#define FPIT fcr8
+#define FPSR fcr62
+#define FPCR fcr63
/*
* At various times, there is the need to clear the pipeline (i.e.
@@ -145,42 +156,28 @@
#define NOP or r0, r0, r0
#define NOP_STRING "or r0, r0, r0"
+#define RTE NOP ; rte
+
/*
* Useful in some situations.
* NOTE: If ARG1 or ARG2 are r2 or r3, strange things may happen. Watch out!
*/
-#define CALL(NAME, ARG1, ARG2) \
- subu r31, r31, 32 ; \
- or r2, r0, ARG1 ; \
- bsr.n NAME ; \
- or r3, r0, ARG2 ; \
- addu r31, r31, 32
+#define CALL(NAME, ARG1, ARG2) \
+ subu r31, r31, 32; \
+ or r2, r0, ARG1; \
+ bsr.n NAME; \
+ or r3, r0, ARG2; \
+ addu r31, r31, 32
/* This define is similar to CALL, but accepts a function pointer XXX smurph */
-#define CALLP(NAME, ARG1, ARG2) \
- subu r31, r31, 32 ; \
- or.u r5, r0, hi16(NAME) ; \
- ld r4, r5, lo16(NAME) ; \
- or r2, r0, ARG1 ; \
- jsr.n r4 ; \
- or r3, r0, ARG2 ; \
- addu r31, r31, 32
-
-/* This define can replace the xcr instruction XXX smurph */
-#define XCR(DR, SR, CR) ; \
- stcr r13, SR0 ; \
- or r13, r0, SR ; \
- ldcr DR, CR ; \
- stcr r13, CR ; \
- ldcr r13, SR0
-
-/* This define can be used to debug sub routine returns XXX smurph*/
-#define STORE_R1(varname) ; \
- stcr r13, SR0 /* r13 now free */ ; \
- /* save r1 to memory location varname */ ; \
- or.u r13, r0, hi16(varname) ; \
- st r1, r13, lo16(varname) ; \
- ldcr r13, SR0 /* retore r13 */
+#define CALLP(NAME, ARG1, ARG2) \
+ subu r31, r31, 32; \
+ or.u r5, r0, hi16(NAME); \
+ ld r4, r5, lo16(NAME); \
+ or r2, r0, ARG1; \
+ jsr.n r4; \
+ or r3, r0, ARG2; \
+ addu r31, r31, 32
/*
* SR1 - CPU FLAGS REGISTER
@@ -227,104 +224,84 @@
*
* Also, if any are 'r2' or 'r3', be careful using with CALL above!
*/
-#define FLAGS r2
-#define TMP r3
-#define TMP2 r10
-#define TMP3 r11
-#define SAVE_TMP2 st r10, r31, GENREG_OFF(10)
-#define SAVE_TMP3 st r11, r31, GENREG_OFF(11)
-#define RESTORE_TMP2 ld r10, r31, GENREG_OFF(10)
-#define RESTORE_TMP3 ld r11, r31, GENREG_OFF(11)
+#define FLAGS r2
+#define TMP r3
+#define TMP2 r10
+#define TMP3 r11
+#define SAVE_TMP2 st r10, r31, GENREG_OFF(10)
+#define SAVE_TMP3 st r11, r31, GENREG_OFF(11)
+#define RESTORE_TMP2 ld r10, r31, GENREG_OFF(10)
+#define RESTORE_TMP3 ld r11, r31, GENREG_OFF(11)
/*
* Info about the PSR
*/
-#define PSR_SHADOW_FREEZE_BIT 0
-#define PSR_INTERRUPT_DISABLE_BIT 1
-#define PSR_FPU_DISABLE_BIT 3
-#define PSR_BIG_ENDIAN_MODE 30
-#define PSR_SUPERVISOR_MODE_BIT 31
+#define PSR_SHADOW_FREEZE_BIT 0
+#define PSR_INTERRUPT_DISABLE_BIT 1
+#define PSR_FPU_DISABLE_BIT 3
+#define PSR_BIG_ENDIAN_MODE 30
+#define PSR_SUPERVISOR_MODE_BIT 31
/*
* Status bits for an SXIP/SNIP/SFIP address.
*/
-#define RTE_VALID_BIT 1
-#define RTE_ERROR_BIT 0
+#define RTE_VALID_BIT 1
+#define RTE_ERROR_BIT 0
/*
* Info about DMT0/DMT1/DMT2
*/
-#define DMT_VALID_BIT 0
-#define DMT_WRITE_BIT 1
-#define DMT_LOCK_BIT 12
-#define DMT_DOUBLE_BIT 13
-#define DMT_DAS_BIT 14
-#define DMT_DREG_OFFSET 7
-#define DMT_DREG_WIDTH 5
+#define DMT_VALID_BIT 0
+#define DMT_WRITE_BIT 1
+#define DMT_LOCK_BIT 12
+#define DMT_DOUBLE_BIT 13
+#define DMT_DAS_BIT 14
+#define DMT_DREG_OFFSET 7
+#define DMT_DREG_WIDTH 5
/*
* Bits for eh_debug.
*/
-#define DEBUG_INTERRUPT_BIT 0
-#define DEBUG_DATA_BIT 1
-#define DEBUG_INSTRUCTION_BIT 2
-#define DEBUG_MISALIGN_BIT 3
-#define DEBUG_UNIMP_BIT 4
-#define DEBUG_DIVIDE_BIT 5
-#define DEBUG_OF_BIT 6
-#define DEBUG_FPp_BIT 7
-#define DEBUG_FPi_BIT 8
-#define DEBUG_SYSCALL_BIT 9
-#define DEBUG_MACHSYSCALL_BIT 10
-#define DEBUG_UNIMPLEMENTED_BIT 11
-#define DEBUG_PRIVILEGE_BIT 12
-#define DEBUG_BOUNDS_BIT 13
-#define DEBUG_OVERFLOW_BIT 14
-#define DEBUG_ERROR_BIT 15
-#define DEBUG_SIGSYS_BIT 16
-#define DEBUG_SIGTRAP_BIT 17
-#define DEBUG_BREAK_BIT 18
-#define DEBUG_TRACE_BIT 19
-#define DEBUG_KDB_BIT 20
-#define DEBUG_JKDB_BIT 21
-#define DEBUG_BUGCALL_BIT 22
-#define DEBUG_NON_MASK_BIT 23 /* MVME197 Non-Maskable Interrupt */
-#define DEBUG_197_READ_BIT 25 /* MVME197 Data Read Miss (Software Table Searches) */
-#define DEBUG_197_WRITE_BIT 26 /* MVME197 Data Write Miss (Software Table Searches) */
-#define DEBUG_197_INST_BIT 27 /* MVME197 Inst ATC Miss (Software Table Searches) */
-
-#define DEBUG_UNKNOWN_BIT 31
+#define DEBUG_INTERRUPT_BIT 0
+#define DEBUG_DATA_BIT 1
+#define DEBUG_INSTRUCTION_BIT 2
+#define DEBUG_MISALIGN_BIT 3
+#define DEBUG_UNIMP_BIT 4
+#define DEBUG_DIVIDE_BIT 5
+#define DEBUG_OF_BIT 6
+#define DEBUG_FPp_BIT 7
+#define DEBUG_FPi_BIT 8
+#define DEBUG_SYSCALL_BIT 9
+#define DEBUG_MACHSYSCALL_BIT 10
+#define DEBUG_UNIMPLEMENTED_BIT 11
+#define DEBUG_PRIVILEGE_BIT 12
+#define DEBUG_BOUNDS_BIT 13
+#define DEBUG_OVERFLOW_BIT 14
+#define DEBUG_ERROR_BIT 15
+#define DEBUG_SIGSYS_BIT 16
+#define DEBUG_SIGTRAP_BIT 17
+#define DEBUG_BREAK_BIT 18
+#define DEBUG_TRACE_BIT 19
+#define DEBUG_KDB_BIT 20
+#define DEBUG_JKDB_BIT 21
+#define DEBUG_BUGCALL_BIT 22
+/* MVME197 Non-Maskable Interrupt */
+#define DEBUG_NON_MASK_BIT 23
+/* MVME197 Data Read Miss (Software Table Searches) */
+#define DEBUG_197_READ_BIT 25
+/* MVME197 Data Write Miss (Software Table Searches) */
+#define DEBUG_197_WRITE_BIT 26
+/* MVME197 Inst ATC Miss (Software Table Searches) */
+#define DEBUG_197_INST_BIT 27
+
+#define DEBUG_UNKNOWN_BIT 31
/*
- * These things for vector_init.c and locore.c
+ * These things for locore_c_routines.c and locore.S
*/
-#if defined(_LOCORE)
-# define PREDEFINED_BY_ROM 0xffffffff
-# define END_OF_VECTOR_LIST 0xfffffffe
-#else
-# define PREDEFINED_BY_ROM 0xffffffffU
-# define END_OF_VECTOR_LIST 0xfffffffeU
-#endif
+#define PREDEFINED_BY_ROM 0xffffffff
+#define END_OF_VECTOR_LIST 0xfffffffe
-/*
- * Define ERROR__XXX_USR if the xxx.usr bug (mask C82N) is present.
- * This implements the workaround.
- */
-#define ERRATA__XXX_USR 1
-
-#ifndef CMMU_DEFS
-#define CMMU_DEFS
-#define SBC_CMMU_I 0xFFF77000 /* Single Board Computer code CMMU */
-#define SBC_CMMU_D 0xFFF7F000 /* Single Board Computer data CMMU */
-
-#define VME_CMMU_I0 0xFFF7E000 /* MVME188 code CMMU 0 */
-#define VME_CMMU_I1 0xFFF7D000 /* MVME188 code CMMU 1 */
-#define VME_CMMU_I2 0xFFF7B000 /* MVME188 code CMMU 2 */
-#define VME_CMMU_I3 0xFFF77000 /* MVME188 code CMMU 3 */
-#define VME_CMMU_D0 0xFFF6F000 /* MVME188 data CMMU 0 */
-#define VME_CMMU_D1 0xFFF5F000 /* MVME188 data CMMU 1 */
-#define VME_CMMU_D2 0xFFF3F000 /* MVME188 data CMMU 2 */
-#define VME_CMMU_D3 0xFFF7F000 /* MVME188 data CMMU 3 */
-#endif /* CMMU_DEFS */
+#endif /* _KERNEL */
#endif /* __MACHINE_M88K_ASM_H__ */
diff --git a/sys/arch/mvme88k/include/asm_macro.h b/sys/arch/mvme88k/include/asm_macro.h
index c9245754166..e6087420ef7 100644
--- a/sys/arch/mvme88k/include/asm_macro.h
+++ b/sys/arch/mvme88k/include/asm_macro.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm_macro.h,v 1.15 2001/10/28 00:58:29 miod Exp $ */
+/* $OpenBSD: asm_macro.h,v 1.16 2001/11/20 23:55:20 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -29,6 +29,7 @@
#ifndef __MACHINE_M88K_ASM_MACRO_H__
#define __MACHINE_M88K_ASM_MACRO_H__
+#include <machine/asm.h>
/*
* Various compiler macros used for speed and efficiency.
* Anyone can include.