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

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

?? diti.c

?? 這是單板上DPRAM的驅動程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* @(#) pSOSystem PowerPC/V2.2.2: drivers/diti.c 2.53 97/10/22 18:43:44  */
/***********************************************************************/
/*                                                                     */
/*   MODULE: diti.c                                                    */
/*   DATE:    97/10/22                                                 */
/*   PURPOSE: Device Independent Terminal Interface.                   */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*                                                                     */
/*           Copyright 1994 - 1996, 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 <types.h>
#include <psos.h>
#include <drv_intf.h>
#include <pna.h>
#include <gsblk.h>
#include <disi.h>
#include <diti.h>
#include <configs.h>
#include "bsp.h"
#include <bspfuncs.h>
#include <ctype.h>
#include <phile.h>

/*---------------------------------------------------------------------*/
/* Names of the semaphores used by the devices - "n" is replaced by a  */
/* decimal digit corresponding to the minor device number that the     */
/* semaphore is associated with.                                       */
/*---------------------------------------------------------------------*/
#define READ_NAME   "RDAn"  /* read access control */
#define WRITE_NAME  "WRAn"  /* write access control */
#define RXQUE_NAME  "RXQn"  /* receive que */
#define CANQUE_NAME "CNQn"  /* Canononical que */
#define TXCOMP_NAME "TXCn"  /* transmit complete */
#define IOCTL_NAME  "CTLn"  /* I/O control call complete */

#define bzero(pt,statlen) \
{ \
static int n; \
unsigned char *s; \
s = (unsigned char *)pt; \
  for(n=1;n<=statlen;n++) \
     *(s++)=0; \
}

typedef struct
    {
    ULONG lid;                       /* lower reference pointer */
    ULONG hdwflags;                  /* hardware flags returned by */
                                     /* lower driver */
    ULONG dflags;                    /* driver flags */
    ULONG rda_id;                    /* read access semaphore ID */
    ULONG wra_id;                    /* write access semaphore ID */
    ULONG rxq_id;                    /* receive queue ID */
    ULONG can_id;                    /* Canonical queue ID */
    ULONG txc_id;                    /* transmit complete semaphore ID */
    ULONG ctl_id;                    /* I/O control complete semaphore ID */
    mblk_t *rdmblk;                  /* pointer to current read */
                                     /* message block from recv queue */
    mblk_t *cnmblk;                  /* pointer to current read message */
                                     /* block from canonical queue */
    mblk_t *echo_mblk;               /* mblock pointer used for echo */
    mblk_t *rqhead;                  /* Head of the MBUF's in Recv Q */
    mblk_t *rqtail;                  /* Tail of the MBUF's in Recv Q */
    UCHAR *echo_rwprt;               /* place to save read/write pointer */
    ULONG rdbflg;                    /* bite wise status of RDMBLK */
    UCHAR LineMode;                  /* Sync/Async */
    UCHAR num_open;                  /* number of opens done */
    struct termio  termio;
    } ChanCfg;

/*---------------------------------------------------------------------*/
/* Baud rate table                                                     */
/*---------------------------------------------------------------------*/
const ULONG baud_table[] ={0,
                     50,
                     75,
                     110,
                     134,
                     150,
                     200,
                     300,
                     600,
                     1200,
                     1800,
                     2400,
                     4800,
                     9600,
                     19200,
                     38400};

/*---------------------------------------------------------------------*/
/* Values for DFLAGS.  (bit wise flags)                                */
/*---------------------------------------------------------------------*/
#define OPENED    0x1
#define CONNECTED 0x2
#define WAITING   0x4
#define ABORTED   0x8

/*---------------------------------------------------------------------*/
/* Characters of interest.                                             */
/*---------------------------------------------------------------------*/
#define CEOF   04       /* Control-d                                   */
#define CSTART 021      /* Control-q                                   */
#define CSTOP  023      /* Control-s                                   */
#define EOT    CEOF
#define BS     0x08
#define NL     0x0A     /* '\n'                                        */
#define CR     0x0D     /* '\r'                                        */
#define SPACE  0x20
#define XON    CSTART
#define XOFF   CSTOP

/*---------------------------------------------------------------------*/
/* Receive buffer size that will be passed to DISI                     */
/*---------------------------------------------------------------------*/
#define RBUFFSIZE 32

/*---------------------------------------------------------------------*/
/* Term_Init_Done used to check if TermInit has been done.             */
/*---------------------------------------------------------------------*/
unsigned long Term_Init_Done;

/*---------------------------------------------------------------------*/
/* This is the array of the data areas of each of the minor devices    */
/* present.                                                            */
/*---------------------------------------------------------------------*/
static ChanCfg DChanCfg[BSP_SERIAL + 1];

/*---------------------------------------------------------------------*/
/* SysConsole is the channel that is to be used a a console. If a      */
/* minor number of 0 is passed in to any of the DICI function calls    */
/* the actual channel number used will be SysConsole.                  */
/* In this way the user may select the channel to be used as standard  */
/* input and output.                                                   */
/* NOTE: SysConsole is set in sysinit to SC_APP_CONSOLE.               */
/*---------------------------------------------------------------------*/
extern int SysConsole;

/*---------------------------------------------------------------------*/
/* Prototypes of functions                                             */
/*---------------------------------------------------------------------*/
void term_dataind(Uid, mblk_t *, unsigned long);
void term_expind(Uid, unsigned long);
void term_datacnf(Uid, mblk_t *, unsigned long);
void term_ctlcnf(Uid, unsigned long);
ULONG opost(UCHAR *, mblk_t *, ULONG, USHORT);
static int doctl(Lid lid, unsigned long cmd,
             void *arg, struct ioparms *parms);

/*---------------------------------------------------------------------*/
/* FOREVER used for semaphores to indicate they should wait until      */
/* released                                                            */
/*---------------------------------------------------------------------*/
#define FOREVER 0

/*---------------------------------------------------------------------*/
/* anchor used to get number of ticks per second                       */
/*---------------------------------------------------------------------*/
extern NODE_CT *anchor;

/*---------------------------------------------------------------------*/
/* Pointer used to re-initialize the Serial Buffer pool.               */
/*---------------------------------------------------------------------*/
extern UCHAR *GSblkBase;

/*---------------------------------------------------------------------*/
/* Prototype for initialization of pMONT port.                         */
/*---------------------------------------------------------------------*/
void init_pmont_serial(struct ioparms *);

/***********************************************************************/
/*  StringCopy: Copy a character string                                */
/*                                                                     */
/*      INPUTS: destination = ptr to destination string                */
/*              source = ptr to source string                          */
/*                                                                     */
/***********************************************************************/
static void StringCopy(char *destination, char *source)
{
while (*destination++ = *source++);
}

/***********************************************************************/
/*     cleanup: Return all system resources because an error occurred  */
/*              during initialization.                                 */
/*                                                                     */
/*       INPUT: chancfg = pointer to channel's configuration           */
/*             parameters                                              */
/*        NOTE: This is called by TermOPEN() if an error occurs        */
/*              during open.                                           */
/***********************************************************************/
static void cleanup(ChanCfg *chancfg)
{
sm_delete(chancfg->rda_id);
sm_delete(chancfg->wra_id);
q_delete(chancfg->rxq_id);
q_delete(chancfg->can_id);
sm_delete(chancfg->txc_id);
sm_delete(chancfg->ctl_id);
SerialClose((Lid )chancfg->lid);
}

/***********************************************************************/
/* TermInit: initialize the Terminal Driver.                           */
/*                                                                     */
/*     NOTE(S): The initialization should only be done once per 'GS'.  */
/*              The IDLE task's Scratch Pad Registers are used to      */
/*              track if 'GS' has been done or not.                    */
/*                                                                     */
/***********************************************************************/
void TermInit (struct ioparms *parms)
{
int i, p, DoClose;
extern int NumNon_pSOSChan, Non_pSOSChan[];
ULONG rc, imask;
mblk_t *tmblk;

/*---------------------------------------------------------------------*/
/* Set elements of the ioparms structure to their default values.      */
/* used - will tell pSOS we're using stack interface                   */
/* out_retval - is used to pass additional error information to the    */
/*              user.                                                  */
/* err - will contain an error code (0 for success)                    */
/*---------------------------------------------------------------------*/
parms->used = 1;
parms->out_retval = 0;
parms->err = 0;

rc = ScratchPadTest(IDLE_TID, DRV_INIT_REG, DMAJOR(parms->in_dev));

if (rc == SP_BIT_SET)
    return;

if (rc != SP_BIT_NOT_SET)
    {
    parms->err = rc;
    return;
    }

if ((rc = ScratchPadSet(IDLE_TID, DRV_INIT_REG, DMAJOR(parms->in_dev)))
        != SP_OK)
    {
    parms->err = rc;
    return;
    }

/*---------------------------------------------------------------------*/
/* To insure that this driver is in sync with the lower driver on      */
/* warm starts, it must call the lower driver for all ports that it    */
/* thinks are open so that the lower driver can clean them up.         */
/*---------------------------------------------------------------------*/
for(i = 1; i < (BSP_SERIAL + 1); i++)
    {
    /*-----------------------------------------------------------------*/
    /* The driver does not want to close those ports that have been    */
    /* opened by a non pSOS element, such as pROBE. NumNon_pSOSPorts   */
    /* is a variable set during system initialization (before pSOS) to */
    /* the number of ports in the Non_pSOSPort list. Non_pSOSPort is a */
    /* list of non pSOS ports also created during system               */
    /* initialization.                                                 */
    /*-----------------------------------------------------------------*/
    DoClose = 1;
    for(p = 0; p < NumNon_pSOSChan; p++)
        {
        if(Non_pSOSChan[p] == i)
            {
            DoClose = 0;
            break;
            }
        }

    if(DoClose)
        if(DChanCfg[i].dflags & OPENED && DChanCfg[i].lid)
            SerialClose((Lid)(DChanCfg[i].lid));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区在线看| 国产精品一区二区在线观看网站| 91福利国产成人精品照片| 一区二区三区精品久久久| 欧美中文一区二区三区| 爽好多水快深点欧美视频| 精品成人免费观看| caoporn国产一区二区| 亚洲另类在线制服丝袜| 欧美日韩日日夜夜| 国产精品一区二区久久不卡| 亚洲天堂a在线| 欧美一区二区三区视频免费| 国产美女娇喘av呻吟久久| 国产精品三级电影| 精品污污网站免费看| 久久99国产精品久久| 亚洲欧美福利一区二区| 欧美成人性福生活免费看| 99v久久综合狠狠综合久久| 婷婷久久综合九色综合绿巨人| 久久精品亚洲精品国产欧美kt∨| a亚洲天堂av| 国内精品久久久久影院薰衣草 | 成人一区二区三区中文字幕| 亚洲免费观看视频| 久久亚洲二区三区| 337p亚洲精品色噜噜| 成人午夜又粗又硬又大| 捆绑调教一区二区三区| 亚洲三级在线免费观看| 国产亚洲精品bt天堂精选| 欧美另类一区二区三区| 91国产视频在线观看| 国产一区二区三区在线观看精品 | 久久av中文字幕片| 中文字幕视频一区二区三区久| 日本精品一区二区三区高清 | 欧美日韩在线播放一区| 成人av免费在线观看| 极品少妇一区二区三区精品视频 | 96av麻豆蜜桃一区二区| 国产精品综合二区| 国内一区二区在线| 久久99久久99精品免视看婷婷| 亚洲成在人线在线播放| 夜夜嗨av一区二区三区| 最近日韩中文字幕| 综合久久久久久| 亚洲免费电影在线| 樱桃国产成人精品视频| 亚洲欧洲精品一区二区三区| 亚洲国产成人在线| 1024精品合集| 亚洲一区在线观看免费观看电影高清| 亚洲欧美日韩国产成人精品影院| 国产精品色婷婷久久58| 国产精品国产三级国产aⅴ无密码| 国产精品嫩草99a| 1024成人网| 性久久久久久久久久久久| 天堂资源在线中文精品| 免费在线看成人av| 国产成人福利片| 色婷婷精品久久二区二区蜜臀av | 91女人视频在线观看| 欧美在线免费视屏| 精品久久人人做人人爽| 亚洲国产成人一区二区三区| 亚洲欧美激情一区二区| 日本成人在线电影网| 国产99精品国产| 欧美美女视频在线观看| 国产夜色精品一区二区av| 亚洲精品自拍动漫在线| 久久成人羞羞网站| 一本大道av伊人久久综合| 日韩一本二本av| 中文字幕亚洲区| 麻豆精品在线看| 91片在线免费观看| 精品福利一二区| 亚洲成人av福利| 成人综合在线网站| 日韩片之四级片| 亚洲一区二区三区影院| 成人中文字幕在线| 日韩欧美一级二级三级| 亚洲制服丝袜av| www.久久精品| 久久久国产精品午夜一区ai换脸| 亚洲福利视频一区| 91性感美女视频| 国产无遮挡一区二区三区毛片日本| 天天综合网 天天综合色| 色综合久久中文综合久久97| 久久精品一区二区| 激情伊人五月天久久综合| 欧美精三区欧美精三区| 亚洲国产你懂的| 日本高清免费不卡视频| 国产拍揄自揄精品视频麻豆| 另类成人小视频在线| 欧美一区二区三区免费| 日韩av在线免费观看不卡| 欧美日韩视频一区二区| 亚洲一区二区精品视频| 欧美日精品一区视频| 亚洲亚洲精品在线观看| 欧洲一区二区av| 亚洲福利电影网| 欧美理论片在线| 男女男精品网站| 久久综合九色综合97婷婷女人| 日本不卡中文字幕| 欧美mv日韩mv| 国产成人精品影视| 日韩码欧中文字| 欧美丝袜丝交足nylons图片| 亚洲成人免费在线观看| 欧美一区二区三区日韩视频| 狠狠色丁香九九婷婷综合五月| 久久久久久久久伊人| jlzzjlzz国产精品久久| 亚洲精品欧美激情| 欧美色精品天天在线观看视频| 五月综合激情婷婷六月色窝| 91麻豆精品国产91久久久久久久久| 麻豆91在线看| 中文字幕制服丝袜一区二区三区| 色婷婷综合激情| 精品一区二区三区免费毛片爱| 久久精品男人天堂av| 欧美性生活大片视频| 国产麻豆视频精品| 艳妇臀荡乳欲伦亚洲一区| 欧美一区日韩一区| 99精品视频在线播放观看| 偷拍日韩校园综合在线| 亚洲国产精品精华液ab| 欧美日韩国产一级| eeuss鲁一区二区三区| 人人超碰91尤物精品国产| 日韩美女视频19| 精品99一区二区| 欧美日韩一区视频| 成人午夜免费视频| 蜜桃精品视频在线| 亚洲午夜久久久久久久久电影网 | 99精品欧美一区二区蜜桃免费| 午夜精品久久久久久久久| 亚洲欧洲av另类| 国产偷国产偷精品高清尤物| 91精品蜜臀在线一区尤物| 色婷婷久久久综合中文字幕| 国产精品一卡二卡| 免费成人性网站| 三级亚洲高清视频| 一区二区三区中文在线观看| 中文字幕av一区二区三区免费看 | 欧美一级在线免费| 欧美日韩国产综合久久| 97久久精品人人爽人人爽蜜臀| 国产在线精品一区二区夜色| 午夜精品久久久久久不卡8050| ...xxx性欧美| 自拍偷在线精品自拍偷无码专区 | 91精品国产综合久久精品麻豆| 91免费观看视频在线| 成人app在线| 91视频观看视频| 日本高清视频一区二区| 欧美在线色视频| 在线成人av影院| 精品国精品国产| 久久美女高清视频| 国产日韩影视精品| 椎名由奈av一区二区三区| 日本一二三四高清不卡| 中文字幕中文字幕在线一区| 日韩一区在线看| 亚洲一区二区三区四区的| 热久久一区二区| 国产精品一二一区| 美女免费视频一区| 韩国欧美一区二区| 成人app软件下载大全免费| 色偷偷久久人人79超碰人人澡 | 一区二区三区中文字幕在线观看| 亚洲精品日产精品乱码不卡| 午夜免费欧美电影| 国内精品视频666| 日本电影欧美片| 欧美一级理论片| 国产精品国产三级国产aⅴ入口| 一级中文字幕一区二区| 精品一区二区三区免费视频| 91丝袜美女网| 精品日韩一区二区三区 | 亚洲高清免费观看|