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

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

?? diti.c

?? 這是單板上DPRAM的驅(qū)動(dòng)程序
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
/* @(#) 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));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩视频第一区| 久久午夜色播影院免费高清| 国产乱国产乱300精品| 亚洲精品免费看| 亚洲成人一区二区在线观看| 久久精品人人做人人综合| 欧美性欧美巨大黑白大战| 国产999精品久久| 亚洲不卡av一区二区三区| 国产精品成人免费在线| 久久丝袜美腿综合| 91麻豆精品国产91久久久久久| 成人av网址在线| 国产福利一区二区三区视频 | 一级精品视频在线观看宜春院| 精品入口麻豆88视频| 欧美影视一区二区三区| av综合在线播放| 丰满放荡岳乱妇91ww| 国产精品一卡二卡| 久久国产精品露脸对白| 婷婷开心激情综合| 亚洲自拍与偷拍| 亚洲人成在线观看一区二区| 国产人久久人人人人爽| 久久久久国色av免费看影院| 日韩欧美一区二区久久婷婷| 91精品欧美综合在线观看最新| 在线看不卡av| 欧美视频日韩视频在线观看| 在线观看不卡视频| 欧美少妇bbb| 欧美日韩免费在线视频| 欧美三级在线看| 欧美三级电影网| 欧美日韩精品一区二区在线播放| 在线视频欧美区| 欧洲中文字幕精品| 欧美日韩成人激情| 91麻豆精品91久久久久久清纯| 欧美日韩一区三区四区| 欧美日韩在线综合| 欧美男生操女生| 欧美一区二区视频在线观看2020| 欧美福利一区二区| 91精品国产综合久久精品麻豆| 欧美美女直播网站| 日韩三级视频中文字幕| 日韩精品在线看片z| 久久久99免费| 国产精品国产三级国产普通话99| 国产精品久久久一区麻豆最新章节| 国产精品素人一区二区| 自拍偷在线精品自拍偷无码专区 | 日韩成人免费电影| 蜜臀91精品一区二区三区| 久久99精品久久只有精品| 国产一区二区毛片| 欧美一级黄色片| 26uuu欧美| 1024国产精品| 亚洲一二三四久久| 日韩av不卡在线观看| 久久精品国产99国产精品| 国产一区 二区 三区一级| 成人av集中营| 欧美日韩视频在线第一区| 欧美一区二区三区思思人| 久久久亚洲高清| 亚洲视频一区在线| 日本不卡在线视频| 国产91丝袜在线18| 91激情五月电影| 欧美大胆人体bbbb| 亚洲人成伊人成综合网小说| 三级成人在线视频| 国产精品一二三四区| 色综合天天天天做夜夜夜夜做| 欧美日韩国产高清一区二区三区 | 免费观看30秒视频久久| 国产69精品久久99不卡| 91日韩在线专区| 日韩欧美国产精品| 日韩美女视频一区二区| 人禽交欧美网站| 99r精品视频| 精品国产一区久久| 一区二区三区中文在线观看| 久久国产精品99久久人人澡| 91麻豆高清视频| 欧美tickling网站挠脚心| 亚洲视频一二三| 国产精品一二二区| 精品视频资源站| 欧美激情综合在线| 日本va欧美va欧美va精品| 成人h版在线观看| 日韩精品一区二区三区四区视频| 麻豆精品国产传媒mv男同| 99re热视频精品| 久久嫩草精品久久久精品| 亚洲福利视频一区| 国产福利一区二区三区视频| 3d成人h动漫网站入口| 亚洲欧美在线视频观看| 精彩视频一区二区| 欧美老肥妇做.爰bbww| 亚洲日本一区二区三区| 国产激情精品久久久第一区二区| 91精品国产综合久久蜜臀| 亚洲综合色噜噜狠狠| 国产成人8x视频一区二区| 精品免费视频.| 日韩av一区二区在线影视| 欧美系列日韩一区| 日韩毛片一二三区| 成人教育av在线| 国产亚洲精品资源在线26u| 秋霞午夜av一区二区三区| 欧美三区免费完整视频在线观看| 最新国产精品久久精品| 成人丝袜视频网| 久久久久久久久久久久久夜| 蜜臀久久久久久久| 91麻豆精品国产91久久久久久久久| 一区二区三区中文字幕| 一本到不卡免费一区二区| 亚洲天堂免费看| 99久久久无码国产精品| 欧美国产日韩一二三区| 国产成人午夜视频| 久久久久久日产精品| 国产一区999| 欧美激情中文不卡| 国产成人高清视频| 中文无字幕一区二区三区| 国产成人精品影视| 国产精品狼人久久影院观看方式| 国产99久久精品| 中文字幕亚洲精品在线观看| 成人美女在线观看| 亚洲日本中文字幕区| 欧美中文字幕亚洲一区二区va在线| 一卡二卡三卡日韩欧美| 欧美日韩一区高清| 蜜桃视频一区二区三区 | 久久这里只有精品视频网| 黑人精品欧美一区二区蜜桃| 精品国内二区三区| 粉嫩欧美一区二区三区高清影视 | 2024国产精品| 国产一区二区三区精品视频| 中文欧美字幕免费| 一本色道久久综合亚洲aⅴ蜜桃| 一区二区日韩电影| 91.xcao| 久国产精品韩国三级视频| 国产欧美精品日韩区二区麻豆天美| 成人精品免费看| 亚洲一区二区黄色| 欧美大片在线观看一区| 成人国产在线观看| 亚洲线精品一区二区三区| 日韩一级片网址| 国产成人小视频| 一区二区三区四区亚洲| 欧美一区二区三区思思人| 国产**成人网毛片九色| 亚洲国产精品一区二区www | 欧美一区二区三区爱爱| 国产在线播放一区二区三区| 亚洲欧洲色图综合| 欧美放荡的少妇| 国产成人午夜片在线观看高清观看| 一区二区三区中文字幕| 精品美女一区二区| 91一区二区三区在线播放| 日韩精品一级二级| 中文欧美字幕免费| 欧美日韩国产经典色站一区二区三区| 国产一区二区成人久久免费影院| 亚洲欧洲一区二区三区| 日韩精品最新网址| 91视频精品在这里| 久久爱www久久做| 亚洲天天做日日做天天谢日日欢| 日韩欧美中文字幕精品| 99视频在线精品| 精品一区二区三区在线视频| 亚洲猫色日本管| 久久久.com| 欧美一级免费观看| 色偷偷一区二区三区| 国产精品88av| 日韩av电影天堂| 亚洲在线成人精品| 国产精品国模大尺度视频| 日韩欧美亚洲一区二区| 一本一本大道香蕉久在线精品| 国产中文字幕精品|