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