亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sndsintrctl.c

?? 三星公司出arm7內核4510VXWORKS環境下驅動開發包
?? C
字號:
/* sndsIntrCtl.c - Samsung SNDS100 interrupt controller driver */

/*
modification history
--------------------
01b,27sep99,nb  updated documentation
01a,20aug99,knp  adapted from WRS template
*/

/*

DESCRIPTION

This module implements interrupt controller driver for Samsung's SNDS100
evaluation board.  This board is an evaluation board for their KS32C50100
microprocessor.  This is an ARM based processor with several integrated 
peripherals.  It has an interrupt controller, two 32-bit timers, one 
Ethernet controller, two HDLC controllers, one IIC controller, general 
purpose I/O ports, and a 2-channel DMA controller.

The SNDS interrupt controller is a simple, generic interrupt controller
that manages 21 levels of interrupts from various sources internal to the
microprocessor and external to it.  For external interrupts are supported.
The interrupt controller has control and pending status registers, mask
register and supports level-sensitive interrupts.  This library provides
the routines to manage interrupts multiplexed by the SNDS interrupt controller.

The SNDS interrupt controller registers used by this driver are described
below under the symbolic names used herein.

SNDS_INT_CSR_ENB (write): this is the mask register described in the
KS32C50100 Users' Manual.  When this register is written, each data bit 
that is clear (0) causes the corresponding interrupt to be enabled.
Each bit that is set (1) causes the corresponding interrupt to be disabled.

SNDS_INT_CSR_PEND (read): this is the interrupt pending register.
When this register is read, each data bit that is set (1) indicates that
an interrupt is pending from the corresponsing source. Level 20 is the
highest priority and level 0 is the lowest.

SNDS_INT_CSR_MODE (write): this register is used to configure the interrupts
in FIQ or IRQ mode.  Each bit set in this register configures the corresponding
interrupt as FIQ.  Otherwise the interrupt is treated as IRQ.  VxWorks
does not support the high priority FIQ mode of interrupts.  Hence all the
interrupts have to be configured in IRQ mode.

The interrupt priority registers can be used to change the priorities
of the interrupts from the default settings.  This feature is not
supported in this driver.  All the interrupts are set with the default
priority ordering.

The number of interrupts supported by the device i.e. the number of
valid bits in the SNDS_INT_CSR_PEND register (21), is specified by
SNDS_INT_NUM_LEVELS.

snds100.h has defined the addresses of the controller chips registers:
SNDS_INT_CSR_ENB, SNDS_INT_CSR_DIS and SNDS_INT_CSR_PEND and also the 
driver constants SNDS_INT_CSR_MASK, SNDS_INT_NUM_LEVELS.

The chip registers are memory-mapped at specified addresses internal to
the processor.  32-bit accesses can be made to these register locations.
The macros SNDS_INT_REG_READ and SNDS_INT_REG_WRITE are used to
access these registers.

The BSP will initialize this driver in sysHwInit2(), after initializing
the main interrupt library, usually intLibInit().  The initialization
routine, sndsIntDevInit() will setup the interrupt controller device,
it will mask off all individual interrupt sources and then set the
interrupt level to enable all interrupts.  See sndsIntDevInit for more
information.

All of the functions in this library are global.  This allows them to
be used by the BSP if it is necessary to create wrapper routines or to
incorporate several drivers together as one.
*/

#include "vxWorks.h"
#include "config.h"
#include "intLib.h"

/* Defines from snds100.h */

#if !defined (SNDS_INT_CSR_PEND) || !defined (SNDS_INT_CSR_ENB) || \
    !defined (SNDS_INT_CSR_MASK) || !defined (SNDS_INT_NUM_LEVELS) || \
    !defined (SNDS_INT_CSR_DIS)
#   error missing SNDS interrupt definitions
#endif

#define SNDS_INT_VEC_BASE	(0x0)

/* hardware access methods */
#ifndef SNDS_INT_REG_READ
#   define SNDS_INT_REG_READ(x,result) \
	    ((result) = *(volatile UINT32 *)(x))
#endif	/*SNDS_INT_REG_READ*/

#ifndef SNDS_INT_REG_WRITE
#   define SNDS_INT_REG_WRITE(x,data) \
	    (*((volatile UINT32 *)(x)) = (data))
#endif /*SNDS_INT_REG_WRITE*/


/* Convert level number to vector number */

#ifndef SNDS_INT_LVL_VEC_MAP
#   define SNDS_INT_LVL_VEC_MAP(level, vector) \
	    ((vector) = ((level) + SNDS_INT_VEC_BASE))
#endif

/* Convert pending register value, to a level number */

#ifndef SNDS_INT_PEND_LVL_MAP
#   define SNDS_INT_PEND_LVL_MAP(pendReg, level) \
	    ((level) = (pendReg))
#endif


/* driver constants */

#define SNDS_INT_ALL_ENABLED	(SNDS_INT_NUM_LEVELS)
#define SNDS_INT_ALL_DISABLED	(SNDS_INT_NUM_LEVELS-1)


/* Local data */

/*
 * 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.
 */

LOCAL UINT32 sndsIntLvlEnabled;

/* forward declarations */

STATUS	sndsIntLvlVecChk (int*, int*);
STATUS	sndsIntLvlEnable (int);
STATUS	sndsIntLvlDisable (int);

/*******************************************************************************
*
* sndsIntDevInit - initialize the interrupt controller
*
* This routine will initialize the interrupt controller device, disabling all
* interrupt sources.  It will also connect the device driver specific routines
* into the architecture level hooks.  If the BSP needs to create a wrapper
* routine around any of the arhitecture level routines, it should install the
* pointer to the wrapper routine after calling this routine.
*
* RETURNS: N/A
*/

void sndsIntDevInit (void)
    {
    /* install the driver routines in the architecture hooks */

    sysIntLvlVecChkRtn	= sndsIntLvlVecChk;
    sysIntLvlEnableRtn	= sndsIntLvlEnable;
    sysIntLvlDisableRtn	= sndsIntLvlDisable;

    sndsIntLvlEnabled = 0x0; 	/* all sources disabled */
    SNDS_INT_REG_WRITE (SNDS_INT_CSR_ENB, ((~sndsIntLvlEnabled) & SNDS_INT_CSR_MASK));
    SNDS_INT_REG_WRITE (SNDS_INT_CSR_PEND, SNDS_INT_CSR_MASK);
    SNDS_INT_REG_WRITE(SNDS_INT_CSR_MODE,SNDS_INT_MODE_IRQ);
    }

/*******************************************************************************
*
* sndsIntLvlVecChk - 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.
*/

STATUS  sndsIntLvlVecChk
    (
    int* pLevel,  /* ptr to receive old interrupt level */
    int* pVector  /* ptr to receive current interrupt vector */
    )
    {
    int newLevel;
	int intPendMask = 0x100000;
	int count;
    UINT32 isr;

    /* Read pending interrupt register and mask undefined bits */

    SNDS_INT_REG_READ (SNDS_INT_CSR_PEND, newLevel);

	if ((newLevel & SNDS_INT_CSR_MASK) == 0)
	 	return ERROR;

    /*
     * Step through the bits looking for a 1. This *will* terminate.
     * We could use ffsLsb() for this if we don't mind the function call
     * overhead
     */
	for (count = 0, isr = 20; count < SNDS_INT_NUM_LEVELS; count++)
	{
		if (intPendMask & newLevel)
			break;
		isr--;
		intPendMask >>= 1;
	}
     *pVector = isr;

	/* Acknowledge the interrupt as given in SNDS100 sample code */
    SNDS_INT_REG_WRITE(SNDS_INT_CSR_PEND,(1 << isr));

    return OK;
    }

/*******************************************************************************
*
* sndsIntLvlEnable - 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  sndsIntLvlEnable
    (
    int level  /* level to be enabled */
    )
    {
	int key;

    if (level < 0 ||
	level >= SNDS_INT_NUM_LEVELS)
	return ERROR;

    /* clear bit in mask register */
	key = intLock ();
	sndsIntLvlEnabled |= ((1 << level));
	intUnlock (key);

    SNDS_INT_REG_WRITE (SNDS_INT_CSR_ENB, ((~sndsIntLvlEnabled) & SNDS_INT_CSR_MASK));
    return OK;
   }

/*******************************************************************************
*
* sndsIntLvlDisable - 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  sndsIntLvlDisable
    (
    int level  /* level to be disabled */
    )
    {
	int key;

    if (level < 0 ||
	level >= SNDS_INT_NUM_LEVELS)
	return ERROR;

    /* set bit in mask register */
	key = intLock ();
	sndsIntLvlEnabled &= ~(1 << level);
	intUnlock (key);

    SNDS_INT_REG_WRITE (SNDS_INT_CSR_ENB, ((~sndsIntLvlEnabled) & SNDS_INT_CSR_MASK));

    return OK;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美激情小说另类| 日日夜夜精品免费视频| 亚洲精品久久久蜜桃| 亚洲一二三四在线| 国产精品一区三区| 色狠狠一区二区| 日韩欧美国产电影| 亚洲午夜久久久久中文字幕久| 天堂va蜜桃一区二区三区| 国产精品一线二线三线| 欧美一级久久久| 国产精品免费免费| 天天影视网天天综合色在线播放| 成人午夜大片免费观看| 欧美日韩国产高清一区二区三区 | 欧美日韩一区国产| 国产精品人人做人人爽人人添| 亚洲一区二区在线免费观看视频| 久久精品国产久精国产| 欧洲人成人精品| 国产精品毛片大码女人| 日韩综合一区二区| 欧美日韩高清在线| 国产精品久久久久久久久久久免费看| 一区二区视频在线看| 不卡的av中国片| 亚洲精品在线一区二区| 一个色在线综合| 在线观看免费视频综合| 国产精品久久久久永久免费观看 | 日韩高清欧美激情| 91网站在线播放| 欧美韩国日本综合| 不卡av在线网| 久久久激情视频| 国产在线精品不卡| 久久久国产精品麻豆| 极品销魂美女一区二区三区| 色屁屁一区二区| 一区av在线播放| 91视视频在线观看入口直接观看www| 欧美tk丨vk视频| 国产伦精品一区二区三区免费 | 午夜精品久久久久影视| 在线精品视频一区二区三四| 日本sm残虐另类| 91丨porny丨在线| 亚洲与欧洲av电影| 色综合久久中文综合久久牛| 亚洲免费观看高清完整版在线观看| 国产不卡在线视频| 国产精品欧美综合在线| 国产成人啪免费观看软件| 欧美成人女星排名| 久久成人羞羞网站| 国产精品久久久久久久久快鸭| 大胆亚洲人体视频| 国产精品免费视频一区| 色欧美88888久久久久久影院| 亚洲情趣在线观看| 91社区在线播放| 日韩福利视频网| 日韩欧美的一区| 国产乱理伦片在线观看夜一区| 国产精品理论片| 色综合久久天天综合网| 亚洲va韩国va欧美va精品| 久久综合色天天久久综合图片| 国产一二三精品| 成人欧美一区二区三区视频网页 | 国产精品久久久久桃色tv| av亚洲精华国产精华| 亚洲精品你懂的| 欧美精品一区二区三区很污很色的| 国产乱码精品一区二区三区忘忧草 | 综合av第一页| 日韩一区二区在线观看视频| 国产综合一区二区| 亚洲色图另类专区| 欧美成人官网二区| 成人黄色大片在线观看| 亚洲一线二线三线久久久| 久久嫩草精品久久久久| 99精品视频在线免费观看| 亚洲一二三专区| 中文字幕一区在线| 日韩一区二区电影网| 成a人片亚洲日本久久| 极品尤物av久久免费看| 亚洲色图19p| 精品久久久久久最新网址| 欧美日韩综合色| 国产91精品一区二区麻豆亚洲| 亚洲一区二区三区激情| 亚洲欧美电影院| 久久先锋影音av| 欧美日韩中文另类| 91丨porny丨首页| 激情小说亚洲一区| 亚洲婷婷综合久久一本伊一区| 精品国产免费一区二区三区四区 | 欧美成人精品高清在线播放| 不卡电影免费在线播放一区| 天天综合天天做天天综合| 欧美不卡一区二区| 日韩一区二区三区av| 欧美性猛片aaaaaaa做受| 久久国产麻豆精品| 日本成人在线看| 亚洲国产三级在线| 国产亚洲欧洲997久久综合| 日韩女优视频免费观看| 欧美在线高清视频| 国产电影一区在线| 国产成人aaa| 国内精品写真在线观看| 一区二区三区成人| 1000精品久久久久久久久| 久久久五月婷婷| 7777精品伊人久久久大香线蕉最新版| 99久久精品99国产精品 | 一区二区三区精品在线观看| 国产亚洲美州欧州综合国| 欧美一级高清片在线观看| 欧美一区二区三区四区在线观看 | 久久中文娱乐网| 欧美疯狂性受xxxxx喷水图片| 日本高清不卡一区| av电影天堂一区二区在线| 91在线云播放| 99精品国产一区二区三区不卡| 久草在线在线精品观看| 国产伦精品一区二区三区视频青涩| 理论电影国产精品| 日本aⅴ精品一区二区三区| 激情综合网激情| 精品一区二区成人精品| 亚洲一级在线观看| 老司机午夜精品| 韩国欧美国产1区| 国产精品一区专区| 丁香另类激情小说| 91原创在线视频| 日韩欧美国产综合在线一区二区三区| 制服丝袜av成人在线看| 日韩三级高清在线| 国产精品每日更新在线播放网址| 国产精品成人一区二区艾草 | 亚洲靠逼com| 麻豆精品一区二区综合av| 久久超级碰视频| 国产ts人妖一区二区| 欧美丝袜第三区| 日韩精品专区在线影院观看| 欧美日韩国产综合一区二区 | 粉嫩av亚洲一区二区图片| 成人深夜在线观看| 色综合天天综合网国产成人综合天| 欧美日韩久久久久久| 精品国产乱子伦一区| 国产精品丝袜黑色高跟| 日韩综合小视频| 国产精品 欧美精品| 99久久综合99久久综合网站| 欧美成人女星排行榜| 亚洲欧洲色图综合| 婷婷中文字幕综合| 不卡av在线免费观看| 欧美日韩一区不卡| 日韩欧美亚洲另类制服综合在线| 国产精品久久久久9999吃药| 亚洲一区免费观看| 美女免费视频一区二区| 99精品视频在线播放观看| 欧美剧情片在线观看| 国产精品高潮呻吟久久| 日韩综合小视频| 91在线免费播放| 久久久久久久久久久黄色| 亚洲精品网站在线观看| 麻豆91在线看| 91精选在线观看| 亚洲视频1区2区| 欧美aaaaa成人免费观看视频| 色网综合在线观看| 日韩一区二区免费电影| 欧美人牲a欧美精品| 亚洲视频一区在线| 卡一卡二国产精品 | 天堂va蜜桃一区二区三区漫画版| 国产精品一卡二| 日韩一区二区不卡| 一区二区三区丝袜| 成人精品视频一区二区三区 | 国产福利一区在线| 精品久久久久99| 国产在线精品一区二区夜色| 26uuu国产一区二区三区| 毛片不卡一区二区| 欧美不卡一区二区三区四区|