www.pudn.com > nxplpc2204bsp.rar > lpc2204IntrCtl.c
/* lpc2210IntrCtl.c - interrupt controller driver */
/* Copyright 1984-2001 Wind River Systems, Inc. */
#include "copyright_wrs.h"
#include "vxWorks.h"
#include "config.h"
#include "intLib.h"
#include "lpc2210.h" /* : modified */
#include "mytypes.h"
/* driver constants */
/*
#define LPC2210_INT_ALL_ENABLED (LPC2210_INTNUMLEVELS)
#define LPC2210_INT_ALL_DISABLED (LPC2210_INTNUMLEVELS-1)
*/
#define VICVECTBASE (0x80000000)
/* forward declarations */
STATUS lpc2210IntLvlVecChk (int*, int*);
STATUS lpc2210IntLvlEnable (int);
STATUS lpc2210IntLvlDisable (int);
/* : ÖжÏÈ·ÈÏ */
STATUS lpc2210IntLvlAck (int level, int vector)
{
VICVectAddr = 0;
return OK;
}
void lpc2210IntDevInit (void)
{
/* install the driver routines in the architecture hooks */
sysIntLvlVecChkRtn = lpc2210IntLvlVecChk;
sysIntLvlEnableRtn = lpc2210IntLvlEnable;
sysIntLvlDisableRtn = lpc2210IntLvlDisable;
sysIntLvlVecAckRtn = lpc2210IntLvlAck; /* : added */
VICIntEnClr = 0xffffffff; /* all sources disabled */
VICIntSelect = 0x00000000; /* set all to IRQ, no FIQ */
/* set int vector */
VICDefVectAddr = 0x40000000;
}
STATUS lpc2210IntLvlVecChk
(
int* pLevel, /* ptr to receive old interrupt level */
int* pVector /* ptr to receive current interrupt vector */
)
{
DWORD dwState = VICIRQStatus;
DWORD i;
for (i = 0; i < LPC2210_INTNUMLEVELS; i++)
{
if ((1<= LPC2210_INTNUMLEVELS)
return ERROR;
*pVector = i;
return OK;
}
STATUS lpc2210IntLvlEnable
(
int level /* level to be enabled */
)
{
int key;
if (level < 0 || level >= LPC2210_INTNUMLEVELS)
return ERROR;
/* clear bit in mask register */
key = intLock ();
VICIntEnable = VICIntEnable | (1<= LPC2210_INTNUMLEVELS)
return ERROR;
/* set bit in mask register */
key = intLock ();
VICIntEnClr = 1<