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

📄 vxalib.s

📁 VxWorks BSP框架源代码包含头文件和驱动
💻 S
📖 第 1 页 / 共 5 页
字号:
FUNC_END(vxDmacrSet)/********************************************************************************* vxDmacrGet - return value of a DMA Channel Control register (0 to 3) ** This routine returns the value of one of the 4 DMA Channel Control registers* selected via <dmaRegNo>.** RETURNS: value of a DMA Channel Control register (0 to 3).* UINT32 vxDmacrGet*       (*	UINT32 dmaRegNo		/@ DMA Control register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmacrGet)	andi.	p0, p0, 0x3		/* p0  between 0 and 3 included */ 	cmpwi	p0, 0x0	beq	vxDmacr0Get	cmpwi	p0, 0x1	beq	vxDmacr1Get	cmpwi	p0, 0x2	beq	vxDmacr2Get	cmpwi	p0, 0x3	beq	vxDmacr3Get	li	p0, -1			/* return ERROR */	blr	vxDmacr0Get:	mfdcr	p0, DMACR0	blrvxDmacr1Get:	mfdcr	p0, DMACR1	blrvxDmacr2Get:	mfdcr	p0, DMACR2	blrvxDmacr3Get:	mfdcr	p0, DMACR3	blrFUNC_END(vxDmacrGet)/********************************************************************************* vxDmasrSet - set DMA Channel Status register** This routine sets the PPC403 DMA Channel Status register.** RETURNS: N/A. * void vxDmasrSet*       (*       UINT32 regVal		/@ value to set the register with @/*       )*/FUNC_BEGIN(vxDmasrSet)	mtdcr	DMASR, p0	blrFUNC_END(vxDmasrSet)/********************************************************************************* vxDmasrGet - return value of the PPC403 DMA Channel Status register** RETURNS: value of the PPC403 DMA Channel Status register.* UINT32 vxDmasrGet ()*/FUNC_BEGIN(vxDmasrGet)	mfdcr	p0, DMASR	blrFUNC_END(vxDmasrGet)/********************************************************************************* vxDmaccSet - set a DMA Chained Count register (0 to 3)** This routine sets a DMA Chained Count register selected by <dmaRegNo>* to a new value.** RETURNS: N/A. * void vxDmaccSet*       (*       UINT32 regVal,		/@ value to set the register with @/*	UINT32 dmaRegNo		/@ DMA Chained Count register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmaccSet)	andi.	p1, p1, 0x3		/* p1  between 0 and 3 included */ 	cmpwi	p1, 0x0	beq	vxDmacc0Set	cmpwi	p1, 0x1	beq	vxDmacc1Set	cmpwi	p1, 0x2	beq	vxDmacc2Set	cmpwi	p1, 0x3	beq	vxDmacc3Set	li	p1, -1			/* returns ERROR */	blr	vxDmacc0Set:	mtdcr	DMACC0, p0	blrvxDmacc1Set:	mtdcr	DMACC1, p0	blrvxDmacc2Set:	mtdcr	DMACC2, p0	blrvxDmacc3Set:	mtdcr	DMACC3, p0	blrFUNC_END(vxDmaccSet)/********************************************************************************* vxDmaccGet - return value of a DMA Chained Count register (0 to 3)** This routine returns the value of one of the 4 DMA Chained Count registers* selected via <dmaRegNo>.** RETURNS: value of a DMA Chained Count register (0 to 3).* UINT32 vxDmaccGet*       (*	UINT32 dmaRegNo		/@ DMA Chained Count register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmaccGet)	andi.	p0, p0, 0x3		/* p0  between 0 and 3 included */ 	cmpwi	p0, 0x0	beq	vxDmacc0Get	cmpwi	p0, 0x1	beq	vxDmacc1Get	cmpwi	p0, 0x2	beq	vxDmacc2Get	cmpwi	p0, 0x3	beq	vxDmacc3Get	li	p0, -1			/* return ERROR */	blr	vxDmacc0Get:	mfdcr	p0, DMACC0	blrvxDmacc1Get:	mfdcr	p0, DMACC1	blrvxDmacc2Get:	mfdcr	p0, DMACC2	blrvxDmacc3Get:	mfdcr	p0, DMACC3	blrFUNC_END(vxDmaccGet)/********************************************************************************* vxDmactSet - set a DMA Count register (0 to 3)** This routine sets a DMA Count register selected by <dmaRegNo> to a new * value.** RETURNS: N/A. * void vxDmactSet*       (*       UINT32 regVal,		/@ value to set the register with @/*	UINT32 dmaRegNo		/@ DMA Count register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmactSet)	andi.	p1, p1, 0x3		/* p1  between 0 and 3 included */ 	cmpwi	p1, 0x0	beq	vxDmact0Set	cmpwi	p1, 0x1	beq	vxDmact1Set	cmpwi	p1, 0x2	beq	vxDmact2Set	cmpwi	p1, 0x3	beq	vxDmact3Set	li	p1, -1			/* returns ERROR */	blr	vxDmact0Set:	mtdcr	DMACT0, p0	blrvxDmact1Set:	mtdcr	DMACT1, p0	blrvxDmact2Set:	mtdcr	DMACT2, p0	blrvxDmact3Set:	mtdcr	DMACT3, p0	blrFUNC_END(vxDmactSet)/********************************************************************************* vxDmactGet - return value of a DMA Count register (0 to 3)** This routine returns the value of one of the 4 DMA Count registers* selected via <dmaRegNo>.** RETURNS: value of a DMA Count register (0 to 3).* UINT32 vxDmactGet*       (*	UINT32 dmaRegNo		/@ DMA Count register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmactGet)	andi.	p0, p0, 0x3		/* p0  between 0 and 3 included */ 	cmpwi	p0, 0x0	beq	vxDmact0Get	cmpwi	p0, 0x1	beq	vxDmact1Get	cmpwi	p0, 0x2	beq	vxDmact2Get	cmpwi	p0, 0x3	beq	vxDmact3Get	li	p0, -1			/* return ERROR */	blr	vxDmact0Get:	mfdcr	p0, DMACT0	blrvxDmact1Get:	mfdcr	p0, DMACT1	blrvxDmact2Get:	mfdcr	p0, DMACT2	blrvxDmact3Get:	mfdcr	p0, DMACC3	blrFUNC_END(vxDmactGet)/********************************************************************************* vxDmadaSet - set a DMA Destination Address register (0 to 3)** This routine sets a DMA Destination Address register selected by <dmaRegNo>* to a new value.** RETURNS: N/A. * void vxDmadaSet*       (*       UINT32 regVal,		/@ value to set the register with @/*	UINT32 dmaRegNo		/@ DMA Destination Address reg. No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmadaSet)	andi.	p1, p1, 0x3		/* p1  between 0 and 3 included */ 	cmpwi	p1, 0x0	beq	vxDmada0Set	cmpwi	p1, 0x1	beq	vxDmada1Set	cmpwi	p1, 0x2	beq	vxDmada2Set	cmpwi	p1, 0x3	beq	vxDmada3Set	li	p1, -1			/* returns ERROR */	blr	vxDmada0Set:	mtdcr	DMADA0, p0	blrvxDmada1Set:	mtdcr	DMADA1, p0	blrvxDmada2Set:	mtdcr	DMADA2, p0	blrvxDmada3Set:	mtdcr	DMADA3, p0	blrFUNC_END(vxDmadaSet)/********************************************************************************* vxDmadaGet - return value of a DMA Destination Address register (0 to 3)** This routine returns the value of one of the 4 DMA Destination Address * registers selected via <dmaRegNo>.** RETURNS: value of a DMA Destination Address register (0 to 3).* UINT32 vxDmadaGet*       (*	UINT32 dmaRegNo		/@ DMA Destination Address reg. No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmadaGet)	andi.	p0, p0, 0x3		/* p0  between 0 and 3 included */ 	cmpwi	p0, 0x0	beq	vxDmada0Get	cmpwi	p0, 0x1	beq	vxDmada1Get	cmpwi	p0, 0x2	beq	vxDmada2Get	cmpwi	p0, 0x3	beq	vxDmada3Get	li	p0, -1			/* return ERROR */	blr	vxDmada0Get:	mfdcr	p0, DMADA0	blrvxDmada1Get:	mfdcr	p0, DMADA1	blrvxDmada2Get:	mfdcr	p0, DMADA2	blrvxDmada3Get:	mfdcr	p0, DMADA3	blrFUNC_END(vxDmadaGet)/********************************************************************************* vxDmasaSet - set a DMA Source Address register (0 to 3)** This routine sets a DMA Source Address register selected by <dmaRegNo>* to a new value.** RETURNS: N/A. * void vxDmasaSet*       (*       UINT32 regVal,		/@ value to set the register with @/*	UINT32 dmaRegNo		/@ DMA Source Address register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmasaSet)	andi.	p1, p1, 0x3		/* p1  between 0 and 3 included */ 	cmpwi	p1, 0x0	beq	vxDmasa0Set	cmpwi	p1, 0x1	beq	vxDmasa1Set	cmpwi	p1, 0x2	beq	vxDmasa2Set	cmpwi	p1, 0x3	beq	vxDmasa3Set	li	p1, -1			/* returns ERROR */	blr	vxDmasa0Set:	mtdcr	DMASA0, p0	blrvxDmasa1Set:	mtdcr	DMASA1, p0	blrvxDmasa2Set:	mtdcr	DMASA2, p0	blrvxDmasa3Set:	mtdcr	DMASA3, p0	blrFUNC_END(vxDmasaSet)/********************************************************************************* vxDmasaGet - return value of a DMA Source Address register (0 to 3)** This routine returns the value of one of the 4 DMA Source Address * registers selected via <dmaRegNo>.** RETURNS: value of a DMA Source Address register (0 to 3).* UINT32 vxDmasaGet*       (*	UINT32 dmaRegNo		/@ DMA Source Address register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmasaGet)	andi.	p0, p0, 0x3		/* p0  between 0 and 3 included */ 	cmpwi	p0, 0x0	beq	vxDmasa0Get	cmpwi	p0, 0x1	beq	vxDmasa1Get	cmpwi	p0, 0x2	beq	vxDmasa2Get	cmpwi	p0, 0x3	beq	vxDmasa3Get	li	p0, -1			/* return ERROR */	blr	vxDmasa0Get:	mfdcr	p0, DMASA0	blrvxDmasa1Get:	mfdcr	p0, DMASA1	blrvxDmasa2Get:	mfdcr	p0, DMASA2	blrvxDmasa3Get:	mfdcr	p0, DMASA3	blrFUNC_END(vxDmasaGet)# endif	/* (CPU==PPC403) */#endif	/* CPU == PPC4xx, PPC85XX *//********************************************************************************* vxMemProbeSup - vxMemProbe support routine** This routine is called to try to read byte, word, or long, as specified* by length, from the specified source to the specified destination.** NOMANUALSTATUS vxMemProbeSup (length, src, dest)    (    int 	length,	// length of cell to test (1, 2, 4, 8, 16) *    char *	src,	// address to read *    char *	dest	// address to write *    )*/FUNC_BEGIN(vxMemProbeSup)	addi	p7, p0, 0	/* save length to p7 */	xor	p0, p0, p0	/* set return status */	cmpwi	p7, 1		/* check for byte access */	bne	vmpShort	/* no, go check for short word access */	lbz	p6, 0(p1)	/* load byte from source */	stb	p6, 0(p2)	/* store byte to destination */	sync			/* ensure load/store are performed */	isync			/* enforce for immediate exception handling */	blrvmpShort:	cmpwi	p7, 2		/* check for short word access */	bne	vmpWord		/* no, check for word access */	lhz	p6, 0(p1)	/* load half word from source */	sth	p6, 0(p2)	/* store half word to destination */	sync			/* ensure load/store are performed */	isync			/* enforce for immediate exception handling */	blrvmpWord:	cmpwi	p7, 4		/* check for short word access */	bne	vmpxx		/* no, check for double word access */	lwz	p6, 0(p1)	/* load half word from source */	stw	p6, 0(p2)	/* store half word to destination */	sync			/* ensure load/store are performed */	isync			/* enforce for immediate exception handling */	blrvmpxx:	/*	 * If the access attempted above causes an exception, the handler	 * causes us to come here and return a failure indication.  Also	 * come here if the length parameter is not recognized.	 */	li	p0, -1	blrFUNC_END(vxMemProbeSup)/********************************************************************************* vxGhsFlagSet - set the flag to allow print() to display floating point value** This Pb is Green Hill specific.  Should be removed when Green Hill will* be EABI compatible.*/F

⌨️ 快捷键说明

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