[BACK]Return to inetbsd.S CVS log [TXT][DIR] Up to [local] / sys / arch / m68k / 060sp

Annotation of sys/arch/m68k/060sp/inetbsd.S, Revision 1.1.1.1

1.1       nbrk        1: #
                      2: # $OpenBSD: inetbsd.S,v 1.2 1996/05/30 22:14:42 niklas Exp $
                      3: # $NetBSD: inetbsd.S,v 1.2 1996/05/15 21:16:44 is Exp $
                      4: #
                      5: #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      6: # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
                      7: # M68000 Hi-Performance Microprocessor Division
                      8: # M68060 Software Package Production Release
                      9: #
                     10: # M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc.
                     11: # All rights reserved.
                     12: #
                     13: # THE SOFTWARE is provided on an "AS IS" basis and without warranty.
                     14: # To the maximum extent permitted by applicable law,
                     15: # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
                     16: # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
                     17: # FOR A PARTICULAR PURPOSE and any warranty against infringement with
                     18: # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
                     19: # and any accompanying written materials.
                     20: #
                     21: # To the maximum extent permitted by applicable law,
                     22: # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
                     23: # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
                     24: # BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
                     25: # ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
                     26: #
                     27: # Motorola assumes no responsibility for the maintenance and support
                     28: # of the SOFTWARE.
                     29: #
                     30: # You are hereby granted a copyright license to use, modify, and distribute the
                     31: # SOFTWARE so long as this entire notice is retained without alteration
                     32: # in any modified and/or redistributed versions, and that such modified
                     33: # versions are clearly identified as such.
                     34: # No licenses are granted by implication, estoppel or otherwise under any
                     35: # patents or trademarks of Motorola, Inc.
                     36: #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     37: # Derived from:
                     38: # iskeleton.s
                     39: #
                     40: # This file contains:
                     41: #      (1) example "Call-out"s
                     42: #      (2) example package entry code
                     43: #      (3) example "Call-out" table
                     44: #
                     45:
                     46:
                     47: #################################
                     48: # (1) EXAMPLE CALL-OUTS        #
                     49: #                              #
                     50: # _060_isp_done()              #
                     51: # _060_real_chk()              #
                     52: # _060_real_divbyzero()                #
                     53: #                              #
                     54: # _060_real_cas()              #
                     55: # _060_real_cas2()             #
                     56: # _060_real_lock_page()                #
                     57: # _060_real_unlock_page()      #
                     58: #################################
                     59:
                     60: #
                     61: # _060_isp_done():
                     62: #
                     63: # This is and example main exit point for the Unimplemented Integer
                     64: # Instruction exception handler. For a normal exit, the
                     65: # _isp_unimp() branches to here so that the operating system
                     66: # can do any clean-up desired. The stack frame is the
                     67: # Unimplemented Integer Instruction stack frame with
                     68: # the PC pointing to the instruction following the instruction
                     69: # just emulated.
                     70: # To simply continue execution at the next instruction, just
                     71: # do an "rte".
                     72: #
                     73:        .global _060_isp_done
                     74: _060_isp_done:
                     75:        rte
                     76:
                     77: #
                     78: # _060_real_chk():
                     79: #
                     80: # This is an alternate exit point for the Unimplemented Integer
                     81: # Instruction exception handler. If the instruction was a "chk2"
                     82: # and the operand was out of bounds, then _isp_unimp() creates
                     83: # a CHK exception stack frame from the Unimplemented Integer Instrcution
                     84: # stack frame and branches to this routine.
                     85: #
                     86:        .global _060_real_chk
                     87: _060_real_chk:
                     88:        tstb    sp@             |# is tracing enabled?
                     89:        bpls    real_chk_end            |# no
                     90:
                     91: #
                     92: #          CHK FRAME              TRACE FRAME
                     93: #      *****************       *****************
                     94: #      *   Current PC  *       *   Current PC  *
                     95: #      *****************       *****************
                     96: #      * 0x2 *  0x018  *       * 0x2 *  0x024  *
                     97: #      *****************       *****************
                     98: #      *     Next      *       *     Next      *
                     99: #      *      PC       *       *      PC       *
                    100: #      *****************       *****************
                    101: #      *      SR       *       *      SR       *
                    102: #      *****************       *****************
                    103: #
                    104:        moveb   #0x24,sp@(0x7)          |# set trace vecno
                    105:        bral    _060_real_trace
                    106:
                    107: real_chk_end:
                    108:        jmp     _chkinst
                    109:
                    110: #
                    111: # _060_real_divbyzero:
                    112: #
                    113: # This is an alternate exit point for the Unimplemented Integer
                    114: # Instruction exception handler isp_unimp(). If the instruction is a 64-bit
                    115: # integer divide where the source operand is a zero, then the _isp_unimp()
                    116: # creates a Divide-by-zero exception stack frame from the Unimplemented
                    117: # Integer Instruction stack frame and branches to this routine.
                    118: #
                    119: # Remember that a trace exception may be pending. The code below performs
                    120: # no action associated with the "chk" exception. If tracing is enabled,
                    121: # then it create a Trace exception stack frame from the "chk" exception
                    122: # stack frame and branches to the _real_trace() entry point.
                    123: #
                    124:        .global _060_real_divbyzero
                    125: _060_real_divbyzero:
                    126:        tstb    sp@             |# is tracing enabled?
                    127:        bpls    real_divbyzero_end              |# no
                    128:
                    129: #
                    130: #       DIVBYZERO FRAME           TRACE FRAME
                    131: #      *****************       *****************
                    132: #      *   Current PC  *       *   Current PC  *
                    133: #      *****************       *****************
                    134: #      * 0x2 *  0x014  *       * 0x2 *  0x024  *
                    135: #      *****************       *****************
                    136: #      *     Next      *       *     Next      *
                    137: #      *      PC       *       *      PC       *
                    138: #      *****************       *****************
                    139: #      *      SR       *       *      SR       *
                    140: #      *****************       *****************
                    141: #
                    142:        moveb   #0x24,sp@(0x7)          |# set trace vecno
                    143:        bral    _060_real_trace
                    144:
                    145: real_divbyzero_end:
                    146:        jmp     _zerodiv
                    147:
                    148: ###########################
                    149:
                    150: #
                    151: # _060_real_cas():
                    152: #
                    153: # Entry point for the selected cas emulation code implementation.
                    154: # If the implementation provided by the 68060ISP is sufficient,
                    155: # then this routine simply re-enters the package through _isp_cas.
                    156: #
                    157:        .global _060_real_cas
                    158: _060_real_cas:
                    159:        bral    _I_CALL_TOP+0x80+0x08
                    160:
                    161: #
                    162: # _060_real_cas2():
                    163: #
                    164: # Entry point for the selected cas2 emulation code implementation.
                    165: # If the implementation provided by the 68060ISP is sufficient,
                    166: # then this routine simply re-enters the package through _isp_cas2.
                    167: #
                    168:        .global _060_real_cas2
                    169: _060_real_cas2:
                    170:        bral    _I_CALL_TOP+0x80+0x10
                    171:
                    172: #
                    173: # _060_lock_page():
                    174: #
                    175: # Entry point for the operating system's routine to "lock" a page
                    176: # from being paged out. This routine is needed by the cas/cas2
                    177: # algorithms so that no page faults occur within the "core" code
                    178: # region. Note: the routine must lock two pages if the operand
                    179: # spans two pages.
                    180: # NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE
                    181: # SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME.
                    182: # Arguments:
                    183: #      a0 = operand address
                    184: #      d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user
                    185: #      d1 = `xxxxxxff -> longword| `xxxxxx00 -> word
                    186: # Expected outputs:
                    187: #      d0 = 0 -> success| non-zero -> failure
                    188: #
                    189:        .global _060_real_lock_page
                    190: _060_real_lock_page:
                    191:        clrl    d0
                    192:        rts
                    193:
                    194: #
                    195: # _060_unlock_page():
                    196: #
                    197: # Entry point for the operating system's routine to "unlock" a
                    198: # page that has been "locked" previously with _real_lock_page.
                    199: # Note: the routine must unlock two pages if the operand spans
                    200: # two pages.
                    201: # Arguments:
                    202: #      a0 = operand address
                    203: #      d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user
                    204: #      d1 = `xxxxxxff -> longword| `xxxxxx00 -> word
                    205: #
                    206:        .global _060_real_unlock_page
                    207: _060_real_unlock_page:
                    208:        clrl    d0
                    209:        rts
                    210:
                    211: ############################################################################
                    212:
                    213: ##################################
                    214: # (2) EXAMPLE PACKAGE ENTRY CODE #
                    215: ##################################
                    216:
                    217:        .global _060_isp_unimp
                    218: _060_isp_unimp:
                    219:        bral    _I_CALL_TOP+0x80+0x00
                    220:
                    221:        .global _060_isp_cas
                    222: _060_isp_cas:
                    223:        bral    _I_CALL_TOP+0x80+0x08
                    224:
                    225:        .global _060_isp_cas2
                    226: _060_isp_cas2:
                    227:        bral    _I_CALL_TOP+0x80+0x10
                    228:
                    229:        .global _060_isp_cas_finish
                    230: _060_isp_cas_finish:
                    231:        bral    _I_CALL_TOP+0x80+0x18
                    232:
                    233:        .global _060_isp_cas2_finish
                    234: _060_isp_cas2_finish:
                    235:        bral    _I_CALL_TOP+0x80+0x20
                    236:
                    237:        .global _060_isp_cas_inrange
                    238: _060_isp_cas_inrange:
                    239:        bral    _I_CALL_TOP+0x80+0x28
                    240:
                    241:        .global _060_isp_cas_terminate
                    242: _060_isp_cas_terminate:
                    243:        bral    _I_CALL_TOP+0x80+0x30
                    244:
                    245:        .global _060_isp_cas_restart
                    246: _060_isp_cas_restart:
                    247:        bral    _I_CALL_TOP+0x80+0x38
                    248:
                    249: ############################################################################
                    250:
                    251: ################################
                    252: # (3) EXAMPLE CALL-OUT SECTION #
                    253: ################################
                    254:
                    255: # The size of this section MUST be 128 bytes!!!
                    256:
                    257:        .global _I_CALL_TOP
                    258: _I_CALL_TOP:
                    259:        .long   _060_real_chk-_I_CALL_TOP
                    260:        .long   _060_real_divbyzero-_I_CALL_TOP
                    261:        .long   _060_real_trace-_I_CALL_TOP
                    262:        .long   _060_real_access-_I_CALL_TOP
                    263:        .long   _060_isp_done-_I_CALL_TOP
                    264:
                    265:        .long   _060_real_cas-_I_CALL_TOP
                    266:        .long   _060_real_cas2-_I_CALL_TOP
                    267:        .long   _060_real_lock_page-_I_CALL_TOP
                    268:        .long   _060_real_unlock_page-_I_CALL_TOP
                    269:
                    270:        .long   0x00000000,0x00000000,0x00000000,0x00000000
                    271:        .long   0x00000000,0x00000000,0x00000000
                    272:
                    273:        .long   _060_imem_read-_I_CALL_TOP
                    274:        .long   _060_dmem_read-_I_CALL_TOP
                    275:        .long   _060_dmem_write-_I_CALL_TOP
                    276:        .long   _060_imem_read_word-_I_CALL_TOP
                    277:        .long   _060_imem_read_long-_I_CALL_TOP
                    278:        .long   _060_dmem_read_byte-_I_CALL_TOP
                    279:        .long   _060_dmem_read_word-_I_CALL_TOP
                    280:        .long   _060_dmem_read_long-_I_CALL_TOP
                    281:        .long   _060_dmem_write_byte-_I_CALL_TOP
                    282:        .long   _060_dmem_write_word-_I_CALL_TOP
                    283:        .long   _060_dmem_write_long-_I_CALL_TOP
                    284:
                    285:        .long   0x00000000
                    286:        .long   0x00000000,0x00000000,0x00000000,0x00000000
                    287:
                    288: ############################################################################
                    289:
                    290: # 060 INTEGER KERNEL PACKAGE MUST GO HERE!!!
                    291:
                    292:        .include        "isp.S"

CVSweb