Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k/stand/boot Use proper asm symbol macro.



details:   https://anonhg.NetBSD.org/src/rev/a11ace34445c
branches:  trunk
changeset: 783849:a11ace34445c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Jan 10 16:03:49 2013 +0000

description:
Use proper asm symbol macro.

diffstat:

 sys/arch/luna68k/stand/boot/locore.S |  238 +++++++++++++++++-----------------
 1 files changed, 118 insertions(+), 120 deletions(-)

diffs (truncated from 432 to 300 lines):

diff -r ec9db9a9ee2d -r a11ace34445c sys/arch/luna68k/stand/boot/locore.S
--- a/sys/arch/luna68k/stand/boot/locore.S      Thu Jan 10 16:03:42 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/locore.S      Thu Jan 10 16:03:49 2013 +0000
@@ -102,82 +102,83 @@
 
        .text
 
-       .globl  Reset
-       .globl  _buserr,_addrerr
-       .globl  _illinst,_zerodiv,_chkinst,_trapvinst,_privinst
-       .globl  _lev6intr,_lev5intr,_lev3intr,_lev2intr,_badtrap
-
 ASENTRY_NOPROFILE(start)
-Reset:
+ASGLOBAL(Reset)
        jmp _C_LABEL(start1)    /* 0: NOT USED (reset PC) */
        .word   0               /* 1: NOT USED (reset PC) */
-       .long   _buserr         /* 2: bus error */
-       .long   _addrerr        /* 3: address error */
-       .long   _illinst        /* 4: illegal instruction */
-       .long   _zerodiv        /* 5: zero divide */
-       .long   _chkinst        /* 6: CHK instruction */
-       .long   _trapvinst      /* 7: TRAPV instruction */
-       .long   _privinst       /* 8: privilege violation */
-       .long   _badtrap        /* 9: trace */
-       .long   _illinst        /* 10: line 1010 emulator */
-       .long   _illinst        /* 11: line 1111 emulator */
-       .long   _badtrap        /* 12: unassigned, reserved */
-       .long   _coperr         /* 13: coprocessor protocol violation */
-       .long   _fmterr         /* 14: format error */
-       .long   _badtrap        /* 15: uninitialized interrupt vector */
-       .long   _badtrap        /* 16: unassigned, reserved */
-       .long   _badtrap        /* 17: unassigned, reserved */
-       .long   _badtrap        /* 18: unassigned, reserved */
-       .long   _badtrap        /* 19: unassigned, reserved */
-       .long   _badtrap        /* 20: unassigned, reserved */
-       .long   _badtrap        /* 21: unassigned, reserved */
-       .long   _badtrap        /* 22: unassigned, reserved */
-       .long   _badtrap        /* 23: unassigned, reserved */
-       .long   _badtrap        /* 24: spurious interrupt */
-       .long   _badtrap        /* 25: level 1 interrupt autovector */
-       .long   _lev2intr       /* 26: level 2 interrupt autovector */
-       .long   _lev3intr       /* 27: level 3 interrupt autovector */
-       .long   _badtrap        /* 28: level 4 interrupt autovector */
-       .long   _lev5intr       /* 29: level 5 interrupt autovector */
-       .long   _lev6intr       /* 30: level 6 interrupt autovector */
-       .long   _badtrap        /* 31: level 7 interrupt autovector */
-       .long   _illinst        /* 32: syscalls */
-       .long   _illinst        /* 33: sigreturn syscall or breakpoint */
-       .long   _illinst        /* 34: breakpoint or sigreturn syscall */
-       .long   _illinst        /* 35: TRAP instruction vector */
-       .long   _illinst        /* 36: TRAP instruction vector */
-       .long   _illinst        /* 37: TRAP instruction vector */
-       .long   _illinst        /* 38: TRAP instruction vector */
-       .long   _illinst        /* 39: TRAP instruction vector */
-       .long   _illinst        /* 40: TRAP instruction vector */
-       .long   _illinst        /* 41: TRAP instruction vector */
-       .long   _illinst        /* 42: TRAP instruction vector */
-       .long   _illinst        /* 43: TRAP instruction vector */
-       .long   _illinst        /* 44: TRAP instruction vector */
-       .long   _illinst        /* 45: TRAP instruction vector */
-       .long   _illinst        /* 46: TRAP instruction vector */
-       .long   _illinst        /* 47: TRAP instruction vector */
-       .long   _fptrap         /* 48: FPCP branch/set on unordered cond */
-       .long   _fptrap         /* 49: FPCP inexact result */
-       .long   _fptrap         /* 50: FPCP divide by zero */
-       .long   _fptrap         /* 51: FPCP underflow */
-       .long   _fptrap         /* 52: FPCP operand error */
-       .long   _fptrap         /* 53: FPCP overflow */
-       .long   _fptrap         /* 54: FPCP signalling NAN */
+       VECTOR(buserr)          /* 2: bus error */
+       VECTOR(addrerr)         /* 3: address error */
+       VECTOR(illinst)         /* 4: illegal instruction */
+       VECTOR(zerodiv)         /* 5: zero divide */
+       VECTOR(chkinst)         /* 6: CHK instruction */
+       VECTOR(trapvinst)       /* 7: TRAPV instruction */
+       VECTOR(privinst)        /* 8: privilege violation */
+       VECTOR(badtrap)         /* 9: trace */
+       VECTOR(illinst)         /* 10: line 1010 emulator */
+       VECTOR(illinst)         /* 11: line 1111 emulator */
+       VECTOR(badtrap)         /* 12: unassigned, reserved */
+       VECTOR(coperr)          /* 13: coprocessor protocol violation */
+       VECTOR(fmterr)          /* 14: format error */
+       VECTOR(badtrap)         /* 15: uninitialized interrupt vector */
+       VECTOR(badtrap)         /* 16: unassigned, reserved */
+       VECTOR(badtrap)         /* 17: unassigned, reserved */
+       VECTOR(badtrap)         /* 18: unassigned, reserved */
+       VECTOR(badtrap)         /* 19: unassigned, reserved */
+       VECTOR(badtrap)         /* 20: unassigned, reserved */
+       VECTOR(badtrap)         /* 21: unassigned, reserved */
+       VECTOR(badtrap)         /* 22: unassigned, reserved */
+       VECTOR(badtrap)         /* 23: unassigned, reserved */
+       VECTOR(badtrap)         /* 24: unassigned, reserved */
+       VECTOR(badtrap)         /* 25: unassigned, reserved */
+       VECTOR(lev2intr)        /* 26: level 2 interrupt autovector */
+       VECTOR(lev3intr)        /* 27: level 3 interrupt autovector */
+       VECTOR(badtrap)         /* 28: level 4 interrupt autovector */
+       VECTOR(lev5intr)        /* 29: level 5 interrupt autovector */
+       VECTOR(lev6intr)        /* 30: level 6 interrupt autovector */
+       VECTOR(badtrap)         /* 31: level 7 interrupt autovector */
+       VECTOR(illinst)         /* 32: syscalls */
+       VECTOR(illinst)         /* 33: sigreturn syscall or breakpoint */
+       VECTOR(illinst)         /* 34: breakpoint or sigreturn syscall */
+       VECTOR(illinst)         /* 35: TRAP instruction vector */
+       VECTOR(illinst)         /* 36: TRAP instruction vector */
+       VECTOR(illinst)         /* 37: TRAP instruction vector */
+       VECTOR(illinst)         /* 38: TRAP instruction vector */
+       VECTOR(illinst)         /* 39: TRAP instruction vector */
+       VECTOR(illinst)         /* 40: TRAP instruction vector */
+       VECTOR(illinst)         /* 41: TRAP instruction vector */
+       VECTOR(illinst)         /* 42: TRAP instruction vector */
+       VECTOR(illinst)         /* 43: TRAP instruction vector */
+       VECTOR(illinst)         /* 44: TRAP instruction vector */
+       VECTOR(illinst)         /* 45: TRAP instruction vector */
+       VECTOR(illinst)         /* 45: TRAP instruction vector */
+       VECTOR(illinst)         /* 47: TRAP instruction vector */
+       VECTOR(fptrap)          /* 48: FPCP branch/set on unordered cond */
+       VECTOR(fptrap)          /* 49: FPCP inexact result */
+       VECTOR(fptrap)          /* 50: FPCP divide by zero */
+       VECTOR(fptrap)          /* 51: FPCP underflow */
+       VECTOR(fptrap)          /* 52: FPCP operand error */
+       VECTOR(fptrap)          /* 53: FPCP overflow */
+       VECTOR(fptrap)          /* 54: FPCP signalling NAN */
 
-       .long   _badtrap        /* 55: unassigned, reserved */
-       .long   _badtrap        /* 56: unassigned, reserved */
-       .long   _badtrap        /* 57: unassigned, reserved */
-       .long   _badtrap        /* 58: unassigned, reserved */
-       .long   _badtrap        /* 59: unassigned, reserved */
-       .long   _badtrap        /* 60: unassigned, reserved */
-       .long   _badtrap        /* 61: unassigned, reserved */
-       .long   _badtrap        /* 62: unassigned, reserved */
-       .long   _badtrap        /* 63: unassigned, reserved */
-#define BADTRAP16      .long   _badtrap,_badtrap,_badtrap,_badtrap,\
-                               _badtrap,_badtrap,_badtrap,_badtrap,\
-                               _badtrap,_badtrap,_badtrap,_badtrap,\
-                               _badtrap,_badtrap,_badtrap,_badtrap
+       VECTOR(badtrap)         /* 55: unassigned, reserved */
+       VECTOR(badtrap)         /* 56: unassigned, reserved */
+       VECTOR(badtrap)         /* 57: unassigned, reserved */
+       VECTOR(badtrap)         /* 58: unassigned, reserved */
+       VECTOR(badtrap)         /* 59: unassigned, reserved */
+       VECTOR(badtrap)         /* 60: unassigned, reserved */
+       VECTOR(badtrap)         /* 61: unassigned, reserved */
+       VECTOR(badtrap)         /* 62: unassigned, reserved */
+       VECTOR(badtrap)         /* 63: unassigned, reserved */
+#define BADTRAP16       \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap) ; \
+       VECTOR(badtrap) ; VECTOR(badtrap)
+
        BADTRAP16               /* 64-255: user interrupt vectors */
        BADTRAP16               /* 64-255: user interrupt vectors */
        BADTRAP16               /* 64-255: user interrupt vectors */
@@ -192,8 +193,6 @@
        BADTRAP16               /* 64-255: user interrupt vectors */
 
 
-       .globl  _etext,_edata,_end
-
        START = 0x700000
        STACK = 0x800000
        DIPSW = 0x49000000
@@ -203,7 +202,7 @@
        movl    #STACK,%sp              | set SP
 
        movl    #_C_LABEL(prgcore), %a2 | save program address
-       movl    #Reset, %a2@+           | save start of core
+       movl    #_ASM_LABEL(Reset), %a2@+       | save start of core
        movl    #_C_LABEL(end),  %a2@+  | save end of core
        movl    #STACK, %a2@            | save initial stack addr
 
@@ -220,7 +219,7 @@
        movl    %a0@(NMIVEC),%d0        | restore NMIVEC
        movl    #_ASM_LABEL(gotoROM),%a0        | save to _gotoROM
        movl    %d0,%a0@                |
-       movl    #Reset,%a0              | BP vbr to %a0
+       movl    #_ASM_LABEL(Reset),%a0  | BP vbr to %a0
        movl    #_C_LABEL(exit),%a0@(NMIVEC)    | save address
        
 
@@ -229,7 +228,7 @@
        movl    %a0@(ILLGINST),%sp@-    | save ILLINST vector for BrkPtr
        movl    %a0@(EVTRAPF),%sp@-
 
-       movl    #Reset,%a0
+       movl    #_ASM_LABEL(Reset),%a0
        movl    %sp@+,%a0@(EVTRAPF)
        movl    %sp@+,%a0@(ILLGINST)    | restore ILLINST vector
        movec   %a0,%vbr
@@ -267,12 +266,12 @@
  * Trap/interrupt vector routines
  */ 
 
-_buserr:
+ENTRY_NOPROFILE(buserr)
        tstl    _C_LABEL(nofault)       | device probe?
-       jeq     _addrerr                | no, handle as usual
+       jeq     _C_LABEL(addrerr)       | no, handle as usual
        movl    _C_LABEL(nofault),%sp@- | yes,
        jbsr    _C_LABEL(longjmp)       |  longjmp(nofault)
-_addrerr:
+ENTRY_NOPROFILE(addrerr)
        clrw    %sp@-                   | pad SR to longword
        moveml  #0xFFFF,%sp@-           | save user registers
        movl    %usp,%a0                | save the user SP
@@ -344,16 +343,16 @@
        moveml  %sp@+,#0x7FFF           | restore most user regs
        addql   #4,%sp                  | toss SSP
        tstw    %sp@+                   | do we need to clean up stack?
-       jeq     rei                     | no, just continue
+       jeq     _ASM_LABEL(rei)         | no, just continue
        btst    #7,%sp@(6)              | type 9/10/11 frame?
-       jeq     rei                     | no, nothing to do
+       jeq     _ASM_LABEL(rei)         | no, nothing to do
        btst    #5,%sp@(6)              | type 9?
        jne     Lbex1                   | no, skip
        movw    %sp@,%sp@(12)           | yes, push down SR
        movl    %sp@(2),%sp@(14)        | and PC
        clrw    %sp@(18)                | and mark as type 0 frame
        lea     %sp@(12),%sp            | clean the excess
-       jra     rei                     | all done
+       jra     _ASM_LABEL(rei)         | all done
 Lbex1:
        btst    #4,%sp@(6)              | type 10?
        jne     Lbex2                   | no, skip
@@ -361,57 +360,57 @@
        movl    %sp@(2),%sp@(26)        | and PC
        clrw    %sp@(30)                | and mark as type 0 frame
        lea     %sp@(24),%sp            | clean the excess
-       jra     rei                     | all done
+       jra     _ASM_LABEL(rei)         | all done
 Lbex2:
        movw    %sp@,%sp@(84)           | type 11, push down SR
        movl    %sp@(2),%sp@(86)        | and PC
        clrw    %sp@(90)                | and mark as type 0 frame
        lea     %sp@(84),%sp            | clean the excess
-       jra     rei                     | all done
+       jra     _ASM_LABEL(rei)         | all done
 
-_illinst:
+ENTRY_NOPROFILE(illinst)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_ILLINST,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)
 
-_zerodiv:
+ENTRY_NOPROFILE(zerodiv)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_ZERODIV,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)
 
-_chkinst:
+ENTRY_NOPROFILE(chkinst)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_CHKINST,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)
 
-_trapvinst:
+ENTRY_NOPROFILE(trapvinst)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_TRAPVINST,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)
 
-_privinst:
+ENTRY_NOPROFILE(privinst)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_PRIVINST,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)
 
-_coperr:
+ENTRY_NOPROFILE(coperr)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_COPERR,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)
 
-_fmterr:
+ENTRY_NOPROFILE(fmterr)
        clrw    %sp@-
        moveml  #0xFFFF,%sp@-
        moveq   #T_FMTERR,%d0
-       jra     _fault
+       jra     _C_LABEL(fault)



Home | Main Index | Thread Index | Old Index