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

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

?? sngks32cintrctl.c

?? VxWorks BSP 下s3C44b0的源代碼
?? 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一区二区三区免费野_久草精品视频
懂色av一区二区三区免费观看| 国产主播一区二区三区| 国产精品美女久久久久高潮| 日韩欧美中文一区| 4438成人网| 精品国产三级电影在线观看| 日韩欧美成人一区二区| 26uuu成人网一区二区三区| 精品国产乱码久久久久久久久| 精品999在线播放| 久久综合一区二区| 国产精品成人一区二区艾草| 亚洲视频免费在线观看| 亚洲美女区一区| 日韩—二三区免费观看av| 另类欧美日韩国产在线| 国产美女精品在线| 成人av免费观看| 91丨九色丨国产丨porny| 日本国产一区二区| 日韩一区和二区| 国产午夜精品福利| 亚洲欧美一区二区三区国产精品| 一区二区三区日韩| 日本不卡视频在线观看| 成人sese在线| 日韩午夜激情av| 国产精品无遮挡| 石原莉奈在线亚洲二区| 国产成人高清视频| 欧美精品丝袜久久久中文字幕| 精品日产卡一卡二卡麻豆| 亚洲少妇30p| 九九精品一区二区| 色88888久久久久久影院按摩 | 国产在线精品一区二区不卡了| 国产成人亚洲精品青草天美| 欧美日韩一区三区| 国产精品久久久久久久久晋中| 偷拍一区二区三区| 丁香婷婷综合色啪| 欧美一区二区三区小说| 亚洲天堂a在线| 国产精品夜夜嗨| 日韩美女主播在线视频一区二区三区 | 中文字幕免费观看一区| 五月天激情综合| 91麻豆国产福利在线观看| 欧美不卡在线视频| 亚洲va欧美va天堂v国产综合| 国产99久久久国产精品潘金| 日韩一级二级三级精品视频| 亚洲色图20p| 成人国产精品免费| 国产亚洲一区二区三区四区| 热久久国产精品| 717成人午夜免费福利电影| 亚洲裸体在线观看| 成人福利视频在线| 国产精品美女久久久久高潮| 狠狠久久亚洲欧美| 91精品免费观看| 日本中文在线一区| 欧美人牲a欧美精品| 亚洲成人动漫在线免费观看| 91香蕉视频黄| 亚洲视频一区在线观看| 成人福利电影精品一区二区在线观看| 日韩免费一区二区三区在线播放| 亚洲成人免费视频| 欧美日韩国产经典色站一区二区三区| 亚洲美女在线一区| 欧美视频中文一区二区三区在线观看| 亚洲精品欧美专区| 欧美视频在线一区二区三区| 一区二区高清免费观看影视大全| www.久久久久久久久| 椎名由奈av一区二区三区| 成人18视频日本| 亚洲色大成网站www久久九九| 成人精品免费网站| 中文字幕在线播放不卡一区| 97久久超碰国产精品电影| 亚洲人成小说网站色在线| 欧美色欧美亚洲另类二区| 日韩中文欧美在线| 精品国产麻豆免费人成网站| 国产麻豆午夜三级精品| 国产亚洲欧美色| 一本色道综合亚洲| 一区二区视频在线| 91精品国产综合久久精品性色| 精品一区二区三区在线视频| 国产精品丝袜久久久久久app| 色综合久久88色综合天天6| 亚洲h在线观看| 久久蜜桃av一区精品变态类天堂| 成人爽a毛片一区二区免费| 亚洲欧美在线视频| 欧美老女人第四色| 国产很黄免费观看久久| 亚洲精品国产第一综合99久久| 欧美一区二区在线不卡| 国产原创一区二区三区| 中文字幕欧美一| 日韩女同互慰一区二区| bt欧美亚洲午夜电影天堂| 亚洲v中文字幕| 国产色产综合产在线视频| 91福利在线看| 狠狠色综合日日| 亚洲一区二区三区在线| 久久一区二区三区四区| 在线观看av一区| 国产乱色国产精品免费视频| 亚洲成人免费观看| 中文字幕一区二区三区在线观看| 欧美日韩国产首页| 99久久久国产精品免费蜜臀| 久久国产尿小便嘘嘘尿| 一区二区三区中文在线| 国产视频一区二区在线| 日韩丝袜情趣美女图片| 色www精品视频在线观看| 国产精品一区二区在线看| 天天操天天色综合| 亚洲精品国产高清久久伦理二区| 国产农村妇女毛片精品久久麻豆| 欧美日韩免费高清一区色橹橹 | 欧美日韩国产高清一区二区三区| 懂色av一区二区夜夜嗨| 老司机精品视频一区二区三区| 亚洲乱码一区二区三区在线观看| 国产婷婷精品av在线| 欧美xxxxx牲另类人与| 在线不卡的av| 在线观看国产日韩| 在线中文字幕不卡| 91玉足脚交白嫩脚丫在线播放| 精品在线观看视频| 精品在线观看免费| 久久精品国产亚洲一区二区三区| 天堂成人免费av电影一区| 亚洲一线二线三线久久久| 国产精品国产三级国产aⅴ入口| 国产嫩草影院久久久久| 久久免费精品国产久精品久久久久| 日韩一区二区麻豆国产| 欧美一区二区人人喊爽| 7777精品伊人久久久大香线蕉的 | 一本一道综合狠狠老| av影院午夜一区| 成人国产在线观看| 粉嫩蜜臀av国产精品网站| 国产成人精品亚洲午夜麻豆| 粉嫩一区二区三区在线看| 成人a免费在线看| 成人激情开心网| 色欧美日韩亚洲| 色视频欧美一区二区三区| 欧美午夜影院一区| 欧美挠脚心视频网站| 日韩一区二区精品葵司在线| 2021国产精品久久精品| 久久久久久久精| 国产精品久久久久久亚洲毛片| 国产精品久久久久婷婷| 亚洲欧美色一区| 日韩精品一区第一页| 精品一区二区三区免费观看| 高清成人免费视频| 日本久久电影网| 欧美一级夜夜爽| 国产欧美精品区一区二区三区| 中文字幕亚洲欧美在线不卡| 亚洲一区二区高清| 另类调教123区| 99国产精品久久久久久久久久| 欧美日韩成人综合天天影院| 久久天堂av综合合色蜜桃网| 国产网红主播福利一区二区| 一区二区三区av电影| 麻豆国产精品一区二区三区| av亚洲精华国产精华精华| 欧美精品18+| 亚洲欧洲av在线| 日韩激情一区二区| 99re热这里只有精品视频| 3d成人动漫网站| 欧美国产禁国产网站cc| 午夜成人免费电影| 成人一区二区三区视频在线观看| 欧美日韩一区二区三区四区| 国产欧美一区二区精品久导航| 亚洲专区一二三| 国产精品亚洲第一区在线暖暖韩国| 91久久精品日日躁夜夜躁欧美| 精品欧美一区二区久久| 亚洲精品你懂的| 成人综合婷婷国产精品久久 |