From f96915efa51313eb0155009bb80446d3a90d569f Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 17 Jul 2000 02:54:04 +0000 Subject: [PATCH] Changes so that the kernel can be compiled under __ELF__. --- sys/arch/vax/vax/emulate.s | 92 ++++++--------- sys/arch/vax/vax/intvec.s | 170 ++++++++++++++++------------ sys/arch/vax/vax/subr.s | 226 +++++++++++++++++++------------------ sys/arch/vax/vax/trap.c | 10 +- sys/arch/vax/vsa/hdc9224.h | 4 +- 5 files changed, 253 insertions(+), 249 deletions(-) diff --git a/sys/arch/vax/vax/emulate.s b/sys/arch/vax/vax/emulate.s index a9e5045fba19..9fbc2fd8862f 100644 --- a/sys/arch/vax/vax/emulate.s +++ b/sys/arch/vax/vax/emulate.s @@ -1,4 +1,4 @@ -/* $NetBSD: emulate.s,v 1.2 1997/03/15 16:14:25 ragge Exp $ */ +/* $NetBSD: emulate.s,v 1.3 2000/07/17 02:54:04 matt Exp $ */ /* * Copyright (c) 1986, 1987 The Regents of the University of California. * All rights reserved. @@ -37,6 +37,8 @@ * @(#)emulate.s 7.5 (Berkeley) 6/28/90 */ +#include + /* * String instruction emulation - MicroVAX only. These routines are called * from locore.s when an "emulate" fault occurs on the MicroVAX. They are @@ -85,8 +87,7 @@ .text .align 1 - .globl _EMcrc -_EMcrc: +ALTENTRY(EMcrc) argl(1,r11) # (1) table address == r11 argl(2,r0) # (2) initial crc == r0 argl(4,r3) # (4) source address == r3 @@ -109,8 +110,7 @@ Lcrc_out: .align 1 - .globl _EMmovtc -_EMmovtc: +ALTENTRY(EMmovtc) arguw(1,r0) # (1) source length == r0 argl(2,r1) # (2) source address == r1 argub(3,r11) # (3) fill character == r11 @@ -137,8 +137,7 @@ Lmovtc_out: .align 1 - .globl _EMmovtuc -_EMmovtuc: +ALTENTRY(EMmovtuc) arguw(1,r0) # (1) source length == r0 argl(2,r1) # (2) source address == r1 argub(3,r11) # (3) escape character == r11 @@ -165,8 +164,7 @@ Lmovtuc_out: .align 1 - .globl _EMmatchc -_EMmatchc: +ALTENTRY(EMmatchc) argl(2,r10) # (2) substring address == r10 arguw(3,r2) # (3) source length == r2 argl(4,r3) # (4) source address == r3 @@ -201,8 +199,7 @@ Lmatchc_out: .align 1 - .globl _EMspanc -_EMspanc: +ALTENTRY(EMspanc) argl(2,r1) # (2) string address == r1 argub(4,r2) # (4) character-mask == r2 argl(3,r3) # (3) table address == r3 @@ -222,8 +219,7 @@ Lspanc_out: .align 1 - .globl _EMscanc -_EMscanc: +ALTENTRY(EMscanc) argl(2,r1) # (2) string address == r1 argub(4,r2) # (4) character-mask == r2 argl(3,r3) # (3) table address == r3 @@ -243,8 +239,7 @@ Lscanc_out: .align 1 - .globl _EMskpc -_EMskpc: +ALTENTRY(EMskpc) argub(1,r11) # (1) character == r11 argl(3,r1) # (3) string address == r1 arguw(2,r0) # (2) string length == r0 @@ -261,8 +256,7 @@ Lskpc_out: .align 1 - .globl _EMlocc -_EMlocc: +ALTENTRY(EMlocc) argub(1,r11) # (1) character == r11 argl(3,r1) # (3) string address == r1 arguw(2,r0) # (2) string length == r0 @@ -279,8 +273,7 @@ Llocc_out: .align 1 - .globl _EMcmpc3 -_EMcmpc3: +ALTENTRY(EMcmpc3) argl(2,r1) # (2) string1 address == r1 argl(3,r3) # (3) string2 address == r3 arguw(1,r0) # (1) strings length == r0 @@ -298,8 +291,7 @@ Lcmpc3_out: .align 1 - .globl _EMcmpc5 -_EMcmpc5: +ALTENTRY(EMcmpc5) argl(2,r1) # (2) string1 address == r1 argub(3,r11) # (1) fill character == r11 arguw(4,r2) # (1) string2 length == r2 @@ -344,8 +336,7 @@ Lcmpc5_out: .align 1 - .globl _EMaddp4 -_EMaddp4: +ALTENTRY(EMaddp4) toarg(r9,6) # save register r9 in arg6 spot arguw(1,r11) # (1) source length == r11 argl(2,r10) # (2) source address == r10 @@ -584,8 +575,7 @@ Laddp4_out: .align 1 - .globl _EMmovp -_EMmovp: +ALTENTRY(EMmovp) arguw(1,r11) # (1) string length == r11 argl(2,r10) # (1) source address == r10 argl(3,r3) # (1) destination address == r3 @@ -675,8 +665,7 @@ Lmovp_out: .align 1 - .globl _EMeditpc -_EMeditpc: +ALTENTRY(EMeditpc) arguw(1,r11) # (1) source length == r11 argl(2,r10) # (2) source address == r10 argl(3,r3) # (3) pattern address == r3 @@ -899,8 +888,7 @@ L228: .align 1 - .globl _EMashp -_EMashp: +ALTENTRY(EMashp) argb(1,r11) # (1) scale (number to shift) == r11 arguw(2,r10) # (2) source length == r10 argl(3,r1) # (3) source address == r1 @@ -1051,8 +1039,7 @@ Lashp_overfl: # do overflow .align 1 - .globl _EMcvtlp -_EMcvtlp: +ALTENTRY(EMcvtlp) arguw(2,r10) # (2) destination length == r10 argl(3,r3) # (3) destination address == r3 ashl $-1,r10,r10 @@ -1104,8 +1091,7 @@ Lcvtlp_out: .align 1 - .globl _EMcvtpl -_EMcvtpl: +ALTENTRY(EMcvtpl) arguw(1,r11) # (1) source length == r11 argl(2,r10) # (2) source address == r10 clrl r3 # r3 == destination @@ -1143,68 +1129,57 @@ Lcvtpl_out: .align 1 - .globl _EMcvtps -_EMcvtps: +ALTENTRY(EMcvtps) return .align 1 - .globl _EMcvtsp -_EMcvtsp: +ALTENTRY(EMcvtsp) return .align 1 - .globl _EMaddp6 -_EMaddp6: +ALTENTRY(EMaddp6) return .align 1 - .globl _EMsubp4 -_EMsubp4: +ALTENTRY(EMsubp4) return .align 1 - .globl _EMsubp6 -_EMsubp6: +ALTENTRY(EMsubp6) return .align 1 - .globl _EMcvtpt -_EMcvtpt: +ALTENTRY(EMcvtpt) return .align 1 - .globl _EMmulp -_EMmulp: +ALTENTRY(EMmulp) return .align 1 - .globl _EMcvttp -_EMcvttp: +ALTENTRY(EMcvttp) return .align 1 - .globl _EMdivp -_EMdivp: +ALTENTRY(EMdivp) return .align 1 - .globl _EMcmpp3 -_EMcmpp3: +ALTENTRY(EMcmpp3) return .align 1 - .globl _EMcmpp4 -_EMcmpp4: +ALTENTRY(EMcmpp4) return @@ -1217,8 +1192,8 @@ _EMcmpp4: #define EMUTABLE 0x43 #define NOEMULATE .long noemulate #define EMULATE(a) .long _EM/**/a - .globl _emJUMPtable -_emJUMPtable: + .globl _C_LABEL(emJUMPtable) +_C_LABEL(emJUMPtable) /* f8 */ EMULATE(ashp); EMULATE(cvtlp); NOEMULATE; NOEMULATE /* fc */ NOEMULATE; NOEMULATE; NOEMULATE; NOEMULATE /* 00 */ NOEMULATE; NOEMULATE; NOEMULATE; NOEMULATE @@ -1279,7 +1254,8 @@ SCBVEC(emulate): addl2 $8,r10 # shift negative opcodes subl3 r10,$EMUTABLE,r11 # forget it if opcode is out of range bcs noemulate - movl _emJUMPtable[r10],r10 # call appropriate emulation routine + movl _C_LABEL(emJUMPtable)[r10],r10 + # call appropriate emulation routine jsb (r10) # routines put return values into regs 0-5 movl 32(sp),r11 # restore register r11 movl 36(sp),r10 # restore register r10 diff --git a/sys/arch/vax/vax/intvec.s b/sys/arch/vax/vax/intvec.s index c1634ba69a8f..2f3c31bf4805 100644 --- a/sys/arch/vax/vax/intvec.s +++ b/sys/arch/vax/vax/intvec.s @@ -1,4 +1,4 @@ -/* $NetBSD: intvec.s,v 1.50 2000/07/02 04:40:45 cgd Exp $ */ +/* $NetBSD: intvec.s,v 1.51 2000/07/17 02:54:04 matt Exp $ */ /* * Copyright (c) 1994, 1997 Ludd, University of Lule}, Sweden. @@ -37,27 +37,27 @@ #include "opt_cputype.h" -#define ENTRY(name) \ +#define SCBENTRY(name) \ .text ; \ .align 2 ; \ .globl name ; \ name /**/: #define TRAPCALL(namn, typ) \ -ENTRY(namn) ; \ +SCBENTRY(namn) ; \ pushl $0 ; \ pushl $typ ; \ jbr trap #define TRAPARGC(namn, typ) \ -ENTRY(namn) ; \ +SCBENTRY(namn) ; \ pushl $typ ; \ jbr trap #define FASTINTR(namn, rutin) \ -ENTRY(namn) ; \ +SCBENTRY(namn) ; \ pushr $0x3f ; \ - calls $0,__CONCAT(_,rutin) ; \ + calls $0,_C_LABEL(rutin) ; \ popr $0x3f ; \ rei @@ -69,12 +69,13 @@ ENTRY(namn) ; \ #define NOVEC .long 0 #define INTVEC(label,stack) \ .long label+stack; - .text - .globl _kernbase, _rpb, _kernel_text - .set _kernel_text,KERNBASE -_kernbase: -_rpb: + .text + + .globl _C_LABEL(kernbase), _C_LABEL(rpb), _C_LABEL(kernel_text) + .set _C_LABEL(kernel_text),KERNBASE +_C_LABEL(kernbase): +_C_LABEL(rpb): /* * First page in memory we have rpb; so that we know where * (must be on a 64k page boundary, easiest here). We use it @@ -158,18 +159,18 @@ _rpb: # at when returning from a intentional test. # mcheck: .globl mcheck - tstl _cold # Ar we still in coldstart? + tstl _C_LABEL(cold) # Ar we still in coldstart? bneq L4 # Yes. pushr $0x7f pushab 24(sp) - movl _dep_call,r6 # CPU dependent mchk handling + movl _C_LABEL(dep_call),r6 # CPU dependent mchk handling calls $1,*MCHK(r6) tstl r0 # If not machine check, try memory error beql 1f calls $0,*MEMERR(r6) pushab 2f - calls $1,_panic + calls $1,_C_LABEL(panic) 2: .asciz "mchk" 1: popr $0x7f addl2 (sp)+,sp @@ -177,20 +178,20 @@ mcheck: .globl mcheck rei L4: addl2 (sp)+,sp # remove info pushed on stack - cmpl _vax_cputype,$1 # Is it a 11/780? + cmpl _C_LABEL(vax_cputype),$1 # Is it a 11/780? bneq 1f # No... mtpr $0, $PR_SBIFS # Clear SBI fault register brb 2f -1: cmpl _vax_cputype,$4 # Is it a 8600? +1: cmpl _C_LABEL(vax_cputype),$4 # Is it a 8600? bneq 3f mtpr $0, $PR_EHSR # Clear Error status register brb 2f 3: mtpr $0xF,$PR_MCESR # clear the bus error bit -2: movl _memtest,(sp) # REI to new adress +2: movl _C_LABEL(memtest),(sp) # REI to new adress rei TRAPCALL(invkstk, T_KSPNOTVAL) @@ -213,7 +214,7 @@ transl_v: pushr $0x3f pushl 28(sp) pushl 28(sp) - calls $2,_pmap_simulref + calls $2,_C_LABEL(pmap_simulref) tstl r0 bneq 1f popr $0x3f @@ -243,14 +244,14 @@ TRAPCALL(breakp, T_BPTFLT) TRAPARGC(arithflt, T_ARITHFLT) -ENTRY(syscall) # Main system call +SCBENTRY(syscall) # Main system call pushl $T_SYSCALL pushr $0xfff mfpr $PR_USP, -(sp) pushl ap pushl fp pushl sp # pointer to syscall frame; defined in trap.h - calls $1, _syscall + calls $1, _C_LABEL(syscall) movl (sp)+, fp movl (sp)+, ap mtpr (sp)+, $PR_USP @@ -260,34 +261,34 @@ ENTRY(syscall) # Main system call rei -ENTRY(cmrerr) +SCBENTRY(cmrerr) PUSHR - movl _dep_call,r0 + movl _C_LABEL(dep_call),r0 calls $0,*MEMERR(r0) POPR rei -ENTRY(sbiflt); +SCBENTRY(sbiflt); pushab sbifltmsg - calls $1, _panic + calls $1, _C_LABEL(panic) TRAPCALL(astintr, T_ASTFLT) -ENTRY(softclock) +SCBENTRY(softclock) PUSHR - calls $0,_softclock - incl _softclock_intrcnt+EV_COUNT - adwc $0,_softclock_intrcnt+EV_COUNT+4 + calls $0,_C_LABEL(softclock) + incl _C_LABEL(softclock_intrcnt)+EV_COUNT + adwc $0,_C_LABEL(softclock_intrcnt)+EV_COUNT+4 POPR rei -ENTRY(softnet) +SCBENTRY(softnet) PUSHR -# tstl _netisr # any netisr's set +# tstl _C_LABEL(netisr) # any netisr's set # beql 2f # no, skip looking at them one by one #define DONETISR(bit, fn) \ - bbcc $bit,_netisr,1f; \ + bbcc $bit,_C_LABEL(netisr),1f; \ calls $0,__CONCAT(_,fn); \ 1: @@ -295,19 +296,19 @@ ENTRY(softnet) #undef DONETISR -2: movab _softnet_head,r0 +2: movab _C_LABEL(softnet_head),r0 jsb softintr_dispatch - incl _softnet_intrcnt+EV_COUNT - adwc $0,_softnet_intrcnt+EV_COUNT+4 + incl _C_LABEL(softnet_intrcnt)+EV_COUNT + adwc $0,_C_LABEL(softnet_intrcnt)+EV_COUNT+4 POPR rei -ENTRY(softserial) +SCBENTRY(softserial) PUSHR - movab _softserial_head,r0 + movab _C_LABEL(softserial_head),r0 jsb softintr_dispatch - incl _softserial_intrcnt+EV_COUNT - adwc $0,_softserial_intrcnt+EV_COUNT+4 + incl _C_LABEL(softserial_intrcnt)+EV_COUNT + adwc $0,_C_LABEL(softserial_intrcnt)+EV_COUNT+4 POPR rei @@ -329,22 +330,20 @@ softintr_dispatch: TRAPCALL(ddbtrap, T_KDBTRAP) - .align 2 - .globl hardclock -hardclock: +SCBENTRY(hardclock) mtpr $0xc1,$PR_ICCS # Reset interrupt flag pushr $0x3f - incl _clock_intrcnt+EV_COUNT # count the number of clock interrupts - adwc $0,_clock_intrcnt+EV_COUNT+4 + incl _C_LABEL(clock_intrcnt)+EV_COUNT # count the number of clock interrupts + adwc $0,_C_LABEL(clock_intrcnt)+EV_COUNT+4 #if VAX46 - cmpl _vax_boardtype,$VAX_BTYP_46 + cmpl _C_LABEL(vax_boardtype),$VAX_BTYP_46 bneq 1f - movl _ka46_cpu,r0 + movl _C_LABEL(ka46_cpu),r0 clrl VC_DIAGTIMM(r0) #endif 1: pushl sp addl2 $24,(sp) - calls $1,_hardclock + calls $1,_C_LABEL(hardclock) popr $0x3f rei @@ -355,14 +354,15 @@ hardclock: * called from user space it doesn't care. * _sret is used in cpu_set_kpc to jump out to user space first time. */ - .globl _sret + .globl _C_LABEL(sret) trap: pushr $0xfff mfpr $PR_USP, -(sp) pushl ap pushl fp pushl sp calls $1, _arithflt -_sret: movl (sp)+, fp +_C_LABEL(sret): + movl (sp)+, fp movl (sp)+, ap mtpr (sp)+, $PR_USP popr $0xfff @@ -378,25 +378,42 @@ sbifltmsg: * Table of emulated Microvax instructions supported by emulate.s. * Use noemulate to convert unimplemented ones to reserved instruction faults. */ - .globl _emtable -_emtable: -/* f8 */ .long _EMashp; .long _EMcvtlp; .long noemulate; .long noemulate -/* fc */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 00 */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 04 */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 08 */ .long _EMcvtps; .long _EMcvtsp; .long noemulate; .long _EMcrc -/* 0c */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 10 */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 14 */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 18 */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 1c */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 20 */ .long _EMaddp4; .long _EMaddp6; .long _EMsubp4; .long _EMsubp6 -/* 24 */ .long _EMcvtpt; .long _EMmulp; .long _EMcvttp; .long _EMdivp -/* 28 */ .long noemulate; .long _EMcmpc3; .long _EMscanc; .long _EMspanc -/* 2c */ .long noemulate; .long _EMcmpc5; .long _EMmovtc; .long _EMmovtuc -/* 30 */ .long noemulate; .long noemulate; .long noemulate; .long noemulate -/* 34 */ .long _EMmovp; .long _EMcmpp3; .long _EMcvtpl; .long _EMcmpp4 -/* 38 */ .long _EMeditpc; .long _EMmatchc; .long _EMlocc; .long _EMskpc + .globl _C_LABEL(emtable) +_C_LABEL(emtable): +/* f8 */ .long _C_LABEL(EMashp); .long _C_LABEL(EMcvtlp) +/* fa */ .long noemulate; .long noemulate +/* fc */ .long noemulate; .long noemulate +/* fe */ .long noemulate; .long noemulate +/* 00 */ .long noemulate; .long noemulate +/* 02 */ .long noemulate; .long noemulate +/* 04 */ .long noemulate; .long noemulate +/* 05 */ .long noemulate; .long noemulate +/* 08 */ .long _C_LABEL(EMcvtps); .long _C_LABEL(EMcvtsp) +/* 0a */ .long noemulate; .long _C_LABEL(EMcrc) +/* 0c */ .long noemulate; .long noemulate +/* 0e */ .long noemulate; .long noemulate +/* 10 */ .long noemulate; .long noemulate +/* 12 */ .long noemulate; .long noemulate +/* 14 */ .long noemulate; .long noemulate +/* 16 */ .long noemulate; .long noemulate +/* 18 */ .long noemulate; .long noemulate +/* 1a */ .long noemulate; .long noemulate +/* 1c */ .long noemulate; .long noemulate +/* 1e */ .long noemulate; .long noemulate +/* 20 */ .long _C_LABEL(EMaddp4); .long _C_LABEL(EMaddp6) +/* 22 */ .long _C_LABEL(EMsubp4); .long _C_LABEL(EMsubp6) +/* 24 */ .long _C_LABEL(EMcvtpt); .long _C_LABEL(EMmulp) +/* 26 */ .long _C_LABEL(EMcvttp); .long _C_LABEL(EMdivp) +/* 28 */ .long noemulate; .long _C_LABEL(EMcmpc3) +/* 2a */ .long _C_LABEL(EMscanc); .long _C_LABEL(EMspanc) +/* 2c */ .long noemulate; .long _C_LABEL(EMcmpc5) +/* 2e */ .long _C_LABEL(EMmovtc); .long _C_LABEL(EMmovtuc) +/* 30 */ .long noemulate; .long noemulate +/* 32 */ .long noemulate; .long noemulate +/* 34 */ .long _C_LABEL(EMmovp); .long _C_LABEL(EMcmpp3) +/* 36 */ .long _C_LABEL(EMcvtpl); .long _C_LABEL(EMcmpp4) +/* 38 */ .long _C_LABEL(EMeditpc); .long _C_LABEL(EMmatchc) +/* 3a */ .long _C_LABEL(EMlocc); .long _C_LABEL(EMskpc) #endif /* * The following is called with the stack set up as follows: @@ -445,7 +462,8 @@ emulate: addl2 $8,r10 # shift negative opcodes subl3 r10,$0x43,r11 # forget it if opcode is out of range bcs noemulate - movl _emtable[r10],r10 # call appropriate emulation routine + movl _C_LABEL(emtable)[r10],r10 + # call appropriate emulation routine jsb (r10) # routines put return values into regs 0-5 movl 32(sp),r11 # restore register r11 movl 36(sp),r10 # restore register r10 @@ -457,15 +475,17 @@ noemulate: #endif .word 0xffff # "reserved instruction fault" - .globl _intrnames, _eintrnames, _intrcnt, _eintrcnt -_intrnames: + .globl _C_LABEL(intrnames), _C_LABEL(eintrnames) +_C_LABEL(intrnames): .long 0 -_eintrnames: -_intrcnt: +_C_LABEL(eintrnames): + + .globl _C_LABEL(intrcnt), _C_LABEL(eintrcnt) +_C_LABEL(intrcnt): .long 0 -_eintrcnt: +_C_LABEL(eintrcnt): .data -_scb: .long 0 - .globl _scb + .globl _C_LABEL(scb) +_C_LABEL(scb): .long 0 diff --git a/sys/arch/vax/vax/subr.s b/sys/arch/vax/vax/subr.s index d854193b489b..52ff8f0bad1e 100644 --- a/sys/arch/vax/vax/subr.s +++ b/sys/arch/vax/vax/subr.s @@ -1,4 +1,4 @@ -/* $NetBSD: subr.s,v 1.49 2000/07/06 17:37:40 ragge Exp $ */ +/* $NetBSD: subr.s,v 1.50 2000/07/17 02:54:04 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -103,23 +103,23 @@ JSBENTRY(start) #else ASENTRY(start, 0) #endif -2: bisl3 $0x80000000,r9,_esym # End of loaded code +2: bisl3 $0x80000000,r9,_C_LABEL(esym) # End of loaded code pushl $0x1f0000 # Push a nice PSL pushl $to # Address to jump to rei # change to kernel stack -to: movw $0xfff,_panic # Save all regs in panic - addl3 _esym,$0x3ff,r0 # Round symbol table end - bicl3 $0x3ff,r0,_proc0paddr # save proc0 uarea pointer - bicl3 $0x80000000,_proc0paddr,r0 # get phys proc0 uarea addr +to: movw $0xfff,_C_LABEL(panic) # Save all regs in panic + addl3 _C_LABEL(esym),$0x3ff,r0 # Round symbol table end + bicl3 $0x3ff,r0,_C_LABEL(proc0paddr) # save proc0 uarea pointer + bicl3 $0x80000000,_C_LABEL(proc0paddr),r0 # get phys proc0 uarea addr mtpr r0,$PR_PCBB # Save in IPR PCBB - addl3 $USPACE,_proc0paddr,r0 # Get kernel stack top + addl3 $USPACE,_C_LABEL(proc0paddr),r0 # Get kernel stack top mtpr r0,$PR_KSP # put in IPR KSP movl r0,_Sysmap # SPT start addr after KSP movab IFTRAP(r0),4(r0) # Save trap address in ESP mtpr 4(r0),$PR_ESP # Put it in ESP also # Set some registers in known state - movl _proc0paddr,r0 + movl _C_LABEL(proc0paddr),r0 clrl P0LR(r0) clrl P1LR(r0) mtpr $0,$PR_P0LR @@ -136,15 +136,15 @@ to: movw $0xfff,_panic # Save all regs in panic #if defined(COMPAT_14) tstl (ap) # Any arguments? bneq 1f # Yes, called from new boot - movl r11,_boothowto # Howto boot (single etc...) -# movl r10,_bootdev # uninteresting, will complain - movl r8,_avail_end # Usable memory (from VMB) + movl r11,_C_LABEL(boothowto) # Howto boot (single etc...) +# movl r10,_C_LABEL(bootdev) # uninteresting, will complain + movl r8,_C_LABEL(avail_end) # Usable memory (from VMB) clrl -(sp) # Have no RPB brb 2f #endif 1: pushl 4(ap) # Address of old rpb -2: calls $1,_start # Jump away. +2: calls $1,_C_LABEL(start) # Jump away. /* NOTREACHED */ @@ -152,102 +152,105 @@ to: movw $0xfff,_panic # Save all regs in panic * Signal handler code. */ - .align 2 - .globl _sigcode,_esigcode -_sigcode: pushr $0x3f - subl2 $0xc,sp - movl 0x24(sp),r0 - calls $3,(r0) - popr $0x3f - chmk $SYS___sigreturn14 - chmk $SYS_exit - halt -_esigcode: + .align 2 + .globl _C_LABEL(sigcode),_C_LABEL(esigcode) +_C_LABEL(sigcode): + pushr $0x3f + subl2 $0xc,sp + movl 0x24(sp),r0 + calls $3,(r0) + popr $0x3f + chmk $SYS___sigreturn14 + chmk $SYS_exit + halt +_C_LABEL(esigcode): #ifdef COMPAT_IBCS2 - .align 2 - .globl _ibcs2_sigcode,_ibcs2_esigcode -_ibcs2_sigcode: pushr $0x3f - subl2 $0xc,sp - movl 0x24(sp),r0 - calls $3,(r0) - popr $0x3f - chmk $SYS___sigreturn14 - chmk $SYS_exit - halt -_ibcs2_esigcode: + .align 2 + .globl _C_LABEL(ibcs2_sigcode),_C_LABEL(ibcs2_esigcode) +_C_LABEL(ibcs2_sigcode): + pushr $0x3f + subl2 $0xc,sp + movl 0x24(sp),r0 + calls $3,(r0) + popr $0x3f + chmk $SYS___sigreturn14 + chmk $SYS_exit + halt +_C_LABEL(ibcs2_esigcode): #endif /* COMPAT_IBCS2 */ #ifdef COMPAT_ULTRIX - .align 2 - .globl _ultrix_sigcode,_ultrix_esigcode -_ultrix_sigcode: pushr $0x3f - subl2 $0xc,sp - movl 0x24(sp),r0 - calls $3,(r0) - popr $0x3f - chmk $ULTRIX_SYS_sigreturn - chmk $SYS_exit - halt -_ultrix_esigcode: + .align 2 + .globl _C_LABEL(ultrix_sigcode),_C_LABEL(ultrix_esigcode) +_C_LABEL(ultrix_sigcode): + pushr $0x3f + subl2 $0xc,sp + movl 0x24(sp),r0 + calls $3,(r0) + popr $0x3f + chmk $ULTRIX_SYS_sigreturn + chmk $SYS_exit + halt +_C_LABEL(ultrix_esigcode): #endif - .align 2 - .globl _idsptch, _eidsptch -_idsptch: pushr $0x3f - .word 0x9f16 # jsb to absolute address - .long _cmn_idsptch # the absolute address - .long 0 # the callback interrupt routine - .long 0 # its argument - .long 0 # ptr to correspond evcnt struct -_eidsptch: + .align 2 + .globl _C_LABEL(idsptch), _C_LABEL(eidsptch) +_C_LABEL(idsptch): pushr $0x3f + .word 0x9f16 # jsb to absolute address + .long _C_LABEL(cmn_idsptch) # the absolute address + .long 0 # the callback interrupt routine + .long 0 # its argument + .long 0 # ptr to correspond evcnt struct +_C_LABEL(eidsptch): -_cmn_idsptch: - movl (sp)+,r0 # get pointer to idspvec - movl 8(r0),r1 # get evcnt pointer - beql 1f # no ptr, skip increment - incl EV_COUNT(r1) # increment low longword - adwc $0,EV_COUNT+4(r1) # add any carry to hi longword -1: pushl 4(r0) # push argument - calls $1,*(r0) # call interrupt routine - popr $0x3f # pop registers - rei # return from interrut +_C_LABEL(cmn_idsptch): + movl (sp)+,r0 # get pointer to idspvec + movl 8(r0),r1 # get evcnt pointer + beql 1f # no ptr, skip increment + incl EV_COUNT(r1) # increment low longword + adwc $0,EV_COUNT+4(r1) # add any carry to hi longword +1: pushl 4(r0) # push argument + calls $1,*(r0) # call interrupt routine + popr $0x3f # pop registers + rei # return from interrut ENTRY(badaddr,0) # Called with addr,b/w/l - mfpr $PR_IPL,r0 # splhigh() - mtpr $IPL_HIGH,$PR_IPL - movl 4(ap),r2 # First argument, the address - movl 8(ap),r1 # Sec arg, b,w,l - pushl r0 # Save old IPL - clrl r3 - movab 4f,_memtest # Set the return address + mfpr $PR_IPL,r0 # splhigh() + mtpr $IPL_HIGH,$PR_IPL + movl 4(ap),r2 # First argument, the address + movl 8(ap),r1 # Sec arg, b,w,l + pushl r0 # Save old IPL + clrl r3 + movab 4f,_C_LABEL(memtest) # Set the return address - caseb r1,$1,$4 # What is the size -1: .word 1f-1b - .word 2f-1b - .word 3f-1b # This is unused - .word 3f-1b + caseb r1,$1,$4 # What is the size +1: .word 1f-1b + .word 2f-1b + .word 3f-1b # This is unused + .word 3f-1b -1: movb (r2),r1 # Test a byte - brb 5f +1: movb (r2),r1 # Test a byte + brb 5f -2: movw (r2),r1 # Test a word - brb 5f +2: movw (r2),r1 # Test a word + brb 5f -3: movl (r2),r1 # Test a long - brb 5f +3: movl (r2),r1 # Test a long + brb 5f -4: incl r3 # Got machine chk => addr bad -5: mtpr (sp)+,$PR_IPL - movl r3,r0 - ret +4: incl r3 # Got machine chk => addr bad +5: mtpr (sp)+,$PR_IPL + movl r3,r0 + ret #ifdef DDB /* * DDB is the only routine that uses setjmp/longjmp. */ - .globl _setjmp, _longjmp -_setjmp:.word 0 + .globl _C_LABEL(setjmp), _C_LABEL(longjmp) +_C_LABEL(setjmp):.word 0 movl 4(ap), r0 movl 8(fp), (r0) movl 12(fp), 4(r0) @@ -256,7 +259,7 @@ _setjmp:.word 0 clrl r0 ret -_longjmp:.word 0 +_C_LABEL(longjmp):.word 0 movl 4(ap), r1 movl 8(ap), r0 movl (r1), ap @@ -274,27 +277,27 @@ JSBENTRY(Setrq) tstl 4(r0) # Check that process actually are off the queue beql 1f pushab setrq - calls $1,_panic + calls $1,_C_LABEL(panic) setrq: .asciz "setrunqueue" #endif -1: extzv $2,$6,P_PRIORITY(r0),r1 # get priority - movaq _sched_qs[r1],r2 # get address of queue - insque (r0),*PH_RLINK(r2) # put proc last in queue - bbss r1,_sched_whichqs,1f # set queue bit. +1: extzv $2,$6,P_PRIORITY(r0),r1 # get priority + movaq _C_LABEL(sched_qs)[r1],r2 # get address of queue + insque (r0),*PH_RLINK(r2) # put proc last in queue + bbss r1,_C_LABEL(sched_whichqs),1f # set queue bit. 1: rsb JSBENTRY(Remrq) extzv $2,$6,P_PRIORITY(r0),r1 #ifdef DIAGNOSTIC - bbs r1,_sched_whichqs,1f + bbs r1,_C_LABEL(sched_whichqs),1f pushab remrq - calls $1,_panic + calls $1,_C_LABEL(panic) remrq: .asciz "remrunqueue" #endif 1: remque (r0),r2 - bneq 1f # Not last process on queue - bbsc r1,_sched_whichqs,1f -1: clrl P_BACK(r0) # saftey belt + bneq 2f # Not last process on queue + bbsc r1,_C_LABEL(sched_whichqs),2f +2: clrl P_BACK(r0) # saftey belt rsb # @@ -302,12 +305,12 @@ remrq: .asciz "remrunqueue" # pi or something. # idle: mtpr $IPL_NONE,$PR_IPL # Enable all types of interrupts -1: tstl _uvm+UVM_PAGE_IDLE_ZERO +1: tstl _C_LABEL(uvm)+UVM_PAGE_IDLE_ZERO beql 2f #if 0 - calls $0,_uvm_pageidlezero + calls $0,_C_LABEL(uvm_pageidlezero) #endif -2: tstl _sched_whichqs # Anything ready to run? +2: tstl _C_LABEL(sched_whichqs) # Anything ready to run? beql 1b # no, continue to loop brb Swtch # Yes, goto switch again. @@ -320,20 +323,20 @@ JSBENTRY(Swtch) mfpr $PR_SSP,r1 # Get ptr to this cpu_info struct clrl CI_CURPROC(r1) # Stop process accounting mtpr $IPL_HIGH,$PR_IPL # block all interrupts - ffs $0,$32,_sched_whichqs,r3 # Search for bit set + ffs $0,$32,_C_LABEL(sched_whichqs),r3 # Search for bit set beql idle # no bit set, go to idle loop - movaq _sched_qs[r3],r1 # get address of queue head + movaq _C_LABEL(sched_qs)[r3],r1 # get address of queue head remque *(r1),r2 # remove proc pointed to by queue head # proc ptr is now in r2 #ifdef DIAGNOSTIC bvc 1f # check if something on queue pushab noque - calls $1,_panic + calls $1,_C_LABEL(panic) noque: .asciz "swtch" #endif 1: bneq 2f # more processes on queue? - bbsc r3,_sched_whichqs,2f # no, clear bit in whichqs + bbsc r3,_C_LABEL(sched_whichqs),2f # no, clear bit in whichqs 2: clrl P_BACK(r2) # clear proc backpointer mfpr $PR_SSP,r1 # Get ptr to this cpu_info struct /* p->p_cpu initialized in fork1() for single-processor */ @@ -357,7 +360,7 @@ noque: .asciz "swtch" # Nice routine to get physical from virtual adresses. # extzv $9,$21,r0,r1 # extract offset - ashl $9,*_Sysmap[r1],r3 + ashl $9,*_C_LABEL(Sysmap)[r1],r3 # # Do the actual process switch. pc + psl are already on stack, from @@ -365,7 +368,8 @@ noque: .asciz "swtch" # svpctx mtpr r3,$PR_PCBB -_tramp: .globl _tramp # used to kick off multiprocessor systems. + .globl _C_LABEL(tramp) # used to kick off multiprocessor systems. +_C_LABEL(tramp): ldpctx rei @@ -383,7 +387,7 @@ ENTRY(cpu_exit,0) mtpr r8,$PR_PCBB # new PCB mtpr r7,$PR_SSP # In case... pushl r6 - calls $1,_exit2 # release last resources. + calls $1,_C_LABEL(exit2) # release last resources. clrl r0 brw Swtch @@ -554,4 +558,6 @@ ENTRY(blkclr,R6) # .data -_memtest: .long 0 ; .globl _memtest # Memory test in progress. + .globl _C_LABEL(memtest) +_C_LABEL(memtest): # memory test in progress + .long 0 diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index a68b49497012..287c5ecfe0a8 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.56 2000/06/29 07:14:34 mrg Exp $ */ +/* $NetBSD: trap.c,v 1.57 2000/07/17 02:54:05 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -297,9 +297,13 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n", return; #endif } - - if (trapsig) + if (trapsig) { + if (sig == SIGSEGV || sig == SIGILL) + printf("pid %d (%s): sig %d: type %lx, code %lx, pc %lx, psl %lx\n", + p->p_pid, p->p_comm, sig, frame->trap, + frame->code, frame->pc, frame->psl); trapsignal(p, sig, frame->code); + } if (umode == 0) return; diff --git a/sys/arch/vax/vsa/hdc9224.h b/sys/arch/vax/vsa/hdc9224.h index df43266d666a..80dd165006e1 100644 --- a/sys/arch/vax/vsa/hdc9224.h +++ b/sys/arch/vax/vsa/hdc9224.h @@ -1,4 +1,4 @@ -/* $NetBSD: hdc9224.h,v 1.2 2000/06/25 16:00:43 ragge Exp $ */ +/* $NetBSD: hdc9224.h,v 1.3 2000/07/17 02:54:06 matt Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -33,14 +33,12 @@ */ -#ifdef notdef struct hdc9224_DKCreg { unsigned char dkc_reg; /* Disk Register Data Access Port (rw)*/ unsigned char fill[3]; /* bytes are longword aligned */ unsigned char dkc_cmd; /* Disk Controller Command Port (wo) */ #define dkc_stat dkc_cmd /* Interrupt Status Port (ro) */ }; -#endif /* * definition of some commands (constant bits only, incomplete!)