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

📄 locore.s

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 S
📖 第 1 页 / 共 5 页
字号:
 *	r0 - controller number */	.align	1	.globl	dzdmadzdma:	mull2	$8*20,r0	movab	_dzpdma(r0),r3		# pdma structure base					# for this controllerdzploop:	movl	r3,r0	movl	(r0)+,r1		# device register address	movzbl	1(r1),r2		# get line number	bitb	$0x80,r2		# TRDY on?	beql	dzprei			# no	bicb2	$0xf8,r2		# clear garbage bits	mull2	$20,r2	addl2	r2,r0			# point at line's pdma structure	movl	(r0)+,r2		# p_mem	cmpl	r2,(r0)+		# p_mem < p_end ?	bgequ	dzpcall 		# no, go call dzxint	movb	(r2)+,6(r1)		# dztbuf = *p_mem++	movl	r2,-8(r0)	brb	dzploop 		# check for another linedzprei:	POPR	incl	_cnt+V_PDMA	reidzpcall:	pushl	r3	pushl	(r0)+			# push tty address	calls	$1,*(r0)		# call interrupt rtn	movl	(sp)+,r3	brb	dzploop 		# check for another line#endif#if NSS > 0/* * VAXstar SLU pseudo dma routine: *	r0 - controller number * CAUTION: *	The VAXstar system unit spec says that byte reads *	of the SLU CSR are not allowed. This is not an absolute *	restriction. It would only cause problems if there were *	bits in the CSR which were modified by reading. */	.align	1	.globl	ssdmassdma:	mull2	$8*20,r0	movab	_sspdma(r0),r3		# pdma structure base					# for this controllerssploop:	movl	r3,r0	movl	(r0)+,r1		# device register address	movzbl	1(r1),r2		# get line number	bitb	$0x80,r2		# TRDY on?	beql	ssprei			# no	bicb2	$0xfc,r2		# clear garbage bits	mull2	$20,r2	addl2	r2,r0			# point at line's pdma structure	movl	(r0)+,r2		# p_mem	cmpl	r2,(r0)+		# p_mem < p_end ?	bgequ	sspcall 		# no, go call ssxint	movb	(r2)+,12(r1)		# sstbuf = *p_mem++	movl	r2,-8(r0)	brb	ssploop 		# check for another linessprei:	POPR	incl	_cnt+V_PDMA	reisspcall:	pushl	r3	pushl	(r0)+			# push tty address	calls	$1,*(r0)		# call interrupt rtn	movl	(sp)+,r3	brb	ssploop 		# check for another line#endif#if NFC > 0/* * Firefox SLU pseudo dma routine: *	r0 - controller number * CAUTION: *	The Firefox system unit spec says that byte reads *	of the SLU CSR are not allowed. This is not an absolute *	restriction. It would only cause problems if there were *	bits in the CSR which were modified by reading. */	.align	1	.globl fcdmafcdma:	pushl	$0	pushl	r0	pushal	fcdma2	calls	$3,_chrqueue	POPR	rei	.align 1	.globl fcdma2fcdma2:	.word	0	movab	_fcpdma, r3		# base addr of pdma structurefcploop:	movl	r3,r0			# get base of pdma	movl	(r0)+,r1		# device register address	movw	$0x20,(r1)		# disable RIE, TIE	movzbl	(r1),r2			# get line number	bitb	$0x80,r2		# RDONE on?	bneq	fcprint			# yes, go call fcrint	movzbl	1(r1),r2		# get line number	bitb	$0x80,r2		# TRDY on?	beql	fcprei			# no	bicb2	$0xfc,r2		# clear garbage bits	mull2	$20,r2	addl2	r2,r0			# point at line's pdma structure	movl	(r0)+,r2		# p_mem	cmpl	r2,(r0)+		# p_mem < p_end ?	bgequ	fcpxint 		# no, go call fcxint	movb	(r2)+,12(r1)		# fctbuf = *p_mem++	movl	r2,-8(r0)	brb	fcploop 		# check for another linefcprei:	incl	_cnt+V_PDMA	movw	$0x4060,(r1)		# enable reciever interrupts (RIE)	retfcpxint:	pushl	r3	pushl	(r0)+			# push tty address	calls	$1,*(r0)		# call interrupt rtn	movl	(sp)+,r3	brb	fcploop 		# check for another linefcprint:	pushl	r3	pushl	$0			# controller 0	calls	$1,_fcrint		# call fcrint	movl	(sp)+,r3	brb	fcploop 		# check for another line or TRDY#endif#if NUU > 0 && defined(UUDMA)/* * Pseudo DMA routine for tu58 (on DL11) *	r0 - controller number */	.align	1	.globl	uudmauudma:	movl	_uudinfo[r0],r2	movl	16(r2),r2		# r2 = uuaddr	mull3	$48,r0,r3	movab	_uu_softc(r3),r5	# r5 = uuc	cvtwl	2(r2),r1		# c = uuaddr->rdb	bbc	$15,r1,1f		# if (c & UUDB_ERROR)	movl	$13,16(r5)		#	uuc->tu_state = TUC_RCVERR;	rsb				#	let uurintr handle it1:	tstl	4(r5)			# if (uuc->tu_rcnt) {	beql	1f	movb	r1,*0(r5)		#	*uuc->tu_rbptr++ = r1	incl	(r5)	decl	4(r5)			#	if (--uuc->tu_rcnt)	beql	2f			#		done	tstl	(sp)+	POPR				#	registers saved in ubglue.s	rei				# }2:	cmpl	16(r5),$8		# if (uuc->tu_state != TUS_GETH)	beql	2f			#	let uurintr handle it1:	rsb2:	mull2	$14,r0			# sizeof(uudata[ctlr]) = 14	movab	_uudata(r0),r4		# data = &uudata[ctlr];	cmpb	$1,(r4) 		# if (data->pk_flag != TUF_DATA)	bneq	1b#ifdef notdef	/* this is for command packets */	beql	1f			#	r0 = uuc->tu_rbptr	movl	(r5),r0	brb	2f1:					# else#endif	movl	24(r5),r0		#	r0 = uuc->tu_addr2:	movzbl	1(r4),r3		# counter to r3 (data->pk_count)	movzwl	(r4),r1 		# first word of checksum (=header)	mfpr	$IPL,-(sp)		# s = spl5();	mtpr	$0x15,$IPL		# to keep disk interrupts out	clrw	(r2)			# disable receiver interrupts3:	bbc	$7,(r2),3b		# while ((uuaddr->rcs & UUCS_READY)==0);	cvtwb	2(r2),(r0)+		# *buffer = uuaddr->rdb & 0xff	sobgtr	r3,1f			# continue with next byte ...	addw2	2(r2),r1		# unless this was the last (odd count)	brb	2f1:	bbc	$7,(r2),1b		# while ((uuaddr->rcs & UUCS_READY)==0);	cvtwb	2(r2),(r0)+		# *buffer = uuaddr->rdb & 0xff	addw2	-2(r0),r1		# add to checksum..2:	adwc	$0,r1			# get the carry	sobgtr	r3,3b			# loop while r3 > 0/* * We're ready to get the checksum */1:	bbc	$7,(r2),1b		# while ((uuaddr->rcs & UUCS_READY)==0);	cvtwb	2(r2),12(r4)		# get first (lower) byte1:	bbc	$7,(r2),1b	cvtwb	2(r2),13(r4)		# ..and second	cmpw	12(r4),r1		# is checksum ok?	beql	1f	movl	$14,16(r5)		# uuc->tu_state = TUS_CHKERR	brb	2f			# exit1:	movl	$11,16(r5)		# uuc->tu_state = TUS_GET (ok)2:	movw	$0x40,(r2)		# enable receiver interrupts	mtpr	(sp)+,$IPL		# splx(s);	rsb				# continue processing in uurintr#endif#if defined(VAX750) || defined(BINARY)/* * Pseudo DMA routine for VAX-11/750 console tu58 *	    (without MRSP) */	.align	1	.globl	tudmatudma:	movab	_tu,r5			# r5 = tu	tstl	4(r5)			# if (tu.tu_rcnt) {	beql	3f	mfpr	$CSRD,r1		# get data from tu58	movb	r1,*0(r5)		#	*tu.tu_rbptr++ = r1	incl	(r5)	decl	4(r5)			#	if (--tu.tu_rcnt)	beql	1f			#		done	tstl	(sp)+	POPR				#	registers saved in ubglue.s	rei				#	data handled, done1:					# }	cmpl	16(r5),$8		# if (tu.tu_state != TUS_GETH)	beql	2f			#	let turintr handle it3:	rsb2:	movab	_tudata,r4		# r4 = tudata	cmpb	$1,(r4) 		# if (tudata.pk_flag != TUF_DATA)	bneq	3b			#	let turintr handle it1:					# else	movl	24(r5),r1		# get buffer pointer to r1	movzbl	1(r4),r3		# counter to r3	movzwl	(r4),r0 		# first word of checksum (=header)	mtpr	$0,$CSRS		# disable receiver interrupts3:	bsbw	5f			# wait for next byte	mfpr	$CSRD,r5	movb	r5,(r1)+		# *buffer = rdb	sobgtr	r3,1f			# continue with next byte ...	mfpr	$CSRD,r2		# unless this was the last (odd count)	brb	2f1:	bsbw	5f			# wait for next byte	mfpr	$CSRD,r5	movb	r5,(r1)+		# *buffer = rdb	movzwl	-2(r1),r2		# get the last word back from memory2:	addw2	r2,r0			# add to checksum..	adwc	$0,r0			# get the carry	sobgtr	r3,3b			# loop while r3 > 0/* * We're ready to get the checksum. */	bsbw	5f	movab	_tudata,r4	mfpr	$CSRD,r5	movb	r5,12(r4)		# get first (lower) byte	bsbw	5f	mfpr	$CSRD,r5	movb	r5,13(r4)		# ..and second	movab	_tu,r5	cmpw	12(r4),r0		# is checksum ok?	beql	1f	movl	$14,16(r5)		# tu.tu_state = TUS_CHKERR	brb	2f			# exit1:	movl	$11,16(r5)		# tu.tu_state = TUS_GET2:	mtpr	$0x40,$CSRS		# enable receiver interrupts	rsb				# continue processing in turintr/* * Loop until a new byte is ready from * the tu58, make sure we don't loop forever */5:	movl	$5000,r5		# loop max 5000 times1:	mfpr	$CSRS,r2	bbs	$7,r2,1f	sobgtr	r5,1b	movab	_tu,r5	movl	$13,16(r5)		# return TUS_RCVERR	tstl	(sp)+			# and let turintr handle it1:	rsb#endif/* * Stray SCB interrupt catcher */.textSCBVEC(passrel):	rei	.data	.align	2#define PJ	PUSHR;jsb _Xstray	.globl	_scb_stray_scb_stray:	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ#if defined(VAX8600) || defined(VAX9000)	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ	PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;PJ;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either have the floationg emulation code *	linked in or the entire emulation code */	tstl	_vaxopcdec		# floating point emulation load ?	bneq	2f			# br if yes	tstl	_vaxemulbegin		# Is any emulation loaded in?	beql	1f			# br if no	bneq	3f			# br if yes2:	jmp	*_vaxopcdec		# See if it is one that we can emulate	.globl	_Xprivinflt1_Xprivinflt1:				# Special symboll used by vax$opcdec if					# instruction can not be emulated./* *	We check for the vax$special because this is the way the emulation *	code changes it's current mode to kernel */3:	cmpl	_vaxspecialhalt,(sp)	# Is this the special address	bneq	1f			# br if no	addl2	$(4*2),sp		# Pop all of the priv stuff off and	jmp	*_vaxspecialcont	# jmp to emulation code to continue					# it's ways1:	pushl $0; TRAP(PRIVINFLT)SCBVEC(xfcflt):	pushl $0; TRAP(XFCFLT)SCBVEC(resopflt):	pushl $0; TRAP(RESOPFLT)SCBVEC(resadflt):	pushl $0; TRAP(RESADFLT)SCBVEC(bptflt):	pushl $0; TRAP(BPTFLT)SCBVEC(compatflt):	TRAP(COMPATFLT);SCBVEC(tracep):	pushl $0; TRAP(TRCTRAP)SCBVEC(arithtrap):	TRAP(ARITHTRAP)

⌨️ 快捷键说明

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