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

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

?? sngks32cintrctl.c

?? 440bx vxworks bsp
?? C
字號:
/* sngks32cIntrCtl.c - Samsung KS32C interrupt controller driver */


/* Copyright 1984-2001 Wind River Systems, Inc. */
#include "copyright_wrs.h"

/*
modification history
--------------------
01o,23jul04,a_m  BSP定制 for 多刃劍開發板
01c,02oct01,m_h  race condition
01b,26apr01,m_h  convert tabs to spaces for readability
01a,12apr01,m_h  created from snds100 template.
*/

/*

DESCRIPTION

This module implements interrupt controller driver for Samsung's KS32C50100
microprocessor which 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 KS32C 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 KS32C interrupt controller.

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

SNGKS32C_INTENB (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.

SNGKS32C_INTPEND (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 corresponding source. Level 20 is the
highest priority and level 0 is the lowest.

SNGKS32C_INTMODE (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 SNGKS32C_INTPEND register (21), is specified by
SNGKS32C_INTNUMLEVELS.

sngks32carm7.h has defined the addresses of the controller chips registers:
SNGKS32C_INTENB, SNGKS32C_INTDIS and SNGKS32C_INTPEND and also the 
driver constants SNGKS32C_INTMASK_VAL, SNGKS32C_INTNUMLEVELS.

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 SNGKS32C_INT_REG_READ and SNGKS32C_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, sngks32cIntDevInit() 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 sngks32cIntDevInit 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.

SEE ALSO
<Samsung KS32C50100 User's Manual>

*/

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

#include "s3c44b0x.h"	/*  : modified */

#if !defined (S3C44B0X_INTPEND) || !defined (S3C44B0X_INTENB) || \
    !defined (S3C44B0X_INTMASK_VAL) || !defined (S3C44B0X_INTNUMLEVELS) || \
    !defined (S3C44B0X_INTDIS)
#   error missing S3C44B0X interrupt definitions
#endif

#define SNGKS32C_INT_VEC_BASE    (0x0)

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

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


/* Convert level number to vector number */

#ifndef SNGKS32C_INT_LVL_VEC_MAP
#   define SNGKS32C_INT_LVL_VEC_MAP(level, vector) \
        ((vector) = ((level) + SNGKS32C_INT_VEC_BASE))
#endif

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

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


/* driver constants */

#define SNGKS32C_INT_ALL_ENABLED     (S3C44B0X_INTNUMLEVELS)
#define SNGKS32C_INT_ALL_DISABLED    (S3C44B0X_INTNUMLEVELS-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 sngks32cIntLvlEnabled;

/* forward declarations */

STATUS    sngks32cIntLvlVecChk  (int*, int*);
STATUS    sngks32cIntLvlEnable  (int);
STATUS    sngks32cIntLvlDisable (int);

/*  : 中斷確認 */
STATUS s3c44BIntLvlAck (int level, int vector)
{
	SNGKS32C_INT_REG_WRITE(S3C44B0X_I_ISPC,(1 << vector));

	return OK;
}

/*******************************************************************************
*
* sngks32cIntDevInit - 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 sngks32cIntDevInit (void)
    {
    /* install the driver routines in the architecture hooks */

    sysIntLvlVecChkRtn     = sngks32cIntLvlVecChk;
    sysIntLvlEnableRtn     = sngks32cIntLvlEnable;
    sysIntLvlDisableRtn    = sngks32cIntLvlDisable;
	
	sysIntLvlVecAckRtn     = s3c44BIntLvlAck;  			/*  : added */
	
    sngks32cIntLvlEnabled  = 0x0;     /* all sources disabled */
    SNGKS32C_INT_REG_WRITE (S3C44B0X_INTCON, 5);		/*  : added */
	/*  : modified */
    SNGKS32C_INT_REG_WRITE (S3C44B0X_INTENB, ((~sngks32cIntLvlEnabled) & S3C44B0X_INTMASK_VAL));
    /*SNGKS32C_INT_REG_WRITE (SNGKS32C_INTPEND, SNGKS32C_INTMASK_VAL);*/
    /*SNGKS32C_INT_REG_WRITE (SNGKS32C_INTPEND, 0);*/	/*  : deleted */
	SNGKS32C_INT_REG_WRITE (S3C44B0X_I_ISPC, S3C44B0X_INTMASK_VAL);	/*  : added */
    SNGKS32C_INT_REG_WRITE (S3C44B0X_INTMODE,S3C44B0X_INTMODEIRQ);
    }

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

STATUS  sngks32cIntLvlVecChk
    (
    int* pLevel,  /* ptr to receive old interrupt level */
    int* pVector  /* ptr to receive current interrupt vector */
    )
    {
    int newLevel;
    int intPendMask = 0x2000000;	/*  : 0x100000->0x2000000 */
    int count;
    UINT32 isr;
	int intMask;					/*  : added */
	
    /* Read pending interrupt register and mask undefined bits */

    SNGKS32C_INT_REG_READ (S3C44B0X_INTPEND, newLevel);

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

	/*  : added */
	SNGKS32C_INT_REG_READ (S3C44B0X_INTENB, intMask);
	newLevel = newLevel&(~intMask);
	if (newLevel == 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
     */
   	/*  : 20->25, SNGKS32C->S3C44B0X */
    for (count = 0, isr = 25; count < S3C44B0X_INTNUMLEVELS; count++)
        {
        if (intPendMask & newLevel)
            break;
        isr--;
        intPendMask >>= 1;
        }
    *pVector = isr;

    /* Acknowledge the interrupt as given in SNGKS32C ARM7 sample code */
    /*SNGKS32C_INT_REG_WRITE(SNGKS32C_INTPEND,(1 << isr));*/	/*  : deleted */

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

    if (level < 0 ||
        level >= S3C44B0X_INTNUMLEVELS)

        return ERROR;

    /* clear bit in mask register */
    key = intLock ();
    sngks32cIntLvlEnabled |= ((1 << level));
    SNGKS32C_INT_REG_WRITE (S3C44B0X_INTENB, ((~sngks32cIntLvlEnabled) & S3C44B0X_INTMASK_VAL));
    intUnlock (key);

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

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

    /* set bit in mask register */
    key = intLock ();
    sngks32cIntLvlEnabled &= ~(1 << level);
    SNGKS32C_INT_REG_WRITE (S3C44B0X_INTENB, ((~sngks32cIntLvlEnabled) & S3C44B0X_INTMASK_VAL));
    intUnlock (key);


    return OK;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费在线电影| 樱花影视一区二区| 麻豆国产欧美一区二区三区| 日韩三级免费观看| 欧美综合一区二区三区| 日韩一区在线看| 91在线观看污| 亚洲综合色噜噜狠狠| 欧美色倩网站大全免费| 日韩专区在线视频| 精品日韩一区二区三区| 国产精品888| 国产精品国产馆在线真实露脸 | 国产麻豆精品theporn| 国产日韩欧美精品综合| 99国产一区二区三精品乱码| 亚洲综合一区二区三区| 在线不卡欧美精品一区二区三区| 视频一区中文字幕| 精品国产一二三| 99麻豆久久久国产精品免费优播| 亚洲蜜臀av乱码久久精品蜜桃| 欧美欧美欧美欧美| 国产精一区二区三区| 亚洲人精品一区| 欧美一区二区三区喷汁尤物| 国产真实乱对白精彩久久| 亚洲欧美日韩人成在线播放| 欧美乱熟臀69xxxxxx| 国产高清精品在线| 亚洲6080在线| 国产亚洲欧美激情| 欧美午夜寂寞影院| 国产成人在线看| 亚洲成人av资源| 日本一区二区久久| 538prom精品视频线放| 国产91色综合久久免费分享| 亚洲一区二区影院| 中文字幕av资源一区| 欧美日韩精品一区二区在线播放| 国产精品一区二区在线观看不卡| 亚洲精品国产一区二区三区四区在线| 日韩欧美中文字幕精品| 色综合天天综合网天天狠天天| 久久99精品久久久久久| 亚洲综合一二三区| 国产精品久久久久久久久搜平片 | 911精品产国品一二三产区| 国产老妇另类xxxxx| 日韩**一区毛片| 亚洲欧美日韩国产另类专区 | 国产制服丝袜一区| 午夜精品在线看| 亚洲日本va午夜在线影院| 日韩久久精品一区| 911国产精品| 欧美特级限制片免费在线观看| 欧美xxxx老人做受| 欧美精品一二三四| 色八戒一区二区三区| 成人福利视频在线| 国产精品996| 久久电影网站中文字幕 | 日本大胆欧美人术艺术动态| 综合欧美一区二区三区| 亚洲国产岛国毛片在线| 久久久亚洲高清| 日韩一区二区影院| 欧美猛男超大videosgay| 色婷婷国产精品| 一本在线高清不卡dvd| 91丨九色porny丨蝌蚪| 丁香啪啪综合成人亚洲小说 | 国产精品亲子乱子伦xxxx裸| 日韩欧美国产麻豆| 日韩一级成人av| 精品国产三级a在线观看| 日韩一区二区免费视频| 3d成人动漫网站| 欧美一级在线观看| 91精品在线麻豆| 欧美一区二区三区思思人| 制服丝袜中文字幕一区| 91精品久久久久久久99蜜桃| 欧美一卡二卡三卡四卡| 欧美成人伊人久久综合网| 欧美不卡在线视频| 久久亚洲综合色一区二区三区| 久久亚洲一级片| 亚洲国产高清在线观看视频| 自拍偷拍亚洲激情| 夜夜嗨av一区二区三区网页 | 欧美午夜影院一区| 欧美电影一区二区| 日韩欧美成人午夜| 久久亚洲免费视频| 亚洲欧洲日本在线| 亚洲精品国产精华液| 午夜欧美电影在线观看| 蜜桃久久精品一区二区| 国产高清一区日本| 色婷婷av一区二区三区之一色屋| 欧美日韩日日摸| 久久久综合视频| 中文字幕视频一区| 视频一区在线播放| 国产在线精品一区二区三区不卡| 成人黄页在线观看| 欧美三级在线看| 精品国精品自拍自在线| 中文字幕一区二区三区四区| 天堂蜜桃91精品| 国产精选一区二区三区| 色综合中文字幕国产 | 久久看人人爽人人| 亚洲免费观看在线视频| 天天综合色天天综合色h| 国内一区二区视频| 91小宝寻花一区二区三区| 88在线观看91蜜桃国自产| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 中文字幕一区免费在线观看 | 91麻豆精品91久久久久久清纯| 久久天天做天天爱综合色| 亚洲人成精品久久久久久| 七七婷婷婷婷精品国产| 成人avav在线| 精品日产卡一卡二卡麻豆| 亚洲男人的天堂在线观看| 久久狠狠亚洲综合| 色妞www精品视频| 26uuu精品一区二区在线观看| 亚洲最色的网站| 国产在线不卡一卡二卡三卡四卡| 色婷婷av一区二区三区大白胸| www激情久久| 午夜国产精品一区| av不卡一区二区三区| 精品福利视频一区二区三区| 亚洲最新视频在线观看| 成人激情免费视频| 久久只精品国产| 日韩在线一区二区三区| 99精品视频在线观看免费| 欧美精品一区男女天堂| 午夜成人在线视频| 91久久精品午夜一区二区| 亚洲国产成人自拍| 国产美女视频一区| 日韩欧美一级特黄在线播放| 亚洲午夜久久久久久久久久久| 国产91对白在线观看九色| 精品久久久久久久久久久久久久久久久| 亚洲精品综合在线| 不卡一区二区中文字幕| 久久精品亚洲乱码伦伦中文| 精品亚洲成av人在线观看| 777xxx欧美| 亚洲成av人片一区二区梦乃| 色噜噜夜夜夜综合网| 最新欧美精品一区二区三区| 成人深夜福利app| 国产欧美综合色| 国产成人鲁色资源国产91色综| 久久婷婷一区二区三区| 激情五月婷婷综合| 精品播放一区二区| 韩国女主播一区| 久久久久久影视| 国产成人在线观看| 国产精品视频一二| eeuss鲁片一区二区三区| 国产精品嫩草影院com| 99久久亚洲一区二区三区青草 | 日韩欧美中文字幕一区| 麻豆精品视频在线观看| 精品免费视频一区二区| 国模套图日韩精品一区二区 | 亚洲日韩欧美一区二区在线| 久久美女高清视频| 成人国产视频在线观看| 亚洲另类春色国产| 欧美三级电影一区| 奇米一区二区三区av| 久久久久国产免费免费 | 美女被吸乳得到大胸91| 欧美sm美女调教| 国产成人免费在线| 亚洲欧美日韩人成在线播放| 欧美日韩精品欧美日韩精品一 | 美国毛片一区二区| 久久先锋影音av鲁色资源网| 国产成人av一区二区三区在线观看| 国产精品美女久久久久久 | 欧美日韩国产123区| 男人的天堂亚洲一区| 久久精品男人的天堂| 91久久一区二区| 五月婷婷综合激情|