18c2ecf20Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28c2ecf20Sopenharmony_ciMOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP 38c2ecf20Sopenharmony_ciM68000 Hi-Performance Microprocessor Division 48c2ecf20Sopenharmony_ciM68060 Software Package 58c2ecf20Sopenharmony_ciProduction Release P1.00 -- October 10, 1994 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciM68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved. 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciTHE SOFTWARE is provided on an "AS IS" basis and without warranty. 108c2ecf20Sopenharmony_ciTo the maximum extent permitted by applicable law, 118c2ecf20Sopenharmony_ciMOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 128c2ecf20Sopenharmony_ciINCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 138c2ecf20Sopenharmony_ciand any warranty against infringement with regard to the SOFTWARE 148c2ecf20Sopenharmony_ci(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials. 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciTo the maximum extent permitted by applicable law, 178c2ecf20Sopenharmony_ciIN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER 188c2ecf20Sopenharmony_ci(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, 198c2ecf20Sopenharmony_ciBUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) 208c2ecf20Sopenharmony_ciARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. 218c2ecf20Sopenharmony_ciMotorola assumes no responsibility for the maintenance and support of the SOFTWARE. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciYou are hereby granted a copyright license to use, modify, and distribute the SOFTWARE 248c2ecf20Sopenharmony_ciso long as this entire notice is retained without alteration in any modified and/or 258c2ecf20Sopenharmony_ciredistributed versions, and that such modified versions are clearly identified as such. 268c2ecf20Sopenharmony_ciNo licenses are granted by implication, estoppel or otherwise under any patents 278c2ecf20Sopenharmony_cior trademarks of Motorola, Inc. 288c2ecf20Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 298c2ecf20Sopenharmony_ci68060 INTEGER SOFTWARE PACKAGE (Kernel version) 308c2ecf20Sopenharmony_ci------------------------------------------------ 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciThe file isp.sa contains the 68060 Integer Software Package. 338c2ecf20Sopenharmony_ciThis package is essentially an exception handler that can be 348c2ecf20Sopenharmony_ciintegrated into an operating system to handle the "Unimplemented 358c2ecf20Sopenharmony_ciInteger Instruction" exception vector #61. 368c2ecf20Sopenharmony_ciThis exception is taken when any of the integer instructions 378c2ecf20Sopenharmony_cinot hardware implemented on the 68060 are encountered. The 388c2ecf20Sopenharmony_ciisp.sa provides full emulation support for these instructions. 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciThe unimplemented integer instructions are: 418c2ecf20Sopenharmony_ci 64-bit divide 428c2ecf20Sopenharmony_ci 64-bit multiply 438c2ecf20Sopenharmony_ci movep 448c2ecf20Sopenharmony_ci cmp2 458c2ecf20Sopenharmony_ci chk2 468c2ecf20Sopenharmony_ci cas (w/ a misaligned effective address) 478c2ecf20Sopenharmony_ci cas2 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ciRelease file format: 508c2ecf20Sopenharmony_ci-------------------- 518c2ecf20Sopenharmony_ciThe file isp.sa is essentially a hexadecimal image of the 528c2ecf20Sopenharmony_cirelease package. This is the ONLY format which will be supported. 538c2ecf20Sopenharmony_ciThe hex image was created by assembling the source code and 548c2ecf20Sopenharmony_cithen converting the resulting binary output image into an 558c2ecf20Sopenharmony_ciASCII text file. The hexadecimal numbers are listed 568c2ecf20Sopenharmony_ciusing the Motorola Assembly Syntax assembler directive "dc.l" 578c2ecf20Sopenharmony_ci(define constant longword). The file can be converted to other 588c2ecf20Sopenharmony_ciassembly syntaxes by using any word processor with a global 598c2ecf20Sopenharmony_cisearch and replace function. 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ciTo assist in assembling and linking this module with other modules, 628c2ecf20Sopenharmony_cithe installer should add a symbolic label to the top of the file. 638c2ecf20Sopenharmony_ciThis will allow calling routines to access the entry points 648c2ecf20Sopenharmony_ciof this package. 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ciThe source code isp.s has also been included but only for 678c2ecf20Sopenharmony_cidocumentation purposes. 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciRelease file structure: 708c2ecf20Sopenharmony_ci----------------------- 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci(top of module) 738c2ecf20Sopenharmony_ci ----------------- 748c2ecf20Sopenharmony_ci | | - 128 byte-sized section 758c2ecf20Sopenharmony_ci (1) | Call-Out | - 4 bytes per entry (user fills these in) 768c2ecf20Sopenharmony_ci | | - example routines in iskeleton.s 778c2ecf20Sopenharmony_ci ----------------- 788c2ecf20Sopenharmony_ci | | - 8 bytes per entry 798c2ecf20Sopenharmony_ci (2) | Entry Point | - user does a "bra" or "jmp" to this address 808c2ecf20Sopenharmony_ci | | 818c2ecf20Sopenharmony_ci ----------------- 828c2ecf20Sopenharmony_ci | | - code section 838c2ecf20Sopenharmony_ci (3) ~ ~ 848c2ecf20Sopenharmony_ci | | 858c2ecf20Sopenharmony_ci ----------------- 868c2ecf20Sopenharmony_ci(bottom of module) 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ciThe first section of this module is the "Call-out" section. This section 898c2ecf20Sopenharmony_ciis NOT INCLUDED in isp.sa (an example "Call-out" section is provided at 908c2ecf20Sopenharmony_cithe end of the file iskeleton.s). The purpose of this section is to allow 918c2ecf20Sopenharmony_cithe ISP routines to reference external functions that must be provided 928c2ecf20Sopenharmony_ciby the host operating system. This section MUST be exactly 128 bytes in 938c2ecf20Sopenharmony_cisize. There are 32 fields, each 4 bytes in size. Each field corresponds 948c2ecf20Sopenharmony_cito a function required by the ISP (these functions and their location are 958c2ecf20Sopenharmony_cilisted in "68060ISP call-outs" below). Each field entry should contain 968c2ecf20Sopenharmony_cithe address of the corresponding function RELATIVE to the starting address 978c2ecf20Sopenharmony_ciof the "call-out" section. The "Call-out" section must sit adjacent to the 988c2ecf20Sopenharmony_ciisp.sa image in memory. 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ciThe second section, the "Entry-point" section, is used by external routines 1018c2ecf20Sopenharmony_cito access the functions within the ISP. Since the isp.sa hex file contains 1028c2ecf20Sopenharmony_cino symbol names, this section contains function entry points that are fixed 1038c2ecf20Sopenharmony_ciwith respect to the top of the package. The currently defined entry-points 1048c2ecf20Sopenharmony_ciare listed in section "68060 ISP entry points" below. A calling routine 1058c2ecf20Sopenharmony_ciwould simply execute a "bra" or "jmp" that jumped to the selected function 1068c2ecf20Sopenharmony_cientry-point. 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ciFor example, if the 68060 hardware took a "Unimplemented Integer Instruction" 1098c2ecf20Sopenharmony_ciexception (vector #61), the operating system should execute something 1108c2ecf20Sopenharmony_cisimilar to: 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci bra _060ISP_TOP+128+0 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci(_060ISP_TOP is the starting address of the "Call-out" section; the "Call-out" 1158c2ecf20Sopenharmony_cisection is 128 bytes long; and the Unimplemented Integer ISP handler entry 1168c2ecf20Sopenharmony_cipoint is located 0 bytes from the top of the "Entry-point" section.) 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ciThe third section is the code section. After entering through an "Entry-point", 1198c2ecf20Sopenharmony_cithe entry code jumps to the appropriate emulation code within the code section. 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci68060ISP call-outs: (details in iskeleton.s) 1228c2ecf20Sopenharmony_ci-------------------- 1238c2ecf20Sopenharmony_ci0x000: _060_real_chk 1248c2ecf20Sopenharmony_ci0x004: _060_real_divbyzero 1258c2ecf20Sopenharmony_ci0x008: _060_real_trace 1268c2ecf20Sopenharmony_ci0x00c: _060_real_access 1278c2ecf20Sopenharmony_ci0x010: _060_isp_done 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci0x014: _060_real_cas 1308c2ecf20Sopenharmony_ci0x018: _060_real_cas2 1318c2ecf20Sopenharmony_ci0x01c: _060_real_lock_page 1328c2ecf20Sopenharmony_ci0x020: _060_real_unlock_page 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci0x024: (Motorola reserved) 1358c2ecf20Sopenharmony_ci0x028: (Motorola reserved) 1368c2ecf20Sopenharmony_ci0x02c: (Motorola reserved) 1378c2ecf20Sopenharmony_ci0x030: (Motorola reserved) 1388c2ecf20Sopenharmony_ci0x034: (Motorola reserved) 1398c2ecf20Sopenharmony_ci0x038: (Motorola reserved) 1408c2ecf20Sopenharmony_ci0x03c: (Motorola reserved) 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ci0x040: _060_imem_read 1438c2ecf20Sopenharmony_ci0x044: _060_dmem_read 1448c2ecf20Sopenharmony_ci0x048: _060_dmem_write 1458c2ecf20Sopenharmony_ci0x04c: _060_imem_read_word 1468c2ecf20Sopenharmony_ci0x050: _060_imem_read_long 1478c2ecf20Sopenharmony_ci0x054: _060_dmem_read_byte 1488c2ecf20Sopenharmony_ci0x058: _060_dmem_read_word 1498c2ecf20Sopenharmony_ci0x05c: _060_dmem_read_long 1508c2ecf20Sopenharmony_ci0x060: _060_dmem_write_byte 1518c2ecf20Sopenharmony_ci0x064: _060_dmem_write_word 1528c2ecf20Sopenharmony_ci0x068: _060_dmem_write_long 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci0x06c: (Motorola reserved) 1558c2ecf20Sopenharmony_ci0x070: (Motorola reserved) 1568c2ecf20Sopenharmony_ci0x074: (Motorola reserved) 1578c2ecf20Sopenharmony_ci0x078: (Motorola reserved) 1588c2ecf20Sopenharmony_ci0x07c: (Motorola reserved) 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci68060ISP entry points: 1618c2ecf20Sopenharmony_ci----------------------- 1628c2ecf20Sopenharmony_ci0x000: _060_isp_unimp 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci0x008: _060_isp_cas 1658c2ecf20Sopenharmony_ci0x010: _060_isp_cas2 1668c2ecf20Sopenharmony_ci0x018: _060_isp_cas_finish 1678c2ecf20Sopenharmony_ci0x020: _060_isp_cas2_finish 1688c2ecf20Sopenharmony_ci0x028: _060_isp_cas_inrange 1698c2ecf20Sopenharmony_ci0x030: _060_isp_cas_terminate 1708c2ecf20Sopenharmony_ci0x038: _060_isp_cas_restart 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ciIntegrating cas/cas2: 1738c2ecf20Sopenharmony_ci--------------------- 1748c2ecf20Sopenharmony_ciThe instructions "cas2" and "cas" (when used with a misaligned effective 1758c2ecf20Sopenharmony_ciaddress) take the Unimplemented Integer Instruction exception. When the 1768c2ecf20Sopenharmony_ci060ISP is installed properly, these instructions will enter through the 1778c2ecf20Sopenharmony_ci_060_isp_unimp() entry point of the ISP. 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_ciAfter the 060ISP decodes the instruction type and fetches the appropriate 1808c2ecf20Sopenharmony_cidata registers, and BEFORE the actual emulated transfers occur, the 1818c2ecf20Sopenharmony_cipackage calls either the "Call-out" _060_real_cas() or _060_real_cas2(). 1828c2ecf20Sopenharmony_ciIf the emulation code provided by the 060ISP is sufficient for the 1838c2ecf20Sopenharmony_cihost system (see isp.s source code), then these "Call-out"s should be 1848c2ecf20Sopenharmony_cimade, by the system integrator, to point directly back into the package 1858c2ecf20Sopenharmony_cithrough the "Entry-point"s _060_isp_cas() or _060_isp_cas2(). 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ciOne other necessary action by the integrator is to supply the routines 1888c2ecf20Sopenharmony_ci_060_real_lock_page() and _060_real_unlock_page(). These functions are 1898c2ecf20Sopenharmony_cidefined further in iskeleton.s and the 68060 Software Package Specification. 1908c2ecf20Sopenharmony_ci 1918c2ecf20Sopenharmony_ciIf the "core" emulation routines of either "cas" or "cas2" perform some 1928c2ecf20Sopenharmony_ciactions which are too system-specific, then the system integrator must 1938c2ecf20Sopenharmony_cisupply new emulation code. This new emulation code should reside within 1948c2ecf20Sopenharmony_cithe functions _060_real_cas() or _060_real_cas2(). When this new emulation 1958c2ecf20Sopenharmony_cicode has completed, then it should re-enter the 060ISP package through the 1968c2ecf20Sopenharmony_ci"Entry-point" _060_isp_cas_finish() or _060_isp_cas2_finish(). 1978c2ecf20Sopenharmony_ciTo see what the register state is upon entering _060_real_cas() or 1988c2ecf20Sopenharmony_ci_060_real_cas2() and what it should be upon return to the package through 1998c2ecf20Sopenharmony_ci_060_isp_cas_finish() or _060_isp_cas2_finish(), please refer to the 2008c2ecf20Sopenharmony_cisource code in isp.s. 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ciMiscellaneous: 2038c2ecf20Sopenharmony_ci-------------- 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci_060_isp_unimp: 2068c2ecf20Sopenharmony_ci---------------- 2078c2ecf20Sopenharmony_ci- documented in 2.2 in spec. 2088c2ecf20Sopenharmony_ci- Basic flow: 2098c2ecf20Sopenharmony_ci exception taken ---> enter _060_isp_unimp --| 2108c2ecf20Sopenharmony_ci | 2118c2ecf20Sopenharmony_ci | 2128c2ecf20Sopenharmony_ci may exit through _060_real_itrace <----| 2138c2ecf20Sopenharmony_ci or | 2148c2ecf20Sopenharmony_ci may exit through _060_real_chk <----| 2158c2ecf20Sopenharmony_ci or | 2168c2ecf20Sopenharmony_ci may exit through _060_real_divbyzero <----| 2178c2ecf20Sopenharmony_ci or | 2188c2ecf20Sopenharmony_ci may exit through _060_isp_done <----| 219