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

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

?? epic1.c

?? uboot的源碼,包括了常見的處理器平臺
?? C
字號:
/************************************************** * * copyright @ motorola, 1999 * *************************************************/#include <mpc824x.h>#include <common.h>#include "epic.h"#define PRINT(format, args...) printf(format , ## args)typedef void (*VOIDFUNCPTR)  (void);  /* ptr to function returning void */struct SrcVecTable SrcVecTable[MAXVEC] = /* Addr/Vector cross-reference tbl */    {    { EPIC_EX_INT0_VEC_REG,  "External Direct/Serial Source 0"},    { EPIC_EX_INT1_VEC_REG,  "External Direct/Serial Source 1"},    { EPIC_EX_INT2_VEC_REG,  "External Direct/Serial Source 2"},    { EPIC_EX_INT3_VEC_REG,  "External Direct/Serial Source 3"},    { EPIC_EX_INT4_VEC_REG,  "External Direct/Serial Source 4"},    { EPIC_SR_INT5_VEC_REG,  "External Serial Source 5"},    { EPIC_SR_INT6_VEC_REG,  "External Serial Source 6"},    { EPIC_SR_INT7_VEC_REG,  "External Serial Source 7"},    { EPIC_SR_INT8_VEC_REG,  "External Serial Source 8"},    { EPIC_SR_INT9_VEC_REG,  "External Serial Source 9"},    { EPIC_SR_INT10_VEC_REG, "External Serial Source 10"},    { EPIC_SR_INT11_VEC_REG, "External Serial Source 11"},    { EPIC_SR_INT12_VEC_REG, "External Serial Source 12"},    { EPIC_SR_INT13_VEC_REG, "External Serial Source 13"},    { EPIC_SR_INT14_VEC_REG, "External Serial Source 14"},    { EPIC_SR_INT15_VEC_REG, "External Serial Source 15"},    { EPIC_I2C_INT_VEC_REG,  "Internal I2C Source"},    { EPIC_DMA0_INT_VEC_REG, "Internal DMA0 Source"},    { EPIC_DMA1_INT_VEC_REG, "Internal DMA1 Source"},    { EPIC_MSG_INT_VEC_REG,  "Internal Message Source"},    };VOIDFUNCPTR intVecTbl[MAXVEC];    /* Interrupt vector table *//*****************************************************************************  epicInit - Initialize the EPIC registers**  This routine resets the Global Configuration Register, thus it:*     -  Disables all interrupts*     -  Sets epic registers to reset values*     -  Sets the value of the Processor Current Task Priority to the*        highest priority (0xF).*  epicInit then sets the EPIC operation mode to Mixed Mode (vs. Pass*  Through or 8259 compatible mode).**  If IRQType (input) is Direct IRQs:*     - IRQType is written to the SIE bit of the EPIC Interrupt*       Configuration register (ICR).*     - clkRatio is ignored.*  If IRQType is Serial IRQs:*     - both IRQType and clkRatio will be written to the ICR register*/void epicInit    (    unsigned int IRQType,      /* Direct or Serial */    unsigned int clkRatio      /* Clk Ratio for Serial IRQs */    )    {    ULONG tmp;    tmp = sysEUMBBARRead(EPIC_GLOBAL_REG);    tmp |= 0xa0000000;                  /* Set the Global Conf. register */    sysEUMBBARWrite(EPIC_GLOBAL_REG, tmp);	/*	 * Wait for EPIC to reset - CLH	 */    while( (sysEUMBBARRead(EPIC_GLOBAL_REG) & 0x80000000) == 1);    sysEUMBBARWrite(EPIC_GLOBAL_REG, 0x20000000);    tmp = sysEUMBBARRead(EPIC_INT_CONF_REG);    /* Read interrupt conf. reg */    if (IRQType == EPIC_DIRECT_IRQ)             /* direct mode */	sysEUMBBARWrite(EPIC_INT_CONF_REG, tmp & 0xf7ffffff);    else                                        /* Serial mode */	{	tmp = (clkRatio << 28) | 0x08000000;    /* Set clock ratio */	sysEUMBBARWrite(EPIC_INT_CONF_REG, tmp);	}    while (epicIntAck() != 0xff)       /* Clear all pending interrupts */		epicEOI();}/**************************************************************************** *  epicIntEnable - Enable an interrupt source * *  This routine clears the mask bit of an external, an internal or *  a Timer register to enable the interrupt. * *  RETURNS:  None */void epicIntEnable(int intVec){    ULONG tmp;    ULONG srAddr;    srAddr = SrcVecTable[intVec].srcAddr;  /* Retrieve src Vec/Prio register */    tmp = sysEUMBBARRead(srAddr);    tmp &= ~EPIC_VEC_PRI_MASK;             /* Clear the mask bit */    tmp |= (EPIC_VEC_PRI_DFLT_PRI << 16);   /* Set priority to Default - CLH */    tmp |= intVec;				           /* Set Vector number */    sysEUMBBARWrite(srAddr, tmp);    return;    }/**************************************************************************** *  epicIntDisable - Disable an interrupt source * *  This routine sets the mask bit of an external, an internal or *  a Timer register to disable the interrupt. * *  RETURNS:  OK or ERROR * */void epicIntDisable    (    int intVec        /* Interrupt vector number */    )    {    ULONG tmp, srAddr;    srAddr = SrcVecTable[intVec].srcAddr;    tmp = sysEUMBBARRead(srAddr);    tmp |= 0x80000000;                      /* Set the mask bit */    sysEUMBBARWrite(srAddr, tmp);    return;    }/**************************************************************************** * epicIntSourceConfig - Set properties of an interrupt source * * This function sets interrupt properites (Polarity, Sense, Interrupt * Prority, and Interrupt Vector) of an Interrupt Source.  The properties * can be set when the current source is not in-request or in-service, * which is determined by the Activity bit.  This routine return ERROR * if the the Activity bit is 1 (in-request or in-service). * * This function assumes that the Source Vector/Priority register (input) * is a valid address. * * RETURNS:  OK or ERROR */int epicIntSourceConfig    (    int   Vect,                         /* interrupt source vector number */    int   Polarity,                     /* interrupt source polarity */    int   Sense,                        /* interrupt source Sense */    int   Prio                          /* interrupt source priority */    )    {    ULONG tmp, newVal;    ULONG actBit, srAddr;    srAddr = SrcVecTable[Vect].srcAddr;    tmp = sysEUMBBARRead(srAddr);    actBit = (tmp & 40000000) >> 30;    /* retrieve activity bit - bit 30 */    if (actBit == 1)	return ERROR;    tmp &= 0xff30ff00;     /* Erase previously set P,S,Prio,Vector bits */    newVal = (Polarity << 23) | (Sense << 22) | (Prio << 16) | Vect;    sysEUMBBARWrite(srAddr, tmp | newVal );    return (OK);    }/**************************************************************************** * epicIntAck - acknowledge an interrupt * * This function reads the Interrupt acknowldge register and return * the vector number of the highest pending interrupt. * * RETURNS: Interrupt Vector number. */unsigned int epicIntAck(void){    return(sysEUMBBARRead( EPIC_PROC_INT_ACK_REG ));}/**************************************************************************** * epicEOI - signal an end of interrupt * * This function writes 0x0 to the EOI register to signal end of interrupt. * It is usually called after an interrupt routine is served. * * RETURNS: None */void epicEOI(void)    {    sysEUMBBARWrite(EPIC_PROC_EOI_REG, 0x0);    }/**************************************************************************** *  epicCurTaskPrioSet - sets the priority of the Processor Current Task * *  This function should be called after epicInit() to lower the priority *  of the processor current task. * *  RETURNS:  OK or ERROR */int epicCurTaskPrioSet    (    int prioNum                 /* New priority value */    )    {    if ( (prioNum < 0) || (prioNum > 0xF))	return ERROR;    sysEUMBBARWrite(EPIC_PROC_CTASK_PRI_REG, prioNum);    return OK;    }/************************************************************************ * function: epicIntTaskGet * * description: Get value of processor current interrupt task priority register * * note: ***********************************************************************/unsigned char epicIntTaskGet(){  /* get the interrupt task priority register */    ULONG reg;    unsigned char rec;    reg = sysEUMBBARRead( EPIC_PROC_CTASK_PRI_REG );    rec = ( reg & 0x0F );    return rec;}/************************************************************** * function: epicISR * * description: EPIC service routine called by the core exception *              at 0x500 * * note: **************************************************************/unsigned int epicISR(void){   return 0;}/************************************************************ * function: epicModeGet * * description: query EPIC mode, return 0 if pass through mode *                               return 1 if mixed mode * * note: *************************************************************/unsigned int epicModeGet(void){    ULONG val;    val = sysEUMBBARRead( EPIC_GLOBAL_REG );    return (( val & 0x20000000 ) >> 29);}/********************************************* * function: epicConfigGet * * description: Get the EPIC interrupt Configuration *              return 0 if not error, otherwise return 1 * * note: ********************************************/void epicConfigGet( unsigned int *clkRatio, unsigned int *serEnable){    ULONG val;    val = sysEUMBBARRead( EPIC_INT_CONF_REG );    *clkRatio = ( val & 0x70000000 ) >> 28;    *serEnable = ( val & 0x8000000 ) >> 27;}/******************************************************************* *  sysEUMBBARRead - Read a 32-bit EUMBBAR register * *  This routine reads the content of a register in the Embedded *  Utilities Memory Block, and swaps to big endian before returning *  the value. * *  RETURNS:  The content of the specified EUMBBAR register. */ULONG sysEUMBBARRead    (    ULONG regNum    )    {    ULONG temp;    temp = *(ULONG *) (CFG_EUMB_ADDR + regNum);    return ( LONGSWAP(temp));    }/******************************************************************* *  sysEUMBBARWrite - Write a 32-bit EUMBBAR register * *  This routine swaps the value to little endian then writes it to *  a register in the Embedded Utilities Memory Block address space. * *  RETURNS: N/A */void sysEUMBBARWrite    (    ULONG regNum,               /* EUMBBAR register address */    ULONG regVal                /* Value to be written */    )    {    *(ULONG *) (CFG_EUMB_ADDR + regNum) = LONGSWAP(regVal);    return ;    }/******************************************************** * function: epicVendorId * * description: return the EPIC Vendor Identification *              register: * *              siliccon version, device id, and vendor id * * note: ********************************************************/void epicVendorId   (    unsigned int *step,    unsigned int *devId,    unsigned int *venId   )   {    ULONG val;    val = sysEUMBBARRead( EPIC_VENDOR_ID_REG );    *step  = ( val & 0x00FF0000 ) >> 16;    *devId = ( val & 0x0000FF00 ) >> 8;    *venId = ( val & 0x000000FF );    }/************************************************** * function: epicFeatures * * description: return the number of IRQ supported, *              number of CPU, and the version of the *              OpenEPIC * * note: *************************************************/void epicFeatures    (    unsigned int *noIRQs,    unsigned int *noCPUs,    unsigned int *verId    )    {    ULONG val;    val = sysEUMBBARRead( EPIC_FEATURES_REG );    *noIRQs  = ( val & 0x07FF0000 ) >> 16;    *noCPUs  = ( val & 0x00001F00 ) >> 8;    *verId   = ( val & 0x000000FF );}/********************************************************* * function: epciTmFrequncySet * * description: Set the timer frequency reporting register ********************************************************/void epicTmFrequencySet( unsigned int frq ){    sysEUMBBARWrite(EPIC_TM_FREQ_REG, frq);}/******************************************************* * function: epicTmFrequncyGet * * description: Get the current value of the Timer Frequency * Reporting register * ******************************************************/unsigned int epicTmFrequencyGet(void){    return( sysEUMBBARRead(EPIC_TM_FREQ_REG)) ;}/**************************************************** * function: epicTmBaseSet * * description: Set the #n global timer base count register *              return 0 if no error, otherwise return 1. * * note: ****************************************************/unsigned int epicTmBaseSet    (    ULONG srcAddr,         /* Address of the Timer Base register */    unsigned int cnt,    /* Base count */    unsigned int inhibit   /* 1 - count inhibit */    ){    unsigned int val = 0x80000000;    /* First inhibit counting the timer */    sysEUMBBARWrite(srcAddr, val) ;    /* set the new value */    val = (cnt & 0x7fffffff) | ((inhibit & 0x1) << 31);    sysEUMBBARWrite(srcAddr, val) ;    return 0;}/*********************************************************************** * function: epicTmBaseGet * * description: Get the current value of the global timer base count register *              return 0 if no error, otherwise return 1. * * note: ***********************************************************************/unsigned int epicTmBaseGet( ULONG srcAddr, unsigned int *val ){    *val = sysEUMBBARRead( srcAddr );    *val = *val & 0x7fffffff;    return 0;}/*********************************************************** * function: epicTmCountGet * * description: Get the value of a given global timer *              current count register *              return 0 if no error, otherwise return 1 * note: **********************************************************/unsigned int epicTmCountGet( ULONG srcAddr, unsigned int *val ){    *val = sysEUMBBARRead( srcAddr );    *val = *val & 0x7fffffff;    return 0;}/*********************************************************** * function: epicTmInhibit * * description: Stop counting of a given global timer *              return 0 if no error, otherwise return 1 * * note: ***********************************************************/unsigned int epicTmInhibit( unsigned int srcAddr ){    ULONG val;    val = sysEUMBBARRead( srcAddr );    val |= 0x80000000;    sysEUMBBARWrite( srcAddr, val );    return 0;}/****************************************************************** * function: epicTmEnable * * description: Enable counting of a given global timer *              return 0 if no error, otherwise return 1 * * note: *****************************************************************/unsigned int epicTmEnable( ULONG srcAddr ){    ULONG val;    val = sysEUMBBARRead( srcAddr );    val &= 0x7fffffff;    sysEUMBBARWrite( srcAddr, val );    return 0;}void epicSourcePrint(int Vect)    {    ULONG srcVal;    srcVal = sysEUMBBARRead(SrcVecTable[Vect].srcAddr);    PRINT("%s\n", SrcVecTable[Vect].srcName);    PRINT("Address   = 0x%lx\n", SrcVecTable[Vect].srcAddr);    PRINT("Vector    = %ld\n", (srcVal & 0x000000FF) );    PRINT("Mask      = %ld\n", srcVal >> 31);    PRINT("Activitiy = %ld\n", (srcVal & 40000000) >> 30);    PRINT("Polarity  = %ld\n", (srcVal & 0x00800000) >> 23);    PRINT("Sense     = %ld\n", (srcVal & 0x00400000) >> 22);    PRINT("Priority  = %ld\n", (srcVal & 0x000F0000) >> 16);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡的av网站| 91精品国产入口在线| 欧美亚洲免费在线一区| 欧美绝品在线观看成人午夜影视| 欧美成人a在线| 亚洲免费视频中文字幕| 久久av资源站| 欧洲亚洲国产日韩| 久久久午夜电影| 午夜欧美在线一二页| 成人高清伦理免费影院在线观看| 欧美日韩高清一区二区三区| 国产网站一区二区| 日本系列欧美系列| 91美女福利视频| 国产欧美一区视频| 香蕉乱码成人久久天堂爱免费| 国产乱码精品一区二区三区忘忧草| 色婷婷一区二区| 中文av字幕一区| 久久精品二区亚洲w码| 欧美唯美清纯偷拍| 亚洲美女淫视频| 国产成人99久久亚洲综合精品| 91麻豆精品国产无毒不卡在线观看 | av爱爱亚洲一区| 欧美精品一区二区在线播放| 丝袜美腿成人在线| 欧美亚洲高清一区| 亚洲精品伦理在线| 91色婷婷久久久久合中文| 久久久久久影视| 韩国女主播成人在线观看| 这里是久久伊人| 日韩精品一区第一页| 欧美午夜片在线观看| 亚洲人成亚洲人成在线观看图片| 成人美女在线视频| 中文字幕欧美日韩一区| 国产69精品一区二区亚洲孕妇 | 色吧成人激情小说| 亚洲欧美一区二区在线观看| 成人av网站在线观看免费| 国产日韩欧美一区二区三区乱码| 国内成+人亚洲+欧美+综合在线| 欧美一区二区三区在| 日韩av一区二区三区| 欧美一级在线免费| 韩日欧美一区二区三区| 欧美精品一区二区三区一线天视频| 日本aⅴ免费视频一区二区三区| 日韩一卡二卡三卡国产欧美| 捆绑变态av一区二区三区| 欧美一级黄色大片| 国产一区二区三区香蕉| 2021久久国产精品不只是精品| 国产一区在线观看麻豆| 国产精品看片你懂得| 色诱视频网站一区| 日韩电影在线观看网站| 日韩精品综合一本久道在线视频| 国内精品在线播放| 国产精品美女一区二区三区 | 欧美放荡的少妇| 日本不卡一区二区三区高清视频| 欧美一区二区视频在线观看2020 | 欧美日韩电影在线| 美女www一区二区| 国产日本亚洲高清| 91极品视觉盛宴| 欧美aaaaaa午夜精品| 国产欧美日韩在线| 欧美在线一二三四区| 精品一区免费av| 日韩一区欧美小说| 日韩一区二区免费电影| av不卡一区二区三区| 视频一区二区不卡| 亚洲国产精品ⅴa在线观看| 欧洲激情一区二区| 国产露脸91国语对白| 亚洲综合免费观看高清完整版在线 | 精品国产亚洲在线| 一本到不卡精品视频在线观看 | 亚洲欧洲色图综合| 正在播放亚洲一区| 97se亚洲国产综合自在线观| 视频在线观看一区| 国产精品久久看| 欧美久久久久久久久久| 成人国产免费视频| 老司机精品视频线观看86| 一区二区三区中文字幕精品精品 | 老汉av免费一区二区三区| 最新国产精品久久精品| 欧美xxx久久| 在线看不卡av| 成人做爰69片免费看网站| 免费在线看一区| 亚洲免费av高清| 久久精子c满五个校花| 91精品免费在线| 在线观看亚洲一区| 成人aa视频在线观看| 免费一级片91| 午夜免费欧美电影| 亚洲精品v日韩精品| 欧美韩日一区二区三区四区| 日韩美女在线视频| 777色狠狠一区二区三区| 在线一区二区观看| 91丨九色porny丨蝌蚪| 丁香啪啪综合成人亚洲小说| 精品一区二区三区在线播放视频| 亚洲 欧美综合在线网络| 亚洲在线视频免费观看| 亚洲精品视频一区二区| 国产精品久久精品日日| 国产精品网曝门| 中文字幕欧美激情| 中文字幕成人av| 国产日韩欧美一区二区三区乱码 | 91香蕉视频污在线| 97精品电影院| 色综合久久99| 99国产精品久久久久久久久久| 成人激情电影免费在线观看| 成人丝袜高跟foot| 波多野结衣91| 91啪九色porn原创视频在线观看| 99久久国产综合精品麻豆| 91美女蜜桃在线| 欧美三级乱人伦电影| 精品三级在线看| 国产亚洲综合在线| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美久久久久久蜜桃| 91精品国产色综合久久不卡蜜臀| 欧美一区二区三区不卡| 欧美成人一区二区三区| 久久久久久99精品| 中文字幕在线不卡| 亚洲国产日韩综合久久精品| 三级亚洲高清视频| 国产裸体歌舞团一区二区| 国产福利一区二区三区视频在线| 高清成人免费视频| 在线精品视频小说1| 日韩一级免费一区| 久久免费美女视频| 亚洲精品五月天| 蓝色福利精品导航| 不卡欧美aaaaa| 欧美日韩在线不卡| 久久亚洲一级片| 亚洲欧美电影一区二区| 水野朝阳av一区二区三区| 韩国女主播成人在线观看| 99精品视频在线观看免费| 在线视频亚洲一区| 精品99999| 亚洲综合偷拍欧美一区色| 久久精品99国产国产精| 成人黄色电影在线| 欧美一区二区免费观在线| 欧美国产乱子伦 | 亚洲国产日韩精品| 国产一区福利在线| 欧美性xxxxxxxx| 国产欧美一区在线| 日韩成人午夜精品| 91在线免费视频观看| 欧美成人video| 亚洲激情图片小说视频| 国产一区二区女| 欧美丰满美乳xxx高潮www| 国产精品免费av| 韩国v欧美v亚洲v日本v| 欧美视频完全免费看| 国产精品乱码一区二区三区软件 | 日日夜夜精品视频免费| 成人v精品蜜桃久久一区| 欧美videofree性高清杂交| 亚洲美女在线国产| 成人免费视频网站在线观看| 91麻豆精品国产91久久久久| 亚洲欧美成人一区二区三区| 大陆成人av片| 精品国产麻豆免费人成网站| 午夜久久久影院| 欧美最新大片在线看| 国产精品毛片大码女人| 91捆绑美女网站| 久久久久国产免费免费| 美女爽到高潮91| 欧美日韩视频在线第一区| 亚洲男人的天堂av| 99这里只有久久精品视频| 国产精品毛片久久久久久| 国产激情91久久精品导航|