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

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

?? sndsintrctl.c

?? 4510b的vxworks的BSP
?? 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一区二区三区免费野_久草精品视频
亚洲精品免费视频| 欧美视频一区在线观看| 亚洲精品一区二区精华| 日本成人在线电影网| 日韩欧美中文字幕制服| 美国三级日本三级久久99| 日韩视频在线你懂得| 久久99精品网久久| 国产日韩视频一区二区三区| 成人少妇影院yyyy| 亚洲精品自拍动漫在线| 欧美人与禽zozo性伦| 奇米777欧美一区二区| 久久综合视频网| caoporm超碰国产精品| 亚洲国产中文字幕| 精品免费日韩av| 成人精品视频一区二区三区 | 欧洲一区二区av| 亚洲午夜久久久久| 日韩精品一区二区三区中文不卡| 国产成人精品亚洲日本在线桃色| 中文字幕一区av| 欧美三级视频在线观看| 久久99精品一区二区三区| 亚洲欧洲日本在线| 欧美一区二区三区在线观看视频| 国产成人精品亚洲777人妖| 亚洲自拍另类综合| 久久青草国产手机看片福利盒子 | fc2成人免费人成在线观看播放| 一区二区在线观看视频| 欧美一区二区三区的| 国产凹凸在线观看一区二区| 亚洲在线视频一区| 国产午夜亚洲精品羞羞网站| 欧美日韩视频在线第一区| 国产高清精品久久久久| 日韩精品亚洲专区| 国产精品天美传媒| 日韩美女主播在线视频一区二区三区| 成人av动漫网站| 久久疯狂做爰流白浆xx| 亚洲最大成人综合| 久久久久久久久久久黄色| 欧美日韩在线观看一区二区 | 91精品国产综合久久久久久漫画| 久久99久久99| 亚洲国产精品久久久久婷婷884 | 一区二区三区丝袜| 国产不卡在线视频| 免费成人深夜小野草| 日韩美女啊v在线免费观看| 日韩一区二区三区三四区视频在线观看 | 天天av天天翘天天综合网| 欧美韩国日本一区| 91精品国产黑色紧身裤美女| 日本丰满少妇一区二区三区| 国产成人精品影院| 极品销魂美女一区二区三区| 亚洲777理论| 一区二区三区在线观看网站| 中文字幕一区二区三区精华液| 久久精品视频免费观看| 日韩欧美色综合| 91精品国产日韩91久久久久久| 欧美中文字幕亚洲一区二区va在线| 国产成人丝袜美腿| 国产精品自拍毛片| 国产精品乡下勾搭老头1| 精品亚洲免费视频| 精品亚洲porn| 精品一二三四在线| 国模无码大尺度一区二区三区| 青青草97国产精品免费观看无弹窗版| 天堂成人免费av电影一区| 日韩高清在线不卡| 美女网站色91| 精品亚洲免费视频| 国产福利一区二区三区| 国产成人精品亚洲777人妖| 成人免费毛片高清视频| 成人福利视频在线看| jlzzjlzz亚洲日本少妇| 91蜜桃在线免费视频| 91亚洲男人天堂| 色老综合老女人久久久| 欧美日韩一区二区三区四区五区 | 亚洲精品日韩综合观看成人91| 最好看的中文字幕久久| 亚洲精品乱码久久久久久| 亚洲综合丁香婷婷六月香| 亚洲h在线观看| 欧美a级一区二区| 国产高清不卡一区二区| www.av亚洲| 欧美色欧美亚洲另类二区| 欧美高清视频一二三区| 精品粉嫩aⅴ一区二区三区四区| 欧美一区二区三区人| 精品88久久久久88久久久| 国产精品无人区| 亚洲美女屁股眼交3| 丝瓜av网站精品一区二区| 国产综合久久久久久久久久久久| 国产成人啪免费观看软件| 91亚洲永久精品| 日韩午夜激情免费电影| 中文字幕精品一区| 亚洲福利一区二区| 极品尤物av久久免费看| 成人h动漫精品一区二区| 在线影院国内精品| 欧美成人三级在线| 亚洲天堂免费看| 奇米888四色在线精品| 不卡在线视频中文字幕| 日韩欧美在线影院| 国产精品福利一区二区三区| 五月综合激情婷婷六月色窝| 成人综合激情网| 91精品国产综合久久蜜臀| 国产精品毛片高清在线完整版| 午夜精品久久久久久久 | 中文字幕中文乱码欧美一区二区| 亚洲一区二区三区精品在线| 国产精品456| 4438x成人网最大色成网站| 亚洲国产激情av| 日本va欧美va欧美va精品| 91首页免费视频| 国产日产欧美一区| 日韩高清不卡一区二区| 91在线观看成人| 久久久91精品国产一区二区精品 | 有坂深雪av一区二区精品| 国产专区欧美精品| 欧美老女人第四色| 亚洲欧美综合色| 国产精品亚洲视频| 欧美色图免费看| 亚洲激情中文1区| 风流少妇一区二区| 欧美大尺度电影在线| 日韩精品一区第一页| 欧美性猛交xxxx黑人交 | 亚洲成在人线在线播放| 99re在线精品| 国产精品人妖ts系列视频| 日韩高清在线观看| 555夜色666亚洲国产免| 亚洲久草在线视频| 91免费精品国自产拍在线不卡| 国产日韩欧美高清| 国产毛片精品视频| 精品sm捆绑视频| 久久国产精品区| 日韩亚洲欧美综合| 日本成人在线网站| 欧美一区二区女人| 视频一区中文字幕| 欧美日韩精品一区二区在线播放| 中文字幕一区视频| av在线播放不卡| 亚洲乱码国产乱码精品精可以看| 99久久精品免费看国产| 1024亚洲合集| 色婷婷狠狠综合| 亚洲色图制服诱惑| 91久久精品日日躁夜夜躁欧美| 亚洲精品日产精品乱码不卡| 色呦呦一区二区三区| 一区二区三区国产豹纹内裤在线| 色94色欧美sute亚洲线路一ni| 亚洲免费在线看| 欧美午夜影院一区| 日本不卡一二三| www久久久久| 成人午夜免费av| 亚洲久草在线视频| 欧美日韩激情一区二区三区| 日韩电影在线一区| 日韩精品一区二区三区在线| 国产成人亚洲综合a∨婷婷| 中文字幕av资源一区| 91同城在线观看| 亚洲成人一区在线| 欧美刺激午夜性久久久久久久| 狠狠色狠狠色合久久伊人| 亚洲国产精华液网站w | 日韩午夜激情视频| 国产91综合网| 一个色综合网站| 欧美一区在线视频| 国产91精品一区二区| 亚洲高清不卡在线观看| 亚洲精品在线电影| 色综合久久综合网欧美综合网| 丝袜美腿一区二区三区| 国产欧美日本一区视频|