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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sysepic.c

?? cpc-1631的BSP包for VxWorks操作系統(tǒng)
?? C
?? 第 1 頁 / 共 3 頁
/* sysEpic.c - Driver for Embedded Programmable Interrupt Controller */

/* Copyright 1984-1999 Wind River Systems, Inc. */

#include "copyright_wrs.h"

/*
modification history
--------------------
01b,01apr02,jnz   added support for 8245/8241 on chip duarts.
01a,10oct99,mtl   written from SPS/Motorola by teamF1
*/

/*
DESCRIPTION
This module implements the Embedded Programmable Interrupt Controller (EPIC)
driver for the PPMC 8240 on the Sandpoint board.

The EPIC is an integrated interrupt controller in the 8240 which
provides following major capabilities:

  Support for five external interrupt sources or one serial-style
  interrupt (16 interrupt sources)

  Support for connection of external interrupt controller device e.g. 8259
  which is implemented as a part of a via chip.
      
  16 programmable interrupt priority levels
  Fully-nested interrupt delivery
  Spurious vector generation

EPIC features are customized by writing into general control registers
or into interrupt level specific registers (IVPRs).

This driver allows a basic interface to the EPIC such as intializing it,
setting interrupt vectors, priorities, level/edge sense and interrupt
polarities, as well as enabling and disabling specific interrupts.

This driver implements a complete interrupt architecture system, complete
with vector table.

This driver provides the vector table for the system.  It can support
a total of 256 vectors.  In this driver the EPIC controller device can only
generate 5 different vectors, one for each external interrupt.
Other interrupt controllers such as the via on the Sandpoint 8240
can be connected to one of the above external interrupts.

The actual vector number corresponding to IRQ0
is determined by the value in sysVectorIRQ0 at initialization time.  The
other vector numbers are generated by adding the IRQ number to this vector
number. For the Sandpoint PMMC8240, the value of sysVectorIRQ0 is
initialized from a constant INT_NUM_IRQ0, which is = 0x10 (16). So
all IRQs above 16 are assumed to be controlled by an external
interrupt controller such as a the Via vt82c686.

Lower IRQ's are controlled by the 8240's embedded programmable interrupt
controller or EPIC.

Although the EPIC has 5 external interrupts sources, only 4 are available
from the PPMC unit.

Since interrupt vectors can be shared, this driver does provide for
overloading of interrupt routines (i.e. there is
a list of interrupt routines for each interrupt vector (level)).  To service
a vector requires that all connected interrupt routines be called in order
of their connection.

The following diagram shows an example of how interrupts can
be configured in this system.

    EPIC Vector table
0  |-------|
   |-------|							  
   |-------|
   |-------|---------------------
   |-------|			|
5  |-------|			|
   |-------|			| IRQ 2 handler
				|
    ....	      -----------------------------------
		      |			     		|
    sysVectorIRQ0=16  |			     		|
16 |-------|	      |			     		|
   |-------|<--------via Interrupt handler	   PCI slot 3 interrupt handler
   |-------|		Cascaded 8259s
   |-------|
   |-------|
   |-------|
32 |-------|


    ....		    

   |-------|
   |-------|
   |-------|
   |-------|
   |-------|
   |-------|
   |-------|
256|-------|


If there are other devices in the system capable of generating their own
vectors then we presume that an appropriate interrupt handler is created
and attached to the vector associated with the correct IRQ number.  That
interrupt handler would get a new vector directly from the device and then
call all of the handlers attached to that new vector.  Vector information is
stored in a linked list of INT_HANDLER_DESC structures. The sysIntTbl array
contains a pointer to the first entry for each vector.

An example would be a VME interface chip.

If the VME chip interrupts the CPU on IRQ8, then the BSP should create
a special VME interrupt handler and attach it to vector # (sysVectorIRQ0 + 8).
When the handler is called, it should get the new vector from the VME
device.  It will then use that new vector # to locate the specific VME
device handler routine from sysIntTbl.  The VME interrupt handler will
call each handler connected to the devices vector.  Note that the user
must insure that no VME device uses a vector that matches the vector used
by the VME interface chip itself.  This could cause an infinite loop to
be generated.

.CS
/@ This is the sample VME interrupt handler (IRQ8) @/

VOID sysVmeHandler (void)
    {
    INT_HANDLER_DEC * pVector;
    int newVec;

    newVec = ????; /@ get real vector from device @/

    /@ if no VME interrupt is present, exit immediately @/

    if (newVec < 0 || newVec > 255)
	return;

    /@ process all connected routines @/

    pVector = sysIntTbl[newVec];
    while (pVector != NULL)
        {
	(*pVector->vec) (pVector->arg);
        pVector = pVector->next;
        }
    }

/@ The BSP would connect the VME handler to the vector for IRQ 8 @/

    #define SYS_VME_VEC  (sysVectorIRQ0 + 8) /@ IRQ8 @/

    ...
    intConnect (INUM_TO_IVEC(SYS_VME_VEC), sysVmeHandler, 0);
    ...
.CE

.SH INITIALIZATION

This driver is initialized from the BSP, usually as part of sysHwInit().
The first routine to be called is sysEpicInit(). The routine resets the
global configuration register and resets the epic registers to default
values.

The second routine to be called is sysEpicIntrInit().  This routine takes no
arguments. This routine allocates the vector table and initializes the
chips to a default state.  All individual interrupt sources are disabled.
Each has to be individually enabled by intEnable() before it will be
unmasked and allowed to generate an interrupt.

.SH CUSTOMIZING THIS DRIVER

The macros CPU_INT_LOCK() and CPU_INT_UNLOCK provide the access
to the CPU level interrupt lock/unlock routines.  We presume that there
is a single interrupt line to the CPU.  By default these macros call
intLock() and intUnlock() respectively.

*/

/* includes */

#include "vxWorks.h"
#include "sysEpic.h"
#include "mpc107.h"
#include "sysLib.h"
#include "stdio.h"
#include "string.h"

#ifdef INCLUDE_WINDVIEW
#include "private/eventP.h"
#endif

/* defines */

#ifndef CPU_INT_LOCK
#   define CPU_INT_LOCK(pData) \
	(*pData = intLock ())
#endif

#ifndef CPU_INT_UNLOCK
#   define CPU_INT_UNLOCK(data) \
	(intUnlock (data))
#endif

/* externs */

IMPORT STATUS 	excIntConnect (VOIDFUNCPTR *, VOIDFUNCPTR);

#if FALSE /* defined(INCLUDE_WINDVIEW) || defined(INCLUDE_INSTRUMENTATION) */
IMPORT	int	evtTimeStamp;  /* Windview 1.0 only */
#endif

/* get the interrupt hook routines  prototypes*/

IMPORT STATUS	(*_func_intConnectRtn) (VOIDFUNCPTR *, VOIDFUNCPTR, int);
IMPORT int	(*_func_intEnableRtn) (int);
IMPORT int	(*_func_intdisableRtn)  (int);

/* globals */

INT_HANDLER_DESC * sysIntTbl [INTERRUPT_TABLESIZE]; /* system interrupt tbl */

int epicIntTrace = 0;   /* epic internal interrupts trace */


/* locals */

/* forward declarations */

LOCAL STATUS  	sysEpicIntConnect (VOIDFUNCPTR * vector, VOIDFUNCPTR routine,
                                   int parameter);
LOCAL STATUS	sysEpicIntEnable (int intNum);
LOCAL STATUS	sysEpicIntDisable (int intNum);
LOCAL void 	sysEpicIntHandler (void);

/*******************************************************************************
*
* sysEpicInit - initialize the epic controller
*
* This routine resets the global Configuration Register, thus it:
*  -  disables all interrupts
*  -  sets epic registers to reset values
*
* It then sets the EPIC operation mode to Mixed Mode (vs. Pass Through
* mode). At this point only mixed mode is supported which means the EPIC
* is not configured for the pass through mode.
*
* Input:
*    -  <irqType> is either Direct IRQs (0) or Serial Interrupt IRQs (1).
*    -  <clkRatio> is clock frequency driving the serial interrupt
*         interface.
*
*   If irqType is Direct IRQs:
*    - irqType is written to the SIE bit of the EPIC Interrupt
*       Configuration register.
*    - clkRatio is ignored.  
*
*   If irqType is Serial IRQs:
*    - both irqType and clkRatio will be written to the EPIC
*      Interrupt Configuration register.
*
* NOMANUAL
* 
* RETURNS: N/A
*/    

void sysEpicInit
    (
    ULONG 	irqType, 	/* irq type to initialize with */
    ULONG 	clkRatio	/* clock ratio */
    )
    {
    ULONG 	gcrVal;
    ULONG 	icrVal;
    int 	irq;
		
  	int i = 0;
			
    gcrVal = sysEUMBBARRead (EPIC_GLOBAL_REG);

    gcrVal |= (EPIC_GCR_RESET);
    
    sysEUMBBARWrite (EPIC_GLOBAL_REG, gcrVal);

    /* wait for the reset sequence to be completed */
		
    while (sysEUMBBARRead (EPIC_GLOBAL_REG) & EPIC_GCR_RESET)
      {
		i++;
		if(i>0x100000)
		{
			logMsg("EPIC Reset error!\n",0,0,0,0,0,0);
			break;
		}
		/* do nothing */
      }
		
    gcrVal = sysEUMBBARRead (EPIC_GLOBAL_REG);

    gcrVal |= (EPIC_GCR_MODE_MIXED);	/* configure for mixed mode */
    
    sysEUMBBARWrite (EPIC_GLOBAL_REG, gcrVal);

    icrVal = sysEUMBBARRead (EPIC_INT_CONF_REG);	/* read EICR */

    if (irqType == EPIC_DIRECT_IRQ)
        {
        icrVal &= ~(EPIC_ICR_SEI); /* disable serial mode interrupts */
        }

    else /* serial mode is configured */
        {
        if (clkRatio != 0)
            {
            icrVal |= EPIC_ICR_CLK_RATIO (clkRatio);
            }
        }

    sysEUMBBARWrite (EPIC_INT_CONF_REG, icrVal);
		
	i = 0;
	
    while (epicIntAck() != 0xff)           /* Clear all pending interrupt */
        {

		i++;
		if(i>0x100000)
		{
			logMsg("EPIC Clear all pending interrupt error!\n",0,0,0,0,0,0);
			break;
		}
        /* do nothing */
	}
		
    /* init all IVPRs to sense = 1, polarity = defined, vec = 0, prio = 0 */

    for (irq = 0; irq < EPIC_MAX_EXT_IRQS; irq++)
        {
        epicIntDisable (EPIC_VEC_REG(irq));

        epicIntSourceSet (EPIC_VEC_REG(irq), EPIC_INT_POLARITY,
                          EPIC_SENSE_LVL, 0x0, 0x0);
        }

#ifdef INCLUDE_DUART
    /* init duart interrupts */
    epicIntDisable (EPIC_DUART1_INT_VEC_REG);
    epicIntSourceSet (EPIC_DUART1_INT_VEC_REG, EPIC_INT_POLARITY, \
		      EPIC_SENSE_LVL, 0x0, EPIC_DUART1_INT_VECT);
                     
    epicIntDisable (EPIC_DUART2_INT_VEC_REG);
    epicIntSourceSet (EPIC_DUART2_INT_VEC_REG, EPIC_INT_POLARITY,  \
		      EPIC_SENSE_LVL, 0x0, EPIC_DUART2_INT_VECT);
#endif /* INCLUDE_DUART */

    epicCurTaskPrioSet (EPIC_PRIORITY_MAX); /* set it to highest priority */
    }

/*******************************************************************************
*
* sysEpicIntrInit - initialize the interrupt table
*
* This function initializes the interrupt mechanism of the board.
*
* RETURNS: OK, always.
*/

STATUS  sysEpicIntrInit (void)
    {
    int vector;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久66| 91福利国产成人精品照片| 亚洲精品乱码久久久久久黑人| 欧美日韩精品一区二区天天拍小说 | 丝袜脚交一区二区| 久久九九影视网| 欧美日韩在线播放一区| 国产精品中文字幕日韩精品 | 成人国产精品免费| 日韩av电影天堂| 亚洲免费av在线| www国产亚洲精品久久麻豆| 一本久道久久综合中文字幕| 久久精品国产秦先生| 一区二区成人在线视频 | 一区二区三区欧美日韩| 久久在线观看免费| 制服丝袜av成人在线看| 色综合色综合色综合| 国产精一区二区三区| 日本不卡一二三区黄网| 亚洲精品乱码久久久久久| 国产欧美一区二区三区在线看蜜臀| 欧美精品在线视频| 色94色欧美sute亚洲线路二 | 欧美成人a视频| 欧美三级电影网站| 91香蕉视频黄| 丁香啪啪综合成人亚洲小说| 美女看a上一区| 亚洲高清视频的网址| 日韩精彩视频在线观看| 中文字幕在线观看不卡视频| 欧美精品一区视频| 欧美一级在线视频| 在线综合亚洲欧美在线视频| 欧洲在线/亚洲| 色国产精品一区在线观看| 99在线热播精品免费| 成人免费视频网站在线观看| 国产一区二区三区观看| 国产综合色精品一区二区三区| 蜜桃视频免费观看一区| 琪琪久久久久日韩精品| 午夜精品国产更新| 日日噜噜夜夜狠狠视频欧美人| 亚洲无人区一区| 亚洲午夜日本在线观看| 亚洲福利视频一区二区| 午夜电影网一区| 亚洲成人免费av| 亚洲成人av一区二区| 亚洲国产一区二区在线播放| 亚洲精品乱码久久久久久日本蜜臀| 自拍偷拍国产精品| 亚洲精品日韩综合观看成人91| 中文字幕亚洲电影| 亚洲欧美日韩国产成人精品影院 | 国产一区二区剧情av在线| 黄网站免费久久| 国产成人午夜电影网| 成人av先锋影音| 色综合天天综合在线视频| 一本色道久久综合亚洲91| 91福利在线免费观看| 欧美日韩一区二区三区四区| 欧美美女视频在线观看| 欧美一级日韩免费不卡| 精品国产一区二区三区不卡 | 亚洲美女淫视频| 亚洲成国产人片在线观看| 婷婷国产v国产偷v亚洲高清| 日韩精品欧美成人高清一区二区| 蜜桃视频一区二区三区在线观看| 老色鬼精品视频在线观看播放| 国产精品原创巨作av| 成人av在线网| 欧美精品tushy高清| 亚洲精品一区二区三区四区高清 | 中文字幕视频一区二区三区久| 1024成人网| 日韩成人av影视| 国产不卡免费视频| 在线观看视频一区| 2022国产精品视频| 亚洲精品videosex极品| 精品在线播放免费| 97se亚洲国产综合自在线不卡| 欧美日韩一本到| 久久久99精品免费观看| 亚洲一区二区精品视频| 紧缚捆绑精品一区二区| 91亚洲男人天堂| 欧美岛国在线观看| 自拍偷拍国产精品| 另类的小说在线视频另类成人小视频在线| 国产成人亚洲精品狼色在线| 91行情网站电视在线观看高清版| 欧美一区二区二区| 亚洲天堂久久久久久久| 国产在线精品一区二区夜色 | 色老汉一区二区三区| 2欧美一区二区三区在线观看视频| 亚洲欧洲韩国日本视频| 捆绑调教美女网站视频一区| 91网上在线视频| 久久久久久久综合狠狠综合| 亚洲午夜免费电影| 成人免费毛片片v| 日韩免费高清av| 亚洲一二三区在线观看| 成人精品一区二区三区中文字幕| 91麻豆精品国产91久久久久| 亚洲欧美综合网| 韩国毛片一区二区三区| 欧美老肥妇做.爰bbww视频| 一区免费观看视频| 国产精品一区一区| 日韩欧美一二三区| 午夜精品视频一区| 91麻豆swag| 国产精品毛片a∨一区二区三区| 青娱乐精品视频| 欧洲一区二区三区在线| 亚洲私人黄色宅男| 成人一区在线观看| 久久九九影视网| 欧美在线一二三| 国产精品美女久久久久久久网站| 国内精品伊人久久久久av一坑| 欧美日韩三级在线| 亚洲午夜羞羞片| 91美女片黄在线观看91美女| 欧美极品aⅴ影院| 国产一区在线观看视频| 日韩你懂的电影在线观看| 日韩精品乱码免费| 欧美一区午夜精品| 男女激情视频一区| 日韩欧美国产精品一区| 麻豆91免费观看| 精品国产麻豆免费人成网站| 视频在线在亚洲| 91精品中文字幕一区二区三区| 亚洲电影你懂得| 欧美精品九九99久久| 天堂蜜桃一区二区三区 | 337p日本欧洲亚洲大胆精品| 久久不见久久见中文字幕免费| 日韩欧美在线123| 精品一区二区三区在线观看| 欧美一级理论片| 韩国在线一区二区| 国产日产精品1区| 成人免费视频一区| 亚洲欧美电影一区二区| 欧美性生活一区| 日韩va亚洲va欧美va久久| 日韩欧美色综合| 国产乱人伦偷精品视频不卡| 欧美国产精品一区二区三区| 成人晚上爱看视频| 一区二区在线观看不卡| 欧美日韩黄色影视| 麻豆精品在线播放| 国产午夜精品久久| 色妹子一区二区| 天堂va蜜桃一区二区三区漫画版| 欧美一级一区二区| 日韩午夜在线观看| 国产精品资源网站| 亚洲女爱视频在线| 欧美疯狂做受xxxx富婆| 久久精品国产精品青草| 国产欧美精品在线观看| 色综合久久88色综合天天免费| 亚洲综合在线观看视频| 日韩一级免费观看| 成人黄色777网| 亚洲国产视频一区二区| 久久久亚洲午夜电影| 色视频欧美一区二区三区| 奇米四色…亚洲| 国产精品免费看片| 欧美精选在线播放| 国产成人免费视频一区| 亚洲一区二区在线观看视频| 欧美一卡二卡在线观看| 成人国产电影网| 日本不卡视频在线观看| 欧美国产日本视频| 欧美另类高清zo欧美| 国产精品一级片| 亚洲高清免费观看高清完整版在线观看| 欧美一区二区三区爱爱| aaa欧美色吧激情视频| 美女视频免费一区| 曰韩精品一区二区| 国产亚洲精品福利| 欧美日韩国产成人在线免费|