⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isp.s

📁 linux内核源码
💻 S
📖 第 1 页 / 共 5 页
字号:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUPM68000 Hi-Performance Microprocessor DivisionM68060 Software PackageProduction Release P1.00 -- October 10, 1994M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.THE SOFTWARE is provided on an "AS IS" basis and without warranty.To the maximum extent permitted by applicable law,MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSEand any warranty against infringement with regard to the SOFTWARE(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.To the maximum extent permitted by applicable law,IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.Motorola assumes no responsibility for the maintenance and support of the SOFTWARE.You are hereby granted a copyright license to use, modify, and distribute the SOFTWAREso long as this entire notice is retained without alteration in any modified and/orredistributed versions, and that such modified versions are clearly identified as such.No licenses are granted by implication, estoppel or otherwise under any patentsor trademarks of Motorola, Inc.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# ireal.s:#	This file is appended to the top of the 060ISP package# and contains the entry points into the package. The user, in# effect, branches to one of the branch table entries located# after _060ISP_TABLE.#	Also, subroutine stubs exist in this file (_isp_done for# example) that are referenced by the ISP package itself in order# to call a given routine. The stub routine actually performs the# callout. The ISP code does a "bsr" to the stub routine. This# extra layer of hierarchy adds a slight performance penalty but# it makes the ISP code easier to read and more mainatinable.#set	_off_chk,	0x00set	_off_divbyzero,	0x04set	_off_trace,	0x08set	_off_access,	0x0cset	_off_done,	0x10set	_off_cas,	0x14set	_off_cas2,	0x18set	_off_lock,	0x1cset	_off_unlock,	0x20set	_off_imr,	0x40set	_off_dmr,	0x44set	_off_dmw,	0x48set	_off_irw,	0x4cset	_off_irl,	0x50set	_off_drb,	0x54set	_off_drw,	0x58set	_off_drl,	0x5cset	_off_dwb,	0x60set	_off_dww,	0x64set	_off_dwl,	0x68_060ISP_TABLE:# Here's the table of ENTRY POINTS for those linking the package.	bra.l		_isp_unimp	short		0x0000	bra.l		_isp_cas	short		0x0000	bra.l		_isp_cas2	short		0x0000	bra.l		_isp_cas_finish	short		0x0000	bra.l		_isp_cas2_finish	short		0x0000	bra.l		_isp_cas_inrange	short		0x0000	bra.l		_isp_cas_terminate	short		0x0000	bra.l		_isp_cas_restart	short		0x0000	space		64#############################################################	global		_real_chk_real_chk:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_chk,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_real_divbyzero_real_divbyzero:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_divbyzero,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_real_trace_real_trace:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_trace,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_real_access_real_access:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_access,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_isp_done_isp_done:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_done,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4#######################################	global		_real_cas_real_cas:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_cas,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_real_cas2_real_cas2:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_cas2,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_real_lock_page_real_lock_page:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_lock,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_real_unlock_page_real_unlock_page:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_unlock,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4#######################################	global		_imem_read_imem_read:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_imr,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_read_dmem_read:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_dmr,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_write_dmem_write:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_dmw,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_imem_read_word_imem_read_word:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_irw,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_imem_read_long_imem_read_long:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_irl,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_read_byte_dmem_read_byte:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_drb,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_read_word_dmem_read_word:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_drw,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_read_long_dmem_read_long:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_drl,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_write_byte_dmem_write_byte:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_dwb,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_write_word_dmem_write_word:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_dww,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4	global		_dmem_write_long_dmem_write_long:	mov.l		%d0,-(%sp)	mov.l		(_060ISP_TABLE-0x80+_off_dwl,%pc),%d0	pea.l		(_060ISP_TABLE-0x80,%pc,%d0)	mov.l		0x4(%sp),%d0	rtd		&0x4## This file contains a set of define statements for constants# in oreder to promote readability within the core code itself.#set LOCAL_SIZE,		96			# stack frame size(bytes)set LV,			-LOCAL_SIZE		# stack offsetset EXC_ISR,		0x4			# stack status registerset EXC_IPC,		0x6			# stack pcset EXC_IVOFF,		0xa			# stacked vector offsetset EXC_AREGS,		LV+64			# offset of all address regsset EXC_DREGS,		LV+32			# offset of all data regsset EXC_A7,		EXC_AREGS+(7*4)		# offset of a7set EXC_A6,		EXC_AREGS+(6*4)		# offset of a6set EXC_A5,		EXC_AREGS+(5*4)		# offset of a5set EXC_A4,		EXC_AREGS+(4*4)		# offset of a4set EXC_A3,		EXC_AREGS+(3*4)		# offset of a3set EXC_A2,		EXC_AREGS+(2*4)		# offset of a2set EXC_A1,		EXC_AREGS+(1*4)		# offset of a1set EXC_A0,		EXC_AREGS+(0*4)		# offset of a0set EXC_D7,		EXC_DREGS+(7*4)		# offset of d7set EXC_D6,		EXC_DREGS+(6*4)		# offset of d6set EXC_D5,		EXC_DREGS+(5*4)		# offset of d5set EXC_D4,		EXC_DREGS+(4*4)		# offset of d4set EXC_D3,		EXC_DREGS+(3*4)		# offset of d3set EXC_D2,		EXC_DREGS+(2*4)		# offset of d2set EXC_D1,		EXC_DREGS+(1*4)		# offset of d1set EXC_D0,		EXC_DREGS+(0*4)		# offset of d0set EXC_TEMP,		LV+16			# offset of temp stack spaceset EXC_SAVVAL,		LV+12			# offset of old areg valueset EXC_SAVREG,		LV+11			# offset of old areg indexset SPCOND_FLG,		LV+10			# offset of spc condition flgset EXC_CC,		LV+8			# offset of cc registerset EXC_EXTWPTR,	LV+4			# offset of current PCset EXC_EXTWORD,	LV+2			# offset of current ext opwordset EXC_OPWORD,		LV+0			# offset of current opword############################ SPecial CONDition FLaGs ############################set mia7_flg,		0x04			# (a7)+ flagset mda7_flg,		0x08			# -(a7) flagset ichk_flg,		0x10			# chk exception flagset idbyz_flg,		0x20			# divbyzero flagset restore_flg,	0x40			# restore -(an)+ flagset immed_flg,		0x80			# immediate data flagset mia7_bit,		0x2			# (a7)+ bitset mda7_bit,		0x3			# -(a7) bitset ichk_bit,		0x4			# chk exception bitset idbyz_bit,		0x5			# divbyzero bitset restore_bit,	0x6			# restore -(a7)+ bitset immed_bit,		0x7			# immediate data bit########## Misc. ##########set BYTE,		1			# len(byte) == 1 byteset WORD,		2			# len(word) == 2 bytesset LONG,		4			# len(longword) == 4 bytes########################################################################## XDEF ****************************************************************	##	_isp_unimp(): 060ISP entry point for Unimplemented Instruction	##									##	This handler should be the first code executed upon taking the	##	"Unimplemented Integer Instruction" exception in an operating	##	system.								##									## XREF ****************************************************************	##	_imem_read_{word,long}() - read instruction word/longword	##	_mul64() - emulate 64-bit multiply				##	_div64() - emulate 64-bit divide				##	_moveperipheral() - emulate "movep"				##	_compandset() - emulate misaligned "cas"			##	_compandset2() - emulate "cas2"					##	_chk2_cmp2() - emulate "cmp2" and "chk2"			##	_isp_done() - "callout" for normal final exit			##	_real_trace() - "callout" for Trace exception			##	_real_chk() - "callout" for Chk exception			##	_real_divbyzero() - "callout" for DZ exception			##	_real_access() - "callout" for access error exception		##									## INPUT ***************************************************************	##	- The system stack contains the Unimp Int Instr stack frame	##									## OUTPUT **************************************************************	##	If Trace exception:						##	- The system stack changed to contain Trace exc stack frame	##	If Chk exception:						##	- The system stack changed to contain Chk exc stack frame	##	If DZ exception:						##	- The system stack changed to contain DZ exc stack frame	##	If access error exception:					##	- The system stack changed to contain access err exc stk frame	##	Else:								##	- Results saved as appropriate					##									## ALGORITHM ***********************************************************	##	This handler fetches the first instruction longword from	## memory and decodes it to determine which of the unimplemented		## integer instructions caused this exception. This handler then calls	## one of _mul64(), _div64(), _moveperipheral(), _compandset(),		## _compandset2(), or _chk2_cmp2() as appropriate.			##	Some of these instructions, by their nature, may produce other	## types of exceptions. "div" can produce a divide-by-zero exception,	## and "chk2" can cause a "Chk" exception. In both cases, the current	## exception stack frame must be converted to an exception stack frame	## of the correct exception type and an exit must be made through	## _real_divbyzero() or _real_chk() as appropriate. In addition, all	## instructions may be executing while Trace is enabled. If so, then	## a Trace exception stack frame must be created and an exit made	## through _real_trace().						##	Meanwhile, if any read or write to memory using the		## _mem_{read,write}() "callout"s returns a failing value, then an	## access error frame must be created and an exit made through		## _real_access().							##	If none of these occur, then a normal exit is made through	## _isp_done().								##									##	This handler, upon entry, saves almost all user-visible		## address and data registers to the stack. Although this may seem to	## cause excess memory traffic, it was found that due to having to	## access these register files for things like data retrieval and <ea>	## calculations, it was more efficient to have them on the stack where	## they could be accessed by indexing rather than to make subroutine	## calls to retrieve a register of a particular index.			##									##########################################################################	global		_isp_unimp_isp_unimp:	link.w		%a6,&-LOCAL_SIZE	# create room for stack frame	movm.l		&0x3fff,EXC_DREGS(%a6)	# store d0-d7/a0-a5	mov.l		(%a6),EXC_A6(%a6)	# store a6	btst		&0x5,EXC_ISR(%a6)	# from s or u mode?	bne.b		uieh_s			# supervisor modeuieh_u:	mov.l		%usp,%a0		# fetch user stack pointer	mov.l		%a0,EXC_A7(%a6)		# store a7	bra.b		uieh_contuieh_s:	lea		0xc(%a6),%a0	mov.l		%a0,EXC_A7(%a6)		# store corrected sp###############################################################################uieh_cont:	clr.b		SPCOND_FLG(%a6)		# clear "special case" flag	mov.w		EXC_ISR(%a6),EXC_CC(%a6) # store cc copy on stack	mov.l		EXC_IPC(%a6),EXC_EXTWPTR(%a6) # store extwptr on stack## fetch the opword and first extension word pointed to by the stacked pc# and store them to the stack for now#	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr	bsr.l		_imem_read_long		# fetch opword & extword	mov.l		%d0,EXC_OPWORD(%a6)	# store extword on stack########################################################################## muls.l	0100 1100 00 |<ea>|	0*** 1100 0000 0***		## mulu.l	0100 1100 00 |<ea>|	0*** 0100 0000 0***		##									## divs.l	0100 1100 01 |<ea>|	0*** 1100 0000 0***		## divu.l	0100 1100 01 |<ea>|	0*** 0100 0000 0***		##									## movep.w m2r	0000 ***1 00 001***	| <displacement>  |		## movep.l m2r	0000 ***1 01 001***	| <displacement>  |		## movep.w r2m	0000 ***1 10 001***	| <displacement>  |		## movep.l r2m	0000 ***1 11 001***	| <displacement>  |		##									#

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -