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