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

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

?? sysserial.c

?? WINDRIVER SBC405 BSP
?? C
字號(hào):
/* sysSerial.c - IBM 405GP serial device initialization *//*******************************************************************************   This source and object code has been made available to you by IBM on an   AS-IS basis.   IT IS PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING THE WARRANTIES OF   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR OF NONINFRINGEMENT   OF THIRD PARTY RIGHTS.  IN NO EVENT SHALL IBM OR ITS LICENSORS BE LIABLE   FOR INCIDENTAL, CONSEQUENTIAL OR PUNITIVE DAMAGES.  IBM'S OR ITS LICENSOR'S   DAMAGES FOR ANY CAUSE OF ACTION, WHETHER IN CONTRACT OR IN TORT, AT LAW OR   AT EQUITY, SHALL BE LIMITED TO A MAXIMUM OF $1,000 PER LICENSE.  No license   under IBM patents or patent applications is to be implied by the copyright   license.   Any user of this software should understand that neither IBM nor its   licensors will be responsible for any consequences resulting from the use   of this software.   Any person who transfers this source code or any derivative work must   include the IBM copyright notice, this paragraph, and the preceding two   paragraphs in the transferred software.   Any person who transfers this object code or any derivative work must   include the IBM copyright notice in the transferred software.   COPYRIGHT   I B M   CORPORATION 2000   LICENSED MATERIAL  -  PROGRAM PROPERTY OF  I B M"*******************************************************************************//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01f,26jun02,mcg  Add CPU:UART divisor values for CPU speeds of 333 and 400MHz.                 Update divisor values for 266MHz.01e,11jan02,pch  merge in wrSbc405gp version of file, make common01d,19nov01,pch  cleanup01c,25may00,mcg  UART clock derived from CPU clock support added01b,15may00,mcg  register name updates to match 405GP User Manual01a,05mar99,mcg  created from Spruce sysSerial.c ver 01a*//*DESCRIPTIONThis library contains board-specific routines for serial devices.There are two serial ports integrated into the IBM 405GP.  Thesedevices are 16550-like. The evbNs16550Sio driver is used for both devices.*/#include "vxWorks.h"#include "config.h"#include "iv.h"#include "intLib.h"#include "sysLib.h"#include "drv/sio/evbNs16550Sio.h"/* device initialization structure */typedef struct    {    USHORT vector;    ULONG  baseAdrs;    USHORT regSpace;    USHORT intLevel;    } EVBNS16550_CHAN_PARAS;/* initialize the structure for each serial device */LOCAL EVBNS16550_CHAN_PARAS dev0Paras =      {0,UART0_BASE,UART_REG_ADDR_INTERVAL,INT_LVL_UART0};LOCAL EVBNS16550_CHAN_PARAS dev1Paras =      {0,UART1_BASE,UART_REG_ADDR_INTERVAL,INT_LVL_UART1};#define UART0_REG(reg)   (dev0Paras.baseAdrs + reg*dev0Paras.regSpace)#define UART1_REG(reg)   (dev1Paras.baseAdrs + reg*dev1Paras.regSpace)LOCAL EVBNS16550_CHAN  evbNs16550Chan0;LOCAL EVBNS16550_CHAN  evbNs16550Chan1;#ifndef UART_CLOCK_EXTERNAL/* forward declarations */STATUS sysSerialCalcDivisor(UINT freqProcMhz, UINT baudRate, UINT *divisor );/* Structure for internal serial clock array */typedef struct    {    UINT freqProcMhz;    UINT baudRate;    UINT uartClkDivisor;    } INT_SERIAL_INFO;/* * Table of CPU speeds and baud rates used to determine the CPU:UART divisor. * The CPU clock is divided by the CPU:UART divisor to get the UART clock which * is fed into the UARTs.  The UART clock is then divided again by the UART to * obtain the baud rate.  The table of CPU:UART divisors below helps to select * a value that will result in the lowest % error on the baud rate. * NOTE: * The CPU:UART divisor must be high enough so the resulting UART clock is * less than 1/2 of the OPB bus frequency. */INT_SERIAL_INFO uartClkTbl[] =    {      /* CPU Freq     Baud   CPU:UART divisor */        {  133,       1200,     15  },        {  133,       2400,     16  },        {  133,       4800,     28  },        {  133,       9600,     14  },        {  133,      19200,     14  },        {  133,      28800,     17  },        {  133,      33600,     31  },        {  133,      38400,     31  },        {  133,      57600,     29  },        {  133,     115200,     12  },        {  133,     307200,     27  },        {  200,       1200,     11  },        {  200,       2400,     28  },        {  200,       4800,     28  },        {  200,       9600,     14  },        {  200,      19200,     31  },        {  200,      28800,     31  },        {  200,      33600,     31  },        {  200,      38400,     25  },        {  200,      57600,     31  },        {  200,     115200,     12  },        {  200,     307200,     20  },        {  266,       1200,     19  },        {  266,       2400,     31  },        {  266,       4800,     28  },        {  266,       9600,     28  },        {  266,      19200,     28  },        {  266,      28800,     29  },        {  266,      33600,     31  },        {  266,      38400,     31  },        {  266,      57600,     29  },        {  266,     115200,     29  },        {  266,     307200,     27  },        {  333,       1200,     27  },        {  333,       2400,     31  },        {  333,       4800,     31  },        {  333,       9600,     31  },        {  333,      19200,     31  },        {  333,      28800,     29  },        {  333,      33600,     31  },        {  333,      38400,     17  },        {  333,      57600,     30  },        {  333,     115200,     30  },        {  333,     307200,     17  },        {  400,       1200,     22  },        {  400,       2400,     31  },        {  400,       4800,     31  },        {  400,       9600,     31  },        {  400,      19200,     31  },        {  400,      28800,     31  },        {  400,      33600,     31  },        {  400,      38400,     31  },        {  400,      57600,     31  },        {  400,     115200,     31  },        {  400,     307200,     27  }    };#endif /* UART_CLOCK_EXTERNAL *//************************************************************************* sysSerialHwInit - initialize the BSP serial devices to a quiescent state** This routine initializes the BSP serial device descriptors and puts the* devices in a quiescent state.  It is called from sysHwInit() with* interrupts locked.** RETURNS: N/A** SEE ALSO: sysHwInit()*/void sysSerialHwInit    (    void    )    {    UINT32 cr0;    #ifndef UART_CLOCK_EXTERNAL    UINT   clkDivisor;    #endif /* UART_CLOCK_EXTERNAL */    /*     * Disable and clear serial interrupts in the UIC for both UARTs     */    intDisable (INT_LVL_UART0);    intDisable (INT_LVL_UART1);    /*     * intialize serial device 0 descriptors (S0)     */    evbNs16550Chan0.int_vec = dev0Paras.vector;    evbNs16550Chan0.channelMode = 0;    evbNs16550Chan0.lcr  = UART0_REG(UART_LCR);    evbNs16550Chan0.data = UART0_REG(UART_RDR);    evbNs16550Chan0.brdl = UART0_REG(UART_BRDL);    evbNs16550Chan0.brdh = UART0_REG(UART_BRDH);    evbNs16550Chan0.ier  = UART0_REG(UART_IER);    evbNs16550Chan0.iid  = UART0_REG(UART_IID);    evbNs16550Chan0.mdc  = UART0_REG(UART_MDC);    evbNs16550Chan0.lst  = UART0_REG(UART_LST);    evbNs16550Chan0.msr  = UART0_REG(UART_MSR);    evbNs16550Chan0.outByte = sysOutByte;    evbNs16550Chan0.inByte  = sysInByte;    /*     * intialize serial device 1 descriptors (S1)     */    evbNs16550Chan1.int_vec = dev1Paras.vector;    evbNs16550Chan1.channelMode = 0;    evbNs16550Chan1.lcr  = UART1_REG(UART_LCR);    evbNs16550Chan1.data = UART1_REG(UART_RDR);    evbNs16550Chan1.brdl = UART1_REG(UART_BRDL);    evbNs16550Chan1.brdh = UART1_REG(UART_BRDH);    evbNs16550Chan1.ier  = UART1_REG(UART_IER);    evbNs16550Chan1.iid  = UART1_REG(UART_IID);    evbNs16550Chan1.mdc  = UART1_REG(UART_MDC);    evbNs16550Chan1.lst  = UART1_REG(UART_LST);    evbNs16550Chan1.msr  = UART1_REG(UART_MSR);    evbNs16550Chan1.outByte = sysOutByte;    evbNs16550Chan1.inByte  = sysInByte;    /*     * Set the the CPC0_CR0 register for internal or external UART clock source.     * Set UART1 to work in CTS/RTS mode by turning on the CTS enable bit     * in the Chip Control Reg 0 plus setting the DEFAULT_UART_1 control     * bit in the Walnut board's FPGA_BRDC register.  The FPGA routes the     * correct signal from the connector to the chip.  Other boards sharing     * this file (wrSbc405gp) may not implement FPGA_BRDC.     */#ifdef UART_CLOCK_EXTERNAL    cr0 = sysDcrCr0Get ();    sysDcrCr0Set (cr0 | CR0_UART1_CTS_EN                      | CR0_UART0_EXT_CLK | CR0_UART1_EXT_CLK);    evbNs16550Chan0.clkFreq = EXT_SER_CLK_FREQ;    evbNs16550Chan1.clkFreq = EXT_SER_CLK_FREQ;#else	/* UART_CLOCK_EXTERNAL */    /* CPU to UART clock divisor is determined and placed into CPC0_CR0 */    cr0 = sysDcrCr0Get ();    cr0 &= ~(CR0_UART_DIV_MASK | CR0_UART0_EXT_CLK | CR0_UART1_EXT_CLK );    sysSerialCalcDivisor (systemInfo.freqProcessor / 1000000,                          CONSOLE_BAUD_RATE,                          &clkDivisor);    sysDcrCr0Set (cr0 | CR0_UART1_CTS_EN | ((clkDivisor - 1) << 1));    evbNs16550Chan0.clkFreq = systemInfo.freqProcessor / clkDivisor;    evbNs16550Chan1.clkFreq = systemInfo.freqProcessor / clkDivisor;#endif /* UART_CLOCK_EXTERNAL */#if defined(FPGA_BRDC) && defined(FPGA_BRDC_DEF_UART1)    sysOutByte(FPGA_BRDC,(sysInByte(FPGA_BRDC) | FPGA_BRDC_DEF_UART1));#endif	/* FPGA_BRDC && FPGA_BRDC_DEF_UART1 */    /*     * reset both devices     */    evbNs16550HrdInit (&evbNs16550Chan0);    evbNs16550HrdInit (&evbNs16550Chan1);    }/************************************************************************* sysSerialHwInit2 - connect BSP serial device interrupts** This routine connects the BSP serial device interrupts.  It is called from* sysHwInit2().** Serial device interrupts cannot be connected in sysSerialHwInit() because* the kernel memory allocator is not initialized at that point, and* intConnect() calls malloc().** RETURNS: N/A** SEE ALSO: sysHwInit2()*/void sysSerialHwInit2    (    void    )    {    int intLevel = intLock ();    /*     * Connect serial interrupt handlers for S0 (UART 0)     * and enable serial interrupts for S0     */    (void) intConnect (INUM_TO_IVEC(INT_VEC_UART0), evbNs16550Int,                       (int) sysSerialChanGet(0));    intEnable (INT_LVL_UART0);    /*     * connect serial interrupt handlers for S1 (UART 1)     * and enable serial interrupts for S1     */    (void) intConnect (INUM_TO_IVEC(INT_VEC_UART1), evbNs16550Int,                       (int) sysSerialChanGet(1));    intEnable (INT_LVL_UART1);    intUnlock (intLevel);    }/************************************************************************* sysSerialChanGet - get the SIO_CHAN device associated with a serial channel** This routine returns a pointer to the SIO_CHAN device associated* with a specified serial channel.  It is called by usrRoot() to obtain* pointers when creating the system serial devices, `/tyCo/x'.  It* is also used by the WDB agent to locate its serial channel.** RETURNS: A pointer to the SIO_CHAN structure for the channel, or ERROR* if the channel is invalid.**/SIO_CHAN * sysSerialChanGet    (    int channel         /* serial channel */    )    {    switch (channel)        {        case 0:                                 /* S0 */            return ((SIO_CHAN *)&evbNs16550Chan0);        case 1:                                 /* S1 */            return ((SIO_CHAN *)&evbNs16550Chan1);        default:            return ((SIO_CHAN *)ERROR);        }    }#ifndef UART_CLOCK_EXTERNAL/************************************************************************* sysSerialCalcDivisor - determines CPU clock to UART clock divisor** This routine determines the optimal CPU clock to UART clock divisor for a* given CPU frequency and desired baud rate.  This function is required only* when the serial clock is being derived from the CPU clock.** RETURNS: The optimal CPU to UART clock divisor, or ERROR**/STATUS sysSerialCalcDivisor    (    UINT freqProcMhz,    UINT baudRate,    UINT *divisor    )    {    int numEntries;    int i;    numEntries = sizeof(uartClkTbl) / sizeof(INT_SERIAL_INFO);    /*     * Search the table of processor frequencies and Baud rates to determine     * the optimal divisor for the UART clock speed     */    for (i=0; i < numEntries; i++)        {        if ((uartClkTbl[i].freqProcMhz == freqProcMhz) &&            (uartClkTbl[i].baudRate == baudRate))            {            *divisor = uartClkTbl[i].uartClkDivisor;            break;            }        }    if (i == numEntries)             /* not found */        return(ERROR);    return(OK);    }#endif /* UART_CLOCK_EXTERNAL */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频在线观看一区二区| 亚洲色图在线播放| 亚洲午夜电影网| 国产成人在线影院| 91麻豆精品91久久久久久清纯| 中文字幕一区二区三区四区不卡| 蜜臀国产一区二区三区在线播放| 91在线视频免费观看| 精品不卡在线视频| 日韩极品在线观看| 在线视频国内自拍亚洲视频| 国产欧美日韩精品在线| 狠狠色狠狠色综合系列| 91精品国产综合久久福利软件| 国产精品传媒视频| 懂色一区二区三区免费观看| 亚洲精品一区二区三区四区高清| 日韩电影免费一区| 欧美高清dvd| 亚洲一区自拍偷拍| 在线免费观看一区| 亚洲欧美日韩电影| 99久久久无码国产精品| 国产人成一区二区三区影院| 国产主播一区二区| 精品国产乱码久久久久久夜甘婷婷| 天天操天天色综合| 欧美日韩激情在线| 亚洲午夜视频在线| 欧美色综合影院| 一区二区三区国产精品| 在线影视一区二区三区| 亚洲欧美日韩一区二区 | 另类小说视频一区二区| 欧美电影在线免费观看| 天堂在线亚洲视频| 欧美精品粉嫩高潮一区二区| 亚洲成人免费av| 欧美日韩不卡在线| 日韩电影网1区2区| 日韩精品资源二区在线| 精彩视频一区二区| 国产亚洲精品aa午夜观看| 国产一区二区三区av电影| 国产日韩欧美电影| 成人sese在线| 最近中文字幕一区二区三区| 91免费精品国自产拍在线不卡| 中文字幕一区av| 色综合中文综合网| 国产主播一区二区| 日本一区二区成人| 91在线国产观看| 玉米视频成人免费看| 欧美中文字幕一区二区三区亚洲| 亚洲va中文字幕| 日韩欧美资源站| 激情小说亚洲一区| 中文字幕不卡在线观看| 色丁香久综合在线久综合在线观看| 一区二区三区波多野结衣在线观看| 欧美片在线播放| 韩国欧美一区二区| 1000精品久久久久久久久| 在线看日韩精品电影| 青青草原综合久久大伊人精品| 精品精品欲导航| 成人激情免费电影网址| 亚洲免费高清视频在线| 欧美精品丝袜中出| 国产精品911| 亚洲免费在线电影| 欧美一区二区三区人| 国产一区二区免费看| 亚洲欧美中日韩| 欧美群妇大交群中文字幕| 国产美女av一区二区三区| 一区在线中文字幕| 欧美伦理视频网站| 国产成人综合视频| 亚洲国产精品一区二区久久 | 国产亚洲欧洲一区高清在线观看| 成人国产精品免费| 亚洲第一二三四区| 久久精品一区二区| 在线亚洲人成电影网站色www| 日本一区中文字幕| 中文字幕av免费专区久久| 欧美午夜不卡在线观看免费| 国产精品影音先锋| 亚洲宅男天堂在线观看无病毒| 日韩女优av电影| 一本大道av伊人久久综合| 免费视频最近日韩| 亚洲人成电影网站色mp4| 日韩欧美高清dvd碟片| av成人免费在线| 麻豆国产欧美一区二区三区| 中文字幕一区三区| 日韩欧美国产电影| 91视频在线观看免费| 精品嫩草影院久久| 色综合久久天天综合网| 国产在线精品一区二区| 亚洲18色成人| 国产精品免费av| 欧美揉bbbbb揉bbbbb| 亚洲最大的成人av| 肉肉av福利一精品导航| 国产亚洲欧美一区在线观看| 欧美酷刑日本凌虐凌虐| 99久久国产综合色|国产精品| 美女视频第一区二区三区免费观看网站| 中文字幕一区二区三区在线不卡 | 在线一区二区三区四区| 国产99精品国产| 蜜臀a∨国产成人精品| 亚洲色图色小说| 污片在线观看一区二区| 中文字幕电影一区| ww亚洲ww在线观看国产| 欧美日韩精品三区| 色婷婷精品久久二区二区蜜臂av| 国内精品自线一区二区三区视频| 首页国产欧美久久| 一区二区视频免费在线观看| 中文字幕av一区二区三区| 欧美大黄免费观看| 激情成人午夜视频| 亚洲视频资源在线| 欧美日本不卡视频| 色屁屁一区二区| 成人av网址在线观看| 国产精品一区二区在线播放| 蜜桃av一区二区三区电影| 亚洲h精品动漫在线观看| 亚洲欧美日韩国产另类专区| 久久这里只有精品视频网| 成人精品鲁一区一区二区| 日韩免费视频一区| 91亚洲国产成人精品一区二区三| 蜜臀va亚洲va欧美va天堂| 婷婷国产在线综合| 亚洲一区二区在线免费观看视频| 久久精品亚洲国产奇米99| 久久一区二区视频| 精品粉嫩aⅴ一区二区三区四区| 91精品免费在线观看| 日本精品一区二区三区四区的功能| eeuss影院一区二区三区| 国产成人在线免费| 国产99久久久国产精品免费看| 国产成人免费av在线| 国产成人精品影视| 成人在线视频一区| 成熟亚洲日本毛茸茸凸凹| 成人美女在线观看| av不卡在线播放| 97成人超碰视| 色噜噜狠狠一区二区三区果冻| 在线观看视频一区| 欧美日韩国产小视频在线观看| 欧美福利一区二区| 日韩一二三四区| 久久久午夜精品理论片中文字幕| 国产香蕉久久精品综合网| 国产精品久久综合| 一区二区三区中文字幕| 婷婷综合五月天| 免费观看成人av| 国产一区二区三区免费在线观看| 国产精品一品二品| 成人av免费观看| 日本韩国欧美一区二区三区| 欧美日韩国产综合视频在线观看 | 欧美日韩黄色一区二区| 制服丝袜成人动漫| 日韩精品中文字幕在线不卡尤物| 久久精品一区蜜桃臀影院| 国产精品久久久久久久久图文区| 亚洲日本丝袜连裤袜办公室| 亚洲成人精品影院| 激情伊人五月天久久综合| 成人午夜电影网站| 欧美影片第一页| 精品免费国产一区二区三区四区| 欧美国产97人人爽人人喊| 亚洲综合久久久久| 美女爽到高潮91| 成人福利在线看| 欧美视频一区二区三区在线观看| 欧美色电影在线| 久久久久久久久99精品| 1区2区3区精品视频| 天天色 色综合| 国产91富婆露脸刺激对白| 91久久精品一区二区三| 欧美一级午夜免费电影| 亚洲国产经典视频| 亚洲风情在线资源站|