diff --git a/sys/arch/sparc/sparc/amd7930intr.s b/sys/arch/sparc/sparc/amd7930intr.s index 53b1beb94baa..e7fb429ca8c7 100644 --- a/sys/arch/sparc/sparc/amd7930intr.s +++ b/sys/arch/sparc/sparc/amd7930intr.s @@ -1,4 +1,4 @@ -/* $NetBSD: amd7930intr.s,v 1.12 1998/02/10 14:11:49 mrg Exp $ */ +/* $NetBSD: amd7930intr.s,v 1.13 1999/03/05 10:45:25 pk Exp $ */ /* * Copyright (c) 1995 Rolf Grossmann. * Copyright (c) 1992, 1993 @@ -49,6 +49,7 @@ #ifndef AUDIO_C_HANDLER #include "assym.h" #include +#include #include #include @@ -71,8 +72,8 @@ #define AUDIO_SET_SWINTR AUDIO_SET_SWINTR_4M #else #define AUDIO_SET_SWINTR \ - sethi %hi(_cputyp), %l5; \ - ld [%l5 + %lo(_cputyp)], %l5; \ + sethi %hi(_C_LABEL(cputyp)), %l5; \ + ld [%l5 + %lo(_C_LABEL(cputyp))], %l5; \ cmp %l5, CPU_SUN4M; \ be 8f; \ AUDIO_SET_SWINTR_4C; \ @@ -93,28 +94,26 @@ savepc: .seg "text" .align 4 - .global _amd7930_trap - .global _auiop -_amd7930_trap: +_ENTRY(amd7930_trap) sethi %hi(savepc), %l7 st %l2, [%l7 + %lo(savepc)] ! tally interrupt #if defined(UVM) - sethi %hi(_uvmexp+V_INTR), %l7 - ld [%l7 + %lo(_uvmexp+V_INTR)], %l6 + sethi %hi(_C_LABEL(uvmexp)+V_INTR), %l7 + ld [%l7 + %lo(_C_LABEL(uvmexp)+V_INTR)], %l6 inc %l6 - st %l6, [%l7 + %lo(_uvmexp+V_INTR)] + st %l6, [%l7 + %lo(_C_LABEL(uvmexp)+V_INTR)] #else - sethi %hi(_cnt+V_INTR), %l7 - ld [%l7 + %lo(_cnt+V_INTR)], %l6 + sethi %hi(_C_LABEL(cnt)+V_INTR), %l7 + ld [%l7 + %lo(_C_LABEL(cnt)+V_INTR)], %l6 inc %l6 - st %l6, [%l7 + %lo(_cnt+V_INTR)] + st %l6, [%l7 + %lo(_C_LABEL(cnt)+V_INTR)] #endif - sethi %hi(_auiop), %l7 - ld [%l7 + %lo(_auiop)], %l7 + sethi %hi(_C_LABEL(auiop)), %l7 + ld [%l7 + %lo(_C_LABEL(auiop))], %l7 ld [%l7 + AU_EVCNT], %l6 inc %l6 diff --git a/sys/arch/sparc/sparc/bsd_fdintr.s b/sys/arch/sparc/sparc/bsd_fdintr.s index 2db1826e3973..d877c412ecc8 100644 --- a/sys/arch/sparc/sparc/bsd_fdintr.s +++ b/sys/arch/sparc/sparc/bsd_fdintr.s @@ -1,4 +1,4 @@ -/* $NetBSD: bsd_fdintr.s,v 1.13 1998/02/10 14:11:50 mrg Exp $ */ +/* $NetBSD: bsd_fdintr.s,v 1.14 1999/03/05 10:45:25 pk Exp $ */ /* * Copyright (c) 1995 Paul Kranenburg @@ -36,6 +36,7 @@ #ifndef FDC_C_HANDLER #include "assym.h" #include +#include #include #include #include @@ -62,8 +63,8 @@ #define FD_SET_SWINTR FD_SET_SWINTR_4M #else #define FD_SET_SWINTR \ - sethi %hi(_cputyp), %l5; \ - ld [%l5 + %lo(_cputyp)], %l5; \ + sethi %hi(_C_LABEL(cputyp)), %l5; \ + ld [%l5 + %lo(_C_LABEL(cputyp))], %l5; \ cmp %l5, CPU_SUN4M; \ be 8f; \ FD_SET_SWINTR_4C; \ @@ -108,8 +109,8 @@ #define FD_DEASSERT_TC FD_DEASSERT_TC_4M #else #define FD_ASSERT_TC \ - sethi %hi(_cputyp), %l5; \ - ld [%l5 + %lo(_cputyp)], %l5; \ + sethi %hi(_C_LABEL(cputyp)), %l5; \ + ld [%l5 + %lo(_C_LABEL(cputyp))], %l5; \ cmp %l5, CPU_SUN4M; \ be 8f; \ nop; \ @@ -149,41 +150,40 @@ .seg "data" .align 8 - .global _fdciop /* A save haven for three precious registers */ save_l: .word 0 .word 0 .word 0 /* Pointer to a `struct fdcio', set in fd.c */ -_fdciop: + .global _C_LABEL(fdciop) +_C_LABEL(fdciop): .word 0 .seg "text" .align 4 - .global _fdchwintr -_fdchwintr: +_ENTRY(fdchwintr) set save_l, %l7 std %l0, [%l7] st %l2, [%l7 + 8] ! tally interrupt #if defined(UVM) - sethi %hi(_uvmexp+V_INTR), %l7 - ld [%l7 + %lo(_uvmexp+V_INTR)], %l6 + sethi %hi(_C_LABEL(uvmexp)+V_INTR), %l7 + ld [%l7 + %lo(_C_LABEL(uvmexp)+V_INTR)], %l6 inc %l6 - st %l6, [%l7 + %lo(_uvmexp+V_INTR)] + st %l6, [%l7 + %lo(_C_LABEL(uvmexp)+V_INTR)] #else - sethi %hi(_cnt+V_INTR), %l7 - ld [%l7 + %lo(_cnt+V_INTR)], %l6 + sethi %hi(_C_LABEL(cnt)+V_INTR), %l7 + ld [%l7 + %lo(_C_LABEL(cnt)+V_INTR)], %l6 inc %l6 - st %l6, [%l7 + %lo(_cnt+V_INTR)] + st %l6, [%l7 + %lo(_C_LABEL(cnt)+V_INTR)] #endif ! load fdc, if it's NULL there's nothing to do: schedule soft interrupt - sethi %hi(_fdciop), %l7 - ld [%l7 + %lo(_fdciop)], R_fdc + sethi %hi(_C_LABEL(fdciop)), %l7 + ld [%l7 + %lo(_C_LABEL(fdciop))], R_fdc ! tally interrupt ld [R_fdc + FDC_EVCNT], %l6 diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s index 685e3d11289e..a98b85ea47b3 100644 --- a/sys/arch/sparc/sparc/locore.s +++ b/sys/arch/sparc/sparc/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.110 1999/02/14 14:37:15 pk Exp $ */ +/* $NetBSD: locore.s,v 1.111 1999/03/05 10:45:25 pk Exp $ */ /* * Copyright (c) 1996 Paul Kranenburg @@ -57,6 +57,7 @@ #include "assym.h" #include +#include #include #include #include @@ -102,7 +103,7 @@ * something like: * foointr: * TRAP_SETUP(...) ! makes %o registers safe - * INCR(_cnt+V_FOO) ! count a foo + * INCR(cnt+V_FOO) ! count a foo */ #define INCR(what) \ sethi %hi(what), %o0; \ @@ -146,11 +147,11 @@ * to determine whether we're already on the interrupt stack is slightly * more time consuming (see INTR_SETUP() below). */ - .globl _intstack - .globl _eintstack -_intstack: + .globl _C_LABEL(intstack) + .globl _C_LABEL(eintstack) +_C_LABEL(intstack): .skip INT_STACK_SIZE ! 16k = 128 128-byte stack frames -_eintstack: +_C_LABEL(eintstack): _EINTSTACKP = CPUINFO_VA + CPUINFO_EINTSTACK @@ -162,22 +163,22 @@ _EINTSTACKP = CPUINFO_VA + CPUINFO_EINTSTACK * process 0's kernel stack can quietly overrun into it during bootup, if * we feel like doing that). */ - .globl _idle_u -_idle_u: + .globl _C_LABEL(idle_u) +_C_LABEL(idle_u): .skip USPACE /* * On SMP kernels, there's an idle u-area for each CPU and we must * read its location from cpuinfo. */ -_IDLE_UP = CPUINFO_VA + CPUINFO_IDLE_U +IDLE_UP = CPUINFO_VA + CPUINFO_IDLE_U /* * Process 0's u. * * This must be aligned on an 8 byte boundary. */ - .globl _u0 -_u0: .skip USPACE + .globl _C_LABEL(u0) +_C_LABEL(u0): .skip USPACE estack0: #ifdef KGDB @@ -185,36 +186,36 @@ estack0: * Another item that must be aligned, easiest to put it here. */ KGDB_STACK_SIZE = 2048 - .globl _kgdb_stack -_kgdb_stack: + .globl _C_LABEL(kgdb_stack) +_C_LABEL(kgdb_stack): .skip KGDB_STACK_SIZE ! hope this is enough #endif /* - * _cpcb points to the current pcb (and hence u. area). + * cpcb points to the current pcb (and hence u. area). * Initially this is the special one. */ -_cpcb = CPUINFO_VA + CPUINFO_CURPCB +cpcb = CPUINFO_VA + CPUINFO_CURPCB -/* _curproc points to the current process that has the CPU */ -_curproc = CPUINFO_VA + CPUINFO_CURPROC +/* curproc points to the current process that has the CPU */ +curproc = CPUINFO_VA + CPUINFO_CURPROC /* - * _cputyp is the current cpu type, used to distinguish between + * cputyp is the current cpu type, used to distinguish between * the many variations of different sun4* machines. It contains * the value CPU_SUN4, CPU_SUN4C, or CPU_SUN4M. */ - .globl _cputyp -_cputyp: + .globl _C_LABEL(cputyp) +_C_LABEL(cputyp): .word 1 #if defined(SUN4C) || defined(SUN4M) -_cputypval: +cputypval: .asciz "sun4c" .ascii " " -_cputypvar: +cputypvar: .asciz "compatible" -_cputypvallen = _cputypvar - _cputypval +cputypvallen = cputypvar - cputypval _ALIGN #endif @@ -222,16 +223,16 @@ _cputypvallen = _cputypvar - _cputypval * There variables are pointed to by the cpp symbols PGSHIFT, NBPG, * and PGOFSET. */ - .globl _pgshift, _nbpg, _pgofset -_pgshift: + .globl _C_LABEL(pgshift), _C_LABEL(nbpg), _C_LABEL(pgofset) +_C_LABEL(pgshift): .word 0 -_nbpg: +_C_LABEL(nbpg): .word 0 -_pgofset: +_C_LABEL(pgofset): .word 0 - .globl _trapbase -_trapbase: + .globl _C_LABEL(trapbase) +_C_LABEL(trapbase): .word 0 #if 0 @@ -313,11 +314,11 @@ _msgbufaddr = KERNBASE /* hardware interrupts (can be linked or made `fast') */ #define HARDINT44C(lev) \ - mov (lev), %l3; b _sparc_interrupt44c; mov %psr, %l0; nop + mov (lev), %l3; b _C_LABEL(sparc_interrupt44c); mov %psr, %l0; nop /* hardware interrupts (can be linked or made `fast') */ #define HARDINT4M(lev) \ - mov (lev), %l3; b _sparc_interrupt4m; mov %psr, %l0; nop + mov (lev), %l3; b _C_LABEL(sparc_interrupt4m); mov %psr, %l0; nop /* software interrupts (may not be made direct, sorry---but you should not be using them trivially anyway) */ @@ -355,9 +356,9 @@ _msgbufaddr = KERNBASE #define ZS_INTERRUPT4M HARDINT4M(12) #endif - .globl start, _kernel_text - _kernel_text = start ! for kvm_mkdb(8) -start: + .globl _ASM_LABEL(start), _C_LABEL(kernel_text) + _C_LABEL(kernel_text) = start ! for kvm_mkdb(8) +_ASM_LABEL(start): /* * Put sun4 traptable first, since it needs the most stringent aligment (8192) */ @@ -1472,8 +1473,8 @@ wmask: .skip 32 ! u_char wmask[0..31]; add %fp, stackspace, %sp; \ 1: \ /* came from user mode: compute pcb_nw */ \ - sethi %hi(_cpcb), %l6; \ - ld [%l6 + %lo(_cpcb)], %l6; \ + sethi %hi(cpcb), %l6; \ + ld [%l6 + %lo(cpcb)], %l6; \ ld [%l6 + PCB_WIM], %l5; \ and %l0, 31, %l4; \ sub %l4, %l5, %l5; \ @@ -1485,8 +1486,8 @@ wmask: .skip 32 ! u_char wmask[0..31]; sethi %hi(USPACE+(stackspace)), %l5; \ /* yes, in trap window; must clean it */ \ CALL_CLEAN_TRAP_WINDOW; \ - sethi %hi(_cpcb), %l6; \ - ld [%l6 + %lo(_cpcb)], %l6; \ + sethi %hi(cpcb), %l6; \ + ld [%l6 + %lo(cpcb)], %l6; \ sethi %hi(USPACE+(stackspace)), %l5; \ 2: \ /* trap window is (now) clean: set %sp */ \ @@ -1533,8 +1534,8 @@ wmask: .skip 32 ! u_char wmask[0..31]; add %fp, stackspace, %sp; /* else stay on intstack */ \ 1: \ /* came from user mode: compute pcb_nw */ \ - sethi %hi(_cpcb), %l6; \ - ld [%l6 + %lo(_cpcb)], %l6; \ + sethi %hi(cpcb), %l6; \ + ld [%l6 + %lo(cpcb)], %l6; \ ld [%l6 + PCB_WIM], %l5; \ and %l0, 31, %l4; \ sub %l4, %l5, %l5; \ @@ -1566,9 +1567,9 @@ wmask: .skip 32 ! u_char wmask[0..31]; btst %l5, %l4; \ /* came from kernel mode; cond codes still indicate trap window */ \ bz,a 0f; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi(_C_LABEL(eintstack)), %l7; \ CALL_CLEAN_TRAP_WINDOW; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi(_C_LABEL(eintstack)), %l7; \ 0: /* now if %fp >= eintstack, we were on the kernel stack */ \ cmp %fp, %l7; \ bge,a 3f; \ @@ -1577,8 +1578,8 @@ wmask: .skip 32 ! u_char wmask[0..31]; add %fp, stackspace, %sp; /* else stay on intstack */ \ 1: \ /* came from user mode: compute pcb_nw */ \ - sethi %hi(_cpcb), %l6; \ - ld [%l6 + %lo(_cpcb)], %l6; \ + sethi %hi(cpcb), %l6; \ + ld [%l6 + %lo(cpcb)], %l6; \ ld [%l6 + PCB_WIM], %l5; \ and %l0, 31, %l4; \ sub %l4, %l5, %l5; \ @@ -1587,14 +1588,14 @@ wmask: .skip 32 ! u_char wmask[0..31]; st %l5, [%l6 + PCB_UW]; \ /* cond codes still indicate whether in trap window */ \ bz,a 2f; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi(_C_LABEL(eintstack)), %l7; \ /* yes, in trap window; must save regs */ \ CALL_CLEAN_TRAP_WINDOW; \ - sethi %hi(_eintstack), %l7; \ + sethi %hi(_C_LABEL(eintstack)), %l7; \ 2: \ add %l7, stackspace, %sp; \ 3: \ - SET_SP_REDZONE_CONST(_intstack, %l6, %l5); \ + SET_SP_REDZONE_CONST(_C_LABEL(intstack), %l6, %l5); \ 4: \ CHECK_SP_REDZONE(%l6, %l5) #endif /* MULTIPROCESSOR */ @@ -1621,8 +1622,8 @@ clean_trap_window: mov %g5, %l5 ! save %g5 mov %g6, %l6 ! ... and %g6 /* mov %g7, %l7 ! ... and %g7 (already done for us) */ - sethi %hi(_cpcb), %g6 ! get current pcb - ld [%g6 + %lo(_cpcb)], %g6 + sethi %hi(cpcb), %g6 ! get current pcb + ld [%g6 + %lo(cpcb)], %g6 /* Figure out whether it is a user window (cpcb->pcb_uw > 0). */ ld [%g6 + PCB_UW], %g7 @@ -1647,8 +1648,8 @@ ctw_merge: sll %g5, %g7, %g5 wr %g5, 0, %wim ! setwim(g5); and %g7, 31, %g7 ! cpcb->pcb_wim = g7 & 31; - sethi %hi(_cpcb), %g6 ! re-get current pcb - ld [%g6 + %lo(_cpcb)], %g6 + sethi %hi(cpcb), %g6 ! re-get current pcb + ld [%g6 + %lo(cpcb)], %g6 st %g7, [%g6 + PCB_WIM] nop restore ! back to trap window @@ -1670,8 +1671,8 @@ ctw_user: bne ctw_invalid ! choke on it EMPTY - sethi %hi(_pgofset), %g6 ! trash %g6=curpcb - ld [%g6 + %lo(_pgofset)], %g6 + sethi %hi(_C_LABEL(pgofset)), %g6 ! trash %g6=curpcb + ld [%g6 + %lo(_C_LABEL(pgofset))], %g6 PTE_OF_ADDR(%sp, %g7, ctw_invalid, %g6, NOP_ON_4M_1) CMP_PTE_USER_WRITE(%g7, %g5, NOP_ON_4M_2) ! likewise if not writable bne ctw_invalid @@ -1700,8 +1701,8 @@ ctw_invalid: * Reread cpcb->pcb_uw. We decremented this earlier, * so it is off by one. */ - sethi %hi(_cpcb), %g6 ! re-get current pcb - ld [%g6 + %lo(_cpcb)], %g6 + sethi %hi(cpcb), %g6 ! re-get current pcb + ld [%g6 + %lo(cpcb)], %g6 ld [%g6 + PCB_UW], %g7 ! (number of user windows) - 1 add %g6, PCB_RW, %g5 @@ -1780,9 +1781,9 @@ ctw_invalid: memfault_sun4: TRAP_SETUP(-CCFSZ-80) #if defined(UVM) - INCR(_uvmexp+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) #else - INCR(_cnt+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) #endif st %g1, [%sp + CCFSZ + 20] ! save g1 @@ -1795,7 +1796,7 @@ memfault_sun4: * buserr = basically just like sun4c sync error reg but * no SER_WRITE bit (have to figure out from code). */ - set _par_err_reg, %o0 ! memerr ctrl addr -- XXX mapped? + set _C_LABEL(par_err_reg), %o0 ! memerr ctrl addr -- XXX mapped? ld [%o0], %o0 ! get it std %g2, [%sp + CCFSZ + 24] ! save g2, g3 ld [%o0], %o1 ! memerr ctrl register @@ -1814,9 +1815,9 @@ memfault_sun4: /* memory error = death for now XXX */ clr %o3 clr %o4 - call _memerr4_4c ! memerr(0, ser, sva, 0, 0) + call _C_LABEL(memerr4_4c) ! memerr(0, ser, sva, 0, 0) clr %o0 - call _prom_halt + call _C_LABEL(prom_halt) nop 0: @@ -1849,9 +1850,9 @@ memfault_sun4c: #if defined(SUN4C) TRAP_SETUP(-CCFSZ-80) #if defined(UVM) - INCR(_uvmexp+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) #else - INCR(_cnt+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) #endif st %g1, [%sp + CCFSZ + 20] ! save g1 @@ -1914,7 +1915,7 @@ memfault_sun4c: * If memerr() returns, return from the trap. */ wr %l0, PSR_ET, %psr - call _memerr4_4c ! memerr(0, ser, sva, aer, ava) + call _C_LABEL(memerr4_4c) ! memerr(0, ser, sva, aer, ava) clr %o0 ld [%sp + CCFSZ + 20], %g1 ! restore g1 through g7 @@ -1934,7 +1935,7 @@ memfault_sun4c: * %o1 through %o4 still hold the error reg contents. */ 1: - call _memerr4_4c ! memerr(1, ser, sva, aer, ava) + call _C_LABEL(memerr4_4c) ! memerr(1, ser, sva, aer, ava) mov 1, %o0 ld [%sp + CCFSZ + 20], %g1 ! restore g1 through g7 @@ -1959,9 +1960,9 @@ BARF or %l4, %lo(CPUINFO_SYNCFLTDUMP), %l4 TRAP_SETUP(-CCFSZ-80) #if defined(UVM) - INCR(_uvmexp+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) #else - INCR(_cnt+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1) #endif st %g1, [%sp + CCFSZ + 20] ! save g1 @@ -1987,7 +1988,8 @@ BARF std %i2, [%sp + CCFSZ + 56] std %i4, [%sp + CCFSZ + 64] std %i6, [%sp + CCFSZ + 72] - call _mem_access_fault4m ! mem_access_fault(type,sfsr,sfva,&tf); + ! mem_access_fault(type,sfsr,sfva,&tf); + call _C_LABEL(mem_access_fault4m) add %sp, CCFSZ, %o3 ! (argument: &tf) ldd [%sp + CCFSZ + 0], %l0 ! load new values @@ -2023,7 +2025,7 @@ normal_mem_fault: mov %l0, %o4 ! (argument: psr) std %i4, [%sp + CCFSZ + 64] std %i6, [%sp + CCFSZ + 72] - call _mem_access_fault ! mem_access_fault(type, ser, sva, + call _C_LABEL(mem_access_fault)! mem_access_fault(type, ser, sva, ! pc, psr, &tf); add %sp, CCFSZ, %o5 ! (argument: &tf) @@ -2094,7 +2096,7 @@ Lslowtrap_reenter: mov %l1, %o2 ! (pc) std %i4, [%sp + CCFSZ + 64] add %sp, CCFSZ, %o3 ! (&tf) - call _trap ! trap(type, psr, pc, &tf) + call _C_LABEL(trap) ! trap(type, psr, pc, &tf) std %i6, [%sp + CCFSZ + 72] ldd [%sp + CCFSZ], %l0 ! load new values @@ -2139,13 +2141,13 @@ softtrap: blu Lslowtrap_reenter EMPTY #else - sethi %hi(_eintstack), %l7 + sethi %hi(_C_LABEL(eintstack)), %l7 cmp %sp, %l7 bge Lslowtrap_reenter EMPTY #endif - sethi %hi(_cpcb), %l6 - ld [%l6 + %lo(_cpcb)], %l6 + sethi %hi(cpcb), %l6 + ld [%l6 + %lo(cpcb)], %l6 set USPACE-CCFSZ-80, %l5 add %l6, %l5, %l7 SET_SP_REDZONE(%l6, %l5) @@ -2191,7 +2193,7 @@ bpt: * Now call kgdb_trap_glue(); if it returns, call trap(). */ mov %o0, %l3 ! gotta save trap type - call _kgdb_trap_glue ! kgdb_trap_glue(type, &trapframe) + call _C_LABEL(kgdb_trap_glue)! kgdb_trap_glue(type, &trapframe) add %sp, CCFSZ, %o1 ! (&trapframe) /* @@ -2216,11 +2218,10 @@ bpt: * int type; * struct trapframe *tf0; */ - .globl _kgdb_trap_glue -_kgdb_trap_glue: +_ENTRY(_C_LABEL(kgdb_trap_glue)) save %sp, -CCFSZ, %sp - call _write_all_windows + call _C_LABEL(write_all_windows) mov %sp, %l4 ! %l4 = current %sp /* copy trapframe to top of kgdb stack */ @@ -2245,7 +2246,7 @@ _kgdb_trap_glue: /* if (kgdb_trap(type, tfcopy)) kgdb_rett(tfcopy); */ mov %i0, %o0 - call _kgdb_trap + call _C_LABEL(kgdb_trap) add %l0, -80, %o1 tst %o0 bnz,a kgdb_rett @@ -2316,8 +2317,8 @@ kgdb_rett: rd %psr, %l0 sll %l1, %l0, %l1 wr %l1, 0, %wim ! %wim = 1 << (%psr & 31) - sethi %hi(_cpcb), %l1 - ld [%l1 + %lo(_cpcb)], %l1 + sethi %hi(cpcb), %l1 + ld [%l1 + %lo(cpcb)], %l1 and %l0, 31, %l0 ! CWP = %psr & 31; st %l0, [%l1 + PCB_WIM] ! cpcb->pcb_wim = CWP; save %g0, %g0, %g0 ! back to window to reload @@ -2349,7 +2350,7 @@ syscall: std %i2, [%sp + CCFSZ + 56] mov %l1, %o2 ! (pc) std %i4, [%sp + CCFSZ + 64] - call _syscall ! syscall(code, &tf, pc, suncompat) + call _C_LABEL(syscall) ! syscall(code, &tf, pc, suncompat) std %i6, [%sp + CCFSZ + 72] ! now load em all up again, sigh ldd [%sp + CCFSZ + 0], %l0 ! new %psr, new pc @@ -2426,9 +2427,9 @@ softintr_common: INTR_SETUP(-CCFSZ-80) std %g2, [%sp + CCFSZ + 24] ! save registers #if defined(UVM) - INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #endif mov %g1, %l7 rd %y, %l6 @@ -2441,12 +2442,12 @@ softintr_common: wr %l4, PSR_ET, %psr ! song and dance is necessary std %l0, [%sp + CCFSZ + 0] ! set up intrframe/clockframe sll %l3, 2, %l5 - set _intrcnt, %l4 ! intrcnt[intlev]++; + set _C_LABEL(intrcnt), %l4 ! intrcnt[intlev]++; ld [%l4 + %l5], %o0 std %l2, [%sp + CCFSZ + 8] inc %o0 st %o0, [%l4 + %l5] - set _intrhand, %l4 ! %l4 = intrhand[intlev]; + set _C_LABEL(intrhand), %l4 ! %l4 = intrhand[intlev]; ld [%l4 + %l5], %l4 b 3f st %fp, [%sp + CCFSZ + 16] @@ -2474,15 +2475,14 @@ softintr_common: * (see intr.c). */ #if defined(SUN4M) - .globl _sparc_interrupt4m -_sparc_interrupt4m: +_ENTRY(_C_LABEL(sparc_interrupt4m)) mov 1, %l4 sethi %hi(CPUINFO_VA+CPUINFO_INTREG), %l6 ld [%l6 + %lo(CPUINFO_VA+CPUINFO_INTREG)], %l6 ld [%l6 + ICR_PI_PEND_OFFSET], %l5 ! get pending interrupts sll %l4, %l3, %l4 ! test SOFTINT bit andcc %l5, %l4, %g0 - bne _sparc_interrupt_common + bne sparc_interrupt_common nop ! a soft interrupt; clear bit in interrupt-pending register @@ -2491,15 +2491,14 @@ _sparc_interrupt4m: b,a softintr_common #endif - .globl _sparc_interrupt44c -_sparc_interrupt44c: -_sparc_interrupt_common: +_ENTRY(_C_LABEL(sparc_interrupt44c)) +sparc_interrupt_common: INTR_SETUP(-CCFSZ-80) std %g2, [%sp + CCFSZ + 24] ! save registers #if defined(UVM) - INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #endif mov %g1, %l7 rd %y, %l6 @@ -2512,12 +2511,12 @@ _sparc_interrupt_common: wr %l4, PSR_ET, %psr ! song and dance is necessary std %l0, [%sp + CCFSZ + 0] ! set up intrframe/clockframe sll %l3, 2, %l5 - set _intrcnt, %l4 ! intrcnt[intlev]++; + set _C_LABEL(intrcnt), %l4 ! intrcnt[intlev]++; ld [%l4 + %l5], %o0 std %l2, [%sp + CCFSZ + 8] ! set up intrframe/clockframe inc %o0 st %o0, [%l4 + %l5] - set _intrhand, %l4 ! %l4 = intrhand[intlev]; + set _C_LABEL(intrhand), %l4 ! %l4 = intrhand[intlev]; ld [%l4 + %l5], %l4 b 3f st %fp, [%sp + CCFSZ + 16] @@ -2537,13 +2536,13 @@ _sparc_interrupt_common: nop /* Unhandled interrupts while cold cause IPL to be raised to `high' */ - sethi %hi(_cold), %o0 - ld [%o0 + %lo(_cold)], %o0 + sethi %hi(_C_LABEL(cold)), %o0 + ld [%o0 + %lo(_C_LABEL(cold))], %o0 tst %o0 ! if (cold) { bnz,a 4f ! splhigh(); or %l0, 0xf00, %l0 ! } else - call _strayintr ! strayintr(&intrframe) + call _C_LABEL(strayintr) ! strayintr(&intrframe) add %sp, CCFSZ, %o0 /* all done: restore registers and go return */ 4: mov %l7, %g1 @@ -2597,9 +2596,9 @@ zshard: nmi_sun4: INTR_SETUP(-CCFSZ-80) #if defined(UVM) - INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #endif /* * Level 15 interrupts are nonmaskable, so with traps off, @@ -2627,9 +2626,9 @@ nmi_sun4: nmi_sun4c: INTR_SETUP(-CCFSZ-80) #if defined(UVM) - INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #endif /* * Level 15 interrupts are nonmaskable, so with traps off, @@ -2664,7 +2663,7 @@ nmi_sun4c: nmi_common: ! and call C code - call _memerr4_4c ! memerr(0, ser, sva, aer, ava) + call _C_LABEL(memerr4_4c) ! memerr(0, ser, sva, aer, ava) clr %o0 mov %l5, %g1 ! restore g1 through g7 @@ -2686,9 +2685,9 @@ nmi_common: nmi_sun4m: INTR_SETUP(-CCFSZ-80) #if defined(UVM) - INCR(_uvmexp+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #else - INCR(_cnt+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) + INCR(_C_LABEL(cnt)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1) #endif /* Read the Pending Interrupts register */ @@ -2696,14 +2695,14 @@ nmi_sun4m: ld [%l6 + %lo(CPUINFO_VA+CPUINFO_INTREG)], %l6 ld [%l6 + ICR_PI_PEND_OFFSET], %l5 ! get pending interrupts - set _nmi_soft, %o3 ! assume a softint + set _C_LABEL(nmi_soft), %o3 ! assume a softint set PINTR_IC, %o1 ! hard lvl 15 bit sethi %hi(PINTR_SINTRLEV(15)), %o0 ! soft lvl 15 bit btst %o0, %l5 ! soft level 15? bnz,a 1f ! mov %o0, %o1 ! shift int clear bit to SOFTINT 15 - set _nmi_hard, %o3 ! it's a hardint; switch handler + set _C_LABEL(nmi_hard), %o3 ! it's a hardint; switch handler /* * Level 15 interrupts are nonmaskable, so with traps off, @@ -2826,8 +2825,8 @@ winof_user: * SHOULD EXPAND IN LINE TO AVOID BUILDING TRAP FRAME ON * `EASY' SAVES */ - sethi %hi(_cpcb), %l6 - ld [%l6 + %lo(_cpcb)], %l6 + sethi %hi(cpcb), %l6 + ld [%l6 + %lo(cpcb)], %l6 ld [%l6 + PCB_WIM], %l5 and %l0, 31, %l3 sub %l3, %l5, %l5 /* l5 = CWP - pcb_wim */ @@ -2836,8 +2835,8 @@ winof_user: st %l5, [%l6 + PCB_UW] jmpl %l7 + %lo(clean_trap_window), %l4 mov %g7, %l7 ! for clean_trap_window - sethi %hi(_cpcb), %l6 - ld [%l6 + %lo(_cpcb)], %l6 + sethi %hi(cpcb), %l6 + ld [%l6 + %lo(cpcb)], %l6 set USPACE-CCFSZ-80, %l5 add %l6, %l5, %sp /* over to kernel stack */ CHECK_SP_REDZONE(%l6, %l5) @@ -2910,8 +2909,8 @@ window_uf: and %l0, 31, %l0 sll %l1, %l0, %l1 ! wim = 1 << cwp; wr %l1, 0, %wim ! setwim(wim); - sethi %hi(_cpcb), %l1 - ld [%l1 + %lo(_cpcb)], %l1 + sethi %hi(cpcb), %l1 + ld [%l1 + %lo(cpcb)], %l1 st %l0, [%l1 + PCB_WIM] ! cpcb->pcb_wim = cwp; save %g0, %g0, %g0 ! back to window I LOADWIN(%sp) @@ -2936,8 +2935,8 @@ winuf_user: bne winuf_invalid EMPTY - sethi %hi(_pgofset), %l4 - ld [%l4 + %lo(_pgofset)], %l4 + sethi %hi(_C_LABEL(pgofset)), %l4 + ld [%l4 + %lo(_C_LABEL(pgofset))], %l4 PTE_OF_ADDR(%sp, %l7, winuf_invalid, %l4, NOP_ON_4M_5) CMP_PTE_USER_READ(%l7, %l5, NOP_ON_4M_6) ! if first page not readable, bne winuf_invalid ! it is invalid @@ -2971,8 +2970,8 @@ winuf_invalid: */ save %g0, %g0, %g0 ! back to R save %g0, 1, %l4 ! back to T, then %l4 = 1 - sethi %hi(_cpcb), %l6 - ld [%l6 + %lo(_cpcb)], %l6 + sethi %hi(cpcb), %l6 + ld [%l6 + %lo(cpcb)], %l6 st %l4, [%l6 + PCB_UW] ! pcb_uw = 1 ld [%l6 + PCB_WIM], %l5 ! get log2(%wim) sll %l4, %l5, %l4 ! %l4 = old %wim @@ -3000,7 +2999,7 @@ winuf_invalid: std %i0, [%sp + CCFSZ + 48] ! tf.tf_out[0], etc std %i2, [%sp + CCFSZ + 56] std %i4, [%sp + CCFSZ + 64] - call _trap ! trap(T_WINUF, pc, psr, &tf) + call _C_LABEL(trap) ! trap(T_WINUF, pc, psr, &tf) std %i6, [%sp + CCFSZ + 72] ! tf.tf_out[6] ldd [%sp + CCFSZ + 0], %l0 ! new psr, pc @@ -3015,8 +3014,8 @@ winuf_invalid: ldd [%sp + CCFSZ + 64], %i4 wr %l0, 0, %psr ! disable traps: test must be atomic ldd [%sp + CCFSZ + 72], %i6 - sethi %hi(_cpcb), %l6 - ld [%l6 + %lo(_cpcb)], %l6 + sethi %hi(cpcb), %l6 + ld [%l6 + %lo(cpcb)], %l6 ld [%l6 + PCB_NSAVED], %l7 ! if nsaved is -1, we have our regs tst %l7 bl,a 1f ! got them @@ -3057,8 +3056,8 @@ winuf_ok: rd %psr, %l0 sll %l1, %l0, %l1 wr %l1, 0, %wim ! make this one invalid - sethi %hi(_cpcb), %l2 - ld [%l2 + %lo(_cpcb)], %l2 + sethi %hi(cpcb), %l2 + ld [%l2 + %lo(cpcb)], %l2 and %l0, 31, %l0 st %l0, [%l2 + PCB_WIM] ! cpcb->pcb_wim = cwp; save %g0, %g0, %g0 ! back to I @@ -3112,8 +3111,8 @@ rft_kernel: and %l0, 31, %l0 sll %l1, %l0, %l1 ! wim = 1 << CWP; wr %l1, 0, %wim ! setwim(wim); - sethi %hi(_cpcb), %l1 - ld [%l1 + %lo(_cpcb)], %l1 + sethi %hi(cpcb), %l1 + ld [%l1 + %lo(cpcb)], %l1 st %l0, [%l1 + PCB_WIM] ! cpcb->pcb_wim = l0 & 31; save %g0, %g0, %g0 ! back to window I LOADWIN(%sp) @@ -3137,8 +3136,8 @@ rft_kernel: * If returning to a valid window, just set psr and return. */ rft_user: -! sethi %hi(_want_ast), %l7 ! (done below) - ld [%l7 + %lo(_want_ast)], %l7 +! sethi %hi(_C_LABEL(want_ast)), %l7 ! (done below) + ld [%l7 + %lo(_C_LABEL(want_ast))], %l7 tst %l7 ! want AST trap? bne,a softtrap ! yes, re-enter trap with type T_AST mov T_AST, %o0 @@ -3160,8 +3159,8 @@ rft_user: bne rft_invalid EMPTY - sethi %hi(_pgofset), %l3 - ld [%l3 + %lo(_pgofset)], %l3 + sethi %hi(_C_LABEL(pgofset)), %l3 + ld [%l3 + %lo(_C_LABEL(pgofset))], %l3 PTE_OF_ADDR(%fp, %l7, rft_invalid, %l3, NOP_ON_4M_9) CMP_PTE_USER_READ(%l7, %l5, NOP_ON_4M_10) ! try first page bne rft_invalid ! no good @@ -3198,8 +3197,8 @@ rft_user_ok: rd %psr, %l0 ! l0 = (junk << 5) + CWP; sll %l1, %l0, %l1 ! %wim = 1 << CWP; wr %l1, 0, %wim - sethi %hi(_cpcb), %l1 - ld [%l1 + %lo(_cpcb)], %l1 + sethi %hi(cpcb), %l1 + ld [%l1 + %lo(cpcb)], %l1 and %l0, 31, %l0 st %l0, [%l1 + PCB_WIM] ! cpcb->pcb_wim = l0 & 31; save %g0, %g0, %g0 ! back to window I @@ -3244,12 +3243,12 @@ rft_user_or_recover_pcb_windows: * if -1, cpcb->pcb_rw[0] holds user registers for rett window * from an earlier T_RWRET pseudo-trap. */ - sethi %hi(_cpcb), %l6 - ld [%l6 + %lo(_cpcb)], %l6 + sethi %hi(cpcb), %l6 + ld [%l6 + %lo(cpcb)], %l6 ld [%l6 + PCB_NSAVED], %l7 tst %l7 bz,a rft_user - sethi %hi(_want_ast), %l7 ! first instr of rft_user + sethi %hi(_C_LABEL(want_ast)), %l7 ! first instr of rft_user bg,a softtrap ! if (pcb_nsaved > 0) mov T_WINOF, %o0 ! trap(T_WINOF); @@ -3288,8 +3287,8 @@ rft_user_or_recover_pcb_windows: RETT ! exported end marker for kernel gdb - .globl _endtrapcode -_endtrapcode: + .globl _C_LABEL(endtrapcode) +_C_LABEL(endtrapcode): /* * init_tables(nwin) int nwin; @@ -3362,8 +3361,7 @@ init_tables: /* * getidprom(struct idprom *, sizeof(struct idprom)) */ - .global _getidprom -_getidprom: +_ENTRY(_C_LABEL(getidprom)) set AC_IDPROM, %o2 1: lduba [%o2] ASI_CONTROL, %o3 stb %o3, [%o0] @@ -3453,13 +3451,13 @@ dostart: mov 0, %o0 ! node mov %o0, %l0 - set _cputypvar-KERNBASE, %o1 ! name = "compatible" - set _cputypval-KERNBASE, %o2 ! buffer ptr (assume buffer long enough) + set cputypvar-KERNBASE, %o1 ! name = "compatible" + set cputypval-KERNBASE, %o2 ! buffer ptr (assume buffer long enough) ld [%g7 + PV_NODEOPS], %o4 ! (void)pv->pv_nodeops->no_getprop(...) ld [%o4 + NO_GETPROP], %o4 call %o4 nop - set _cputypval-KERNBASE, %o2 ! buffer ptr + set cputypval-KERNBASE, %o2 ! buffer ptr ldub [%o2 + 4], %o0 ! which is it... "sun4c", "sun4m", "sun4d"? cmp %o0, 'c' be is_sun4c @@ -3744,20 +3742,20 @@ startmap_done: jmp %g1 nop 1: - sethi %hi(_cputyp), %o0 ! what type of cpu we are on - st %g4, [%o0 + %lo(_cputyp)] + sethi %hi(_C_LABEL(cputyp)), %o0 ! what type of cpu we are on + st %g4, [%o0 + %lo(_C_LABEL(cputyp))] - sethi %hi(_pgshift), %o0 ! pgshift = log2(nbpg) - st %g5, [%o0 + %lo(_pgshift)] + sethi %hi(_C_LABEL(pgshift)), %o0 ! pgshift = log2(nbpg) + st %g5, [%o0 + %lo(_C_LABEL(pgshift))] mov 1, %o0 ! nbpg = 1 << pgshift sll %o0, %g5, %g5 - sethi %hi(_nbpg), %o0 ! nbpg = bytes in a page - st %g5, [%o0 + %lo(_nbpg)] + sethi %hi(_C_LABEL(nbpg)), %o0 ! nbpg = bytes in a page + st %g5, [%o0 + %lo(_C_LABEL(nbpg))] sub %g5, 1, %g5 - sethi %hi(_pgofset), %o0 ! page offset = bytes in a page - 1 - st %g5, [%o0 + %lo(_pgofset)] + sethi %hi(_C_LABEL(pgofset)), %o0 ! page offset = bytes in a page - 1 + st %g5, [%o0 + %lo(_C_LABEL(pgofset))] rd %psr, %g3 ! paranoia: make sure ... andn %g3, PSR_ET, %g3 ! we have traps off @@ -3771,8 +3769,8 @@ startmap_done: wr %g0, 2, %wim ! set initial %wim (w1 invalid) mov 1, %g1 ! set pcb_wim (log2(%wim) = 1) - sethi %hi(_u0 + PCB_WIM), %g2 - st %g1, [%g2 + %lo(_u0 + PCB_WIM)] + sethi %hi(_C_LABEL(u0) + PCB_WIM), %g2 + st %g1, [%g2 + %lo(_C_LABEL(u0) + PCB_WIM)] set USRSTACK - CCFSZ, %fp ! as if called from user code set estack0 - CCFSZ - 80, %sp ! via syscall(boot_me_up) or somesuch @@ -3781,8 +3779,8 @@ startmap_done: nop; nop; nop /* Export actual trapbase */ - sethi %hi(_trapbase), %o0 - st %g6, [%o0+%lo(_trapbase)] + sethi %hi(_C_LABEL(trapbase)), %o0 + st %g6, [%o0+%lo(_C_LABEL(trapbase))] /* * Step 2: clear BSS. This may just be paranoia; the boot @@ -3790,7 +3788,7 @@ startmap_done: */ set _edata, %o0 ! bzero(edata, end - edata) set _end, %o1 - call _bzero + call _C_LABEL(bzero) sub %o1, %o0, %o1 /* @@ -3798,8 +3796,8 @@ startmap_done: * (which we just zeroed). * This depends on the fact that bzero does not use %g7. */ - sethi %hi(_romp), %l0 - st %g7, [%l0 + %lo(_romp)] + sethi %hi(_C_LABEL(romp)), %l0 + st %g7, [%l0 + %lo(_C_LABEL(romp))] /* * Step 3: compute number of windows and set up tables. @@ -3810,9 +3808,9 @@ startmap_done: restore and %g1, 31, %g1 ! want just the CWP bits add %g1, 1, %o0 ! compute nwindows - sethi %hi(_nwindows), %o1 ! may as well tell everyone + sethi %hi(_C_LABEL(nwindows)), %o1 ! may as well tell everyone call init_tables - st %o0, [%o1 + %lo(_nwindows)] + st %o0, [%o1 + %lo(_C_LABEL(nwindows))] #if defined(SUN4) /* @@ -3889,37 +3887,37 @@ Lgandul: nop /* Clear `cpuinfo' */ sethi %hi(CPUINFO_VA), %o0 ! bzero(&cpuinfo, NBPG) sethi %hi(CPUINFO_STRUCTSIZE), %o1 - call _bzero + call _C_LABEL(bzero) add %o1, %lo(CPUINFO_STRUCTSIZE), %o1 /* Initialize `cpuinfo' fields which are needed early */ - set _u0, %o0 ! cpuinfo.curpcb = _u0; - sethi %hi(_cpcb), %l0 - st %o0, [%l0 + %lo(_cpcb)] + set _C_LABEL(u0), %o0 ! cpuinfo.curpcb = u0; + sethi %hi(cpcb), %l0 + st %o0, [%l0 + %lo(cpcb)] - set _eintstack, %o0 ! cpuinfo.eintstack= _eintstack; + set _C_LABEL(eintstack), %o0 ! cpuinfo.eintstack= _eintstack; sethi %hi(_EINTSTACKP), %l0 st %o0, [%l0 + %lo(_EINTSTACKP)] /* * Ready to run C code; finish bootstrap. */ - call _bootstrap + call _C_LABEL(bootstrap) nop /* * Call main. This returns to us after loading /sbin/init into * user space. (If the exec fails, main() does not return.) */ - call _main + call _C_LABEL(main) clr %o0 ! our frame arg is ignored /*NOTREACHED*/ /* * Entry point for non-boot CPUs in MP systems. */ - .globl _cpu_hatch -_cpu_hatch: + .globl _C_LABEL(cpu_hatch) +_C_LABEL(cpu_hatch): rd %psr, %g3 ! paranoia: make sure ... andn %g3, PSR_ET, %g3 ! we have traps off wr %g3, 0, %psr ! so that we can fiddle safely @@ -3933,15 +3931,15 @@ _cpu_hatch: wr %g0, 2, %wim ! set initial %wim (w1 invalid) /* Initialize Trap Base register */ - sethi %hi(_trapbase), %o0 - ld [%o0+%lo(_trapbase)], %g6 + sethi %hi(_C_LABEL(trapbase)), %o0 + ld [%o0+%lo(_C_LABEL(trapbase))], %g6 wr %g6, 0, %tbr nop; nop; nop ! paranoia /* Set up a stack */ set USRSTACK - CCFSZ, %fp ! as if called from user code - sethi %hi(_cpu_hatchstack), %o0 - ld [%o0+%lo(_cpu_hatchstack)], %o0 + sethi %hi(_C_LABEL(cpu_hatchstack)), %o0 + ld [%o0+%lo(_C_LABEL(cpu_hatchstack))], %o0 set USPACE - CCFSZ - 80, %sp add %sp, %o0, %sp @@ -3951,9 +3949,9 @@ _cpu_hatch: nop; nop; nop /* Call C code */ - sethi %hi(_cpu_hatch_sc), %o0 - call _cpu_setup - ld [%o0+%lo(_cpu_hatch_sc)], %o0 + sethi %hi(_C_LABEL(cpu_hatch_sc)), %o0 + call _C_LABEL(cpu_setup) + ld [%o0+%lo(_C_LABEL(cpu_hatch_sc))], %o0 /* Idle here .. */ rd %psr, %l0 @@ -3989,9 +3987,9 @@ _cpu_hatch: * will eventually be removed, with a hole left in its place, if things * work out. */ - .globl _sigcode - .globl _esigcode -_sigcode: + .globl _C_LABEL(sigcode) + .globl _C_LABEL(esigcode) +_C_LABEL(sigcode): /* * XXX the `save' and `restore' below are unnecessary: should * replace with simple arithmetic on %sp @@ -4083,7 +4081,7 @@ _sigcode: ! sigreturn does not return unless it fails mov SYS_exit, %g1 ! exit(errno) t ST_SYSCALL -_esigcode: +_C_LABEL(esigcode): #ifdef COMPAT_SVR4 /* @@ -4110,9 +4108,9 @@ _esigcode: * will eventually be removed, with a hole left in its place, if things * work out. */ - .globl _svr4_sigcode - .globl _svr4_esigcode -_svr4_sigcode: + .globl _C_LABEL(svr4_sigcode) + .globl _C_LABEL(svr4_esigcode) +_C_LABEL(svr4_sigcode): /* * XXX the `save' and `restore' below are unnecessary: should * replace with simple arithmetic on %sp @@ -4204,26 +4202,13 @@ _svr4_sigcode: ! setcontext does not return unless it fails mov SYS_exit, %g1 ! exit(errno) t ST_SYSCALL -_svr4_esigcode: +_C_LABEL(svr4_esigcode): #endif /* * Primitives */ -#ifdef GPROF - .globl mcount -#define ENTRY(x) \ - .globl _/**/x; _/**/x: ; \ - save %sp, -CCFSZ, %sp; \ - call mcount; \ - nop; \ - restore -#else -#define ENTRY(x) .globl _/**/x; _/**/x: -#endif -#define ALTENTRY(x) .globl _/**/x; _/**/x: - /* * General-purpose NULL routine. */ @@ -4254,14 +4239,14 @@ ENTRY(copyinstr) set KERNBASE, %o4 cmp %o0, %o4 ! fromaddr < KERNBASE? blu,a Lcsdocopy ! yes, go do it - sethi %hi(_cpcb), %o4 ! (first instr of copy) + sethi %hi(cpcb), %o4 ! (first instr of copy) b Lcsdone ! no, return EFAULT mov EFAULT, %o0 1: sethi %hi(2f), %o0 - call _panic + call _C_LABEL(panic) or %lo(2f), %o0, %o0 2: .asciz "copyinstr" _ALIGN @@ -4282,21 +4267,21 @@ ENTRY(copyoutstr) set KERNBASE, %o4 cmp %o1, %o4 ! toaddr < KERNBASE? blu,a Lcsdocopy ! yes, go do it - sethi %hi(_cpcb), %o4 ! (first instr of copy) + sethi %hi(cpcb), %o4 ! (first instr of copy) b Lcsdone ! no, return EFAULT mov EFAULT, %o0 1: sethi %hi(2f), %o0 - call _panic + call _C_LABEL(panic) or %lo(2f), %o0, %o0 2: .asciz "copyoutstr" _ALIGN Lcsdocopy: -! sethi %hi(_cpcb), %o4 ! (done earlier) - ld [%o4 + %lo(_cpcb)], %o4 ! catch faults +! sethi %hi(cpcb), %o4 ! (done earlier) + ld [%o4 + %lo(cpcb)], %o4 ! catch faults set Lcsfault, %o5 st %o5, [%o4 + PCB_ONFAULT] @@ -4368,7 +4353,7 @@ ENTRY(copystr) #ifdef DIAGNOSTIC 4: sethi %hi(5f), %o0 - call _panic + call _C_LABEL(panic) or %lo(5f), %o0, %o0 5: .asciz "copystr" @@ -4384,7 +4369,7 @@ ENTRY(copyin) set KERNBASE, %o3 cmp %o0, %o3 ! src < KERNBASE? blu,a Ldocopy ! yes, can try it - sethi %hi(_cpcb), %o3 + sethi %hi(cpcb), %o3 /* source address points into kernel space: return EFAULT */ retl @@ -4401,7 +4386,7 @@ ENTRY(copyout) set KERNBASE, %o3 cmp %o1, %o3 ! dst < KERBASE? blu,a Ldocopy - sethi %hi(_cpcb), %o3 + sethi %hi(cpcb), %o3 /* destination address points into kernel space: return EFAULT */ retl @@ -4411,15 +4396,15 @@ ENTRY(copyout) * ******NOTE****** this depends on bcopy() not using %g7 */ Ldocopy: -! sethi %hi(_cpcb), %o3 - ld [%o3 + %lo(_cpcb)], %o3 +! sethi %hi(cpcb), %o3 + ld [%o3 + %lo(cpcb)], %o3 set Lcopyfault, %o4 mov %o7, %g7 ! save return address - call _bcopy ! bcopy(src, dst, len) + call _C_LABEL(bcopy) ! bcopy(src, dst, len) st %o4, [%o3 + PCB_ONFAULT] - sethi %hi(_cpcb), %o3 - ld [%o3 + %lo(_cpcb)], %o3 + sethi %hi(cpcb), %o3 + ld [%o3 + %lo(cpcb)], %o3 st %g0, [%o3 + PCB_ONFAULT] jmp %g7 + 8 clr %o0 ! return 0 @@ -4429,8 +4414,8 @@ Ldocopy: ! the only special thing is that we have to return to [g7 + 8] rather than ! [o7 + 8]. Lcopyfault: - sethi %hi(_cpcb), %o3 - ld [%o3 + %lo(_cpcb)], %o3 + sethi %hi(cpcb), %o3 + ld [%o3 + %lo(cpcb)], %o3 st %g0, [%o3 + PCB_ONFAULT] jmp %g7 + 8 mov EFAULT, %o0 @@ -4448,8 +4433,8 @@ Lcopyfault: * restore(); */ ENTRY(write_user_windows) - sethi %hi(_cpcb), %g6 - ld [%g6 + %lo(_cpcb)], %g6 + sethi %hi(cpcb), %g6 + ld [%g6 + %lo(cpcb)], %g6 b 2f clr %g5 1: @@ -4467,23 +4452,23 @@ ENTRY(write_user_windows) nop - .comm _want_resched,4 - .comm _want_ast,4 + .comm _C_LABEL(want_resched),4 + .comm _C_LABEL(want_ast),4 /* * Masterpaddr is the p->p_addr of the last process on the processor. * XXX masterpaddr is almost the same as cpcb * XXX should delete this entirely */ - .comm _masterpaddr, 4 + .comm _C_LABEL(masterpaddr), 4 /* * Switch statistics (for later tweaking): * nswitchdiff = p1 => p2 (i.e., chose different process) * nswitchexit = number of calls to switchexit() - * _cnt.v_swtch = total calls to swtch+swtchexit + * cnt.v_swtch = total calls to swtch+swtchexit */ - .comm _nswitchdiff, 4 - .comm _nswitchexit, 4 + .comm _C_LABEL(nswitchdiff), 4 + .comm _C_LABEL(nswitchexit), 4 /* * REGISTER USAGE IN cpu_switch AND switchexit: @@ -4495,12 +4480,12 @@ ENTRY(write_user_windows) * usually changes the CWP field (hence heavy usage of %g's). * * %g1 = oldpsr (excluding ipl bits) - * %g2 = %hi(_whichqs); newpsr + * %g2 = %hi(whichqs); newpsr * %g3 = p * %g4 = lastproc * %g5 = ; newpcb - * %g6 = %hi(_cpcb) - * %g7 = %hi(_curproc) + * %g6 = %hi(cpcb) + * %g7 = %hi(curproc) * %o0 = tmp 1 * %o1 = tmp 2 * %o2 = tmp 3 @@ -4522,28 +4507,28 @@ ENTRY(switchexit) /* * Change pcb to idle u. area, i.e., set %sp to top of stack - * and %psr to PSR_S|PSR_ET, and set cpcb to point to _idle_u. + * and %psr to PSR_S|PSR_ET, and set cpcb to point to idle_u. * Once we have left the old stack, we can call kmem_free to * destroy it. Call it any sooner and the register windows * go bye-bye. */ #if defined(MULTIPROCESSOR) - sethi %hi(_IDLE_UP), %g5 - ld [%g5 + %lo(_IDLE_UP)], %g5 + sethi %hi(IDLE_UP), %g5 + ld [%g5 + %lo(IDLE_UP)], %g5 #else - set _idle_u, %g5 + set _C_LABEL(idle_u), %g5 #endif - sethi %hi(_cpcb), %g6 + sethi %hi(cpcb), %g6 mov 1, %g7 wr %g0, PSR_S, %psr ! change to window 0, traps off wr %g0, 2, %wim ! and make window 1 the trap window - st %g5, [%g6 + %lo(_cpcb)] ! cpcb = &idle_u + st %g5, [%g6 + %lo(cpcb)] ! cpcb = &idle_u st %g7, [%g5 + PCB_WIM] ! idle_u.pcb_wim = log2(2) = 1 #if defined(MULTIPROCESSOR) set USPACE-CCFSZ, %o1 ! add %g5, %o1, %sp ! set new %sp #else - set _idle_u + USPACE-CCFSZ, %sp ! set new %sp + set _C_LABEL(idle_u) + USPACE-CCFSZ, %sp ! set new %sp #endif #ifdef DEBUG @@ -4551,37 +4536,37 @@ ENTRY(switchexit) SET_SP_REDZONE(%l6, %l5) #endif wr %g0, PSR_S|PSR_ET, %psr ! and then enable traps - call _exit2 ! exit2(p) + call _C_LABEL(exit2) ! exit2(p) mov %g2, %o0 /* * Now fall through to `the last switch'. %g6 was set to - * %hi(_cpcb), but may have been clobbered in kmem_free, + * %hi(cpcb), but may have been clobbered in kmem_free, * so all the registers described below will be set here. * * REGISTER USAGE AT THIS POINT: * %g1 = oldpsr (excluding ipl bits) - * %g2 = %hi(_whichqs) + * %g2 = %hi(whichqs) * %g4 = lastproc - * %g6 = %hi(_cpcb) - * %g7 = %hi(_curproc) + * %g6 = %hi(cpcb) + * %g7 = %hi(curproc) * %o0 = tmp 1 * %o1 = tmp 2 * %o3 = whichqs */ - INCR(_nswitchexit) ! nswitchexit++; + INCR(_C_LABEL(nswitchexit)) ! nswitchexit++; #if defined(UVM) - INCR(_uvmexp+V_SWTCH) ! cnt.v_switch++; + INCR(_C_LABEL(uvmexp)+V_SWTCH) ! cnt.v_switch++; #else - INCR(_cnt+V_SWTCH) ! cnt.v_switch++; + INCR(_C_LABEL(cnt)+V_SWTCH) ! cnt.v_switch++; #endif mov PSR_S|PSR_ET, %g1 ! oldpsr = PSR_S | PSR_ET; - sethi %hi(_whichqs), %g2 + sethi %hi(_C_LABEL(whichqs)), %g2 clr %g4 ! lastproc = NULL; - sethi %hi(_cpcb), %g6 - sethi %hi(_curproc), %g7 + sethi %hi(cpcb), %g6 + sethi %hi(curproc), %g7 /* FALLTHROUGH */ /* @@ -4589,12 +4574,12 @@ ENTRY(switchexit) * idles here waiting for something to come ready. * The registers are set up as noted above. */ - .globl idle -idle: - st %g0, [%g7 + %lo(_curproc)] ! curproc = NULL; + .globl _ASM_LABEL(idle) +_ASM_LABEL(idle): + st %g0, [%g7 + %lo(curproc)] ! curproc = NULL; wr %g1, 0, %psr ! (void) spl0(); -1: ! spin reading _whichqs until nonzero - ld [%g2 + %lo(_whichqs)], %o3 +1: ! spin reading whichqs until nonzero + ld [%g2 + %lo(_C_LABEL(whichqs))], %o3 tst %o3 bnz,a Lsw_scan wr %g1, PIL_CLOCK << 8, %psr ! (void) splclock(); @@ -4602,15 +4587,15 @@ idle: Lsw_panic_rq: sethi %hi(1f), %o0 - call _panic + call _C_LABEL(panic) or %lo(1f), %o0, %o0 Lsw_panic_wchan: sethi %hi(2f), %o0 - call _panic + call _C_LABEL(panic) or %lo(2f), %o0, %o0 Lsw_panic_srun: sethi %hi(3f), %o0 - call _panic + call _C_LABEL(panic) or %lo(3f), %o0, %o0 1: .asciz "switch rq" 2: .asciz "switch wchan" @@ -4630,17 +4615,17 @@ Lsw_panic_srun: * IT MIGHT BE WORTH SAVING BEFORE ENTERING idle TO AVOID HAVING TO * SAVE LATER WHEN SOMEONE ELSE IS READY ... MUST MEASURE! */ - .globl ___ffstab + .globl _C_LABEL(__ffstab) ENTRY(cpu_switch) /* * REGISTER USAGE AT THIS POINT: * %g1 = oldpsr (excluding ipl bits) - * %g2 = %hi(_whichqs) + * %g2 = %hi(whichqs) * %g3 = p * %g4 = lastproc * %g5 = tmp 0 - * %g6 = %hi(_cpcb) - * %g7 = %hi(_curproc) + * %g6 = %hi(cpcb) + * %g7 = %hi(curproc) * %o0 = tmp 1 * %o1 = tmp 2 * %o2 = tmp 3 @@ -4648,13 +4633,13 @@ ENTRY(cpu_switch) * %o4 = tmp 5, then at Lsw_scan, which * %o5 = tmp 6, then at Lsw_scan, q */ - sethi %hi(_whichqs), %g2 ! set up addr regs - sethi %hi(_cpcb), %g6 - ld [%g6 + %lo(_cpcb)], %o0 + sethi %hi(_C_LABEL(whichqs)), %g2 ! set up addr regs + sethi %hi(cpcb), %g6 + ld [%g6 + %lo(cpcb)], %o0 std %o6, [%o0 + PCB_SP] ! cpcb->pcb_ = ; rd %psr, %g1 ! oldpsr = %psr; - sethi %hi(_curproc), %g7 - ld [%g7 + %lo(_curproc)], %g4 ! lastproc = curproc; + sethi %hi(curproc), %g7 + ld [%g7 + %lo(curproc)], %g4 ! lastproc = curproc; st %g1, [%o0 + PCB_PSR] ! cpcb->pcb_psr = oldpsr; andn %g1, PSR_PIL, %g1 ! oldpsr &= ~PSR_PIL; @@ -4669,20 +4654,20 @@ ENTRY(cpu_switch) * that can run above splclock and call wakeup(). Otherwise, we * should run at splstatclock() until we have the new process. */ - st %g0, [%g7 + %lo(_curproc)] ! curproc = NULL; + st %g0, [%g7 + %lo(curproc)] ! curproc = NULL; wr %g1, 0, %psr ! (void) spl0(); nop; nop; nop ! paranoia wr %g1, PIL_CLOCK << 8 , %psr ! (void) splclock(); Lsw_scan: nop; nop; nop ! paranoia - ld [%g2 + %lo(_whichqs)], %o3 + ld [%g2 + %lo(_C_LABEL(whichqs))], %o3 /* * Optimized inline expansion of `which = ffs(whichqs) - 1'; * branches to idle if ffs(whichqs) was 0. */ - set ___ffstab, %o2 + set _C_LABEL(__ffstab), %o2 andcc %o3, 0xff, %o1 ! byte 0 zero? bz,a 1f ! yes, try byte 1 srl %o3, 8, %o0 @@ -4710,7 +4695,7 @@ Lsw_scan: /* * We found a nonempty run queue. Take its first process. */ - set _qs, %o5 ! q = &qs[which]; + set _C_LABEL(qs), %o5 ! q = &qs[which]; sll %o4, 3, %o0 add %o0, %o5, %o5 ld [%o5], %g3 ! p = q->ph_link; @@ -4726,7 +4711,7 @@ Lsw_scan: mov 1, %o1 ! whichqs &= ~(1 << which); sll %o1, %o4, %o1 andn %o3, %o1, %o3 - st %o3, [%g2 + %lo(_whichqs)] + st %o3, [%g2 + %lo(_C_LABEL(whichqs))] 1: /* * PHASE TWO: NEW REGISTER USAGE: @@ -4735,8 +4720,8 @@ Lsw_scan: * %g3 = p * %g4 = lastproc * %g5 = newpcb - * %g6 = %hi(_cpcb) - * %g7 = %hi(_curproc) + * %g6 = %hi(cpcb) + * %g7 = %hi(curproc) * %o0 = tmp 1 * %o1 = tmp 2 * %o2 = tmp 3 @@ -4759,12 +4744,12 @@ Lsw_scan: * Committed to running process p. * It may be the same as the one we were running before. */ - sethi %hi(_want_resched), %o0 - st %g0, [%o0 + %lo(_want_resched)] ! want_resched = 0; + sethi %hi(_C_LABEL(want_resched)), %o0 ! want_resched = 0; + st %g0, [%o0 + %lo(_C_LABEL(want_resched))] ld [%g3 + P_ADDR], %g5 ! newpcb = p->p_addr; st %g0, [%g3 + 4] ! p->p_back = NULL; ld [%g5 + PCB_PSR], %g2 ! newpsr = newpcb->pcb_psr; - st %g3, [%g7 + %lo(_curproc)] ! curproc = p; + st %g3, [%g7 + %lo(curproc)] ! curproc = p; cmp %g3, %g4 ! p == lastproc? be,a Lsw_sameproc ! yes, go return 0 @@ -4778,7 +4763,7 @@ Lsw_scan: be,a Lsw_load ! if no old process, go load wr %g1, (PIL_CLOCK << 8) | PSR_ET, %psr - INCR(_nswitchdiff) ! clobbers %o0,%o1 + INCR(_C_LABEL(nswitchdiff)) ! clobbers %o0,%o1 /* * save: write back all windows (including the current one). * XXX crude; knows nwindows <= 8 @@ -4812,10 +4797,12 @@ Lsw_load: /* set new psr, but with traps disabled */ wr %g2, PSR_ET, %psr ! %psr = newpsr ^ PSR_ET; /* set new cpcb */ - st %g5, [%g6 + %lo(_cpcb)] ! cpcb = newpcb; + st %g5, [%g6 + %lo(cpcb)] ! cpcb = newpcb; +#if 0 /* XXX update masterpaddr too */ - sethi %hi(_masterpaddr), %g7 - st %g5, [%g7 + %lo(_masterpaddr)] + sethi %hi(_C_LABEL(masterpaddr)), %g7 + st %g5, [%g7 + %lo(_C_LABEL(masterpaddr))] +#endif ldd [%g5 + PCB_SP], %o6 ! = newpcb->pcb_ /* load window */ ldd [%sp + (0*8)], %l0 @@ -4848,7 +4835,7 @@ Lsw_load: /* p does not have a context: call ctx_alloc to get one */ save %sp, -CCFSZ, %sp - call _ctx_alloc ! ctx_alloc(pm); + call _C_LABEL(ctx_alloc) ! ctx_alloc(pm); mov %i3, %o0 ret @@ -4859,8 +4846,8 @@ Lsw_havectx: ! context is in %o0 ! pmap is in %o3 #if (defined(SUN4) || defined(SUN4C)) && defined(SUN4M) - sethi %hi(_cputyp), %o1 ! what cpu are we running on? - ld [%o1 + %lo(_cputyp)], %o1 + sethi %hi(_C_LABEL(cputyp)), %o1 ! what cpu are we running on? + ld [%o1 + %lo(_C_LABEL(cputyp))], %o1 cmp %o1, CPU_SUN4M be 1f nop @@ -4953,7 +4940,7 @@ ENTRY(proc_trampoline) /* * {fu,su}{,i}{byte,word} */ -ALTENTRY(fuiword) +_ENTRY(fuiword) ENTRY(fuword) set KERNBASE, %o2 cmp %o0, %o2 ! if addr >= KERNBASE... @@ -4962,8 +4949,8 @@ ENTRY(fuword) btst 3, %o0 ! or has low bits set... bnz Lfsbadaddr ! go return -1 EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; - ld [%o2 + %lo(_cpcb)], %o2 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; + ld [%o2 + %lo(cpcb)], %o2 set Lfserr, %o3 st %o3, [%o2 + PCB_ONFAULT] ld [%o0], %o0 ! fetch the word @@ -4981,8 +4968,8 @@ Lfsbadaddr: * mem_access_fault() to check to see that we don't want to try to * page in the fault. It's used by fuswintr() etc. */ - .globl _Lfsbail -_Lfsbail: + .globl _C_LABEL(Lfsbail) +_C_LABEL(Lfsbail): st %g0, [%o2 + PCB_ONFAULT]! error in r/w, clear pcb_onfault retl ! and return error indicator mov -1, %o0 @@ -4996,9 +4983,9 @@ ENTRY(fuswintr) cmp %o0, %o2 ! if addr >= KERNBASE bgeu Lfsbadaddr ! return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = _Lfsbail; - ld [%o2 + %lo(_cpcb)], %o2 - set _Lfsbail, %o3 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfsbail; + ld [%o2 + %lo(cpcb)], %o2 + set _C_LABEL(Lfsbail), %o3 st %o3, [%o2 + PCB_ONFAULT] lduh [%o0], %o0 ! fetch the halfword retl ! made it @@ -5009,29 +4996,29 @@ ENTRY(fusword) cmp %o0, %o2 ! if addr >= KERNBASE bgeu Lfsbadaddr ! return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; - ld [%o2 + %lo(_cpcb)], %o2 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; + ld [%o2 + %lo(cpcb)], %o2 set Lfserr, %o3 st %o3, [%o2 + PCB_ONFAULT] lduh [%o0], %o0 ! fetch the halfword retl ! made it st %g0, [%o2 + PCB_ONFAULT]! but first clear onfault -ALTENTRY(fuibyte) +_ENTRY(fuibyte) ENTRY(fubyte) set KERNBASE, %o2 cmp %o0, %o2 ! if addr >= KERNBASE bgeu Lfsbadaddr ! return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; - ld [%o2 + %lo(_cpcb)], %o2 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; + ld [%o2 + %lo(cpcb)], %o2 set Lfserr, %o3 st %o3, [%o2 + PCB_ONFAULT] ldub [%o0], %o0 ! fetch the byte retl ! made it st %g0, [%o2 + PCB_ONFAULT]! but first clear onfault -ALTENTRY(suiword) +_ENTRY(suiword) ENTRY(suword) set KERNBASE, %o2 cmp %o0, %o2 ! if addr >= KERNBASE ... @@ -5040,8 +5027,8 @@ ENTRY(suword) btst 3, %o0 ! or has low bits set ... bnz Lfsbadaddr ! go return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; - ld [%o2 + %lo(_cpcb)], %o2 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; + ld [%o2 + %lo(cpcb)], %o2 set Lfserr, %o3 st %o3, [%o2 + PCB_ONFAULT] st %o1, [%o0] ! store the word @@ -5054,9 +5041,9 @@ ENTRY(suswintr) cmp %o0, %o2 ! if addr >= KERNBASE bgeu Lfsbadaddr ! go return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = _Lfsbail; - ld [%o2 + %lo(_cpcb)], %o2 - set _Lfsbail, %o3 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfsbail; + ld [%o2 + %lo(cpcb)], %o2 + set _C_LABEL(Lfsbail), %o3 st %o3, [%o2 + PCB_ONFAULT] sth %o1, [%o0] ! store the halfword st %g0, [%o2 + PCB_ONFAULT]! made it, clear onfault @@ -5068,8 +5055,8 @@ ENTRY(susword) cmp %o0, %o2 ! if addr >= KERNBASE bgeu Lfsbadaddr ! go return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; - ld [%o2 + %lo(_cpcb)], %o2 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; + ld [%o2 + %lo(cpcb)], %o2 set Lfserr, %o3 st %o3, [%o2 + PCB_ONFAULT] sth %o1, [%o0] ! store the halfword @@ -5077,14 +5064,14 @@ ENTRY(susword) retl ! and return 0 clr %o0 -ALTENTRY(suibyte) +_ENTRY(suibyte) ENTRY(subyte) set KERNBASE, %o2 cmp %o0, %o2 ! if addr >= KERNBASE bgeu Lfsbadaddr ! go return error EMPTY - sethi %hi(_cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; - ld [%o2 + %lo(_cpcb)], %o2 + sethi %hi(cpcb), %o2 ! cpcb->pcb_onfault = Lfserr; + ld [%o2 + %lo(cpcb)], %o2 set Lfserr, %o3 st %o3, [%o2 + PCB_ONFAULT] stb %o1, [%o0] ! store the byte @@ -5105,8 +5092,8 @@ ENTRY(subyte) */ ENTRY(probeget) ! %o0 = addr, %o1 = (1,2,4) - sethi %hi(_cpcb), %o2 - ld [%o2 + %lo(_cpcb)], %o2 ! cpcb->pcb_onfault = Lfserr; + sethi %hi(cpcb), %o2 + ld [%o2 + %lo(cpcb)], %o2 ! cpcb->pcb_onfault = Lfserr; set Lfserr, %o5 st %o5, [%o2 + PCB_ONFAULT] btst 1, %o1 @@ -5128,8 +5115,8 @@ ENTRY(probeget) */ ENTRY(probeset) ! %o0 = addr, %o1 = (1,2,4), %o2 = val - sethi %hi(_cpcb), %o3 - ld [%o3 + %lo(_cpcb)], %o3 ! cpcb->pcb_onfault = Lfserr; + sethi %hi(cpcb), %o3 + ld [%o3 + %lo(cpcb)], %o3 ! cpcb->pcb_onfault = Lfserr; set Lfserr, %o5 st %o5, [%o3 + PCB_ONFAULT] btst 1, %o1 @@ -5152,10 +5139,10 @@ ENTRY(probeset) * read a byte from the specified address in ASI_CONTROL space. */ ENTRY(xldcontrolb) - !sethi %hi(_cpcb), %o2 - !ld [%o2 + %lo(_cpcb)], %o2 ! cpcb->pcb_onfault = Lfsbail; + !sethi %hi(cpcb), %o2 + !ld [%o2 + %lo(cpcb)], %o2 ! cpcb->pcb_onfault = Lfsbail; or %o1, %g0, %o2 ! %o2 = %o1 - set _Lfsbail, %o5 + set _C_LABEL(Lfsbail), %o5 st %o5, [%o2 + PCB_ONFAULT] lduba [%o0] ASI_CONTROL, %o0 ! read 0: retl @@ -5171,7 +5158,7 @@ ENTRY(xldcontrolb) */ ENTRY(fkbyte) or %o1, %g0, %o2 ! %o2 = %o1 - set _Lfsbail, %o5 + set _C_LABEL(Lfsbail), %o5 st %o5, [%o2 + PCB_ONFAULT] ldub [%o0], %o0 ! fetch the byte retl ! made it @@ -5597,8 +5584,8 @@ Lback_mopb: * caller. */ ENTRY(kcopy) - sethi %hi(_cpcb), %o5 ! cpcb->pcb_onfault = Lkcerr; - ld [%o5 + %lo(_cpcb)], %o5 + sethi %hi(cpcb), %o5 ! cpcb->pcb_onfault = Lkcerr; + ld [%o5 + %lo(cpcb)], %o5 set Lkcerr, %o3 ld [%o5 + PCB_ONFAULT], %g1! save current onfault handler st %o3, [%o5 + PCB_ONFAULT] @@ -5899,13 +5886,13 @@ ENTRY(loadfpstate) #if defined(SUN4M) && (defined(SUN4) || defined(SUN4C)) ENTRY(ienab_bis) NOP_ON_4M_13: - b,a _ienab_bis_4_4c - b,a _ienab_bis_4m + b,a _C_LABEL(ienab_bis_4_4c) + b,a _C_LABEL(ienab_bis_4m) ENTRY(ienab_bic) NOP_ON_4M_14: - b,a _ienab_bic_4_4c - b,a _ienab_bic_4m + b,a _C_LABEL(ienab_bic_4_4c) + b,a _C_LABEL(ienab_bic_4m) #endif #if defined(SUN4) || defined(SUN4C) @@ -5995,8 +5982,8 @@ ENTRY(raise) * Only use %l5 and %l6. * Note: not C callable. */ -ALTENTRY(srmmu_get_syncflt) -ALTENTRY(hypersparc_get_syncflt) +_ENTRY(_C_LABEL(srmmu_get_syncflt)) +_ENTRY(_C_LABEL(hypersparc_get_syncflt)) set SRMMU_SFAR, %l5 lda [%l5] ASI_SRMMU, %l5 ! sync virt addr; must be read first st %l5, [%l4 + 4] ! => dump.sfva @@ -6005,11 +5992,11 @@ ALTENTRY(hypersparc_get_syncflt) jmp %l7 + 8 ! return to caller st %l5, [%l4] ! => dump.sfsr -ALTENTRY(viking_get_syncflt) -ALTENTRY(ms1_get_syncflt) -ALTENTRY(swift_get_syncflt) -ALTENTRY(turbosparc_get_syncflt) -ALTENTRY(cypress_get_syncflt) +_ENTRY(_C_LABEL(viking_get_syncflt)) +_ENTRY(_C_LABEL(ms1_get_syncflt)) +_ENTRY(_C_LABEL(swift_get_syncflt)) +_ENTRY(_C_LABEL(turbosparc_get_syncflt)) +_ENTRY(_C_LABEL(cypress_get_syncflt)) cmp %l3, T_TEXTFAULT be,a 1f mov %l1, %l5 ! use PC if type == T_TEXTFAULT @@ -6030,7 +6017,7 @@ ALTENTRY(cypress_get_syncflt) * On entry: %o0 == &afsr, %o1 == &afar * Return 0 if async register are present. */ -ALTENTRY(srmmu_get_asyncflt) +_ENTRY(_C_LABEL(srmmu_get_asyncflt)) set SRMMU_AFAR, %o4 lda [%o4] ASI_SRMMU, %o4 ! get async fault address set SRMMU_AFSR, %o3 ! @@ -6040,8 +6027,8 @@ ALTENTRY(srmmu_get_asyncflt) retl clr %o0 ! return value -ALTENTRY(cypress_get_asyncflt) -ALTENTRY(hypersparc_get_asyncflt) +_ENTRY(_C_LABEL(cypress_get_asyncflt)) +_ENTRY(_C_LABEL(hypersparc_get_asyncflt)) set SRMMU_AFSR, %o3 ! must read status before fault on HS lda [%o3] ASI_SRMMU, %o3 ! get async fault status st %o3, [%o0] @@ -6056,11 +6043,11 @@ ALTENTRY(hypersparc_get_asyncflt) retl clr %o0 ! return value -ALTENTRY(no_asyncflt_regs) +_ENTRY(_C_LABEL(no_asyncflt_regs)) retl mov 1, %o0 ! return value -ALTENTRY(hypersparc_pure_vcache_flush) +_ENTRY(_C_LABEL(hypersparc_pure_vcache_flush)) /* * Flush entire on-chip instruction cache, which is * a pure vitually-indexed/virtually-tagged cache. @@ -6090,7 +6077,7 @@ ENTRY(lo_microtime) #else ENTRY(microtime) #endif - sethi %hi(_time), %g2 + sethi %hi(_C_LABEL(time)), %g2 #if defined(SUN4M) && !(defined(SUN4C) || defined(SUN4)) sethi %hi(TIMERREG_VA+4), %g3 @@ -6106,9 +6093,9 @@ NOP_ON_4_4C_1: #endif 2: - ldd [%g2+%lo(_time)], %o2 ! time.tv_sec & time.tv_usec + ldd [%g2+%lo(_C_LABEL(time))], %o2 ! time.tv_sec & time.tv_usec ld [%g3], %o4 ! usec counter - ldd [%g2+%lo(_time)], %g4 ! see if time values changed + ldd [%g2+%lo(_C_LABEL(time))], %g4 ! see if time values changed cmp %g4, %o2 bne 2b ! if time.tv_sec changed cmp %g5, %o3 @@ -6117,8 +6104,8 @@ NOP_ON_4_4C_1: bpos 3f ! reached limit? srl %o4, TMR_SHIFT, %o4 ! convert counter to usec - sethi %hi(_tick), %g4 ! bump usec by 1 tick - ld [%g4+%lo(_tick)], %o1 + sethi %hi(_C_LABEL(tick)), %g4 ! bump usec by 1 tick + ld [%g4+%lo(_C_LABEL(tick))], %o1 set TMR_MASK, %g5 add %o1, %o3, %o3 and %o4, %g5, %o4 @@ -6150,8 +6137,8 @@ ENTRY(delay) ! %o0 = n subcc %o0, %g0, %g0 be 2f - sethi %hi(_timerblurb), %o1 - ld [%o1 + %lo(_timerblurb)], %o1 ! %o1 = timerblurb + sethi %hi(_C_LABEL(timerblurb)), %o1 + ld [%o1 + %lo(_C_LABEL(timerblurb))], %o1 ! %o1 = timerblurb addcc %o1, %g0, %o2 ! %o2 = cntr (start @ %o1), clear CCs ! first time through only @@ -6180,8 +6167,8 @@ ENTRY(write_all_windows) * while (--g1 > 0) save(); * while (--g2 > 0) restore(); */ - sethi %hi(_nwindows), %g1 - ld [%g1 + %lo(_nwindows)], %g1 + sethi %hi(_C_LABEL(nwindows)), %g1 + ld [%g1 + %lo(_C_LABEL(nwindows))], %g1 dec %g1 mov %g1, %g2 @@ -6225,7 +6212,7 @@ Llongjmpbotch: ! otherwise, went too far; bomb out save %sp, -CCFSZ, %sp /* preserve current window */ sethi %hi(Lpanic_ljmp), %o0 - call _panic + call _C_LABEL(panic) or %o0, %lo(Lpanic_ljmp), %o0; unimp 0 @@ -6240,21 +6227,22 @@ Llongjmpbotch: .data #ifdef DDB - .globl _esym -_esym: + .globl _C_LABEL(esym) +_C_LABEL(esym): .word 0 #endif - .globl _cold -_cold: + .globl _C_LABEL(cold) +_C_LABEL(cold): .word 1 ! cold start flag - .globl _proc0paddr -_proc0paddr: - .word _u0 ! KVA of proc0 uarea + .globl _C_LABEL(proc0paddr) +_C_LABEL(proc0paddr): + .word _C_LABEL(u0) ! KVA of proc0 uarea /* interrupt counters XXX THESE BELONG ELSEWHERE (if anywhere) */ - .globl _intrcnt, _eintrcnt, _intrnames, _eintrnames -_intrnames: + .globl _C_LABEL(intrcnt), _C_LABEL(eintrcnt) + .globl _C_LABEL(intrnames), _C_LABEL(eintrnames) +_C_LABEL(intrnames): .asciz "spur" .asciz "lev1" .asciz "lev2" @@ -6270,13 +6258,13 @@ _intrnames: .asciz "lev12" .asciz "lev13" .asciz "prof" -_eintrnames: +_C_LABEL(eintrnames): _ALIGN -_intrcnt: +_C_LABEL(intrcnt): .skip 4*15 -_eintrcnt: +_C_LABEL(eintrcnt): - .comm _nwindows, 4 - .comm _romp, 4 - .comm _qs, 32 * 8 - .comm _whichqs, 4 + .comm _C_LABEL(nwindows), 4 + .comm _C_LABEL(romp), 4 + .comm _C_LABEL(qs), 32 * 8 + .comm _C_LABEL(whichqs), 4