?? isp060alib.s
字號(hào):
/* isp060ALib.s - MC68060 unimplemented integer instruction assembly library *//* Copyright 1984-1994 Wind River Systems, Inc. */ .data .globl _copyright_wind_river .long _copyright_wind_river/*modification history--------------------01c,09jul96,p_m replaced addql by addl since addql only support value between 0 and 8.01b,21sep95,ms moved data to data segement to fix SPR 498701a,24jun94,tpr clean up following code review. written, handler source code from Motorola FPSP 060sp_B1.*//*DESCRIPTIONThis library provides the exception handler to handle the "UnimplementedInteger Instruction" exception vector #61. This exception is taken when anyof the integer instructions not implemented on the 68060 hardware areencountered. The unimplemented integer instructions are: 64-bit divide 64-bit multiply movep cmp2 chk2 cas (with a misaligned effective address) cas2The exception handler code is provided by the Motorola software package. TheONLY format which is supported by Motorola is a hexadecimal image of the sourcecode. The hex code is divided into 2 parts: the entry point section and the codesection. A third section named "call out section" build by the host operatingsystem integrator is placed just before the Motorola hex code. The codestructure is ----------------- | | - 128 byte-sized section (1) | Call-Out | - 4 bytes per entry | | ----------------- | | - 8 bytes per entry (2) | Entry Point | | | ----------------- | | - code section (3) ~ Code ~ | | -----------------The purpose of the call out section is to allow the handler to referenceexternal functions that must be provided by the host operating system (VxWorks).This section is exactly 128 bytes in size. There are 32 fields, each 4bytes in size. Each field entry contains the address of the correspondingfunction RELATIVE to the starting address of the "call-out" section.The "Call-out" section sits adjacent to the Motorola code. The functionaddress order in the call out section is fixed by Motorola and must neverchange. Below are listed the functions used by the Motorola handler: _060_real_chk _060_real_divbyzero _060_real_trace _060_real_access _060_isp_done _060_real_cas _060_real_cas2 _060_real_lock_page _060_real_unlock_page _060_imem_read _060_dmem_read _060_dmem_write _060_imem_read_word _060_imem_read_long _060_dmem_read_byte _060_dmem_read_word _060_dmem_read_long _060_dmem_write_byte _060_dmem_write_word _060_dmem_write_longThe first functions are only used by the handler, but the second functions areused both by the umimplemented integer instruction handler and by theunimplemented floating point instruction handler. The first functions aredefined in this file before the call out section and Motorola hex code. Thesecond functions are defined in the os060ALib.s file.The call out section is initialized by the isp060COTblInit() function defined in the isp060ArchLib.c file. isp060COTblInit() function is called byexcVecInit().The second section, the "Entry-point" section, can be used by the hostoperating system to access the functions within the handler. This avoids theoverhead associated with taking the exception. The currently definedentry-points are listed below: _060_isp_unimp _060_isp_cas _060_isp_cas2 _060_isp_cas_finish _060_isp_cas2_finish _060_isp_cas_inrange _060_isp_cas_terminate _060_isp_cas_restartThe only entry point used by VxWorks is the _060_isp_unimp exception handlerentry point. This handler is connected to the exception number 61 by theintVecSet() function called by intVecSet().The third section is the Motorola code section. The Motorola files isp.sa and iskeleton.s was merged to obtain this file. All"dc.l" from isp.sa file was replaced by ".long" and all "$" by "0x".Only the call out functions was kept from the iskeleton.s. The codewas translated from Motorola to GNU style.SEE ALSO: MC68060, MC68LC60, MC68EC60 MICROPROCESSORS USER'S MANUAL appendix C.*/ /* internals */ .global __060_isp_done .global __060_real_chk .global __060_real_divbyzero .global __060_real_cas .global __060_real_cas2 .global __060_real_lock_page .global __060_real_unlock_page .global _ISP_060_CO_TBL /* externals */ .global __060_real_trace .text .even/********************************************************************************* _060_isp_done - main exit point for the Integer exception handler.** This function is the main exit point for the Unimplemented Integer* Instruction exception handler. The stack frame is the Unimplemented Integer* Instruction stack frame with the PC pointing to the instruction following* the instruction just emulated. Till now no special action is performed before* to exit the exception handler.**/__060_isp_done: rte/********************************************************************************* _060_real_chk - CHK instruction emulation exit point ** This is an alternate exit point for the Unimplemented Integer* Instruction exception handler. If the instruction was a "chk2"* and the operand was out of bounds, then exception handler creates* a CHK exception stack frame from the Unimplemented Integer Instrcution* stack frame and branches to this routine which calls the exception handler* connected to the vector number 6 (IV_CHK_INSTRUCTION).** Remember that a trace exception may be pending. The code below performs* no action associated with the "chk" exception. If tracing is enabled,* then it create a Trace exception stack frame from the "chk" exception* stack frame and branches to the _real_trace() entry point.**/__060_real_chk: tstb (sp) /* is tracing enabled ? */ jpl real_chk_end /* no *//* * * CHK FRAME TRACE FRAME * ***************** ***************** * * Current PC * * Current PC * * ***************** ***************** * * 0x2 * 0x018 * * 0x2 * 0x024 * * ***************** ***************** * * Next * * Next * * * PC * * PC * * ***************** ***************** * * SR * * SR * * ***************** ***************** * */ moveb #0x24,0x7(sp) /* set trace vecno */ bral __060_real_tracereal_chk_end: subql #0x04,sp /* save space for vector handler addr */ movel d0,sp@- /* save d0 */ movel a0,sp@- /* save a0 */ jsr _intVecBaseGet /* get the interrupt vector base addr */ addl #0x18,d0 /* compute the vector number 6 addr */ movel d0,sp@- /* move the vector number 6 addr */ movel sp@+,a0 /* into a0 */ movel a0@,sp@(8) /* put into the stack the vector nb 6 */ /* handler address */ movel sp@+,a0 /* restore a0 */ movel sp@+,d0 /* restore d0 */ rts /* jmp into the vector nb 6 handler *//********************************************************************************* _060_real_divbyzero - divide by zero exit point** This is an alternate exit point for the Unimplemented Integer * Instruction exception handler . If the instruction is a 64-bit* integer divide where the source operand is a zero, then the exception handler* creates a Divide-by-zero exception stack frame from the Unimplemented* Integer Instruction stack frame and branches to this routine. This* routine calls the exception handler connected to the vector number 5* (IV_ZERO_DIVIDE).** Remember that a trace exception may be pending. The code below performs* no action associated with the "chk" exception. If tracing is enabled,* then it create a Trace exception stack frame from the "chk" exception* stack frame and branches to the _real_trace() entry point.* */__060_real_divbyzero: tstb (sp) /* is tracing enabled */ jpl real_divbyzero_end /* no *//* * * DIVBYZERO FRAME TRACE FRAME * ***************** ***************** * * Current PC * * Current PC * * ***************** ***************** * * 0x2 * 0x014 * * 0x2 * 0x024 * * ***************** ***************** * * Next * * Next * * * PC * * PC * * ***************** ***************** * * SR * * SR * * ***************** ***************** * */ moveb #0x24,0x7(sp) /* set trace vecno */ bral __060_real_tracereal_divbyzero_end: subql #0x04,sp /* save space for vector handler addr */ movel d0,sp@- /* save d0 */ movel a0,sp@- /* save a0 */ jsr _intVecBaseGet /* get the interrupt vector base addr */ addl #0x14,d0 /* compute the vector number 5 addr */ movel d0,sp@- /* move the vector number 5 addr */ movel sp@+,a0 /* into a0 */ movel a0@,sp@(8) /* put into the stack the vector nb 5 */ /* handler address */ movel sp@+,a0 /* restore a0 */ movel sp@+,d0 /* restore d0 */ rts /* jmp into the vector nb 5 handler *//********************************************************************************* _060_real_cas - entry point for CAS instruction emulation** This function is called when the CAS unimplemented instruction is encountered.* The host OS can provide the emulation code or used the code provided by the* Motorola library. ** VxWorks uses the CAS emulation code provided by the Motorola library thus* we jump to the CAS entry point.**/__060_real_cas: bral _ISP_060_TOP + 0x08/********************************************************************************* _060_real_cas2 - entry point for CAS2 instruction emulation** This function is called when the CAS2 unimplemented instruction is* encountered. The host OS can provide the emulation code or used the* code provided by the Motorola library. ** VxWorks uses the CAS emalulation code provided by the Motorola library thus* we jump to the CAS2 entry point.**/__060_real_cas2: bral _ISP_060_TOP + 0x10/********************************************************************************* _060_lock_page - entry point to lock a page** Entry point for the operating system's routine to "lock" a page* from being paged out. This routine is needed by the cas/cas2* algorithms so that no page faults occur within the "core" code* region. Note: the routine must lock two pages if the operand * spans two pages.* Arguments:* a0 = operand address* d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user* d1 = `xxxxxxff -> longword; `xxxxxx00 -> word* Expected outputs:* d0 = 0 -> success; non-zero -> failure** All VxWorks accessible pages are always present thus this function simply* returns 0.*/__060_real_lock_page: clrl d0 rts/********************************************************************************* _060_unlock_page - unlock a page** Entry point for the operating system's routine to "unlock" a* page that has been "locked" previously with _real_lock_page.* Note: the routine must unlock two pages if the operand spans* two pages.* Arguments:* a0 = operand address* d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user* d1 = `xxxxxxff -> longword; `xxxxxx00 -> word* Expected outputs:* d0 = 0 -> success; non-zero -> failure** All vxWorks accessible pages are always present thus this function simply* returns 0. */__060_real_unlock_page: clrl d0 rts/* * The following table handles the function relative addresses needed by the * unimplemented integer instruction exception handler. This handler called * the following functions: * * _060_real_chk /@ defined above @/ * _060_real_divbyzero /@ defined above @/ * _060_real_trace /@ defined above @/ * _060_real_access /@ defined above @/ * _060_isp_done /@ defined above @/ * * _060_real_cas /@ defined above @/ * _060_real_cas2 /@ defined above @/ * _060_real_lock_page /@ defined above @/ * _060_real_unlock_page /@ defined above @/ * * _060_imem_read /@ defined in os060ALib.s @/ * _060_dmem_read /@ defined in os060ALib.s @/ * _060_dmem_write /@ defined in os060ALib.s @/ * _060_imem_read_word /@ defined in os060ALib.s @/ * _060_imem_read_long /@ defined in os060ALib.s @/ * _060_dmem_read_byte /@ defined in os060ALib.s @/ * _060_dmem_read_word /@ defined in os060ALib.s @/ * _060_dmem_read_long /@ defined in os060ALib.s @/ * _060_dmem_write_byte /@ defined in os060ALib.s @/ * _060_dmem_write_word /@ defined in os060ALib.s @/ * _060_dmem_write_long /@ defined in os060ALib.s @/
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -