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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? sndsintrctl.c

?? 三星官方基于VXWORKS的S3C2510的BSP
?? C
字號(hào):
/* 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;
    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人晚上爱看视频| 欧美日韩一区 二区 三区 久久精品| 136国产福利精品导航| 欧美猛男gaygay网站| 国产激情视频一区二区三区欧美 | 成人av网站免费| 日韩av中文字幕一区二区| 亚洲欧洲日韩av| 精品国产伦一区二区三区观看方式 | 成年人国产精品| 精品一区二区免费看| 一区二区三区成人在线视频 | 日韩电影一区二区三区| 亚洲同性同志一二三专区| 26uuu另类欧美亚洲曰本| 欧美午夜在线观看| 成人黄色网址在线观看| 精品在线视频一区| 亚洲va韩国va欧美va精品| 国产精品久久久久久亚洲伦| 精品国产99国产精品| 91麻豆精品91久久久久同性| 在线精品国精品国产尤物884a| 成人精品国产一区二区4080| 国产做a爰片久久毛片| 免费久久99精品国产| 天天色综合成人网| 亚洲综合另类小说| 1000精品久久久久久久久| 国产亚洲一区字幕| 久久久精品欧美丰满| 日韩美女一区二区三区| 91精品国产色综合久久不卡电影 | 欧美一级免费大片| 欧美三区在线观看| 欧美偷拍一区二区| 欧美亚洲动漫制服丝袜| 色88888久久久久久影院按摩| av在线不卡观看免费观看| 国产成人av电影在线观看| 国产精品一线二线三线| 极品少妇一区二区三区精品视频| 日韩福利电影在线观看| 日韩精品久久理论片| 蜜桃一区二区三区在线| 免费在线观看日韩欧美| 九九九精品视频| 国产原创一区二区三区| 国产激情一区二区三区桃花岛亚洲| 国产成人自拍网| 成人中文字幕电影| eeuss鲁一区二区三区| 色天天综合色天天久久| 欧洲国内综合视频| 欧美麻豆精品久久久久久| 日韩一区二区精品葵司在线| 精品欧美一区二区在线观看 | 欧美mv日韩mv亚洲| 亚洲精品在线观看网站| 欧美国产日韩精品免费观看| 国产精品久久久久桃色tv| 亚洲精品自拍动漫在线| 天天色图综合网| 国产一区在线视频| 成人精品鲁一区一区二区| 91成人免费在线视频| 欧美精品日韩一区| 久久综合国产精品| 成人欧美一区二区三区小说| 亚洲大片一区二区三区| 久久精品国产99国产| 夫妻av一区二区| 欧美性一二三区| 精品国精品国产尤物美女| 中文字幕制服丝袜一区二区三区| 亚洲成人一区在线| 国产一级精品在线| 日本韩国精品一区二区在线观看| 91麻豆精品国产91久久久久久 | 欧美日本乱大交xxxxx| 欧美va天堂va视频va在线| 中文字幕中文字幕一区| 午夜精品久久一牛影视| 国产98色在线|日韩| 欧美日韩中文国产| 欧美激情综合网| 三级不卡在线观看| 成人免费视频一区| 欧美欧美欧美欧美| 国产精品成人免费精品自在线观看| 视频在线观看国产精品| 成人午夜电影小说| 91精品国产一区二区三区香蕉| 国产午夜亚洲精品理论片色戒 | 中文字幕av免费专区久久| 亚洲成a人片在线不卡一二三区| 国产剧情一区二区三区| 欧美视频精品在线| 国产精品美女久久久久av爽李琼| 日本一区中文字幕| 色综合久久精品| 国产人成一区二区三区影院| 日本网站在线观看一区二区三区 | 国产精品久久久久aaaa樱花| 人禽交欧美网站| 色一情一乱一乱一91av| 国产日韩欧美精品在线| 日本麻豆一区二区三区视频| 91福利区一区二区三区| 国产精品乱子久久久久| 国产最新精品精品你懂的| 欧美精品久久一区二区三区| 亚洲欧洲中文日韩久久av乱码| 韩国女主播成人在线| 91精品国产91综合久久蜜臀| 一区二区三区四区高清精品免费观看 | 欧美日韩中文精品| 亚洲蜜臀av乱码久久精品| 高清日韩电视剧大全免费| 精品福利一二区| 肉色丝袜一区二区| 欧美日韩在线一区二区| 亚洲最色的网站| 成人美女视频在线观看18| 久久亚区不卡日本| 韩国一区二区视频| 日韩精品资源二区在线| 日本女优在线视频一区二区| 欧美女孩性生活视频| 午夜精品国产更新| 精品视频资源站| 亚洲成年人网站在线观看| 欧美日韩极品在线观看一区| 亚洲福利视频导航| 欧美日韩不卡在线| 五月天网站亚洲| 欧美人体做爰大胆视频| 亚洲第一福利一区| 91精品国产综合久久精品性色| 日韩一区精品视频| 欧美一级理论性理论a| 久久成人av少妇免费| 精品国产123| 成人妖精视频yjsp地址| 日韩一区欧美一区| 色综合色综合色综合| 亚洲大片一区二区三区| 7777精品伊人久久久大香线蕉经典版下载 | 日韩免费看的电影| 国内精品久久久久影院薰衣草| 久久精品在这里| 成人av先锋影音| 亚洲免费观看在线观看| 欧美日本在线观看| 久久精品国产成人一区二区三区 | 中文字幕一区二区三区在线播放| 成人爱爱电影网址| 一区二区三区日韩欧美| 91精品国产综合久久久久| 国产一区在线观看麻豆| 中文字幕字幕中文在线中不卡视频| 日本乱码高清不卡字幕| 天堂在线一区二区| 久久男人中文字幕资源站| 91丨九色porny丨蝌蚪| 天天色图综合网| 国产人伦精品一区二区| 色国产精品一区在线观看| 日本人妖一区二区| 亚洲精品一线二线三线| 北岛玲一区二区三区四区| 亚洲电影中文字幕在线观看| 精品福利av导航| 成人aa视频在线观看| 亚洲午夜成aⅴ人片| 精品福利在线导航| 91网站黄www| 麻豆精品视频在线观看视频| 综合av第一页| 制服.丝袜.亚洲.另类.中文| 国产成人亚洲精品青草天美| 亚洲激情一二三区| 欧美va亚洲va在线观看蝴蝶网| 91在线观看一区二区| 麻豆成人免费电影| 亚洲免费观看高清完整版在线观看 | 欧美一区二区三区四区在线观看| 国产不卡视频一区| 天涯成人国产亚洲精品一区av| 久久精品夜夜夜夜久久| 欧美日韩一区二区欧美激情| 国产成人啪午夜精品网站男同| 亚洲sss视频在线视频| 国产亚洲欧美激情| 4438x成人网最大色成网站| 丰满白嫩尤物一区二区| 久久精品999| 亚洲综合精品久久| 国产精品美女久久久久久久网站| 欧美一级理论片|