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

📄 vxalib.s

📁 VxWorks BSP框架源代码包含头文件和驱动
💻 S
📖 第 1 页 / 共 5 页
字号:
*/FUNC_BEGIN(vxDbcr2Set)	mtspr	DBCR2, p0	/* move p0 to dbcr2 */	blrFUNC_END(vxDbcr2Set)/********************************************************************************* vxFitIntAck - acknowledge fixed interval timer interrupt** RETURN: N/A.*/FUNC_BEGIN(vxFitIntAck)	addis	p0, r0, _PPC_TSR_FIS_U		/* load status mask bit */	mtspr 	TSR, p0				/* clear fit pending bit */	blrFUNC_END(vxFitIntAck)/********************************************************************************* vxFitIntDisable - disable fixed interval timer interrupt** RETURN: N/A.*/FUNC_BEGIN(vxFitIntDisable)        mfspr   p0, TCR        addis   p1, r0, _PPC_TCR_FIE_U	/* set fit interrupt enable */        andc    p1, p0, p1		/* mask off fie bit */        mtspr   TCR, p1        blrFUNC_END(vxFitIntDisable)/********************************************************************************* vxFitIntEnable - enable fixed interval timer interrupt** RETURN: N/A.*/FUNC_BEGIN(vxFitIntEnable)        mfspr   p1, TCR        oris    p1, p1, _PPC_TCR_FIE_U	/* set fit interrupt enable */        mtspr   TCR, p1        blrFUNC_END(vxFitIntEnable)# endif /* CPU == PPC440, PPC85XX */# endif /* CPU == PPC405, PPC405F, PPC440, PPC85XX */# if 	(CPU == PPC403)/********************************************************************************* vxExisrGet - get external interrupt status register** RETURN: value of exisr.*/FUNC_BEGIN(vxExisrGet)	mfdcr	p0,EXISR  			/* read exisr to p0 */	blrFUNC_END(vxExisrGet)/********************************************************************************* vxExisrClear - this routine clears the specified bit in exisr** RETURN: N/A.*/FUNC_BEGIN(vxExisrClear)	mtdcr	EXISR,p0			/* clear specified bit */	mfdcr	p0,EXISR			/* read exisr for debug */	blrFUNC_END(vxExisrClear)/********************************************************************************* vxExierGet - this routine returns the value of exier** RETURN: value of exier.*/FUNC_BEGIN(vxExierGet)	mfdcr	p0,EXIER			/* read exier to p0 */	blrFUNC_END(vxExierGet)/********************************************************************************* vxExierSet - this routine sets exier to the specified value** RETURN: N/A.*/FUNC_BEGIN(vxExierSet)	mtdcr	EXIER,p0			/* set exier */	blrFUNC_END(vxExierSet)# endif	/* (CPU==PPC403) */# ifndef PPC_NO_REAL_MODE/********************************************************************************* vxIccrGet - this routine returns the content of ICCR** RETURN: value of iccr.*/FUNC_BEGIN(vxIccrGet)	mfspr	p0, ICCR			/* read iccr */	blrFUNC_END(vxIccrGet)/********************************************************************************* vxIccrSet - this routine sets the content of ICCR** RETURN: N/A.*/FUNC_BEGIN(vxIccrSet)	mtspr	ICCR, p0			/* set iccr */	blrFUNC_END(vxIccrSet)# endif	/* PPC_NO_REAL_MODE *//********************************************************************************* vxTcrGet - this routine returns the content of TCR** RETURN: value of tcr.*/FUNC_BEGIN(vxTcrGet)	mfspr	p0, TCR				/* read TCR */	blrFUNC_END(vxTcrGet)/********************************************************************************* vxTcrSet - this routine sets the content of TCR** RETURN: N/A.*/FUNC_BEGIN(vxTcrSet)	mtspr	TCR, p0				/* write to TCR */	blrFUNC_END(vxTcrSet)/********************************************************************************* vxTsrGet - this routine returns the content of TSR** RETURN: value of tsr.*/FUNC_BEGIN(vxTsrGet)	mfspr	p0, TSR				/* read TSR */	blrFUNC_END(vxTsrGet)/********************************************************************************* vxTsrSet - this routine sets the content of TSR** RETURN: N/A.*/FUNC_BEGIN(vxTsrSet)	mtspr	TSR, p0				/* write to TSR */	/* XXX mfspr	p0, TSR			/* return new TSR */	blrFUNC_END(vxTsrSet)# ifndef PPC_NO_REAL_MODE/********************************************************************************* vxDccrGet - this routine returns the content of DCCR** RETURN: value of dccr.*/FUNC_BEGIN(vxDccrGet)	mfspr	p0, DCCR			/* read dccr */	blrFUNC_END(vxDccrGet)/********************************************************************************* vxDccrSet - this routine sets the DCCR to the specified value** RETURN: N/A.*/FUNC_BEGIN(vxDccrSet)	mtspr	DCCR, p0			/* write to dccr */	blrFUNC_END(vxDccrSet)# endif	/* PPC_NO_REAL_MODE */# ifdef	IVPR/********************************************************************************* vxIvprGet - this routine returns the content of IVPR** RETURN: value of IVPR.*/FUNC_BEGIN(vxIvprGet)	mfspr	p0, IVPR	blrFUNC_END(vxIvprGet)/********************************************************************************* vxIvprSet - this routine sets the IVPR to the specified value** RETURN: N/A.*/FUNC_BEGIN(vxIvprSet)	mtspr	IVPR, p0	blrFUNC_END(vxIvprSet)# else /* IVPR *//********************************************************************************* vxEvprGet - this routine returns the content of EVPR** RETURN: value of evpr.*/FUNC_BEGIN(vxEvprGet)	mfspr	p0, EVPR	blrFUNC_END(vxEvprGet)/********************************************************************************* vxEvprSet - this routine sets the EVPR to the specified value** RETURN: N/A.*/FUNC_BEGIN(vxEvprSet)	mtspr	EVPR, p0	blrFUNC_END(vxEvprSet)# endif /* IVPR */# if 	(CPU == PPC403)/********************************************************************************* vxIocrGet - this routine returns the content of IOCR** RETURN: value of iocr.*/FUNC_BEGIN(vxIocrGet)	mfdcr	p0, IOCR	blrFUNC_END(vxIocrGet)/********************************************************************************* vxIocrSet - this routine sets the IOCR to the specified value** RETURN: N/A.*/FUNC_BEGIN(vxIocrSet)	mtdcr	IOCR, p0	blrFUNC_END(vxIocrSet)/********************************************************************************* vxBesrSet - this routine sets the BESR to the specified value** RETURN: N/A.*/FUNC_BEGIN(vxBesrSet)	mtdcr   BESR, p0        /* set dbcr */	blrFUNC_END(vxBesrSet)# endif	/* (CPU==PPC403) *//********************************************************************************* vxDbsrGet - return value of debug status register** RETURNS: value of debug status register. */FUNC_BEGIN(vxDbsrGet)	mfspr	p0, DBSR	/* move dbsr to p0 */	blrFUNC_END(vxDbsrGet)/********************************************************************************* vxDbsrClear - clear debug status register bits** RETURNS: N/A. */FUNC_BEGIN(vxDbsrClear)	mtspr	DBSR, p0	/* move p0 to dbsr */	blrFUNC_END(vxDbsrClear)/********************************************************************************* vxDac1Get - return value of data adress compare register 1** RETURNS: value of data adress compare register 1.*/FUNC_BEGIN(vxDac1Get)	mfspr	p0, DAC1	/* move dac1 to p0 */	blrFUNC_END(vxDac1Get)/********************************************************************************* vxDac1Set - set data adress compare register 1 to a specific value** RETURNS: N/A. */FUNC_BEGIN(vxDac1Set)	mtspr	DAC1, p0	/* move p0 to dac1 */	blrFUNC_END(vxDac1Set)/********************************************************************************* vxDac2Get - return value of data adress compare register 2** RETURNS: value of data adress compare register 2.*/FUNC_BEGIN(vxDac2Get)	mfspr	p0, DAC2	/* move dac2 to p0 */	blrFUNC_END(vxDac2Get)/********************************************************************************* vxDac2Set - set data adress compare register 2 to a specific value** RETURNS: N/A. */FUNC_BEGIN(vxDac2Set)	mtspr	DAC2, p0	/* move p0 to dac2 */	blrFUNC_END(vxDac2Set)/********************************************************************************* vxIac1Get - return value of instruction adress compare register 1** RETURNS: value of instruction adress compare register 1.*/FUNC_BEGIN(vxIac1Get)	mfspr	p0, IAC1	/* move iac1 to p0 */	blrFUNC_END(vxIac1Get)/********************************************************************************* vxIac1Set - set instruction adress compare register 1 to a specific value** RETURNS: N/A. */FUNC_BEGIN(vxIac1Set)	mtspr	IAC1, p0	/* move p0 to iac1 */	blrFUNC_END(vxIac1Set)/********************************************************************************* vxIac2Get - return value of instruction adress compare register 2** RETURNS: value of instruction adress compare register 2.*/FUNC_BEGIN(vxIac2Get)	mfspr	p0, IAC2	/* move iac2 to p0 */	blrFUNC_END(vxIac2Get)/********************************************************************************* vxIac2Set - set instruction adress compare register 2 to a specific value** RETURNS: N/A. */FUNC_BEGIN(vxIac2Set)	mtspr	IAC2, p0	/* move p0 to iac2 */	blrFUNC_END(vxIac2Set)# if ((CPU==PPC405) || (CPU==PPC405F) || (CPU==PPC440))/********************************************************************************* vxIac3Get - return value of instruction adress compare register 3** RETURNS: value of instruction adress compare register 3.*/FUNC_BEGIN(vxIac3Get)        mfspr   p0, IAC3        /* move iac3 to p0 */        blrFUNC_END(vxIac3Get)/********************************************************************************* vxIac3Set - set instruction adress compare register 3 to a specific value** RETURNS: N/A.*/FUNC_BEGIN(vxIac3Set)        mtspr   IAC3, p0        /* move p0 to iac3 */        blrFUNC_END(vxIac3Set)/********************************************************************************* vxIac4Get - return value of instruction adress compare register 4** RETURNS: value of instruction adress compare register 4.*/FUNC_BEGIN(vxIac4Get)        mfspr   p0, IAC4        /* move iac4 to p0 */        blrFUNC_END(vxIac4Get)/********************************************************************************* vxIac4Set - set instruction adress compare register 4 to a specific value** RETURNS: N/A.*/FUNC_BEGIN(vxIac4Set)        mtspr   IAC4, p0        /* move p0 to iac4 */        blrFUNC_END(vxIac4Set)# endif /* ((CPU==PPC405) || (CPU==PPC405F) || (CPU==PPC440)) */# if	(CPU == PPC403)/********************************************************************************* vxDmacrSet - set a DMA Channel Control register (0 to 3)** This routine sets a DMA Channel Control register selected by <dmaRegNo>* to a new value.** RETURNS: N/A. * void vxDmacrSet*       (*       UINT32 regVal,		/@ value to set the register with @/*	UINT32 dmaRegNo		/@ DMA Control register No (0 to 3) @/*       )*/FUNC_BEGIN(vxDmacrSet)	andi.	p1, p1, 0x3		/* p1  between 0 and 3 included */ 	cmpwi	p1, 0x0	beq	vxDmacr0Set	cmpwi	p1, 0x1	beq	vxDmacr1Set	cmpwi	p1, 0x2	beq	vxDmacr2Set	cmpwi	p1, 0x3	beq	vxDmacr3Set	li	p1, -1			/* returns ERROR */	blr	vxDmacr0Set:	mtdcr	DMACR0, p0	blrvxDmacr1Set:	mtdcr	DMACR1, p0	blrvxDmacr2Set:	mtdcr	DMACR2, p0	blrvxDmacr3Set:	mtdcr	DMACR3, p0	blr

⌨️ 快捷键说明

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