Home | History | Annotate | Line # | Download | only in dist
      1 #
      2 # $NetBSD: isp.doc,v 1.1 2000/04/14 20:24:39 is Exp $
      3 #
      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 
     38 68060 INTEGER SOFTWARE PACKAGE (Kernel version)
     39 ------------------------------------------------
     40 
     41 The file isp.sa contains the 68060 Integer Software Package.
     42 This package is essentially an exception handler that can be
     43 integrated into an operating system to handle the "Unimplemented
     44 Integer Instruction" exception vector #61.
     45 This exception is taken when any of the integer instructions
     46 not hardware implemented on the 68060 are encountered. The
     47 isp.sa provides full emulation support for these instructions.
     48 
     49 The unimplemented integer instructions are:
     50 	64-bit divide
     51 	64-bit multiply
     52 	movep
     53 	cmp2
     54 	chk2
     55 	cas (w/ a misaligned effective address)
     56 	cas2
     57 
     58 Release file format:
     59 --------------------
     60 The file isp.sa is essentially a hexadecimal image of the
     61 release package. This is the ONLY format which will be supported.
     62 The hex image was created by assembling the source code and
     63 then converting the resulting binary output image into an
     64 ASCII text file. The hexadecimal numbers are listed
     65 using the Motorola Assembly Syntax assembler directive "dc.l"
     66 (define constant longword). The file can be converted to other
     67 assembly syntaxes by using any word processor with a global
     68 search and replace function.
     69 
     70 To assist in assembling and linking this module with other modules,
     71 the installer should add a symbolic label to the top of the file.
     72 This will allow calling routines to access the entry points
     73 of this package.
     74 
     75 The source code isp.s has also been included but only for
     76 documentation purposes.
     77 
     78 Release file structure:
     79 -----------------------
     80 
     81 (top of module)
     82 	-----------------
     83 	|		| - 128 byte-sized section
     84    (1)  |   Call-Out    | - 4 bytes per entry (user fills these in)
     85 	|		| - example routines in iskeleton.s
     86 	-----------------
     87 	|		| - 8 bytes per entry
     88    (2)  | Entry Point   | - user does a "bra" or "jmp" to this address
     89 	|               | 
     90 	-----------------
     91 	|		| - code section
     92    (3)  ~		~
     93 	|		|
     94 	-----------------
     95 (bottom of module)
     96 
     97 The first section of this module is the "Call-out" section. This section
     98 is NOT INCLUDED in isp.sa (an example "Call-out" section is provided at
     99 the end of the file iskeleton.s). The purpose of this section is to allow 
    100 the ISP routines to reference external functions that must be provided 
    101 by the host operating system. This section MUST be exactly 128 bytes in 
    102 size. There are 32 fields, each 4 bytes in size. Each field corresponds
    103 to a function required by the ISP (these functions and their location are
    104 listed in "68060ISP call-outs" below). Each field entry should contain
    105 the address of the corresponding function RELATIVE to the starting address
    106 of the "call-out" section. The "Call-out" section must sit adjacent to the 
    107 isp.sa image in memory.
    108 
    109 The second section, the "Entry-point" section, is used by external routines
    110 to access the functions within the ISP. Since the isp.sa hex file contains
    111 no symbol names, this section contains function entry points that are fixed
    112 with respect to the top of the package. The currently defined entry-points
    113 are listed in section "68060 ISP entry points" below. A calling routine
    114 would simply execute a "bra" or "jmp" that jumped to the selected function
    115 entry-point.
    116 
    117 For example, if the 68060 hardware took a "Unimplemented Integer Instruction"
    118 exception (vector #61), the operating system should execute something
    119 similar to:
    120 
    121 	bra	_060ISP_TOP+128+0
    122 
    123 (_060ISP_TOP is the starting address of the "Call-out" section; the "Call-out"
    124 section is 128 bytes long; and the Unimplemented Integer ISP handler entry 
    125 point is located 0 bytes from the top of the "Entry-point" section.)
    126 
    127 The third section is the code section. After entering through an "Entry-point",
    128 the entry code jumps to the appropriate emulation code within the code section.
    129 
    130 68060ISP call-outs: (details in iskeleton.s)
    131 --------------------
    132 0x000:	_060_real_chk
    133 0x004:	_060_real_divbyzero
    134 0x008:	_060_real_trace
    135 0x00c:	_060_real_access
    136 0x010:	_060_isp_done
    137 
    138 0x014:	_060_real_cas
    139 0x018:	_060_real_cas2
    140 0x01c:	_060_real_lock_page
    141 0x020:	_060_real_unlock_page
    142 
    143 0x024:	(Motorola reserved)
    144 0x028:	(Motorola reserved)
    145 0x02c:	(Motorola reserved)
    146 0x030:	(Motorola reserved)
    147 0x034:	(Motorola reserved)
    148 0x038:	(Motorola reserved)
    149 0x03c:	(Motorola reserved)
    150 
    151 0x040:	_060_imem_read
    152 0x044:	_060_dmem_read
    153 0x048:	_060_dmem_write
    154 0x04c:	_060_imem_read_word
    155 0x050:	_060_imem_read_long
    156 0x054:	_060_dmem_read_byte
    157 0x058:	_060_dmem_read_word
    158 0x05c:	_060_dmem_read_long
    159 0x060:	_060_dmem_write_byte
    160 0x064:	_060_dmem_write_word
    161 0x068:	_060_dmem_write_long
    162 
    163 0x06c:	(Motorola reserved)
    164 0x070:	(Motorola reserved)
    165 0x074:	(Motorola reserved)
    166 0x078:	(Motorola reserved)
    167 0x07c:	(Motorola reserved)
    168 
    169 68060ISP entry points:
    170 -----------------------
    171 0x000:	_060_isp_unimp
    172 
    173 0x008:	_060_isp_cas
    174 0x010:	_060_isp_cas2
    175 0x018:	_060_isp_cas_finish
    176 0x020:	_060_isp_cas2_finish
    177 0x028:	_060_isp_cas_inrange
    178 0x030:	_060_isp_cas_terminate
    179 0x038:	_060_isp_cas_restart
    180 
    181 Integrating cas/cas2:
    182 ---------------------
    183 The instructions "cas2" and "cas" (when used with a misaligned effective
    184 address) take the Unimplemented Integer Instruction exception. When the
    185 060ISP is installed properly, these instructions will enter through the
    186 _060_isp_unimp() entry point of the ISP.
    187 
    188 After the 060ISP decodes the instruction type and fetches the appropriate
    189 data registers, and BEFORE the actual emulated transfers occur, the 
    190 package calls either the "Call-out" _060_real_cas() or _060_real_cas2().
    191 If the emulation code provided by the 060ISP is sufficient for the
    192 host system (see isp.s source code), then these "Call-out"s should be
    193 made, by the system integrator, to point directly back into the package
    194 through the "Entry-point"s _060_isp_cas() or _060_isp_cas2().
    195 
    196 One other necessary action by the integrator is to supply the routines
    197 _060_real_lock_page() and _060_real_unlock_page(). These functions are
    198 defined further in iskeleton.s and the 68060 Software Package Specification.
    199 
    200 If the "core" emulation routines of either "cas" or "cas2" perform some
    201 actions which are too system-specific, then the system integrator must
    202 supply new emulation code. This new emulation code should reside within
    203 the functions _060_real_cas() or _060_real_cas2(). When this new emulation
    204 code has completed, then it should re-enter the 060ISP package through the
    205 "Entry-point" _060_isp_cas_finish() or _060_isp_cas2_finish().
    206 To see what the register state is upon entering _060_real_cas() or
    207 _060_real_cas2() and what it should be upon return to the package through
    208 _060_isp_cas_finish() or _060_isp_cas2_finish(), please refer to the
    209 source code in isp.s.
    210 
    211 Miscellaneous:
    212 --------------
    213 
    214 _060_isp_unimp:
    215 ----------------
    216 - documented in 2.2 in spec.
    217 - Basic flow:
    218 	exception taken ---> enter _060_isp_unimp   --|
    219 						      |
    220 						      |
    221             may exit through _060_real_itrace    <----|
    222 						  or  |
    223             may exit through _060_real_chk       <----|
    224 						  or  |
    225             may exit through _060_real_divbyzero <----|
    226 						  or  |
    227             may exit through _060_isp_done       <----|
    228