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

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

?? smc8xx.c

?? 這是單板上DPRAM的驅(qū)動程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* @(#) pSOSystem PowerPC/V2.2.2: bsps/devices/serial/smc8xx.c  2.15 97/09/12 13:40:00 */
/***********************************************************************/
/*                                                                     */
/*   MODULE:  bsps/devices/serial/smc8xx.c                             */
/*   DATE:    97/09/12                                                      */
/*   PURPOSE: MPC8xx SMC driver using DISI interface                   */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*                                                                     */
/*           Copyright 1991 - 1997, Integrated Systems, Inc.           */
/*                      ALL RIGHTS RESERVED                            */
/*                                                                     */
/*   Permission is hereby granted to licensees of Integrated Systems,  */
/*   Inc. products to use or abstract this computer program for the    */
/*   sole purpose of implementing a product based on Integrated        */
/*   Systems, Inc. products.   No other rights to reproduce, use,      */
/*   or disseminate this computer program, whether in part or in       */
/*   whole, are granted.                                               */
/*                                                                     */
/*   Integrated Systems, Inc. makes no representation or warranties    */
/*   with respect to the performance of this computer program, and     */
/*   specifically disclaims any responsibility for any damages,        */
/*   special or consequential, connected with the use of this program. */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*                                                                     */
/***********************************************************************/
#include <psos.h>
#include <pna.h>
#include <gsblk.h>
#include <disi.h>
#include <icontrol/mpc8xx.h>
#include "board.h"
#include <bsp.h>
#include <bspfuncs.h>
#include <serial/smc8xx.h>

#ifndef CPM_CMD
#define SPLX(A) { unsigned long ilev=splx(1); A; splx(ilev); }
#define CPM_CMD(t) {\
    unsigned long old=splx(1);    \
    while ((S_CP_CommandReg& SEMAPHORE_FLAG) == SEMAPHORE_FLAG);  \
    S_CP_CommandReg =t|SEMAPHORE_FLAG;  \
    splx(old);  \
    while ((S_CP_CommandReg& SEMAPHORE_FLAG) == SEMAPHORE_FLAG);  }
#endif

/*---------------------------------------------------------------------*/
/* If there is more than one serial driver for the BSP, the drivers    */
/* are multiplexed using the ser_mplx.c code and must have different   */
/* names for the DISI entry points. The names are changed so that the  */
/* Serial prefix is replaced with a chip specific specifier.           */
/*---------------------------------------------------------------------*/

#ifndef BSP_NUM_SER_DRVRS
#define BSP_NUM_SER_DRVRS 1
#endif

#if BSP_NUM_SER_DRVRS > 1
extern const SERIAL_FUNCS SerialFuncs[BSP_NUM_SER_DRVRS];
extern SDRVCNFG SDrvCnfg[BSP_SERIAL+1];
#endif

#if BSP_NUM_SER_DRVRS < 2
#define smc8xx_Init  SerialInit
#define smc8xx_Open  SerialOpen
#define smc8xx_Send  SerialSend
#define smc8xx_Close SerialClose
#define smc8xx_Ioctl SerialIoctl
#endif

/***********************************************************************/
/* Conditional Compile Time Constants                                  */
/***********************************************************************/
/*---------------------------------------------------------------------*/
/* Function prototypes                                                 */
/*---------------------------------------------------------------------*/
void smc8xx_Init();
static int  validate_config(ChannelCfg *);
static int  online(chan_control *, UINT);
static int  offline(chan_control *);
static void bzero(void *, UINT);
static void stop(chan_control *);
static int  init_param(chan_control *);
static int  init_regs(chan_control *);
static int  init_uart(chan_control *);
static void enable_interrupts(UINT, UINT);
static void disable_interrupts(UINT, UINT);
static void init_rxring(chan_control *);
static void init_txring(chan_control *);
static void flush_rxring(chan_control *);
static void flush_txring(chan_control *);
static void replenish_desc(chan_control *);
static void drop_buffer(chan_control *);
static ULONG smc_isr(chan_control *);
static void error_poll(chan_control *);
static void flush_backup(chan_control *);
static mblk_t  *BufJoin (mblk_t *, mblk_t *);
static void    BufAdjust(mblk_t *, UINT);
static UINT    BufSize  (mblk_t *);
static mblk_t *frame_receive(chan_control *, UINT *);
static int  frame_transmit(chan_control *, mblk_t *, UINT);
static int  hardware_transmit(chan_control *, mblk_t *);
static void buffer_done(chan_control *);
static void service_queue(chan_control *);
static void queue_toseq(chan_control *, UCHAR);
static void poll_toseq(chan_control *);
static int  allocate_brg(UINT, UINT, UINT);
static void issue_command(UINT, USHORT);
static int  canon_change_only(ChannelCfg *cur_cfg, ChannelCfg *new_cfg);
static void init_uart_RAM_param(chan_control *chan);


/*---------------------------------------------------------------------*/
/* Allocation functions to allocate dual ported ram for Buffer         */
/* descriptors.                                                        */
/*---------------------------------------------------------------------*/
extern ULONG BspCpuClkRate(void);
extern void dpram_init(void);
extern UCHAR *dpram_alloc(UINT, UINT);
extern void dpram_dealloc(UINT, UCHAR *, UINT);
extern UINT AllocBrg[];
extern UINT SmcNum[];

extern int NumNon_pSOSChan;
extern int Non_pSOSChan[];
extern int ProbeCon;

/*---------------------------------------------------------------------*/
/* GLOBAL STATIC DATA                                                  */
/*---------------------------------------------------------------------*/
static int SerialDriverInit;             /* driver not yet initialized */

/*---------------------------------------------------------------------*/
/* This is the closure dereference enable vector.  Bits in this vector */
/* are referenced in the SCLOSENOFREE macro, so that other components  */
/* may safely zero memory allocation pool and not worry about leaks    */
/* while closing serial channels.                                      */
/*---------------------------------------------------------------------*/
static int closevec;
static int serial_break_detected;

/*---------------------------------------------------------------------*/
/* control structure declaration                                       */
/*---------------------------------------------------------------------*/
chan_control channels[MAX_SMC];     /* one ctl struct per SMC */
#ifdef USE_UNCACHE_SECTION
#pragma use_section UNCACHE channels
#endif

/***********************************************************************/
/* init_rxring:                                                        */
/*              This routine clears the rcv descriptor ring. All       */
/*              descriptors are marked for the CPU by clearing         */
/*              the EMPTY bit.  The receiver should be stopped before  */
/*              this routine is executed.                              */
/*                                                                     */
/*      INPUTS:                                                        */
/*              chan pointer to the structure that contains channel    */
/*                   information                                       */
/*                                                                     */
/***********************************************************************/
static void
init_rxring(chan_control *chan)
{
    BuffDescType  *ring;          /* descriptor entry pointer */

 /*---------------------------------------------------------------------*/
/* Init all ring structure pointers                                    */
/*---------------------------------------------------------------------*/
    ring = chan->rxrg_ep = chan->rxrg_wr = chan->rxrg_rd = chan->rxrg_top;
    chan->rxrg_bottom = chan->rxrg_top + chan->MaxBuffers -1;
    chan->unused_rx   = 0;

/*---------------------------------------------------------------------*/
/* Clear all descriptor buffer pointers and flags bits (except the     */
/* WRAP bit on the last entry).                                        */
/*---------------------------------------------------------------------*/
    _sync_io();
    while (ring != chan->rxrg_bottom)
        {
        ring->address = (void *)0;
        ring->length = 0;
        ring->status  = 0;
        ring++;
        _sync_io();
        }

    chan->rxrg_bottom->address = (void *)0;
    chan->rxrg_bottom->length = 0;
    chan->rxrg_bottom->status  = SMC_TX_WRAP;
    _sync_io();
}

/***********************************************************************/
/* init_txring:                                                        */
/*              This routine clears the transmit descriptor ring.      */
/*              All descriptors are marked for the CPU by clearing     */
/*              the READY bit.  The transmitter should be stopped      */
/*              before this routine is executed.                       */
/*                                                                     */
/*      INPUTS:                                                        */
/*              chan pointer to the structure that contains channel    */
/*                   information                                       */
/*                                                                     */
/***********************************************************************/
static void
init_txring(chan_control *chan)
{
    BuffDescType  *ring;      /* descriptor entry pointer */

/*---------------------------------------------------------------------*/
/* Init all ring structure pointers.                                   */
/*---------------------------------------------------------------------*/
    ring = chan->txrg_wr = chan->txrg_rd = chan->txrg_top;
    chan->txrg_bottom = chan->txrg_top + (chan->MaxBuffers -1);
    chan->unused_tx   = chan->MaxBuffers;

/*---------------------------------------------------------------------*/
/* Clear all descriptor buffer pointers and status bits (except the    */
/* WRAP bit on the last entry).                                        */
/*---------------------------------------------------------------------*/
    _sync_io();
    while (ring != chan->txrg_bottom)
        {
        ring->address = (void *)0;
        ring->length = 0;
        ring->status  = 0;
        ring++;
        _sync_io();
   }

    chan->txrg_bottom->address = (void *)0;
    chan->txrg_bottom->length = 0;
    chan->txrg_bottom->status  = SMC_TX_WRAP;
    _sync_io();
}

/***********************************************************************/
/* flush_rxring:                                                       */
/*               This routine flushes the receive descriptor ring by   */
/*               returning all buffers to the free pool.  The          */
/*               receiver should be stopped before this routine is     */
/*               executed.                                             */
/*                                                                     */
/*      INPUTS:                                                        */
/*              chan pointer to the structure that contains channel    */
/*                   information                                       */
/*                                                                     */
/***********************************************************************/
static void
flush_rxring(chan_control *chan)
{
    BuffDescType *ring;      /* pointer to rx descriptor ring */
    mblk_t       *buffer;    /* actual buffer structure */
    ULONG         imask;     /* slpx saved level */

/*---------------------------------------------------------------------*/
/* Get current read pointer to descriptor ring.                        */
/*---------------------------------------------------------------------*/
    ring = chan->rxrg_rd;

/*---------------------------------------------------------------------*/
/* Delete everything from the receive descriptor ring and              */
/* return buffers to free pool.                                        */
/* Go through the ring until a null buffer pointer is found.           */
/*---------------------------------------------------------------------*/
while (ring->address != (void *)0)
    {
    /*-----------------------------------------------------------------*/
    /* Clear the Buffer Descriptor data pointer and data length.       */
    /*-----------------------------------------------------------------*/
    ring->address = (void *)0;
    ring->length = 0;

    /*-----------------------------------------------------------------*/
    /* The rx_queue contains a list of actual mblk_t structures,       */
    /* it operates in parallel to the receive ring.                    */
    /* The macro BufListRxRemove will remove the first mblk_t          */
    /* structure from the rx_queue and return the pointer that         */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久影院| 国产日韩成人精品| 国产69精品一区二区亚洲孕妇| 亚洲狠狠丁香婷婷综合久久久| 久久伊人蜜桃av一区二区| 欧美色欧美亚洲另类二区| 国产成人亚洲综合a∨婷婷| 视频一区二区国产| 专区另类欧美日韩| 久久久www成人免费毛片麻豆| 欧美丰满少妇xxxbbb| 99精品视频一区二区| 国产精品资源在线观看| 麻豆精品一区二区三区| 亚洲va韩国va欧美va| 亚洲视频免费在线观看| 久久久亚洲综合| 精品国产乱码久久久久久图片| 欧美色老头old∨ideo| 91色porny| 丁香啪啪综合成人亚洲小说| 久久成人免费电影| 亚洲图片自拍偷拍| 亚洲精品成人在线| 樱桃国产成人精品视频| ...xxx性欧美| 国产精品亲子伦对白| 久久久.com| 国产亚洲精品福利| ww亚洲ww在线观看国产| 日韩免费福利电影在线观看| 欧美日韩亚洲国产综合| 欧美性xxxxxxxx| 欧美日韩中文字幕一区| 在线观看区一区二| 欧美老人xxxx18| 在线观看国产91| 91黄色免费看| 欧美午夜在线观看| 欧美日韩精品电影| 91精品国产欧美日韩| 欧美一区二区精美| 日韩欧美精品在线| 精品精品国产高清a毛片牛牛| 日韩欧美一区在线| 精品国产成人系列| 国产日韩欧美电影| 1000精品久久久久久久久| 亚洲三级理论片| 亚洲男人的天堂av| 亚洲国产精品久久久男人的天堂| 同产精品九九九| 日本va欧美va瓶| 国产一本一道久久香蕉| zzijzzij亚洲日本少妇熟睡| 99久久精品免费看| 欧美亚洲尤物久久| 欧美大片免费久久精品三p| 精品国精品自拍自在线| 国产欧美日本一区二区三区| 中文av字幕一区| 亚洲精品国产精品乱码不99| 婷婷丁香激情综合| 久99久精品视频免费观看| 国产精品一区二区三区网站| 99热99精品| 欧美男女性生活在线直播观看| 337p亚洲精品色噜噜噜| 久久精品亚洲麻豆av一区二区| 国产精品嫩草影院av蜜臀| 亚洲制服丝袜在线| 激情文学综合网| 99久久精品国产观看| 欧美精品久久99| 久久久久久久综合色一本| 亚洲视频一二三区| 开心九九激情九九欧美日韩精美视频电影 | 男男视频亚洲欧美| 国产成人在线免费观看| 在线观看日产精品| 26uuu国产日韩综合| 亚洲精品国久久99热| 久久国产视频网| 91亚洲午夜精品久久久久久| 日韩欧美国产高清| 最新中文字幕一区二区三区| 日本在线不卡视频一二三区| 成人黄色电影在线| 日韩一区二区视频在线观看| 国产精品三级视频| 日韩va欧美va亚洲va久久| 成人爱爱电影网址| 日韩午夜av电影| 肉肉av福利一精品导航| 成人午夜av影视| 69堂国产成人免费视频| 一区在线观看视频| 国内一区二区视频| 欧美日韩一二三| 国产精品国产自产拍高清av王其| 欧美aaaaaa午夜精品| 色乱码一区二区三区88| 久久九九久久九九| 婷婷国产v国产偷v亚洲高清| 色狠狠桃花综合| 国产午夜精品久久久久久久| 日韩国产高清在线| 欧美专区亚洲专区| 国产精品欧美精品| 久久成人免费日本黄色| 91麻豆精品国产无毒不卡在线观看| 国产精品高清亚洲| 国产一区二区福利| 欧美成人女星排名| 日韩精品一级二级| 在线观看亚洲一区| 国产精品久久久久aaaa| 国产一区二区视频在线| 日韩一区二区三区视频在线| 亚洲第一成人在线| 色先锋资源久久综合| 中文字幕 久热精品 视频在线| 精品一区二区三区免费播放| 在线观看91av| 视频在线观看91| 欧美精品自拍偷拍| 亚洲国产综合色| 欧美亚洲免费在线一区| 一区二区视频在线| 色94色欧美sute亚洲13| 一区二区三区日韩欧美精品| 色婷婷av一区| 亚洲综合在线视频| 在线观看91视频| 亚洲一区二区欧美| 欧美日韩一区二区三区在线| 香蕉影视欧美成人| 欧美日本一区二区| 日韩影院精彩在线| 91精品国产麻豆国产自产在线 | 亚洲三级免费电影| 91国内精品野花午夜精品| 亚洲激情在线激情| 在线免费观看日本欧美| 亚洲电影一区二区三区| 欧美精品在线观看一区二区| 三级影片在线观看欧美日韩一区二区| 欧美丰满美乳xxx高潮www| 日韩电影在线观看一区| 精品久久人人做人人爰| 成人性生交大片免费| 亚洲三级久久久| 精品视频一区二区三区免费| 日韩av不卡一区二区| 欧美大片一区二区| 成人午夜在线视频| 亚洲精品国产第一综合99久久| 欧洲日韩一区二区三区| 青青草原综合久久大伊人精品优势| 精品三级在线看| 不卡一卡二卡三乱码免费网站| 一区二区三区中文免费| 欧美一区二区三区在线观看| 国产麻豆视频精品| 亚洲女人小视频在线观看| 欧美久久婷婷综合色| 国产美女精品人人做人人爽| 亚洲欧美一区二区三区国产精品 | 亚洲欧洲精品成人久久奇米网| 色婷婷久久久亚洲一区二区三区| 天天操天天综合网| 久久婷婷综合激情| 日本乱码高清不卡字幕| 美腿丝袜亚洲一区| 欧美国产精品中文字幕| 色成年激情久久综合| 视频在线在亚洲| 国产精品第五页| 欧美一级在线观看| 国产一区二区免费视频| 一区二区三区在线视频免费观看| 欧美一区二区三级| 国产精品一二三四| 亚洲国产精品久久人人爱蜜臀| 欧美一区二区播放| 色综合久久88色综合天天免费| 精品一区免费av| 亚洲精品国产精华液| 久久精品综合网| 欧美午夜寂寞影院| 成人性生交大合| 精品亚洲成a人在线观看| 国产精品久久久久毛片软件| 欧美电视剧在线观看完整版| 国产中文字幕精品| 亚洲国产另类精品专区| 国产精品美女一区二区| 91精品国产综合久久久蜜臀图片| 99久久国产综合精品色伊| 国产精品护士白丝一区av|