162306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262306a36Sopenharmony_ciMOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
362306a36Sopenharmony_ciM68000 Hi-Performance Microprocessor Division
462306a36Sopenharmony_ciM68060 Software Package
562306a36Sopenharmony_ciProduction Release P1.00 -- October 10, 1994
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciM68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciTHE SOFTWARE is provided on an "AS IS" basis and without warranty.
1062306a36Sopenharmony_ciTo the maximum extent permitted by applicable law,
1162306a36Sopenharmony_ciMOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
1262306a36Sopenharmony_ciINCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
1362306a36Sopenharmony_ciand any warranty against infringement with regard to the SOFTWARE
1462306a36Sopenharmony_ci(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciTo the maximum extent permitted by applicable law,
1762306a36Sopenharmony_ciIN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
1862306a36Sopenharmony_ci(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
1962306a36Sopenharmony_ciBUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
2062306a36Sopenharmony_ciARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
2162306a36Sopenharmony_ciMotorola assumes no responsibility for the maintenance and support of the SOFTWARE.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciYou are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
2462306a36Sopenharmony_ciso long as this entire notice is retained without alteration in any modified and/or
2562306a36Sopenharmony_ciredistributed versions, and that such modified versions are clearly identified as such.
2662306a36Sopenharmony_ciNo licenses are granted by implication, estoppel or otherwise under any patents
2762306a36Sopenharmony_cior trademarks of Motorola, Inc.
2862306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2962306a36Sopenharmony_ci68060 INTEGER SOFTWARE PACKAGE (Kernel version)
3062306a36Sopenharmony_ci------------------------------------------------
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ciThe file isp.sa contains the 68060 Integer Software Package.
3362306a36Sopenharmony_ciThis package is essentially an exception handler that can be
3462306a36Sopenharmony_ciintegrated into an operating system to handle the "Unimplemented
3562306a36Sopenharmony_ciInteger Instruction" exception vector #61.
3662306a36Sopenharmony_ciThis exception is taken when any of the integer instructions
3762306a36Sopenharmony_cinot hardware implemented on the 68060 are encountered. The
3862306a36Sopenharmony_ciisp.sa provides full emulation support for these instructions.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciThe unimplemented integer instructions are:
4162306a36Sopenharmony_ci	64-bit divide
4262306a36Sopenharmony_ci	64-bit multiply
4362306a36Sopenharmony_ci	movep
4462306a36Sopenharmony_ci	cmp2
4562306a36Sopenharmony_ci	chk2
4662306a36Sopenharmony_ci	cas (w/ a misaligned effective address)
4762306a36Sopenharmony_ci	cas2
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ciRelease file format:
5062306a36Sopenharmony_ci--------------------
5162306a36Sopenharmony_ciThe file isp.sa is essentially a hexadecimal image of the
5262306a36Sopenharmony_cirelease package. This is the ONLY format which will be supported.
5362306a36Sopenharmony_ciThe hex image was created by assembling the source code and
5462306a36Sopenharmony_cithen converting the resulting binary output image into an
5562306a36Sopenharmony_ciASCII text file. The hexadecimal numbers are listed
5662306a36Sopenharmony_ciusing the Motorola Assembly Syntax assembler directive "dc.l"
5762306a36Sopenharmony_ci(define constant longword). The file can be converted to other
5862306a36Sopenharmony_ciassembly syntaxes by using any word processor with a global
5962306a36Sopenharmony_cisearch and replace function.
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ciTo assist in assembling and linking this module with other modules,
6262306a36Sopenharmony_cithe installer should add a symbolic label to the top of the file.
6362306a36Sopenharmony_ciThis will allow calling routines to access the entry points
6462306a36Sopenharmony_ciof this package.
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ciThe source code isp.s has also been included but only for
6762306a36Sopenharmony_cidocumentation purposes.
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ciRelease file structure:
7062306a36Sopenharmony_ci-----------------------
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci(top of module)
7362306a36Sopenharmony_ci	-----------------
7462306a36Sopenharmony_ci	|		| - 128 byte-sized section
7562306a36Sopenharmony_ci   (1)  |   Call-Out    | - 4 bytes per entry (user fills these in)
7662306a36Sopenharmony_ci	|		| - example routines in iskeleton.s
7762306a36Sopenharmony_ci	-----------------
7862306a36Sopenharmony_ci	|		| - 8 bytes per entry
7962306a36Sopenharmony_ci   (2)  | Entry Point   | - user does a "bra" or "jmp" to this address
8062306a36Sopenharmony_ci	|               |
8162306a36Sopenharmony_ci	-----------------
8262306a36Sopenharmony_ci	|		| - code section
8362306a36Sopenharmony_ci   (3)  ~		~
8462306a36Sopenharmony_ci	|		|
8562306a36Sopenharmony_ci	-----------------
8662306a36Sopenharmony_ci(bottom of module)
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ciThe first section of this module is the "Call-out" section. This section
8962306a36Sopenharmony_ciis NOT INCLUDED in isp.sa (an example "Call-out" section is provided at
9062306a36Sopenharmony_cithe end of the file iskeleton.s). The purpose of this section is to allow
9162306a36Sopenharmony_cithe ISP routines to reference external functions that must be provided
9262306a36Sopenharmony_ciby the host operating system. This section MUST be exactly 128 bytes in
9362306a36Sopenharmony_cisize. There are 32 fields, each 4 bytes in size. Each field corresponds
9462306a36Sopenharmony_cito a function required by the ISP (these functions and their location are
9562306a36Sopenharmony_cilisted in "68060ISP call-outs" below). Each field entry should contain
9662306a36Sopenharmony_cithe address of the corresponding function RELATIVE to the starting address
9762306a36Sopenharmony_ciof the "call-out" section. The "Call-out" section must sit adjacent to the
9862306a36Sopenharmony_ciisp.sa image in memory.
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ciThe second section, the "Entry-point" section, is used by external routines
10162306a36Sopenharmony_cito access the functions within the ISP. Since the isp.sa hex file contains
10262306a36Sopenharmony_cino symbol names, this section contains function entry points that are fixed
10362306a36Sopenharmony_ciwith respect to the top of the package. The currently defined entry-points
10462306a36Sopenharmony_ciare listed in section "68060 ISP entry points" below. A calling routine
10562306a36Sopenharmony_ciwould simply execute a "bra" or "jmp" that jumped to the selected function
10662306a36Sopenharmony_cientry-point.
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ciFor example, if the 68060 hardware took a "Unimplemented Integer Instruction"
10962306a36Sopenharmony_ciexception (vector #61), the operating system should execute something
11062306a36Sopenharmony_cisimilar to:
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci	bra	_060ISP_TOP+128+0
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci(_060ISP_TOP is the starting address of the "Call-out" section; the "Call-out"
11562306a36Sopenharmony_cisection is 128 bytes long; and the Unimplemented Integer ISP handler entry
11662306a36Sopenharmony_cipoint is located 0 bytes from the top of the "Entry-point" section.)
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ciThe third section is the code section. After entering through an "Entry-point",
11962306a36Sopenharmony_cithe entry code jumps to the appropriate emulation code within the code section.
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci68060ISP call-outs: (details in iskeleton.s)
12262306a36Sopenharmony_ci--------------------
12362306a36Sopenharmony_ci0x000:	_060_real_chk
12462306a36Sopenharmony_ci0x004:	_060_real_divbyzero
12562306a36Sopenharmony_ci0x008:	_060_real_trace
12662306a36Sopenharmony_ci0x00c:	_060_real_access
12762306a36Sopenharmony_ci0x010:	_060_isp_done
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci0x014:	_060_real_cas
13062306a36Sopenharmony_ci0x018:	_060_real_cas2
13162306a36Sopenharmony_ci0x01c:	_060_real_lock_page
13262306a36Sopenharmony_ci0x020:	_060_real_unlock_page
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci0x024:	(Motorola reserved)
13562306a36Sopenharmony_ci0x028:	(Motorola reserved)
13662306a36Sopenharmony_ci0x02c:	(Motorola reserved)
13762306a36Sopenharmony_ci0x030:	(Motorola reserved)
13862306a36Sopenharmony_ci0x034:	(Motorola reserved)
13962306a36Sopenharmony_ci0x038:	(Motorola reserved)
14062306a36Sopenharmony_ci0x03c:	(Motorola reserved)
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci0x040:	_060_imem_read
14362306a36Sopenharmony_ci0x044:	_060_dmem_read
14462306a36Sopenharmony_ci0x048:	_060_dmem_write
14562306a36Sopenharmony_ci0x04c:	_060_imem_read_word
14662306a36Sopenharmony_ci0x050:	_060_imem_read_long
14762306a36Sopenharmony_ci0x054:	_060_dmem_read_byte
14862306a36Sopenharmony_ci0x058:	_060_dmem_read_word
14962306a36Sopenharmony_ci0x05c:	_060_dmem_read_long
15062306a36Sopenharmony_ci0x060:	_060_dmem_write_byte
15162306a36Sopenharmony_ci0x064:	_060_dmem_write_word
15262306a36Sopenharmony_ci0x068:	_060_dmem_write_long
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci0x06c:	(Motorola reserved)
15562306a36Sopenharmony_ci0x070:	(Motorola reserved)
15662306a36Sopenharmony_ci0x074:	(Motorola reserved)
15762306a36Sopenharmony_ci0x078:	(Motorola reserved)
15862306a36Sopenharmony_ci0x07c:	(Motorola reserved)
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci68060ISP entry points:
16162306a36Sopenharmony_ci-----------------------
16262306a36Sopenharmony_ci0x000:	_060_isp_unimp
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci0x008:	_060_isp_cas
16562306a36Sopenharmony_ci0x010:	_060_isp_cas2
16662306a36Sopenharmony_ci0x018:	_060_isp_cas_finish
16762306a36Sopenharmony_ci0x020:	_060_isp_cas2_finish
16862306a36Sopenharmony_ci0x028:	_060_isp_cas_inrange
16962306a36Sopenharmony_ci0x030:	_060_isp_cas_terminate
17062306a36Sopenharmony_ci0x038:	_060_isp_cas_restart
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ciIntegrating cas/cas2:
17362306a36Sopenharmony_ci---------------------
17462306a36Sopenharmony_ciThe instructions "cas2" and "cas" (when used with a misaligned effective
17562306a36Sopenharmony_ciaddress) take the Unimplemented Integer Instruction exception. When the
17662306a36Sopenharmony_ci060ISP is installed properly, these instructions will enter through the
17762306a36Sopenharmony_ci_060_isp_unimp() entry point of the ISP.
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ciAfter the 060ISP decodes the instruction type and fetches the appropriate
18062306a36Sopenharmony_cidata registers, and BEFORE the actual emulated transfers occur, the
18162306a36Sopenharmony_cipackage calls either the "Call-out" _060_real_cas() or _060_real_cas2().
18262306a36Sopenharmony_ciIf the emulation code provided by the 060ISP is sufficient for the
18362306a36Sopenharmony_cihost system (see isp.s source code), then these "Call-out"s should be
18462306a36Sopenharmony_cimade, by the system integrator, to point directly back into the package
18562306a36Sopenharmony_cithrough the "Entry-point"s _060_isp_cas() or _060_isp_cas2().
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_ciOne other necessary action by the integrator is to supply the routines
18862306a36Sopenharmony_ci_060_real_lock_page() and _060_real_unlock_page(). These functions are
18962306a36Sopenharmony_cidefined further in iskeleton.s and the 68060 Software Package Specification.
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ciIf the "core" emulation routines of either "cas" or "cas2" perform some
19262306a36Sopenharmony_ciactions which are too system-specific, then the system integrator must
19362306a36Sopenharmony_cisupply new emulation code. This new emulation code should reside within
19462306a36Sopenharmony_cithe functions _060_real_cas() or _060_real_cas2(). When this new emulation
19562306a36Sopenharmony_cicode has completed, then it should re-enter the 060ISP package through the
19662306a36Sopenharmony_ci"Entry-point" _060_isp_cas_finish() or _060_isp_cas2_finish().
19762306a36Sopenharmony_ciTo see what the register state is upon entering _060_real_cas() or
19862306a36Sopenharmony_ci_060_real_cas2() and what it should be upon return to the package through
19962306a36Sopenharmony_ci_060_isp_cas_finish() or _060_isp_cas2_finish(), please refer to the
20062306a36Sopenharmony_cisource code in isp.s.
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_ciMiscellaneous:
20362306a36Sopenharmony_ci--------------
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci_060_isp_unimp:
20662306a36Sopenharmony_ci----------------
20762306a36Sopenharmony_ci- documented in 2.2 in spec.
20862306a36Sopenharmony_ci- Basic flow:
20962306a36Sopenharmony_ci	exception taken ---> enter _060_isp_unimp   --|
21062306a36Sopenharmony_ci						      |
21162306a36Sopenharmony_ci						      |
21262306a36Sopenharmony_ci            may exit through _060_real_itrace    <----|
21362306a36Sopenharmony_ci						  or  |
21462306a36Sopenharmony_ci            may exit through _060_real_chk       <----|
21562306a36Sopenharmony_ci						  or  |
21662306a36Sopenharmony_ci            may exit through _060_real_divbyzero <----|
21762306a36Sopenharmony_ci						  or  |
21862306a36Sopenharmony_ci            may exit through _060_isp_done       <----|
219