summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-08-24 22:53:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-08-24 22:53:16 +0000
commit4d8ea36bd40a214ecfa5f79e692ea11f54c9bc95 (patch)
treef3198a6e4c191e01569435038ece13156e9e53b1
parent89e57f3e6120f97db4a053148ed19b94ab3804fc (diff)
Adapt to the <machine/asm.h> macros (only for entry points for now, because
LABEL has disappeared), and to the trap() name changes.
-rw-r--r--sys/arch/mvme88k/mvme88k/eh.S335
-rw-r--r--sys/arch/mvme88k/mvme88k/locore.S66
-rw-r--r--sys/arch/mvme88k/mvme88k/locore_asm_routines.S791
-rw-r--r--sys/arch/mvme88k/mvme88k/m88100_fp.S62
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110_fp.S10
-rw-r--r--sys/arch/mvme88k/mvme88k/process.S4
6 files changed, 328 insertions, 940 deletions
diff --git a/sys/arch/mvme88k/mvme88k/eh.S b/sys/arch/mvme88k/mvme88k/eh.S
index 6384cd9570a..b9f75ee03eb 100644
--- a/sys/arch/mvme88k/mvme88k/eh.S
+++ b/sys/arch/mvme88k/mvme88k/eh.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: eh.S,v 1.14 2001/08/12 12:03:02 heko Exp $ */
+/* $OpenBSD: eh.S,v 1.15 2001/08/24 22:53:14 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -217,6 +217,8 @@
#include <machine/trap.h> /* for T_ defines */
#include <machine/asm.h>
+#define EH_DEBUG
+
/*
* The exception frame as defined in "machine/pcb.h" (among other places) is
* a bit outdated and needs to be changed. Until then, we'll define some
@@ -258,9 +260,9 @@ Lbadcpupanic:
** This is the "exception processing preparaton" common to all exception
** processing. It is used in the following manor:
**
- ** LABEL(foo_handler)
+ ** ASGLOBAL(foo_handler)
** PREP("foo", 11, DEBUG_FOO_BIT, No_SSBR_Stuff, No_Precheck)
- ** CALL(_trap, T_FOO_FAULT, r31)
+ ** CALL(_C_LABEL(trapXXX), T_FOO_FAULT, r31)
** DONE(DEBUG_FOO_BIT)
**
** This defines the exception handler for the "foo" exception.
@@ -358,7 +360,7 @@ Lbadcpupanic:
#define M197_Data_Precheck \
bb1.n FLAG_IGNORE_DATA_EXCEPTION, FLAGS, m197_ignore_data_exception
-#if EH_DEBUG
+#ifdef EH_DEBUG
/*
* If we allow debugging, there is a variable "eh_debug"
* in which there is a bit for each exception. If the bit
@@ -367,7 +369,7 @@ Lbadcpupanic:
*
* The bits are defined in "asm.h"
*/
-LABEL(_eh_debug) word 0x00000000
+GLOBAL(eh_debug) word 0x00000000
/*
* additional pre-servicing preparation to be done when
@@ -425,43 +427,43 @@ LABEL(_eh_debug) word 0x00000000
/*#########################################################################*/
/* unknown exception handler */
-LABEL(_unknown_handler)
+GLOBAL(unknown_handler)
PREP("unknown", 0, DEBUG_UNKNOWN_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap18x), T_UNKNOWNFLT, r30)
DONE(DEBUG_UNKNOWN_BIT)
/* interrupt exception handler */
-LABEL(_interrupt_handler)
+GLOBAL(interrupt_handler)
PREP("interrupt", 1, DEBUG_INTERRUPT_BIT, No_SSBR_Stuff, No_Precheck)
/* interrupt_func is set in mvme_bootstrap() */
- CALL(_trap, T_INT, r30)
+ CALL(_C_LABEL(trap18x), T_INT, r30)
/*CALLP(_interrupt_func, 1, r30) */
DONE(DEBUG_INTERRUPT_BIT)
/* instruction access exception handler */
-LABEL(_instruction_access_handler)
+GLOBAL(instruction_access_handler)
PREP("inst", 2, DEBUG_INSTRUCTION_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_INSTFLT, r30)
+ CALL(_C_LABEL(trap18x), T_INSTFLT, r30)
DONE(DEBUG_INSTRUCTION_BIT)
/*
* data access exception handler --
* See badaddr() below for info about Data_Precheck.
*/
-LABEL(_data_exception_handler)
+GLOBAL(data_exception_handler)
PREP("data", 3, DEBUG_DATA_BIT, No_SSBR_Stuff, Data_Precheck)
DONE(DEBUG_DATA_BIT)
/* misaligned access exception handler */
-LABEL(_misaligned_handler)
+GLOBAL(misaligned_handler)
PREP("misalign", 4, DEBUG_MISALIGN_BIT, Clear_SSBR_Dest, No_Precheck)
- CALL(_trap, T_MISALGNFLT, r30)
+ CALL(_C_LABEL(trap18x), T_MISALGNFLT, r30)
DONE(DEBUG_MISALIGN_BIT)
/* unimplemented opcode exception handler */
-LABEL(_unimplemented_handler)
+GLOBAL(unimplemented_handler)
PREP("unimp", 5, DEBUG_UNIMPLEMENTED_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_ILLFLT, r30)
+ CALL(_C_LABEL(trap18x), T_ILLFLT, r30)
DONE(DEBUG_UNIMPLEMENTED_BIT)
/*
@@ -469,112 +471,112 @@ LABEL(_unimplemented_handler)
* violation exceptions are raised. If the valid bit in the SXIP is clear,
* it is false. If so, just return. The code before PREP handles this....
*/
-LABEL(_privilege_handler)
+GLOBAL(privilege_handler)
stcr r1, SR2 /* hold r1 for a moment */
ldcr r1, SXIP /* look at the sxip... valid bit set? */
bb1.n RTE_VALID_BIT, r1, 1f /*skip over return if a valid exception*/
ldcr r1, SR2 /* restore r1 */
RTE
1: PREP("privilege", 6, DEBUG_PRIVILEGE_BIT, Clear_SSBR_Dest, No_Precheck)
- CALL(_trap, T_PRIVINFLT, r30)
+ CALL(_C_LABEL(trap18x), T_PRIVINFLT, r30)
DONE(DEBUG_PRIVILEGE_BIT)
/*
* I'm not sure what the trap(T_BNDFLT,...) does, but it doesn't send
* a signal to the process...
*/
-LABEL(_bounds_handler)
+GLOBAL(bounds_handler)
PREP("bounds", 7, DEBUG_BOUNDS_BIT, Clear_SSBR_Dest, No_Precheck)
- CALL(_trap, T_BNDFLT, r30)
+ CALL(_C_LABEL(trap18x), T_BNDFLT, r30)
DONE(DEBUG_BOUNDS_BIT)
/* integer divide-by-zero exception handler */
-LABEL(_divide_handler)
+GLOBAL(divide_handler)
PREP("divide", 8, DEBUG_DIVIDE_BIT, Clear_SSBR_Dest, No_Precheck)
- CALL(_trap, T_ZERODIV, r30)
+ CALL(_C_LABEL(trap18x), T_ZERODIV, r30)
DONE(DEBUG_DIVIDE_BIT)
/* integer overflow exception handelr */
-LABEL(_overflow_handler)
+GLOBAL(overflow_handler)
PREP("overflow", 9, DEBUG_OVERFLOW_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_OVFFLT, r30)
+ CALL(_C_LABEL(trap18x), T_OVFFLT, r30)
DONE(DEBUG_OVERFLOW_BIT)
/* Floating-point precise handler */
#define FPp_SSBR_STUFF bsr clear_FPp_ssbr_bit
-LABEL(fp_precise_handler)
+ASGLOBAL(fp_precise_handler)
PREP("FPU precise", 114, DEBUG_FPp_BIT, FPp_SSBR_STUFF, No_Precheck)
CALL(_m88100_Xfp_precise, r0, r30) /* call fp_precise(??, exception_frame)*/
DONE(DEBUG_FPp_BIT)
/* Floating-point imprecise handler */
#define FPi_SSBR_STUFF bsr clear_FPi_ssbr_bit
-LABEL(fp_imprecise_handler)
+ASGLOBAL(fp_imprecise_handler)
PREP("FPU imprecise", 115, DEBUG_FPi_BIT, FPi_SSBR_STUFF, No_Precheck)
CALL(_Xfp_imprecise, r0, r30) /*call fp_imprecise(??,exception_frame)*/
DONE(DEBUG_FPi_BIT)
/* All standard system calls. */
-LABEL(_syscall_handler)
+GLOBAL(syscall_handler)
PREP("syscall", 128, DEBUG_SYSCALL_BIT, No_SSBR_Stuff, No_Precheck)
ld r13, r30, GENREG_OFF(13)
CALL(_syscall, r13, r30) /* system call no. is in r13 */
DONE(DEBUG_SYSCALL_BIT)
/* trap 496 comes here */
-LABEL(_bugtrap)
+GLOBAL(bugtrap)
PREP("bugsyscall", 496, DEBUG_BUGCALL_BIT, No_SSBR_Stuff, No_Precheck)
ld r9, r30, GENREG_OFF(9)
CALL(_bugsyscall, r9, r30) /* system call no. is in r9 */
DONE(DEBUG_SYSCALL_BIT)
-LABEL(_sigsys)
+GLOBAL(sigsys)
PREP("sigsys", 0, DEBUG_SIGSYS_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_SIGSYS, r30)
+ CALL(_C_LABEL(trap18x), T_SIGSYS, r30)
DONE(DEBUG_SIGSYS_BIT)
-LABEL(_sigtrap)
+GLOBAL(sigtrap)
PREP("sigtrap", 0, DEBUG_SIGTRAP_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_SIGTRAP, r30)
+ CALL(_C_LABEL(trap18x), T_SIGTRAP, r30)
DONE(DEBUG_SIGTRAP_BIT)
-LABEL(_stepbpt)
+GLOBAL(stepbpt)
PREP("stepbpt", 0, DEBUG_SIGTRAP_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_STEPBPT, r30)
+ CALL(_C_LABEL(trap18x), T_STEPBPT, r30)
DONE(DEBUG_SIGTRAP_BIT)
-LABEL(_userbpt)
+GLOBAL(userbpt)
PREP("userbpt", 0, DEBUG_SIGTRAP_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_USERBPT, r30)
+ CALL(_C_LABEL(trap18x), T_USERBPT, r30)
DONE(DEBUG_SIGTRAP_BIT)
#if DDB
- LABEL(break)
+ ASGLOBAL(break)
PREP("break", 130, DEBUG_BREAK_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_KDB_BREAK, r30)
+ CALL(_C_LABEL(trap18x), T_KDB_BREAK, r30)
DONE(DEBUG_BREAK_BIT)
- LABEL(trace)
+ ASGLOBAL(trace)
PREP("trace", 131, DEBUG_TRACE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_KDB_TRACE, r30)
+ CALL(_C_LABEL(trap18x), T_KDB_TRACE, r30)
DONE(DEBUG_TRACE_BIT)
- LABEL(_entry)
+ GLOBAL(entry)
PREP("kdb", 132, DEBUG_KDB_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_KDB_ENTRY, r30)
+ CALL(_C_LABEL(trap18x), T_KDB_ENTRY, r30)
DONE(DEBUG_KDB_BIT)
#else /* else not DDB */
- LABEL(break)
+ ASGLOBAL(break)
PREP("break", 130, DEBUG_BREAK_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap18x), T_UNKNOWNFLT, r30)
DONE(DEBUG_BREAK_BIT)
- LABEL(trace)
+ ASGLOBAL(trace)
PREP("trace", 131, DEBUG_TRACE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap18x), T_UNKNOWNFLT, r30)
DONE(DEBUG_TRACE_BIT)
- LABEL(_entry)
+ GLOBAL(entry)
PREP("unknown", 132, DEBUG_UNKNOWN_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap18x), T_UNKNOWNFLT, r30)
DONE(DEBUG_KDB_BIT)
#endif /* DDB */
@@ -591,7 +593,7 @@ LABEL(_userbpt)
* We'll not worry about trashing r26-29 here,
* since they aren't generally used.
*/
-LABEL(_error_handler)
+GLOBAL(error_handler)
/* pick up the slavestack */
or r26, r0, r31 /* save old stack */
or.u r31, r0, hi16(_intstack_end)
@@ -716,7 +718,7 @@ LABEL(_error_handler)
stcr r1, PSR
FLUSH_PIPELINE
-LABEL(_error_loop) bsr _error_loop
+GLOBAL(error_loop) bsr _error_loop
/* never returns*/
/*
@@ -738,7 +740,7 @@ LABEL(_error_loop) bsr _error_loop
* We'll not worry about trashing r26-29 here,
* since they aren't generally used.
*/
-LABEL(_reset_handler)
+GLOBAL(reset_handler)
/* pick up the slavestack */
or r26, r0, r31 /* save old stack */
or.u r31, r0, hi16(_intstack_end)
@@ -854,13 +856,13 @@ LABEL(_reset_handler)
stcr r1, PSR
FLUSH_PIPELINE
-LABEL(_error_loop2) bsr _error_loop2
+GLOBAL(error_loop2) bsr _error_loop2
/* never returns*/
/*
* This is part of baddadr (below).
*/
-_LABEL(ignore_data_exception)
+ASGLOBAL(ignore_data_exception)
/******************************************************\
* SR0: pointer to the current thread structure *
* SR1: previous FLAGS reg *
@@ -898,7 +900,7 @@ _LABEL(ignore_data_exception)
/*
* This is part of baddadr (below).
*/
-_LABEL(m197_ignore_data_exception)
+ASGLOBAL(m197_ignore_data_exception)
/******************************************************\
* SR0: pointer to the current thread structure *
* SR1: previous FLAGS reg *
@@ -949,7 +951,7 @@ _LABEL(m197_ignore_data_exception)
* routine (after removing the special CPU flag).
*/
-LABEL(_badaddr)
+GLOBAL(badaddr)
/*
* Disable interrupts ... don't want a context switch while we're
* doing this! Also, save the old PSR in R8 to restore later.
@@ -1029,11 +1031,11 @@ badaddr__unknown_size:
/*NOTREACHED*/
#endif
-_LABEL(badaddr__return_nonzero)
+ASGLOBAL(badaddr__return_nonzero)
or r2, r0, 1
/* fall through to badaddr__return */
-_LABEL(badaddr__return)
+ASGLOBAL(badaddr__return)
ldcr r4, SR1
clr r4, r4, 1<FLAG_IGNORE_DATA_EXCEPTION>
stcr r4, SR1
@@ -1057,7 +1059,7 @@ _LABEL(badaddr__return)
#if defined(MVME187) || defined (MVME188)
-LABEL(setup_phase_one)
+ASGLOBAL(setup_phase_one)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread (if any, null if not) *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1085,7 +1087,7 @@ LABEL(setup_phase_one)
bb0 FLAG_FROM_KERNEL, FLAGS, pickup_stack
/* Interrupt in kernel mode, not FPU restart */
-_LABEL(already_on_kernel_stack)
+ASGLOBAL(already_on_kernel_stack)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread (if any, null if not) *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1110,7 +1112,7 @@ _LABEL(already_on_kernel_stack)
st r1, r31, GENREG_OFF(31)
-_LABEL(use_SR3_pcb)
+ASGLOBAL(use_SR3_pcb)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread (if any, null if not) *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1169,7 +1171,7 @@ _LABEL(use_SR3_pcb)
br.n have_pcb
xcr r30, r30, SR3 /* restore r30 */
-_LABEL(pickup_stack)
+ASGLOBAL(pickup_stack)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1194,7 +1196,7 @@ _LABEL(pickup_stack)
st r1, r31, GENREG_OFF(31)
/*FALLTHROUGH */
-_LABEL(have_pcb)
+ASGLOBAL(have_pcb)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1293,7 +1295,7 @@ _LABEL(have_pcb)
ld TMP2, TMP, lo16(SBC_CMMU_D) + 0x108
st TMP2, r31, REG_OFF(EF_DPFSR)
-_LABEL(pfsr_done)
+ASGLOBAL(pfsr_done)
ldcr TMP, SSBR
ldcr TMP2, SXIP
ldcr TMP3, DMT0
@@ -1352,47 +1354,47 @@ _LABEL(pfsr_done)
* we restart the FPU
*/
-_LABEL(check_DMT0)
+ASGLOBAL(check_DMT0)
ldcr TMP2, DMT0
bb0.n DMT_VALID_BIT, TMP2, DMT_check_finished
stcr r0, DMT0 /* so an exception at fpu_enable doesn't see our DMT0*/
bb1 DMT_LOCK_BIT, TMP2, do_DMT0
bb1 DMT_WRITE_BIT, TMP2, check_DMT1
-_LABEL(do_DMT0)
+ASGLOBAL(do_DMT0)
extu TMP2, TMP2, DMT_DREG_WIDTH <DMT_DREG_OFFSET>
set TMP2, TMP2, 1<5>
clr TMP, TMP, TMP2
-_LABEL(check_DMT1)
+ASGLOBAL(check_DMT1)
ldcr TMP2, DMT1
bb0 DMT_VALID_BIT, TMP2, check_DMT2
bb1 DMT_LOCK_BIT, TMP2, do_DMT1
bb1 DMT_WRITE_BIT, TMP2, check_DMT2
-_LABEL(do_DMT1)
+ASGLOBAL(do_DMT1)
extu TMP2, TMP2, DMT_DREG_WIDTH <DMT_DREG_OFFSET>
set TMP2, TMP2, 1<5>
clr TMP, TMP, TMP2
-_LABEL(check_DMT2)
+ASGLOBAL(check_DMT2)
ldcr TMP2, DMT2
bb0 DMT_VALID_BIT, TMP2, DMT_check_finished
bb1 DMT_LOCK_BIT, TMP2, do_DMT2_single
bb1 DMT_WRITE_BIT, TMP2, DMT_check_finished
bb1 DMT_DOUBLE_BIT,TMP2, do_DMT2_double
-_LABEL(do_DMT2_single)
+ASGLOBAL(do_DMT2_single)
extu TMP2, TMP2, DMT_DREG_WIDTH <DMT_DREG_OFFSET>
br.n 1f
set TMP2, TMP2, 1<5>
-_LABEL(do_DMT2_double)
+ASGLOBAL(do_DMT2_double)
extu TMP2, TMP2, DMT_DREG_WIDTH <DMT_DREG_OFFSET>
set TMP2, TMP2, 1<6>
1: clr TMP, TMP, TMP2
-_LABEL(DMT_check_finished)
+ASGLOBAL(DMT_check_finished)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1420,7 +1422,7 @@ _LABEL(DMT_check_finished)
/************************************************************************/
/************************************************************************/
-_LABEL(clear_FPi_ssbr_bit)
+ASGLOBAL(clear_FPi_ssbr_bit)
/*
* Clear floatingpont-imprecise ssbr bits.
* Also, save appropriate FPU control registers to the E.F.
@@ -1455,7 +1457,7 @@ _LABEL(clear_FPi_ssbr_bit)
set TMP2, TMP2, 1<6> /* set width (width=2 will clear two bits) */
clr TMP, TMP, TMP2
-_LABEL(not_double_fpi)
+ASGLOBAL(not_double_fpi)
jmp r1
@@ -1463,7 +1465,7 @@ _LABEL(not_double_fpi)
/************************************************************************/
-_LABEL(clear_FPp_ssbr_bit)
+ASGLOBAL(clear_FPp_ssbr_bit)
/*
* Clear floating pont precise ssbr bits.
* Also, save appropriate FPU control registers to the E.F.
@@ -1510,7 +1512,7 @@ _LABEL(clear_FPp_ssbr_bit)
/************************************************************************/
-_LABEL(clear_dest_ssbr_bit)
+ASGLOBAL(clear_dest_ssbr_bit)
/*
* There are various cases where an exception can leave the
* destination register's bit in the SB set.
@@ -1596,12 +1598,12 @@ _LABEL(clear_dest_ssbr_bit)
cmp TMP3, TMP3, 0x1000 /* if this is equal, it's a load double */
bb1 eq, TMP3, misaligned_double
-_LABEL(misaligned_single)
+ASGLOBAL(misaligned_single)
extu TMP2, TMP2, 5<21> /* get the destination register */
br.n 1f
set TMP2, TMP2, 1<5> /* set size=1 */
-_LABEL(misaligned_double)
+ASGLOBAL(misaligned_double)
extu TMP2, TMP2, 5<21> /* get the destination register */
set TMP2, TMP2, 1<6> /* set size=2 -- clear two bit for "ld.d" */
@@ -1613,7 +1615,7 @@ _LABEL(misaligned_double)
#if defined(MVME187) || defined (MVME188)
-LABEL(setup_phase_two)
+ASGLOBAL(setup_phase_two)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: saved return address to calling exception handler *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -1706,7 +1708,7 @@ setup_phase_two_cont:
RTE /* jumps to "fpu_enable" on the next line to enable the FPU. */
-_LABEL(fpu_enable)
+ASGLOBAL(fpu_enable)
FLUSH_PIPELINE
xcr TMP, TMP, SR3 /* get E.F. pointer */
st.d r30, TMP, GENREG_OFF(30) /* save previous r30, r31 */
@@ -1853,7 +1855,7 @@ exception_handler_has_ksp: global exception_handler_has_ksp
*/
or r15, r0, r30
- CALL(_trap, T_DATAFLT, r15)
+ CALL(_C_LABEL(trap18x), T_DATAFLT, r15)
CALL(_data_access_emulation, r15, r0)
/* restore it... */
@@ -1862,7 +1864,7 @@ exception_handler_has_ksp: global exception_handler_has_ksp
/* clear the dmt0 word in the E.F */
st r0, r30, REG_OFF(EF_DMT0)
-_LABEL(return_to_calling_exception_handler)
+ASGLOBAL(return_to_calling_exception_handler)
jmp r14 /* loaded above */
#endif /* defined(MVME187) || defined (MVME188) */
@@ -1902,8 +1904,8 @@ ENTRY(proc_do_uret)
st r3,r31,0 /* put it on the stack */
br return_from_exception_handler
-LABEL(return_from_exception_handler)
-LABEL(_return_from_main)
+ASGLOBAL(return_from_exception_handler)
+GLOBAL(return_from_main)
/*
* Regs r1-r30 are free. R31 is pointing at the word
* on the kernel stack where our pointer to the exception frame
@@ -1920,12 +1922,15 @@ LABEL(_return_from_main)
* and thread_bootstrap in luna88k/locore.c.
*
*/
-#ifdef MVME197
+#if (defined(MVME187) || defined(MVME188)) && defined(MVME197)
or.u r2, r0, hi16(_cputyp)
ld r3, r2, lo16(_cputyp)
cmp r2, r3, 0x197
bb1 eq, r2, m197_return_code
#endif
+
+ /* 18x part for return_from_exception_handler() follows... */
+#if defined(MVME187) || defined(MVME188)
#define FPTR r14
ld FPTR, r31, 0 /* grab exception frame pointer */
ld r3, FPTR, REG_OFF(EF_DMT0)
@@ -1939,7 +1944,6 @@ LABEL(_return_from_main)
ld r2, FPTR, REG_OFF(EF_VECTOR)
cmp r2, r2, 1 /* interrupt is exception #1 ; Is an interrupt? */
bb1 eq, r2, 1f
-LABEL(oops)
or.u r4, r0, hi16(2f)
or r4, r4, lo16(2f)
#if DDB
@@ -1981,15 +1985,17 @@ LABEL(oops)
* if there happens to be a data fault that hasn't been serviced yet,
* go off and service that...
*/
- CALL(_trap, T_DATAFLT, r30)
+ CALL(_C_LABEL(trap18x), T_DATAFLT, r30)
CALL(_data_access_emulation, r30, r0) /* really only 2 args */
/* clear the dmt0 word in the E.F. */
st r0 , FPTR, REG_OFF(EF_DMT0)
2:
br _check_ast
+#endif /* defined(MVME187) || defined(MVME188) */
+ /* 197 part for return_from_exception_handler() follows... */
#ifdef MVME197
-LABEL(m197_return_code)
+ASLOCAL(m197_return_code)
#define FPTR r14
ld FPTR, r31, 0 /* grab exception frame pointer */
ld r3, FPTR, REG_OFF(EF_DSR)
@@ -2004,7 +2010,6 @@ LABEL(m197_return_code)
ld r2, FPTR, REG_OFF(EF_VECTOR)
cmp r2, r2, 1 /* interrupt is exception #1 ; Is an interrupt? */
bb1 eq, r2, 1f
-LABEL(oops2)
or.u r4, r0, hi16(2f)
or r4, r4, lo16(2f)
#if DDB
@@ -2047,7 +2052,7 @@ LABEL(oops2)
* if there happens to be a data fault that hasn't been serviced yet,
* go off and service that...
*/
- CALL(_trap2, T_DATAFLT, r30)
+ CALL(_C_LABEL(trap197), T_DATAFLT, r30)
/* clear the dmt0 word in the E.F. */
st r0, FPTR, REG_OFF(EF_DSR)
@@ -2059,7 +2064,7 @@ LABEL(oops2)
* interrupts.
* If returning to user land, look for ASTs
*/
-LABEL(_check_ast)
+GLOBAL(check_ast)
ld r2, FPTR, REG_OFF(EF_EPSR) /* get pre-exception PSR */
bb1 PSR_INTERRUPT_DISABLE_BIT, r2, 1f /* skip if ints off */
@@ -2091,7 +2096,23 @@ LABEL(_check_ast)
* trap(AST,...) will service ast's.
*/
- CALL(_trap, T_ASTFLT, FPTR)
+#if defined(MVME187) || defined(MVME188)
+#if defined(MVME197)
+ or.u r2, r0, hi16(_cputyp)
+ ld r3, r2, lo16(_cputyp)
+ cmp r2, r3, 0x197
+ bb1 eq, r2, 1f
+#endif
+ CALL(_C_LABEL(trap18x), T_ASTFLT, FPTR)
+#if defined(MVME197)
+ br 2f
+1:
+#endif
+#endif
+#if defined(MVME197)
+ CALL(_C_LABEL(trap197), T_ASTFLT, FPTR)
+2:
+#endif
#if 0
/* assert that ipl is 0; if going back to user, it should be 0 */
@@ -2102,7 +2123,7 @@ LABEL(_check_ast)
2:
#endif
-_LABEL(no_ast)
+ASGLOBAL(no_ast)
/* disable interrupts */
@@ -2186,7 +2207,7 @@ _LABEL(no_ast)
ld r1, r31, GENREG_OFF(1)
ld.d r30, r31, GENREG_OFF(30)
-_LABEL(return_from_exception)
+ASGLOBAL(return_from_exception)
RTE
#ifdef MVME197
@@ -2195,160 +2216,160 @@ _LABEL(return_from_exception)
/*#########################################################################*/
/* unknown exception handler */
-LABEL(_m197_unknown_handler)
+GLOBAL(m197_unknown_handler)
PREP2("unknown", 0, DEBUG_UNKNOWN_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap197), T_UNKNOWNFLT, r30)
DONE(DEBUG_UNKNOWN_BIT)
/* interrupt exception handler */
-LABEL(_m197_interrupt_handler)
+GLOBAL(m197_interrupt_handler)
PREP2("interrupt", 1, DEBUG_INTERRUPT_BIT, No_SSBR_Stuff, No_Precheck)
CALL(_sbc_ext_int, 1, r30)
DONE(DEBUG_INTERRUPT_BIT)
/* instruction access exception handler */
-LABEL(_m197_instruction_access_handler)
+GLOBAL(m197_instruction_access_handler)
PREP2("inst", 2, DEBUG_INSTRUCTION_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_INSTFLT, r30)
+ CALL(_C_LABEL(trap197), T_INSTFLT, r30)
DONE(DEBUG_INSTRUCTION_BIT)
/*
* data access exception handler --
* See badaddr() below for info about Data_Precheck.
*/
-LABEL(_m197_data_exception_handler)
+GLOBAL(m197_data_exception_handler)
PREP2("data", 3, DEBUG_DATA_BIT, No_SSBR_Stuff, M197_Data_Precheck)
DONE(DEBUG_DATA_BIT)
/* misaligned access exception handler */
-LABEL(_m197_misaligned_handler)
+GLOBAL(m197_misaligned_handler)
PREP2("misalign", 4, DEBUG_MISALIGN_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_MISALGNFLT, r30)
+ CALL(_C_LABEL(trap197), T_MISALGNFLT, r30)
DONE(DEBUG_MISALIGN_BIT)
/* unimplemented opcode exception handler */
-LABEL(_m197_unimplemented_handler)
+GLOBAL(m197_unimplemented_handler)
PREP2("unimp", 5, DEBUG_UNIMPLEMENTED_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_ILLFLT, r30)
+ CALL(_C_LABEL(trap197), T_ILLFLT, r30)
DONE(DEBUG_UNIMPLEMENTED_BIT)
/* privilege exception handler */
-LABEL(_m197_privilege_handler)
+GLOBAL(m197_privilege_handler)
PREP2("privilege", 6, DEBUG_PRIVILEGE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_PRIVINFLT, r30)
+ CALL(_C_LABEL(trap197), T_PRIVINFLT, r30)
DONE(DEBUG_PRIVILEGE_BIT)
/*
* I'm not sure what the trap(T_BNDFLT,...) does, but it doesn't send
* a signal to the process...
*/
-LABEL(_m197_bounds_handler)
+GLOBAL(m197_bounds_handler)
PREP2("bounds", 7, DEBUG_BOUNDS_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_BNDFLT, r30)
+ CALL(_C_LABEL(trap197), T_BNDFLT, r30)
DONE(DEBUG_BOUNDS_BIT)
/* integer divide-by-zero exception handler */
-LABEL(_m197_divide_handler)
+GLOBAL(m197_divide_handler)
PREP2("divide", 8, DEBUG_DIVIDE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_ZERODIV, r30)
+ CALL(_C_LABEL(trap197), T_ZERODIV, r30)
DONE(DEBUG_DIVIDE_BIT)
/* integer overflow exception handelr */
-LABEL(_m197_overflow_handler)
+GLOBAL(m197_overflow_handler)
PREP2("overflow", 9, DEBUG_OVERFLOW_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_OVFFLT, r30)
+ CALL(_C_LABEL(trap197), T_OVFFLT, r30)
DONE(DEBUG_OVERFLOW_BIT)
/* Floating-point precise handler */
-LABEL(_m197_fp_precise_handler)
+GLOBAL(m197_fp_precise_handler)
PREP2("FPU precise", 114, DEBUG_FPp_BIT, No_SSBR_Stuff, No_Precheck)
CALL(_m88110_Xfp_precise, r0, r30) /* call fp_precise(??, exception_frame)*/
DONE(DEBUG_FPp_BIT)
/* MVME197 non-maskable interrupt handler */
-LABEL(_m197_nonmaskable)
+GLOBAL(m197_nonmaskable)
PREP2("MVME197 non-mask", 11, DEBUG_NON_MASK_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_NON_MASK, r30)
+ CALL(_C_LABEL(trap197), T_NON_MASK, r30)
DONE(DEBUG_NON_MASK_BIT)
/* MVME197 data MMU read miss handler */
-LABEL(_m197_data_read_miss)
+GLOBAL(m197_data_read_miss)
PREP2("MVME197 read miss", 12, DEBUG_197_READ_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_197_READ, r30)
+ CALL(_C_LABEL(trap197), T_197_READ, r30)
DONE(DEBUG_197_READ_BIT)
/* MVME197 data MMU write miss handler */
-LABEL(_m197_data_write_miss)
+GLOBAL(m197_data_write_miss)
PREP2("MVME197 write miss", 13, DEBUG_197_WRITE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_197_WRITE, r30)
+ CALL(_C_LABEL(trap197), T_197_WRITE, r30)
DONE(DEBUG_197_WRITE_BIT)
/* MVME197 inst MMU ATC miss handler */
-LABEL(_m197_inst_atc_miss)
+GLOBAL(m197_inst_atc_miss)
PREP2("MVME197 inst miss", 14, DEBUG_197_INST_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_197_INST, r30)
+ CALL(_C_LABEL(trap197), T_197_INST, r30)
DONE(DEBUG_197_INST_BIT)
/* All standard system calls. */
-LABEL(_m197_syscall_handler)
+GLOBAL(m197_syscall_handler)
PREP2("syscall", 128, DEBUG_SYSCALL_BIT, No_SSBR_Stuff, No_Precheck)
ld r13, r30, GENREG_OFF(13)
CALL(_m197_syscall, r13, r30) /* system call no. is in r13 */
DONE(DEBUG_SYSCALL_BIT)
/* trap 496 comes here */
-LABEL(_m197_bugtrap)
+GLOBAL(m197_bugtrap)
PREP2("bugsyscall", 496, DEBUG_BUGCALL_BIT, No_SSBR_Stuff, No_Precheck)
ld r9, r30, GENREG_OFF(9)
CALL(_bugsyscall, r9, r30) /* system call no. is in r9 */
DONE(DEBUG_SYSCALL_BIT)
-LABEL(_m197_sigsys)
+GLOBAL(m197_sigsys)
PREP2("sigsys", 0, DEBUG_SIGSYS_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_SIGSYS, r30)
+ CALL(_C_LABEL(trap197), T_SIGSYS, r30)
DONE(DEBUG_SIGSYS_BIT)
-LABEL(_m197_sigtrap)
+GLOBAL(m197_sigtrap)
PREP2("sigtrap", 0, DEBUG_SIGTRAP_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_SIGTRAP, r30)
+ CALL(_C_LABEL(trap197), T_SIGTRAP, r30)
DONE(DEBUG_SIGTRAP_BIT)
-LABEL(_m197_stepbpt)
+GLOBAL(m197_stepbpt)
PREP2("sigtrap", 0, DEBUG_SIGTRAP_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_STEPBPT, r30)
+ CALL(_C_LABEL(trap197), T_STEPBPT, r30)
DONE(DEBUG_SIGTRAP_BIT)
-LABEL(_m197_userbpt)
+GLOBAL(m197_userbpt)
PREP2("sigtrap", 0, DEBUG_SIGTRAP_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_USERBPT, r30)
+ CALL(_C_LABEL(trap197), T_USERBPT, r30)
DONE(DEBUG_SIGTRAP_BIT)
#if DDB
- LABEL(_m197_break)
+ GLOBAL(m197_break)
PREP2("break", 130, DEBUG_BREAK_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_KDB_BREAK, r30)
+ CALL(_C_LABEL(trap197), T_KDB_BREAK, r30)
DONE(DEBUG_BREAK_BIT)
- LABEL(_m197_trace)
+ GLOBAL(m197_trace)
PREP2("trace", 131, DEBUG_TRACE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_KDB_TRACE, r30)
+ CALL(_C_LABEL(trap197), T_KDB_TRACE, r30)
DONE(DEBUG_TRACE_BIT)
- LABEL(_m197_entry)
+ GLOBAL(m197_entry)
PREP2("kdb", 132, DEBUG_KDB_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_KDB_ENTRY, r30)
+ CALL(_C_LABEL(trap197), T_KDB_ENTRY, r30)
DONE(DEBUG_KDB_BIT)
#else /* else not DDB */
- LABEL(_m197_break)
+ GLOBAL(m197_break)
PREP2("break", 130, DEBUG_BREAK_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap197), T_UNKNOWNFLT, r30)
DONE(DEBUG_BREAK_BIT)
- LABEL(_m197_trace)
+ GLOBAL(m197_trace)
PREP2("trace", 131, DEBUG_TRACE_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap197), T_UNKNOWNFLT, r30)
DONE(DEBUG_TRACE_BIT)
- LABEL(_m197_entry)
+ GLOBAL(m197_entry)
PREP2("unknown", 132, DEBUG_UNKNOWN_BIT, No_SSBR_Stuff, No_Precheck)
- CALL(_trap2, T_UNKNOWNFLT, r30)
+ CALL(_C_LABEL(trap197), T_UNKNOWNFLT, r30)
DONE(DEBUG_KDB_BIT)
#endif /* DDB */
@@ -2365,7 +2386,7 @@ LABEL(_m197_userbpt)
* We'll not worry about trashing r26-29 here,
* since they aren't generally used.
*/
-LABEL(_m197_error_handler)
+GLOBAL(m197_error_handler)
/* pick up the slavestack */
or r26, r0, r31 /* save old stack */
or.u r31, r0, hi16(_intstack_end)
@@ -2454,7 +2475,8 @@ LABEL(_m197_error_handler)
stcr r1, PSR
FLUSH_PIPELINE
-LABEL(m197_error_loop) bsr m197_error_loop
+ASGLOBAL(m197_error_loop)
+ bsr m197_error_loop
/* never returns*/
/*
@@ -2476,7 +2498,7 @@ LABEL(m197_error_loop) bsr m197_error_loop
* We'll not worry about trashing r26-29 here,
* since they aren't generally used.
*/
-LABEL(_m197_reset_handler)
+GLOBAL(m197_reset_handler)
/* pick up the slavestack */
or r26, r0, r31 /* save old stack */
or.u r31, r0, hi16(_intstack_end)
@@ -2565,11 +2587,12 @@ LABEL(_m197_reset_handler)
stcr r1, PSR
FLUSH_PIPELINE
-LABEL(m197_error_loop2) bsr m197_error_loop2
+ASGLOBAL(m197_error_loop2)
+ bsr m197_error_loop2
/* never returns*/
-LABEL(m197_setup_phase_one)
+ASGLOBAL(m197_setup_phase_one)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread (if any, null if not) *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -2597,7 +2620,7 @@ LABEL(m197_setup_phase_one)
bb0 FLAG_FROM_KERNEL, FLAGS, m197_pickup_stack
/* Interrupt in kernel mode, not FPU restart */
-_LABEL(m197_already_on_kernel_stack)
+ASGLOBAL(m197_already_on_kernel_stack)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread (if any, null if not) *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -2622,7 +2645,7 @@ _LABEL(m197_already_on_kernel_stack)
st r1, r31, GENREG_OFF(31)
-_LABEL(m197_use_SR3_pcb)
+ASGLOBAL(m197_use_SR3_pcb)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread (if any, null if not) *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -2678,10 +2701,10 @@ _LABEL(m197_use_SR3_pcb)
ld r1, r30, GENREG_OFF(0) /* restore old r1 */
st r0, r30, GENREG_OFF(0) /* repair that frame */
st r1, r31, GENREG_OFF(1) /* store r1 in its proper place */
- br.n have_pcb
+ br.n m197_have_pcb
xcr r30, r30, SR3 /* restore r30 */
-_LABEL(m197_pickup_stack)
+ASGLOBAL(m197_pickup_stack)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -2706,7 +2729,7 @@ _LABEL(m197_pickup_stack)
st r1, r31, GENREG_OFF(31)
/*FALLTHROUGH */
-_LABEL(m197_have_pcb)
+ASGLOBAL(m197_have_pcb)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: current thread *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -2762,7 +2785,7 @@ _LABEL(m197_have_pcb)
/************************************************************************/
/************************************************************************/
-LABEL(m197_setup_phase_two)
+ASGLOBAL(m197_setup_phase_two)
/***************** REGISTER STATUS BLOCK ***********************\
* SR0: saved return address to calling exception handler *
* SR1: saved copy of exception-time register now holding FLAGS *
@@ -2838,7 +2861,7 @@ LABEL(m197_setup_phase_two)
NOP
RTE /* jumps to "fpu_enable" on the next line to enable the FPU. */
-_LABEL(m197_fpu_enable)
+ASGLOBAL(m197_fpu_enable)
FLUSH_PIPELINE
xcr TMP, TMP, SR3 /* get E.F. pointer */
st.d r30, TMP, GENREG_OFF(30) /* save previous r30, r31 */
@@ -2986,7 +3009,7 @@ m197_exception_handler_has_ksp: global m197_exception_handler_has_ksp
*/
or r15, r0, r30
- CALL(_trap2, T_DATAFLT, r15)
+ CALL(_C_LABEL(trap197), T_DATAFLT, r15)
/* restore it... */
or r30, r0, r15
@@ -2994,7 +3017,7 @@ m197_exception_handler_has_ksp: global m197_exception_handler_has_ksp
/* clear the dsr word in the E.F */
st r0, r30, REG_OFF(EF_DSR)
-_LABEL(m197_return_to_calling_exception_handler)
+ASGLOBAL(m197_return_to_calling_exception_handler)
jmp r14 /* loaded above */
#endif
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S
index a4ce2c15036..5ac6f5ad50d 100644
--- a/sys/arch/mvme88k/mvme88k/locore.S
+++ b/sys/arch/mvme88k/mvme88k/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.18 2001/08/15 21:27:20 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.19 2001/08/24 22:53:14 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -69,10 +69,6 @@
/***********************************************************************/
-#ifndef UADDR
-#define UADDR 0xEEE00000 /* address of u */
-#endif /* UADDR */
-
/*
* The memory looks like:
* 0x00000 - 0x01000 : trap vectors
@@ -83,26 +79,26 @@
***********************************************************************/
text
-LABEL(_kernelstart)
-LABEL(_kernel_text)
-LABEL(_start)
-LABEL(start)
- br _start_text
- br _start_text
- br _start_text
- br _start_text
+GLOBAL(kernelstart)
+GLOBAL(kernel_text)
+GLOBAL(start)
+ASGLOBAL(start)
+ br _C_LABEL(start_text)
+ br _C_LABEL(start_text)
+ br _C_LABEL(start_text)
+ br _C_LABEL(start_text)
-ENTRY(doboot)
+GLOBAL(doboot)
/*
* Try hitting the SRST bit in VMEchip2 to reset the system.
*/
#ifdef MVME188
/* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
+ or.u r4, r0, hi16(_C_LABEL(cputyp))
+ ld r3, r4, lo16(_C_LABEL(cputyp))
cmp r4, r3, 0x188
bb1 ne, r4, 1f
- bsr _m188_reset
+ bsr _C_LABEL(m188_reset)
br m188_doboot_fail
#endif /* MVME188 */
1:
@@ -115,8 +111,8 @@ ENTRY(doboot)
* We will be here if the reset above failed. In this case,
* we will try to return to bug.
*
- * Switch to interrupt stack and call __doboot to take care
- * going to BUG. Need to do this since __doboot turns off the
+ * Switch to interrupt stack and call _doboot to take care
+ * going to BUG. Need to do this since _doboot turns off the
* the MMU and we need to be on a 1-to-1 mapped stack so that
* further calls don't get data access exceptions.
*/
@@ -127,11 +123,11 @@ m188_doboot_fail:
or r31, r31, lo16(_intstack_end)
clr r31, r31, 3<0> /* round down to 8-byte boundary */
- bsr __doboot
+ bsr _C_LABEL(_doboot)
/*NOTREACHED*/
/**************************************************************************/
-LABEL(_start_text) /* This is the *real* start upon poweron or reset */
+GLOBAL(start_text) /* This is the *real* start upon poweron or reset */
/*
* Args passed by boot loader
* r2 howto
@@ -228,19 +224,19 @@ LABEL(_start_text) /* This is the *real* start upon poweron or reset */
*/
or.u r11, r0, hi16(initialized_cpu_lock)
or r11, r11, lo16(initialized_cpu_lock)
-_LABEL(check_init_lock)
+ASGLOBAL(check_init_lock)
FLUSH_PIPELINE
or r22, r0, 1
xmem r22, r11, r0 /* If r22 gets 0, we have the lock.. */
bcnd eq0, r22, have_init_lock/* ..but if not, we must wait */
-_LABEL(wait_for_init_lock)
+ASGLOBAL(wait_for_init_lock)
/* just watch the lock until it looks clear */
ld r22, r11, r0
bcnd eq0, r22, check_init_lock
br wait_for_init_lock /* looks clear -- try to grab */
-_LABEL(have_init_lock)
+ASGLOBAL(have_init_lock)
FLUSH_PIPELINE
or.u r11, r0, hi16(_initialized_cpus)
ld r22, r11, lo16(_initialized_cpus)
@@ -256,24 +252,24 @@ _LABEL(have_init_lock)
*/
or.u r11, r0, hi16(_inter_processor_lock)
or r11, r11, lo16(_inter_processor_lock)
-_LABEL(check_ip_lock)
+ASGLOBAL(check_ip_lock)
FLUSH_PIPELINE
or r22, r0, 1
xmem r22, r11, r0 /* If r22 gets 0, we have the lock.. */
bcnd eq0, r22, have_ip_lock /* ..but if not, we must wait */
-_LABEL(wait_for_ip_lock)
+ASGLOBAL(wait_for_ip_lock)
/* just watch the lock until it looks clear */
ld r22, r11, r0
bcnd ne0, r22, wait_for_ip_lock
/* since we can be here with caches off, add a few nops to
keep the bus from getting overloaded */
or r2, r0, lo16(1000)
-_LABEL(ip_loop)
+ASGLOBAL(ip_loop)
subu r2, r2, 1
bcnd eq0, r2, ip_loop
br check_ip_lock /* looks clear -- try to grab */
-_LABEL(have_ip_lock)
+ASGLOBAL(have_ip_lock)
/* now try to grab the master_processor_chosen prize */
FLUSH_PIPELINE
or.u r11, r0, hi16(master_processor_chosen)
@@ -293,7 +289,7 @@ _LABEL(have_ip_lock)
bcnd ne0, r22, slave_start
/* fall through to master start if that's appropriate */
-_LABEL(master_start)
+ASGLOBAL(master_start)
/*
* Switch to interrupt stack
* Use idle_u's stack instead?
@@ -358,7 +354,7 @@ _LABEL(master_start)
/***********************************************************************
* slave CPUs starts here
*/
-_LABEL(slave_start)
+ASGLOBAL(slave_start)
/* while holding the inter_processor_lock, the slave cpu
can find use the slavestack to call slave_pre_main and
determine its cpu number. After that, however, it should
@@ -386,7 +382,7 @@ _LABEL(slave_start)
br.n _slave_main /* does not return */
subu r31, r31, 40 /* allocate frame */
-_LABEL(_spin_cpu)
+GLOBAL(spin_cpu)
or.u r3, r0, hi16(_start_text)
or r3, r3, lo16(_start_text)
or r9, r0, 0x100 /* .FORKMPU */
@@ -421,16 +417,16 @@ _ret_addr:
global _msgsw
_msgsw:
word 0 /* Bits here turn on/off debugging somewhere */
-_LABEL(initialized_cpu_lock)
+ASGLOBAL(initialized_cpu_lock)
/* XMEM spin lock -- to count CPUs */
word 0
-LABEL(_initialized_cpus)
+GLOBAL(initialized_cpus)
/* CPU counter to initialize */
word 0
-_LABEL(master_processor_chosen)
+ASGLOBAL(master_processor_chosen)
/* The first processor that XMEMs this becomes the master */
word 0
-LABEL(_inter_processor_lock)
+GLOBAL(inter_processor_lock)
/* XMEM spin lock -- controls access to master_processor_chosen */
word 0
diff --git a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
index 65d484dd338..1e6f85f06ca 100644
--- a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
+++ b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore_asm_routines.S,v 1.15 2001/06/27 04:29:19 art Exp $ */
+/* $OpenBSD: locore_asm_routines.S,v 1.16 2001/08/24 22:53:15 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -27,22 +27,16 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
-/* locore_asm_routines.c
- *
- **********************************************************************
- * This file created by Omron Corporation, 1990.
- *
- * HISTORY
- *
- **************************************************************RCS*****/
#include "assym.h"
-#include <machine/trap.h>
-#include <machine/cpu_number.h>
-#include <machine/board.h>
-#include <machine/asm.h>
+
#include <sys/errno.h>
+#include <machine/asm.h>
+#include <machine/board.h>
+#include <machine/cpu_number.h>
+#include <machine/trap.h>
+
/*****************************************************************************
* DO_LOAD_ADDRESS
*
@@ -57,7 +51,7 @@
ENTRY(do_load_word) /* do_load_word(address, supervisor) */
bcnd ne0,r3,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.usr r2,r2,r0
NOP
@@ -72,7 +66,7 @@ ENTRY(do_load_word) /* do_load_word(address, supervisor) */
ENTRY(do_load_half) /* do_load_half(address, supervisor) */
bcnd ne0,r3,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.h.usr r2,r2,r0
NOP
@@ -87,7 +81,7 @@ ENTRY(do_load_half) /* do_load_half(address, supervisor) */
ENTRY(do_load_byte) /* do_load_byte(address, supervisor) */
bcnd ne0,r3,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.b.usr r2,r2,r0
NOP
@@ -102,7 +96,7 @@ ENTRY(do_load_byte) /* do_load_byte(address, supervisor) */
ENTRY(do_store_word) /* do_store_word(address, data, supervisor) */
bcnd ne0,r4,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.usr r3,r2,r0
NOP
@@ -117,7 +111,7 @@ ENTRY(do_store_word) /* do_store_word(address, data, supervisor) */
ENTRY(do_store_half) /* do_store_half(address, data, supervisor) */
bcnd ne0,r4,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.h.usr r3,r2,r0
NOP
@@ -132,7 +126,7 @@ ENTRY(do_store_half) /* do_store_half(address, data, supervisor) */
ENTRY(do_store_byte) /* do_store_byte(address, data, supervisor) */
bcnd ne0,r4,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.b.usr r3,r2,r0
NOP
@@ -147,7 +141,7 @@ ENTRY(do_store_byte) /* do_store_byte(address, data, supervisor) */
ENTRY(do_xmem_word) /* do_xmem_word(address, data, supervisor) */
bcnd ne0,r4,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
xmem.usr r3,r2,r0
NOP
@@ -162,7 +156,7 @@ ENTRY(do_xmem_word) /* do_xmem_word(address, data, supervisor) */
ENTRY(do_xmem_byte) /* do_xmem_byte(address, data, supervisor) */
bcnd ne0,r4,1f
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
xmem.bu.usr r3,r2,r0
NOP
@@ -175,313 +169,7 @@ ENTRY(do_xmem_byte) /* do_xmem_byte(address, data, supervisor) */
1: xmem.bu r3,r2,r0
2: jmp r1
- .data
-
-/*
- * reserve MAX_CPUS words for lockinit and lockeach;
- * counters for simple_lock_init calls and lock acquisition calls.
- */
-
-LABEL(lockinit)
- zero 4*MAX_CPUS
-
-LABEL(lockuse)
- zero 4*MAX_CPUS
-
-LABEL(lockpause)
- zero 4*MAX_CPUS
-
- .text
-
-/*************************************************************************/
-/****************** SIMPLE LOCK OPERATIONS *****************************/
-/*************************************************************************/
-
-#ifdef done_in_kernel
-/*************************************************************
- *************************************************************
- **
- ** void simple_lock_init(int *lock_data)
- ** {
- ** *lock_data = 0;
- ** }
- **
- ** void simple_unlock(simple_lock_t *)
- ** {
- ** *lock_data = 0;
- ** }
- **/
-#undef simple_unlock
-ENTRY(simple_lock_init)
- st r0, r2, 0 /* init */
-
- ldcr r2, SR1
- extu r2, r2, FLAG_CPU_FIELD_WIDTH<0> /* r2 = cpu# */
- mask r2, r2, 3 /* play it safe */
- or.u r3, r0, hi16(lockinit)
- or r3, r3, lo16(lockinit)
- ld r4, r3[r2]
- addu r4, r4, 1
- jmp.n r1
- st r4, r3[r2]
-
-ENTRY(simple_unlock)
- jmp.n r1
- st r0, r2, 0
-
-#if DDB
-/* version of simple_unlock for the debugger - should be identical to
- simple_unlock, but should never have breakpoints inserted on it */
-ENTRY(db_simple_unlock)
- jmp.n r1
- st r0, r2, 0
-#endif
-
-/**
- ** Simple_lock
- **
- ** Returns when the lock is taken. It also increments lockuse[cpu]
- **/
-ENTRY(simple_lock)
- /* do r3 = test_and_set(r2, 1) */
- or r3, r0, 1
- xmem r3, r2, r0
- bcnd ne0, r3, 1f
-#if 0
- ldcr r5, SR1
- extu r5, r5, FLAG_CPU_FIELD_WIDTH<0> /* r5 = cpu# */
- mask r5, r5, 3 /* play it safe */
- or.u r3, r0, hi16(lockuse)
- or r3, r3, lo16(lockuse)
- ld r4, r3[r5]
- addu r4, r4, 1
- st r4, r3[r5]
-#endif
- jmp r1
-
-1:
- /* wait until the lock appears to be free */
- or.u r4, r0, 0x0300
-2:
- subu r4, r4, 1
- bcnd eq0, r4, _simple_lock_too_long
- ld r3, r2, 0 /* check lock */
- bcnd ne0, r3, 2b
- br _simple_lock /* looks free... check again with the xmem */
-
-ENTRY(simple_lock_too_long)
-#ifdef JEFF_DEBUG
- /* just want to break here.... */
- tb0 0, r0 , 0x84 /* gimmeabreak */
-#else
- /* waited too long */
- subu r31, r31, 0x40
- st r1, r31, 0x30
- st r30, r31, 0x34
- st r2, r31, 0x38
- or r3, r0, r1
-#if 0
- bsr _report_lock_info
-#endif
- ld r2, r31, 0x38
- ld r30, r31, 0x34
- ld r1, r31, 0x30
- addu r31, r31, 0x40
- br _simple_lock
-#endif /* JEFF_DEBUG */
-
-
-#if DDB
-/*
- * Version of simple_lock for the kernel debugger; should never have
- * breakpoints set on it. Should be kept consistent with simple_lock.
- */
-ENTRY(db_simple_lock)
- /* do r10 = test_and_set(r2, 1) */
- or r10, r0, 1
- xmem r10, r2, r0
- bcnd ne0, r10, db_simple_lock_watch
-
- ldcr r2, SR1
- extu r2, r2, FLAG_CPU_FIELD_WIDTH<0> /* r2 = cpu# */
- mask r2, r2, 3 /* play it safe */
- or.u r3, r0, hi16(lockuse)
- or r3, r3, lo16(lockuse)
- ld r4, r3[r2]
- addu r4, r4, 1
- jmp.n r1
- st r4, r3[r2]
-
-db_simple_lock_watch:
- /* wait until the lock appears to be free */
-3:
- ld r10, r2, 0
- bcnd ne0, r10, 3b
- br _db_simple_lock /* looks free... check again with the xmem */
-#endif /* DDB */
-
-/*************************************************************
- *************************************************************
- **
- ** boolean_t simple_try_lock(simple_lock_t *);
- **
- ** Grab the lock if it's free. Return zero if the lock was
- ** busy, non-zero if the lock has been taken.
- **/
-ENTRY(simple_lock_try)
- or r3, r0, 1 /* r3 := test_and_set(r2, 1) */
- xmem r3, r2, r0
- /* If r3 is now zero, we hold the lock -- return non-zero. */
- /* If r3 is now one, we didn't get it -- return zero. */
- /* Thus, we want to "return(!r3)" */
- cmp r4, r3, r0
- jmp.n r1
- extu r2, r4, 1<2>
-
-#if DDB
-/* version for the kernel debugger - keep consistent with above */
-ENTRY(db_simple_lock_try)
- or r3, r0, 1 /* r3 := test_and_set(r2, 1) */
- xmem r3, r2, r0
- /* If r3 is now zero, we hold the lock -- return non-zero. */
- /* If r3 is now one, we didn't get it -- return zero. */
- /* Thus, we want to "return(!r3)" */
- cmp r4, r3, r0
- jmp.n r1
- extu r2, r4, 1<2>
-#endif
-
-#if DDB /* version for the debugger */
-ENTRY(db_simple_lock_held)
- jmp.n r1
- ld r2, r2, 0
-#endif
-
-/*
- * void simple_lock_pause(void).
- *
- * This routine is called when we find a simple lock held that we wish to
- * acquire, but cannot spin on because we are holding a lock that is in the
- * wrong order to it with respect to the locking hierarchy. Once we drop the
- * lock we are holding, however, we cannot assume the lock we were trying to
- * acquire is not deallocated. Consequently, we drop the lock we are holding
- * and wait for a while, then retry. This is the wait for a while routine.
- *
- * We define a array of counters[cpus], lockpause
- * to tell use how many times this routine is called.
- * We currently wait 128 cycles per call.
- */
-
-ENTRY(simple_lock_pause)
- ldcr r2, SR1
- extu r2, r2, FLAG_CPU_FIELD_WIDTH<0> /* r2 = cpu# */
- mask r2, r2, 3 /* play it safe */
- or.u r3, r0, hi16(lockpause)
- or r3, r3, lo16(lockpause)
- ld r4, r3[r2]
- or r5, r0, 128 /* initialize counters*/
-1: subu r5, r5, 1 /* count down */
- bcnd ne0, r5, 1b
- addu r4, r4, 1
- jmp.n r1 /* return*/
- st r4, r3[r2]
-
-#endif /* done_in_kernel */
-
-#ifdef now_in_c
-/*************************************************************************
- *************************************************************************
- **
- ** void get_psr(unsigned psr)
- **
- ** Enables processor interrupts (for the executing cpu).
- **/
-#undef get_psr
-ENTRY(get_psr)
- ldcr r2, PSR
- jmp r1
-
-/*************************************************************************
- *************************************************************************
- **
- ** void set_psr(unsigned psr)
- **
- ** Enables processor interrupts (for the executing cpu).
- **/
-
-#undef set_psr
-ENTRY(set_psr)
- stcr r2, PSR
- FLUSH_PIPELINE
- jmp r1
-
-/*************************************************************************
- *************************************************************************
- **
- ** void enable_interrupt(void)
- **
- ** Enables processor interrupts (for the executing cpu).
- **/
-#undef enable_interrupt
-ENTRY(enable_interrupt)
- ldcr r2, PSR
- clr r2, r2, 1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r2, PSR
- FLUSH_PIPELINE
- jmp r1
-
-#if DDB
-/* a version of enable_interrupt for the debugger; should never
- have breakpoints set it in. Keep it consistent with enable
- interrupt above */
-ENTRY(db_enable_interrupt)
- ldcr r2, PSR
- clr r2, r2, 1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r2, PSR
- FLUSH_PIPELINE
- jmp r1
-#endif /* DDB */
-
-/*************************************************************************
- *************************************************************************
- **
- ** unsigned long disable_interrupt(void)
- **
- ** Disables processor interrupts (for the executing CPU) and returns
- ** the *previous* PSR.
- **
- ** if ((oldPSR & 0x02) == 0)
- ** interrupts_were_previously_on = 1;
- **/
-#undef disable_interrupt
-ENTRY(disable_interrupt)
- ldcr r2, PSR
- set r3, r2, 1<PSR_INTERRUPT_DISABLE_BIT> /* set disable bit*/
- stcr r3, PSR
- FLUSH_PIPELINE
- jmp r1
-
-#if DDB
-ENTRY(db_disable_interrupt)
- ldcr r2, PSR
- set r3, r2, 1<PSR_INTERRUPT_DISABLE_BIT> /* set disable bit*/
- stcr r3, PSR
- FLUSH_PIPELINE
- jmp r1
-#endif /* DDB */
-
-#endif /* now_in_c */
-
-ENTRY(are_interrupts_disabled)
- ldcr r2, PSR /* get the processor status word */
- set r3, r0, 1<PSR_INTERRUPT_DISABLE_BIT> /* set mask */
- jmp.n r1 /* delayed return */
- and r2, r2, r3 /* r2 = r3 & r2 */
-
-
-/* version for the debugger */
#if DDB
-
ENTRY(db_are_interrupts_disabled)
ldcr r2, PSR /* get the processor status word */
set r3, r0, 1<PSR_INTERRUPT_DISABLE_BIT> /* set mask */
@@ -489,12 +177,10 @@ ENTRY(db_are_interrupts_disabled)
and r2, r2, r3 /* r2 = r3 & r2 */
#endif /* DDB */
-LABEL(_FAULT_ERROR)
+GLOBAL(FAULT_ERROR)
or r2,r0,1 /* bad copy */
jmp r1
-/* LABEL(_ALLOW_FAULT_START) */
-
/*
* Fetch from user space
* r2 == address in user space
@@ -507,7 +193,7 @@ ENTRY(fuiword)
or.u r5, r0, hi16(fusu_fault)
or r5, r5, lo16(fusu_fault)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.usr r5, r0, r2
NOP
@@ -533,7 +219,7 @@ ENTRY(fusword)
or.u r5, r0, hi16(fusu_fault)
or r5, r5, lo16(fusu_fault)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.h.usr r5, r0, r2
NOP
@@ -552,7 +238,7 @@ ENTRY(fuibyte)
or.u r5, r0, hi16(fusu_fault)
or r5, r5, lo16(fusu_fault)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.b.usr r5, r0, r2
NOP
@@ -570,7 +256,7 @@ ENTRY(fuswintr)
or.u r5, r0, hi16(_fubail)
or r5, r5, lo16(_fubail)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fubail */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.h.usr r5, r2, r0
NOP
@@ -599,7 +285,7 @@ ENTRY(suiword)
or.u r5, r0, hi16(fusu_fault)
or r5, r5, lo16(fusu_fault)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.usr r3, r2, r0
NOP
@@ -617,7 +303,7 @@ ENTRY(susword)
or.u r5, r0, hi16(fusu_fault)
or r5, r5, lo16(fusu_fault)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.h.usr r3, r2, r0
NOP
@@ -636,7 +322,7 @@ ENTRY(suibyte)
or.u r5, r0, hi16(fusu_fault)
or r5, r5, lo16(fusu_fault)
st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.b.usr r3, r2, r0
NOP
@@ -654,7 +340,7 @@ ENTRY(suswintr)
or.u r5, r0, hi16(_subail)
or r5, r5, lo16(_subail)
st r5, r6, PCB_ONFAULT /* pcb_onfault = subail */
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.h.usr r3, r2, r0
NOP
@@ -670,40 +356,6 @@ ENTRY(subail)
subu r2, r0, 1
br fusu_ret
-#if 0
-/*
- * copystr(fromaddr, toaddr, maxlength, &lencopied)
- *
- * Copy a null terminated string from one point to another in
- * the kernel address space.
- */
-ENTRY(copystr)
- or r6,r0,0
- bcnd lt0,r4,Lcsflt1 /* negative count, error */
- bcnd eq0,r4,Lcsdone /* zero count, all done */
-Lcsloop:
- ld r8,r2,r6 /* copy a byte */
- st r8,r3,r6
- addu r6,r6,1 /* bump the index */
- bcnd eq0,r8,Lcsdone /* if null, done */
- subu r4,r4,1 /* decrement count to copy */
- bcnd ne0,r4,Lcsloop /* if more to copy, loop */
- br Lcsflt2 /* ran out of room, error */
-Lcsdone:
- bcnd eq0, r5, Lcsret /* if return len not desired, return */
- st r6,r5,0 /* stash it */
-Lcsret:
- or r2,r0,0 /* good status */
- jmp r1
-Lcsflt1:
- or r2,r0,EFAULT /* return fault */
- br Lcsdone
-Lcsflt2:
- or r2,r0,ENAMETOOLONG /* ran out of space */
- br Lcsdone
-Lcsdone:
- jmp r1
-#endif /* 0 */
/*
* Copy specified amount of data from user space into the kernel
* copyin(from, to, len)
@@ -759,7 +411,7 @@ copyin_right_aligned_to_word:
or r7, r0, 4
copyin_right_aligned_to_doubleword:
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.usr r5, SRC, r0
NOP
@@ -785,7 +437,7 @@ copyin_right_aligned_to_doubleword:
/***************************************************/
copyin_left_align_to_halfword:
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.b.usr r5, SRC, r0
NOP
@@ -801,7 +453,7 @@ copyin_left_align_to_halfword:
addu DEST, DEST, 1
copyin_left_align_to_word:
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.h.usr r5, SRC, r0
NOP
@@ -818,7 +470,7 @@ copyin_left_align_to_word:
copyin_right_align_to_halfword:
subu LEN, LEN, 1
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.b.usr r5, SRC, LEN
NOP
@@ -832,7 +484,7 @@ copyin_right_align_to_halfword:
copyin_right_align_to_word:
subu LEN, LEN, 2
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.h.usr r5, SRC, LEN
NOP
@@ -846,7 +498,7 @@ copyin_right_align_to_word:
copyin_right_align_to_doubleword:
subu LEN, LEN, 4
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.usr r5, SRC, LEN
NOP
@@ -864,7 +516,7 @@ copyin_byte_only:
bcnd eq0, LEN, 2f
1:
subu LEN, LEN, 1
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.b.usr r5, SRC, LEN
NOP
@@ -920,7 +572,7 @@ ENTRY(copyinstr)
bcnd eq0, CNT, .Lcisdone
or r6, r0, 0
1:
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
ld.bu.usr r7, SRC, r6
NOP
@@ -1015,7 +667,7 @@ copyout_right_aligned_to_doubleword:
ld r5, SRC, r0
ld r6, SRC, r7
subu LEN, LEN, 8
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.usr r5, DEST, r0
NOP
@@ -1025,7 +677,7 @@ copyout_right_aligned_to_doubleword:
st.usr r5, DEST, r0
#endif
addu SRC, SRC, 8
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.usr r6, DEST, r7
NOP
@@ -1043,7 +695,7 @@ copyout_right_aligned_to_doubleword:
copyout_left_align_to_halfword:
ld.b r5, SRC, r0
subu LEN, LEN, 1
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.b.usr r5, DEST, r0
NOP
@@ -1059,7 +711,7 @@ copyout_left_align_to_halfword:
copyout_left_align_to_word:
ld.h r5, SRC, r0
subu LEN, LEN, 2
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.h.usr r5, DEST, r0
NOP
@@ -1075,7 +727,7 @@ copyout_left_align_to_word:
copyout_right_align_to_halfword:
subu LEN, LEN, 1
ld.b r5, SRC, LEN
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.b.usr r5, DEST, LEN
NOP
@@ -1090,7 +742,7 @@ copyout_right_align_to_halfword:
copyout_right_align_to_word:
subu LEN, LEN, 2
ld.h r5, SRC, LEN
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.h.usr r5, DEST, LEN
NOP
@@ -1105,7 +757,7 @@ copyout_right_align_to_word:
copyout_right_align_to_doubleword:
subu LEN, LEN, 4
ld r5, SRC, LEN
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.usr r5, DEST, LEN
NOP
@@ -1119,12 +771,12 @@ copyout_right_align_to_doubleword:
or r2, r0, r0 /* successful return */
br .Lcodone
-_LABEL(copyout_byte_only)
+ASGLOBAL(copyout_byte_only)
bcnd eq0, LEN, 2f
1:
subu LEN, LEN, 1
ld.b r5, SRC, LEN
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.b.usr r5, DEST, LEN
NOP
@@ -1180,7 +832,7 @@ ENTRY(copyoutstr)
or r6, r0, 0
1:
ld.bu r7, SRC, r6
-#if ERRATA__XXX_USR
+#ifdef ERRATA__XXX_USR
NOP
st.b.usr r7, DEST, r6
NOP
@@ -1217,9 +869,6 @@ ENTRY(copyoutstr)
#undef LEN
/*######################################################################*/
-/*LABEL(_ALLOW_FAULT_END)*/
-/*word 0 */ /* to separate from routine below */
-/*######################################################################*/
/*
* kcopy(const void *src, void *dst, size_t len);
@@ -1260,7 +909,7 @@ ENTRY(kcopy)
/*
* Copy three bytes from src to destination then copy words
*/
-_LABEL(kf_3byte_word_copy)
+ASGLOBAL(kf_3byte_word_copy)
ld.bu r6,r2,0 /* load byte from source */
ld.bu r7,r2,1 /* load byte from source */
ld.bu r8,r2,2 /* load byte from source */
@@ -1275,7 +924,7 @@ _LABEL(kf_3byte_word_copy)
/*
* Copy 1 halfword from src to destination then copy words
*/
-_LABEL(kf_1half_word_copy)
+ASGLOBAL(kf_1half_word_copy)
ld.hu r6,r2,0 /* load half-word from source */
st.h r6,r3,0 /* store half-word to destination */
addu r2,r2,2 /* increment source pointer */
@@ -1286,7 +935,7 @@ _LABEL(kf_1half_word_copy)
/*
* Copy 1 byte from src to destination then copy words
*/
-_LABEL(kf_1byte_word_copy)
+ASGLOBAL(kf_1byte_word_copy)
ld.bu r6,r2,0 /* load 1 byte from source */
st.b r6,r3,0 /* store 1 byte to destination */
addu r2,r2,1 /* increment source pointer */
@@ -1296,7 +945,7 @@ _LABEL(kf_1byte_word_copy)
/*
* Copy as many full words as possible, 4 words per loop
*/
-_LABEL(kf_word_copy)
+ASGLOBAL(kf_word_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,kf_byte_copy /* not enough left, copy bytes */
ld r6,r2,0 /* load first word */
@@ -1312,7 +961,7 @@ _LABEL(kf_word_copy)
br.n kf_word_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(kf_1byte_half_copy)
+ASGLOBAL(kf_1byte_half_copy)
ld.bu r6,r2,0 /* load 1 byte from source */
st.b r6,r3,0 /* store 1 byte to destination */
addu r2,r2,1 /* increment source pointer */
@@ -1320,7 +969,7 @@ _LABEL(kf_1byte_half_copy)
subu r4,r4,1 /* decrement remaining length */
/* fall through to half copy */
-_LABEL(kf_half_copy)
+ASGLOBAL(kf_half_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,kf_byte_copy /* not enough left, copy bytes */
ld.hu r6,r2,0 /* load first half-word */
@@ -1344,7 +993,7 @@ _LABEL(kf_half_copy)
br.n kf_half_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(kf_byte_copy)
+ASGLOBAL(kf_byte_copy)
bcnd eq0,r4,kcopy_out /* branch if nothing left to copy */
ld.bu r6,r2,0 /* load byte from source */
st.b r6,r3,0 /* store byte in destination */
@@ -1356,7 +1005,7 @@ _LABEL(kf_byte_copy)
/*
* source address is less than destination address, copy in reverse
*/
-_LABEL(kcopy_reverse)
+ASGLOBAL(kcopy_reverse)
/*
* start copy pointers at end of data
*/
@@ -1383,7 +1032,7 @@ _LABEL(kcopy_reverse)
/*
* Copy three bytes from src to destination then copy words
*/
-_LABEL(kr_3byte_word_copy)
+ASGLOBAL(kr_3byte_word_copy)
subu r2,r2,3 /* decrement source pointer */
subu r3,r3,3 /* decrement destination pointer */
ld.bu r6,r2,0 /* load byte from source */
@@ -1398,7 +1047,7 @@ _LABEL(kr_3byte_word_copy)
/*
* Copy 1 halfword from src to destination then copy words
*/
-_LABEL(kr_1half_word_copy)
+ASGLOBAL(kr_1half_word_copy)
subu r2,r2,2 /* decrement source pointer */
subu r3,r3,2 /* decrement destination pointer */
ld.hu r6,r2,0 /* load half-word from source */
@@ -1409,7 +1058,7 @@ _LABEL(kr_1half_word_copy)
/*
* Copy 1 byte from src to destination then copy words
*/
-_LABEL(kr_1byte_word_copy)
+ASGLOBAL(kr_1byte_word_copy)
subu r2,r2,1 /* decrement source pointer */
subu r3,r3,1 /* decrement destination pointer */
ld.bu r6,r2,0 /* load 1 byte from source */
@@ -1419,7 +1068,7 @@ _LABEL(kr_1byte_word_copy)
/*
* Copy as many full words as possible, 4 words per loop
*/
-_LABEL(kr_word_copy)
+ASGLOBAL(kr_word_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,kr_byte_copy /* not enough left, copy bytes */
subu r2,r2,16 /* decrement source pointer */
@@ -1435,7 +1084,7 @@ _LABEL(kr_word_copy)
br.n kr_word_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(kr_1byte_half_copy)
+ASGLOBAL(kr_1byte_half_copy)
subu r2,r2,1 /* decrement source pointer */
subu r3,r3,1 /* decrement destination pointer */
ld.bu r6,r2,0 /* load 1 byte from source */
@@ -1443,7 +1092,7 @@ _LABEL(kr_1byte_half_copy)
subu r4,r4,1 /* decrement remaining length */
/* fall through to half copy */
-_LABEL(kr_half_copy)
+ASGLOBAL(kr_half_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,kr_byte_copy /* not enough left, copy bytes */
subu r2,r2,16 /* decrement source pointer */
@@ -1467,7 +1116,7 @@ _LABEL(kr_half_copy)
br.n kr_half_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(kr_byte_copy)
+ASGLOBAL(kr_byte_copy)
bcnd eq0,r4,kcopy_out /* branch if nothing left to copy */
subu r2,r2,1 /* decrement source pointer */
subu r3,r3,1 /* decrement destination pointer */
@@ -1476,21 +1125,21 @@ _LABEL(kr_byte_copy)
br.n kr_byte_copy /* branch for next byte */
subu r4,r4,1 /* decrement remaining length */
-_LABEL(kcopy_out)
+ASGLOBAL(kcopy_out)
or r2, r0, 0 /* return success */
-_LABEL(kcopy_out_fault)
+ASGLOBAL(kcopy_out_fault)
or.u r5,r0,hi16(_curpcb)
ld r6,r5,lo16(_curpcb)
st r0,r6,PCB_ONFAULT /* clear the handler */
jmp r1 /* all done, return to caller */
-_LABEL(kcopy_fault)
+ASGLOBAL(kcopy_fault)
or r2, r0, EFAULT /* return fault */
br kcopy_out_fault
data
align 4
-_LABEL(kf_strat)
+ASGLOBAL(kf_strat)
word kf_word_copy
word kf_byte_copy
word kf_half_copy
@@ -1508,7 +1157,7 @@ _LABEL(kf_strat)
word kf_byte_copy
word kf_1byte_word_copy
-_LABEL(kr_strat)
+ASGLOBAL(kr_strat)
word kr_word_copy
word kr_byte_copy
word kr_half_copy
@@ -1602,7 +1251,7 @@ ENTRY(ovbcopy)
/*
* Copy three bytes from src to destination then copy words
*/
-_LABEL(f_3byte_word_copy)
+ASGLOBAL(f_3byte_word_copy)
ld.bu r6,r2,0 /* load byte from source */
ld.bu r7,r2,1 /* load byte from source */
ld.bu r8,r2,2 /* load byte from source */
@@ -1617,7 +1266,7 @@ _LABEL(f_3byte_word_copy)
/*
* Copy 1 halfword from src to destination then copy words
*/
-_LABEL(f_1half_word_copy)
+ASGLOBAL(f_1half_word_copy)
ld.hu r6,r2,0 /* load half-word from source */
st.h r6,r3,0 /* store half-word to destination */
addu r2,r2,2 /* increment source pointer */
@@ -1628,7 +1277,7 @@ _LABEL(f_1half_word_copy)
/*
* Copy 1 byte from src to destination then copy words
*/
-_LABEL(f_1byte_word_copy)
+ASGLOBAL(f_1byte_word_copy)
ld.bu r6,r2,0 /* load 1 byte from source */
st.b r6,r3,0 /* store 1 byte to destination */
addu r2,r2,1 /* increment source pointer */
@@ -1638,7 +1287,7 @@ _LABEL(f_1byte_word_copy)
/*
* Copy as many full words as possible, 4 words per loop
*/
-_LABEL(f_word_copy)
+ASGLOBAL(f_word_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,f_byte_copy /* not enough left, copy bytes */
ld r6,r2,0 /* load first word */
@@ -1654,7 +1303,7 @@ _LABEL(f_word_copy)
br.n f_word_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(f_1byte_half_copy)
+ASGLOBAL(f_1byte_half_copy)
ld.bu r6,r2,0 /* load 1 byte from source */
st.b r6,r3,0 /* store 1 byte to destination */
addu r2,r2,1 /* increment source pointer */
@@ -1662,7 +1311,7 @@ _LABEL(f_1byte_half_copy)
subu r4,r4,1 /* decrement remaining length */
/* fall through to half copy */
-_LABEL(f_half_copy)
+ASGLOBAL(f_half_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,f_byte_copy /* not enough left, copy bytes */
ld.hu r6,r2,0 /* load first half-word */
@@ -1686,7 +1335,7 @@ _LABEL(f_half_copy)
br.n f_half_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(f_byte_copy)
+ASGLOBAL(f_byte_copy)
bcnd eq0,r4,bcopy_out /* branch if nothing left to copy */
ld.bu r6,r2,0 /* load byte from source */
st.b r6,r3,0 /* store byte in destination */
@@ -1698,7 +1347,7 @@ _LABEL(f_byte_copy)
/*
* source address is less than destination address, copy in reverse
*/
-_LABEL(bcopy_reverse)
+ASGLOBAL(bcopy_reverse)
/*
* start copy pointers at end of data
*/
@@ -1725,7 +1374,7 @@ _LABEL(bcopy_reverse)
/*
* Copy three bytes from src to destination then copy words
*/
-_LABEL(r_3byte_word_copy)
+ASGLOBAL(r_3byte_word_copy)
subu r2,r2,3 /* decrement source pointer */
subu r3,r3,3 /* decrement destination pointer */
ld.bu r6,r2,0 /* load byte from source */
@@ -1740,7 +1389,7 @@ _LABEL(r_3byte_word_copy)
/*
* Copy 1 halfword from src to destination then copy words
*/
-_LABEL(r_1half_word_copy)
+ASGLOBAL(r_1half_word_copy)
subu r2,r2,2 /* decrement source pointer */
subu r3,r3,2 /* decrement destination pointer */
ld.hu r6,r2,0 /* load half-word from source */
@@ -1751,7 +1400,7 @@ _LABEL(r_1half_word_copy)
/*
* Copy 1 byte from src to destination then copy words
*/
-_LABEL(r_1byte_word_copy)
+ASGLOBAL(r_1byte_word_copy)
subu r2,r2,1 /* decrement source pointer */
subu r3,r3,1 /* decrement destination pointer */
ld.bu r6,r2,0 /* load 1 byte from source */
@@ -1761,7 +1410,7 @@ _LABEL(r_1byte_word_copy)
/*
* Copy as many full words as possible, 4 words per loop
*/
-_LABEL(r_word_copy)
+ASGLOBAL(r_word_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,r_byte_copy /* not enough left, copy bytes */
subu r2,r2,16 /* decrement source pointer */
@@ -1777,7 +1426,7 @@ _LABEL(r_word_copy)
br.n r_word_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(r_1byte_half_copy)
+ASGLOBAL(r_1byte_half_copy)
subu r2,r2,1 /* decrement source pointer */
subu r3,r3,1 /* decrement destination pointer */
ld.bu r6,r2,0 /* load 1 byte from source */
@@ -1785,7 +1434,7 @@ _LABEL(r_1byte_half_copy)
subu r4,r4,1 /* decrement remaining length */
/* fall through to half copy */
-_LABEL(r_half_copy)
+ASGLOBAL(r_half_copy)
cmp r10,r4,16 /* see if we have 16 bytes remaining */
bb1 lo,r10,r_byte_copy /* not enough left, copy bytes */
subu r2,r2,16 /* decrement source pointer */
@@ -1809,7 +1458,7 @@ _LABEL(r_half_copy)
br.n r_half_copy /* branch to copy another block */
subu r4,r4,16 /* decrement remaining length */
-_LABEL(r_byte_copy)
+ASGLOBAL(r_byte_copy)
bcnd eq0,r4,bcopy_out /* branch if nothing left to copy */
subu r2,r2,1 /* decrement source pointer */
subu r3,r3,1 /* decrement destination pointer */
@@ -1818,12 +1467,12 @@ _LABEL(r_byte_copy)
br.n r_byte_copy /* branch for next byte */
subu r4,r4,1 /* decrement remaining length */
-_LABEL(bcopy_out)
+ASGLOBAL(bcopy_out)
jmp r1 /* all done, return to caller */
data
align 4
-_LABEL(f_strat)
+ASGLOBAL(f_strat)
word f_word_copy
word f_byte_copy
word f_half_copy
@@ -1841,7 +1490,7 @@ _LABEL(f_strat)
word f_byte_copy
word f_1byte_word_copy
-_LABEL(r_strat)
+ASGLOBAL(r_strat)
word r_word_copy
word r_byte_copy
word r_half_copy
@@ -2132,261 +1781,6 @@ ENTRY(invalidate_pte)
jmp.n r1
or r2,r3,r0
-#ifdef now_in_c
-/*
- * This has to be cleaned - we should not use INT_MASK_LEVEL. Should
- * use pcc2_int_lvl instead. XXX nivas
- */
-/*
- * I don't think we need to explictly enable interrupts. We can always enable
- * interrupts and depend on the int level and mask in PCC2 to block the
- * appropriate interrupts for us. If we don't depend on the PCC2 to block ints
- * for us, we need to explicitly set the IND bit in the PSR for every spln(x)
- * when x > 0. But for now... Rewrite the whole mess. XXX nivas
- * This is bogus - it is blocking interrupts for all but 0 XXX nivas
- */
-
-ENTRY(spln)
- ldcr r10,PSR
- or r11,r0,r10
- or r5,r2,r0 /* copy of r2 */
- bb1 PSR_INTERRUPT_DISABLE_BIT,r10,1f
- set r10,r10,1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r10,PSR
- FLUSH_PIPELINE
- 1:
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 2f
- or.u r2, r0, hi16(IEN0_REG)
- or r2, r2, lo16(IEN0_REG)
- bsr.n _m188_get_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r4,r2,r0 /* old mask in r4 */
- or r3,r5,r0 /* new mask in r3 */
- or.u r2, r0, hi16(IEN0_REG)
- or r2, r2, lo16(IEN0_REG)
- bsr.n _m188_set_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r2,r4,r0 /* old mask in r2 */
- br m188_spln_done
-#endif /* MVME188 */
- 2:
- or.u r3,r0,hi16(INT_MASK_LEVEL)
- or r3,r3,lo16(INT_MASK_LEVEL)
- xmem.bu r2,r3,r0
-m188_spln_done:
- bcnd ne0, r5, 3f
- clr r11, r11, 1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r11,PSR
- FLUSH_PIPELINE
- 3:
- jmp r1
-
-ENTRY(getipl)
-ENTRY(spl)
- ldcr r10,PSR
- or r11,r0,r10
- bb1 PSR_INTERRUPT_DISABLE_BIT, r10, 1f
- set r10,r10,1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r10,PSR
- FLUSH_PIPELINE
- 1:
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 2f
- /* get the current mask value mvme188 */
- or.u r2, r0, hi16(IEN0_REG)
- or r2, r2, lo16(IEN0_REG)
- bsr.n _m188_get_mask
- subu r31, r31, 40
- addu r31, r31, 40
-
- br m188_spl_done
-#endif /* MVME188 */
- 2:
- /* get the current mask value mvme1x7 */
- or.u r3,r0,hi16(INT_MASK_LEVEL)
- ld.b r2,r3,lo16(INT_MASK_LEVEL)
-m188_spl_done:
- stcr r11,PSR
- FLUSH_PIPELINE
- jmp r1
-
-/*
- * Set the interrupt mask to the value passed in, returning the
- * the current mask level. This routine does not enable/disable
- * interrupts explicitly. It is assumed that the callers know what
- * to do with interrupts.
- */
-
-ENTRY(setipl)
- ldcr r10,PSR
- or r11,r0,r10
- bb1 PSR_INTERRUPT_DISABLE_BIT, r10, 1f
- set r10,r10,1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r10,PSR /* disable ints, if needed */
- FLUSH_PIPELINE
-1:
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 2f
- or r3, r0, r2 /* r3 now new mask value */
- /* get the current mask value mvme188 */
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_get_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r4, r0, r2 /* r4 now current mask value */
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_set_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r2, r0, r4 /* r2 now the old value */
- br m188_setipl_done
-#endif /* MVME188 */
- 2:
- /* get the current mask value mvme1x7 */
- or.u r3,r0,hi16(INT_MASK_LEVEL)
- or r3,r3,lo16(INT_MASK_LEVEL)
- xmem.bu r2,r3,r0 /* xchng the new mask value */
-m188_setipl_done:
- FLUSH_PIPELINE
- stcr r11,PSR /* restore psr */
- FLUSH_PIPELINE
- jmp r1 /* and return the old value */
-
-#if DDB
-ENTRY(db_spln)
- ldcr r10,PSR
- or r11,r0,r10
- or r5,r2,r0 /* copy of r2 */
- bb1 PSR_INTERRUPT_DISABLE_BIT,r10,1f
- set r10,r10,1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r10,PSR
- FLUSH_PIPELINE
- 1:
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 2f
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_get_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r4,r2,r0 /* old mask in r4 */
- or r3,r5,r0 /* new mask in r3 */
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_set_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r2,r4,r0 /* old mask in r2 */
- br m188_db_spln_done
-#endif /* MVME188 */
- 2:
- or.u r3,r0,hi16(INT_MASK_LEVEL)
- or r3,r3,lo16(INT_MASK_LEVEL)
- xmem.bu r2,r3,r0
-m188_db_spln_done:
- bcnd ne0, r5, 3f
- clr r11, r11, 1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r11,PSR
- FLUSH_PIPELINE
- 3:
- jmp r1
-
-ENTRY(db_getipl)
-ENTRY(db_spl)
- ldcr r10,PSR
- or r11,r0,r10
- bb1 PSR_INTERRUPT_DISABLE_BIT, r10, 1f
- set r10,r10,1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r10,PSR
- FLUSH_PIPELINE
- 1:
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 2f
- /* get the current mask value mvme188 */
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_get_mask
- subu r31, r31, 40
- addu r31, r31, 40
- br m188_db_spl_done
-#endif /* MVME188 */
- 2:
- /* get the current mask value mvme1x7 */
- or.u r3,r0,hi16(INT_MASK_LEVEL)
- ld.b r2,r3,lo16(INT_MASK_LEVEL)
-m188_db_spl_done:
- stcr r11,PSR
- FLUSH_PIPELINE
- jmp r1
-
-ENTRY(db_setipl)
- ldcr r10,PSR
- or r11,r0,r10
- bb1 PSR_INTERRUPT_DISABLE_BIT, r10, 1f
- set r10,r10,1<PSR_INTERRUPT_DISABLE_BIT>
- stcr r10,PSR /* disable ints, if needed */
- FLUSH_PIPELINE
- 1:
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 2f
- or r3, r0, r2 /* r3 now new mask value */
- /* get the current mask value mvme188 */
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_get_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r4, r0, r2 /* r4 now current mask value */
- or.u r2,r0,hi16(IEN0_REG)
- or r2,r2,lo16(IEN0_REG)
- bsr.n _m188_set_mask
- subu r31, r31, 40
- addu r31, r31, 40
- or r2, r0, r4 /* r2 now the old value */
- br m188_db_setipl_done
-#endif /* MVME188 */
- 2:
- /* get the current mask value mvme1x7 */
- or.u r3,r0,hi16(INT_MASK_LEVEL)
- or r3,r3,lo16(INT_MASK_LEVEL)
- xmem.bu r2,r3,r0 /* xchng the new mask value */
-m188_db_setipl_done:
- FLUSH_PIPELINE
- stcr r11,PSR /* restore psr */
- FLUSH_PIPELINE
- jmp r1 /* and return the old value */
-#endif /* DDB */
-#endif /* now_in_c */
-
#if DDB
ENTRY(db_flush_pipeline)
FLUSH_PIPELINE
@@ -2440,31 +1834,6 @@ ENTRY(guarded_access_end)
jmp.n r1
or r2,r0,0
-#if 0 /* There is an inline version of this in
-machine/cpu_number.h but it doesn't work right for some reason.
-/*************************************************************************
- *************************************************************************
- **
- ** int cpu_number(void)
- **
- ** Returns the number of the current cpu.
- **/
-#undef cpu_number
-ENTRY(cpu_number)
- or r2, r0, r0 /* clear return value */
-#ifdef MVME188
- /* check if it's a mvme188 */
- or.u r4, r0, hi16(_cputyp)
- ld r3, r4, lo16(_cputyp)
- cmp r4, r3, 0x188
- bb1 ne, r4, 1f
- ldcr r2, SR1
-#endif /* MVME188 */
-1:
- jmp.n r1
- extu r2, r2, FLAG_CPU_FIELD_WIDTH<0> /* r2 = cpu# */
-#endif
-
/*************************************************************************
*************************************************************************
**
diff --git a/sys/arch/mvme88k/mvme88k/m88100_fp.S b/sys/arch/mvme88k/mvme88k/m88100_fp.S
index fcedb50b037..f0cecbb4293 100644
--- a/sys/arch/mvme88k/mvme88k/m88100_fp.S
+++ b/sys/arch/mvme88k/mvme88k/m88100_fp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88100_fp.S,v 1.10 2001/08/07 22:12:31 miod Exp $ */
+/* $OpenBSD: m88100_fp.S,v 1.11 2001/08/24 22:53:15 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
@@ -164,7 +164,7 @@ fp_p_trap:
st r3,r31,32 /* save exception frame */
or r2,r0,T_FPEPFLT /* load trap type */
or r3, r29, r0
- bsr _trap /* trap */
+ bsr _C_LABEL(trap18x) /* trap */
ld r1,r31,36 /* recover return address */
addu r31,r31,40 /* deallocate stack */
br fp_p_return
@@ -643,7 +643,7 @@ FPintov_return: ld r1,r31,0 /* load return address from memory */
/* do not influence this instruction. */
text
-LABEL(_FPresoper)
+GLOBAL(FPresoper)
st r1, r31, 0
extu r10,r9,5<11> /* extract opcode */
/* cmp r11,r10,FSQRTop ;compare to FSQRT */
@@ -655,7 +655,7 @@ LABEL(_FPresoper)
cmp r11,r10,TRNCop /* compare to TRNC */
bb0 eq,r11,opercheck /* check for reserved operands */
-_LABEL(S1clear)
+ASGLOBAL(S1clear)
or r5,r0,r0 /* clear any NaN''s, denorms, or infinities */
or r6,r0,r0 /* that may be left in S1HI,S1LO from a */
/* previous instruction */
@@ -677,11 +677,11 @@ _LABEL(S1clear)
/* S2 is a NaN or infinity. If it is a NaN, then branch to the NaN routine. */
-_LABEL(opercheck)
+ASGLOBAL(opercheck)
extu r10,r5,11<20> /* internal representation for double */
bb1.n s1size,r9,S1NaNdoub /* S1 is double precision */
or r12,r0,r0 /* clear operand flag register */
-_LABEL(S1NaNsing)
+ASGLOBAL(S1NaNsing)
xor r10,r10,0x0080 /* internal representation for single */
ext r10,r10,8<0> /* precision is IEEE 8 bits sign extended */
/* to 11 bits; for real exp. > 0, the */
@@ -697,11 +697,11 @@ _LABEL(S1NaNsing)
/* number, branch to noS1NaN when eq0 */
br.n S2NaN /* see if S2 has a NaN */
set r12,r12,1<s1nan> /* indicate that S1 has a NaN */
-_LABEL(noS1NaNs)
+ASGLOBAL(noS1NaNs)
br.n S2NaN /* check contents of S2 */
set r12,r0,1<s1inf> /* indicate that S1 has an infinity */
-_LABEL(S1NaNdoub)
+ASGLOBAL(S1NaNdoub)
xor r10,r10,0x0400 /* precision is the same IEEE 11 bits */
/* The */
/* above instructions gives a result exp. */
@@ -715,13 +715,13 @@ _LABEL(S1NaNdoub)
/* number, branch to noS1NaN when eq0 */
br.n S2NaN /* see if S2 has a NaN */
set r12,r12,1<s1nan> /* indicate that S1 has a NaN */
-_LABEL(noS1NaNd)
+ASGLOBAL(noS1NaNd)
set r12,r0,1<s1inf> /* indicate that S1 has an infinity */
-_LABEL(S2NaN)
+ASGLOBAL(S2NaN)
bb1.n s2size,r9,S2NaNdoub /* S1 is double precision */
extu r10,r7,11<20> /* internal representation for double */
-_LABEL(S2NaNsing)
+ASGLOBAL(S2NaNsing)
xor r10,r10,0x0080 /* internal representation for single */
ext r10,r10,8<0> /* precision is IEEE 8 bits sign extended */
/* to 11 bits; for real exp. > 0, the */
@@ -737,7 +737,7 @@ _LABEL(S2NaNsing)
/* number, branch to noS2NaNs when eq0 */
br.n _NaN /* branch to NaN routine */
set r12,r12,1<s2nan> /* indicate that s2 has a NaN */
-_LABEL(noS2NaNs)
+ASGLOBAL(noS2NaNs)
bb0 s1nan,r12, 1f /* branch to NaN if S1 is a NaN */
br _NaN
1: br.n _infinity /* If S1 had a NaN we would have already */
@@ -746,7 +746,7 @@ _LABEL(noS2NaNs)
/* handle the finity */
set r12,r12,1<s2inf> /* indicate that S2 has an infinity */
-_LABEL(S2NaNdoub)
+ASGLOBAL(S2NaNdoub)
xor r10,r10,0x0400 /* precision is the same IEEE 11 bits */
/* The */
/* above instruction gives a result exp. */
@@ -760,7 +760,7 @@ _LABEL(S2NaNdoub)
/* number, branch to noS2NaNd when eq0 */
br.n _NaN /* branch to NaN routine */
set r12,r12,1<s2nan> /* indicate that s2 has a NaN */
-_LABEL(noS2NaNd)
+ASGLOBAL(noS2NaNd)
bb0 s1nan,r12,1f /* branch to NaN if S1 is a NaN */
br _NaN
1: br.n _infinity /* If S1 had a NaN we would have already */
@@ -776,7 +776,7 @@ _LABEL(noS2NaNd)
/* If the routine still has not branched, then branch to denorm, the only */
/* reserved operand left. */
-_LABEL(inf)
+ASGLOBAL(inf)
bb0 s1nan,r12,1f /* branch if S1 has a NaN and S2 does not */
br _NaN
1: bb0 s1inf,r12,2f /* Neither S1 or S2 has a NaN, and we would */
@@ -1491,7 +1491,7 @@ return:
/* it can be written, but a signalling S2 is not modified in this routine */
/* if S1 is a NaN. */
text
-LABEL(_NaN)
+GLOBAL(NaN)
bb0.n s1nan,r12,S2sigcheck /* S1 is not a NaN */
st r1,r31,0 /* save return address */
bb1 sigbit,r5,S2sigcheck /* S1 is not a signaling NaN */
@@ -1517,14 +1517,14 @@ LABEL(_NaN)
bb0 oper,r3,S1nohandler /* branch if no user handler */
bsr _handler /* branch to handler */
br FPnan_return
-_LABEL(S1nohandler)
+ASGLOBAL(S1nohandler)
#endif
br.n S1write /* FPSR bit already set, S1 is made quiet, */
/* and since we always write S1 if it is a */
/* NaN, write S1 and skip rest of routine */
set r5,r5,1<sigbit> /* make S1 a quiet NaN */
-_LABEL(S2sigcheck)
+ASGLOBAL(S2sigcheck)
bb0 s2nan,r12,S1write /* S2 is not a NaN */
bb1 sigbit,r7,S1write /* S2 is not a signaling NaN */
set r2,r2,1<oper> /* set invalid operation bit in FPSR */
@@ -1534,14 +1534,14 @@ _LABEL(S2sigcheck)
br FPnan_return
#endif
-_LABEL(S2nohandler)
+ASGLOBAL(S2nohandler)
set r7,r7,1<sigbit> /* make S2 a quiet NaN */
/* Write a single or double precision quiet NaN unless the opeation is FCMP. */
/* If the operation is FCMP, then set the not comparable bit in the result. */
-_LABEL(S1write)
+ASGLOBAL(S1write)
bb0 s1nan,r12,S2write /* do not write S1 if it is not a NaN */
extu r10,r9,5<11> /* extract opcode */
cmp r11,r10,FCMPop /* compare to FCMP */
@@ -1549,11 +1549,11 @@ _LABEL(S1write)
set r6,r0,1<nc> /* set the not comparable bit */
br.n FPnan_return /* return from subroutine */
set r6,r6,1<ne> /* set the not equal bit */
-_LABEL(S1noFCMP)
+ASGLOBAL(S1noFCMP)
bb1.n dsize,r9,wrdoubS1 /* double destination */
set r5,r5,11<20> /* set all exponent bits to 1 */
/* The single result will be formed the same way whether S1 is a single or double */
-_LABEL(wrsingS1)
+ASGLOBAL(wrsingS1)
mak r10,r5,28<3> /* wipe out extra exponent bits */
extu r11,r6,3<29> /* get lower three bits of mantissa */
or r10,r10,r11 /* combine all of result except sign */
@@ -1561,16 +1561,16 @@ _LABEL(wrsingS1)
br.n FPnan_return /* return from function */
or r6,r6,r10 /* form result */
-_LABEL(wrdoubS1)
+ASGLOBAL(wrdoubS1)
/* ;;;;; bb1 s1size,r9,wrdoubS1d ;write double source to double dest. */
/* took out the above instruction -- don't see why it's there.... jfriedl */
-_LABEL(wrdoubS1s)
+ASGLOBAL(wrdoubS1s)
set r6,r6,29<0> /* set extra bits of lower word */
-_LABEL(wrdoubS1d)
+ASGLOBAL(wrdoubS1d)
br FPnan_return /* no modification necessary for writing */
/* double to double, so return from function */
-_LABEL(S2write)
+ASGLOBAL(S2write)
extu r10,r9,5<11> /* extract opcode */
cmp r11,r10,FCMPop /* compare to FCMP */
bb1.n ne,r11,S2noFCMP /* operation is not FCMP */
@@ -1578,7 +1578,7 @@ _LABEL(S2write)
set r6,r0,1<nc> /* set the not comparable bit */
br.n FPnan_return /* return from subroutine */
set r6,r6,1<ne> /* set the not equal bit */
-_LABEL(S2noFCMP)
+ASGLOBAL(S2noFCMP)
bb1.n dsize,r9,wrdoubS2 /* double destination */
/*
* In the original, the ".n" above and the "set r5..." below
@@ -1589,7 +1589,7 @@ _LABEL(S2noFCMP)
*/
set r5,r5,11<20> /* set all exponent bits to 1 */
/* The single result will be formed the same way whether S1 is a single or double */
-_LABEL(wrsingS2)
+ASGLOBAL(wrsingS2)
mak r10,r7,28<3> /* wipe out extra exponent bits */
extu r11,r8,3<29> /* get lower three bits of mantissa */
or r10,r10,r11 /* combine all of result except sign */
@@ -1597,20 +1597,20 @@ _LABEL(wrsingS2)
br.n FPnan_return /* return from function */
or r6,r6,r10 /* form result */
-_LABEL(wrdoubS2)
+ASGLOBAL(wrdoubS2)
/* ;;; bb1 s2size,r9,FPnan_return ;write double source to double dest. */
/*
* I took out the above branch because I just don't see how it
* makes sense. jfriedl Dec 1, '89
*/
-_LABEL(wrdoubS2s)
+ASGLOBAL(wrdoubS2s)
set r6,r8,29<0> /* set extra bits of lower word */
/* Return from this subroutine with the result. */
-_LABEL(FPnan_return)
+ASGLOBAL(FPnan_return)
/* no modification necessary for writing */
/* double to double, so return from function */
ld r1,r31, 0 /* retrieve return address */
diff --git a/sys/arch/mvme88k/mvme88k/m88110_fp.S b/sys/arch/mvme88k/mvme88k/m88110_fp.S
index f6d7c88ba2d..a15f78297a1 100644
--- a/sys/arch/mvme88k/mvme88k/m88110_fp.S
+++ b/sys/arch/mvme88k/mvme88k/m88110_fp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110_fp.S,v 1.5 2001/08/07 22:12:31 miod Exp $ */
+/* $OpenBSD: m88110_fp.S,v 1.6 2001/08/24 22:53:15 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -76,24 +76,24 @@ ENTRY(m88110_Xfp_precise)
3:
or.u r4, r4, 0xffff
-LABEL(m88110_FPuimp)
+ASGLOBAL(m88110_FPuimp)
subu r31,r31,40 /* allocate stack */
st r1,r31,36 /* save return address */
st r3,r31,32 /* save exception frame */
or r2,r0,T_FPEPFLT /* load trap type */
or r3, r29, r0
- bsr _trap /* trap */
+ bsr _C_LABEL(trap197) /* trap */
ld r1,r31,36 /* recover return address */
addu r31,r31,40 /* deallocate stack */
jmp r1
-LABEL(m88110_FPpriviol)
+ASGLOBAL(m88110_FPpriviol)
subu r31,r31,40 /* allocate stack */
st r1,r31,36 /* save return address */
st r3,r31,32 /* save exception frame */
or r2,r0,T_PRIVINFLT /* load trap type */
or r3, r29, r0
- bsr _trap /* trap */
+ bsr _C_LABEL(trap197) /* trap */
ld r1,r31,36 /* recover return address */
addu r31,r31,40 /* deallocate stack */
jmp r1
diff --git a/sys/arch/mvme88k/mvme88k/process.S b/sys/arch/mvme88k/mvme88k/process.S
index 1c8b2d005eb..af62e54be45 100644
--- a/sys/arch/mvme88k/mvme88k/process.S
+++ b/sys/arch/mvme88k/mvme88k/process.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.S,v 1.9 2001/05/20 05:53:10 miod Exp $ */
+/* $OpenBSD: process.S,v 1.10 2001/08/24 22:53:15 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -92,7 +92,7 @@ ENTRY(switch_exit)
* When no processes are on the runq, switch
* idles here watiing for something to come ready.
*/
-LABEL(idle)
+ASGLOBAL(idle)
or.u r10, r0, hi16(_curproc)
st r0, r10, lo16(_curproc) /* curproc = NULL */