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

📄 s3c2410intctrl.c

📁 ROM型的vxworksBSP包 编译测试通过
💻 C
字号:
/* usbPciStub.c - System-specific PCI Functions *//* Copyright 2000 Wind River Systems, Inc. *//*Modification history--------------------01a,22nov00,wef  First, created from 01h of the mcp750 bsp stub*//*DESCRIPTIONThis file defines a skeleton of functions to be used for accessing the PCI bus capabilities.  These functions allow PCI device drivers to be written independent of the underlying O/S's PCI access mechanisms.The name of each function in this group begins with "usb" to represent"Device Driver Services."*//* Includes */#include "vxWorks.h"#include "config.h"#include "intLib.h"#include "s3c2410.h"#define S3C2410_REG(reg)  (*(volatile UINT32 *)reg)	#define S3C2410_REG_READ(reg,result)  (result) = (S3C2410_REG(reg))#define S3C2410_REG_WRITE(reg,result) (S3C2410_REG(reg)) = (result)      /********************************************************************************* sngks32cIntLvlVecChk - check for and return any pending interrupts** This routine interrogates the hardware to determine the highest priority* interrupt pending.  It returns the vector associated with that interrupt, and* also the interrupt priority level prior to the interrupt (not the* level of the interrupt).  The current interrupt priority level is then* raised to the level of the current interrupt so that only higher priority* interrupts will be accepted until this interrupt is finished.** The return value ERROR indicates that no pending interrupt was found and* that the level and vector values were not returned.** RETURNS: OK or ERROR if no interrupt is pending.*//* * A mask word.  Bits are set in this word when a specific level * is enabled. It is used to mask off individual levels that have * not been explicitly enabled. */ int	s3c2410LvlChg (int);STATUS  s3c2410LvlVecAck (int, int);int	s3c2410LvlChg (int level /* new interrupt level */){	int oldlevel;		oldlevel  = rINTMSK;	rINTMSK  |= (1<<level);			return oldlevel;}STATUS  s3c2410LvlVecAck(int level,	/* old interrupt level to be restored */                         int vector	/* current interrupt vector, if needed */){	rINTMSK &= (~(1<<vector));		return OK;}    	STATUS  s3c2410IntLvlVecChk(int* pLevel,  /* ptr to receive old interrupt level */                            int* pVector  /* ptr to receive current interrupt vector */){    UINT32 newLevel;    UINT32 intPendMask = 0x1;    int count;    UINT32 isr;    newLevel = rINTPND;    for (count = 0, isr = 0; count < AMBA_INT_NUM_LEVELS; count++)    {        if (intPendMask & newLevel)            break;                    isr++;        intPendMask <<= 1;    }         *pLevel  = s3c2410LvlChg (isr);    *pVector = isr;        /*    if( isr == INT_LVL_TIMER_0)    {    	rGPBDAT ^= 0xffffffff;    }*/            ClearPending((1 << isr));        return OK;}    /********************************************************************************* sngks32cIntLvlEnable - enable a single interrupt level** Enable a specific interrupt level.  The enabled level will be allowed to* generate an interrupt, when the overall interrupt level is set below the* specified level.  Without being enabled, the interrupt is blocked regardless* of the overall interrupt level setting.** RETURNS: OK or ERROR if the specified level cannot be enabled.*/STATUS  s3c2410IntLvlEnable(int level  /* level to be enabled */){    rINTMSK &=  ~((1 << level));    return OK;}/********************************************************************************* sngks32cIntLvlDisable - disable a single interrupt level** Disable a specific interrupt level.  The disabled level is prevented* from generating an interrupt even if the overall interrupt level is set* below the specified level.** RETURNS: OK or ERROR, if the specified interrupt level cannot be disabled.*/STATUS  s3c2410IntLvlDisable(int level  /* level to be disabled */){    /* set bit in mask register */        rINTMSK |= (1 << level);    return OK;}void s3c2410IntDevInit (void){     sysIntLvlVecChkRtn = s3c2410IntLvlVecChk;     sysIntLvlVecAckRtn	= s3c2410LvlVecAck;     sysIntLvlChgRtn = s3c2410LvlChg;     sysIntLvlEnableRtn = s3c2410IntLvlEnable;     sysIntLvlDisableRtn = s3c2410IntLvlDisable;          /*according to the templateIntrCtl.c,all the interrupt enable,i don't know why,     but enable the required interrupt level*/     /*rINTMSK &= ~(BIT_TIMER4|BIT_UART0|BIT_UART1);*/     /*rINTSUBMSK &= ~(BIT_SUB_RXD0|BIT_SUB_ERR0|BIT_SUB_RXD1|BIT_SUB_ERR1);*/}/* End of file. */

⌨️ 快捷键说明

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