⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssi.x

📁 中国石油二期加油站IC系统后台通讯软件
💻 X
📖 第 1 页 / 共 4 页
字号:
        SBuf *fwd;                     /* forward */
    } SChn;

/* static chain (4b ALIGNED)*/

/* buffer queue (4b ALIGNED) */

/* queue (4b ALIGNED) */

    struct ss_queue                   /* queue - typdef'd earlier */
    {
        DChn dChn;                     /* dynamic chain */
        QLen crntSize;                 /* current size */
    };

    typedef struct ss_dat             /* data buffer */
    {
        MsgLen strtIdx;                /* start index */
        MsgLen endIdx;                 /* end index */
        MsgLen size;                   /* size */
        Pool pool;                     /* pool id */
        U8 spare;                      /* spare */
        Data *data;                    /* data */
    } Dat;

    typedef struct ss_msg             /* message buffer */
    {
        Queue bufQ;                    /* buffer queue */
        Buffer *nxtDBuf;               /* next DBuf */
        MsgLen msgLen;                 /* message length */
        Pool pool;                     /* pool id */
        U8 spare;                      /* spare */
    } Msg;

/* buffer - typedef'd earlier */

    struct ss_buffer                  /* buffer - typedef'd earlier */
    {
        DChn dChn;                     /* dynamic chain */
        S8 bufType;                    /* buffer type */
        U8 spare1;                     /* spare for alignment */
        U16 spare2;                    /* spare for alignment */
        union
        {
            Dat dat;                    /* data buffer */
            Msg msg;                    /* message buffer */
        } t;
    };

/* static buffer - typedef'd earlier */

    struct sBuf
    {
        SChn sChn;                     /* static chain */
        Size size;                     /* size */
        S8 bufType;                    /* buffer type */
        U8 spare1;                     /* spare 1 */
        U16 spare2;                    /* spare 2 */
    };

    typedef S32 MtRwLockId;
    typedef S32 MtSemaId;
    typedef S32 MtCondId;
    typedef S32 MtMtxId;
    typedef S32 MtThrdId;
    typedef S32 MtThrdFlags;
    typedef S32 MtThrdPrior;

    typedef Void *(MtThrd) ARGS((Void *)); 

#else  /* not MT */
#ifdef PORTVER

/* portable typedefs, structures and prototypes */

/* forward definitions */

#ifndef CMFILE_REORG_1
    typedef struct ss_buffer Buffer;  /* forward definition - buffer */
#endif

    typedef struct ss_queue Queue;       /* forward definition - queue */

/* queue - typdef'd earlier */

    struct ss_queue                   /* queue - typdef'd earlier */
    {
        S16 dummy;                     /* dummy placeholder */
    };

/* buffer - typedef'd earlier */

    struct ss_buffer                  /* buffer - typedef'd earlier */
    {
        S16 dummy;                     /* dummy placeholder */
    };

#else  /* not PORTVER */
#ifdef SS                        /* Common System Services */

/* for SGetOpt() */
    EXTERN  S16 msOptInd;
    EXTERN  S8  *msOptArg;
    EXTERN  Txt **msArgv;
    EXTERN  S16 msArgc;

/* task related stuff */
    typedef U8  SSTskId;             /* System Task Id */
    typedef S32 SSTskPrior;          /* System Task Priority */

#ifndef CMFILE_REORG_1

/* Buffer type is necessary */
    typedef struct ssmsgb Buffer;

#endif /* CMFILE_REORG_1 */

/* message block */
    struct ssmsgb
    {
        struct ssmsgb        *b_next;     /* next message */
        struct ssmsgb        *b_prev;     /* previous message */
        struct ssmsgb        *b_cont;     /* next message block */
        U8                   *b_rptr;     /* 1st unread data byte of buffer */
        U8                   *b_wptr;     /* 1st unwritten data byte of buffer */
        struct ssdatab       *b_datap;    /* pointer to data block */
    };

/* Queue data structure */
    typedef struct ssQueue
    {
        Buffer *head;                     /* head of queue */
        Buffer *tail;                     /* tail of queue */
        QLen   crntSize;                  /* current szie of queue */

    } Queue;


/* Memory CTL operations structure */
    typedef struct sMemCtl
    {
        U8 op;                           /* operation */

        union
        {
            struct
            {
                Data *vaddr;               /* virtual address */
                Data **paddr;              /* physical address */
            } vtop;

            struct
            {
                Size size;                 /* size */
                Status *status;            /* status */
            } chkres;
        } u;

    } SMemCtl;


/* memory management handler function types */
    typedef S16 (*SsAlloc) ARGS((Void *, Size *, U32, Data **));
    typedef S16 (*SsFree) ARGS((Void *, Data *, Size));
    typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));


/* region information structure -- passed to SRegRegion() */
    typedef struct sRegInfo
    {
        Void         *regCb;            /* region control block pointer */
        U32          flags;             /* region characteristics flags  */
        Data         *start;            /* start address of region */
        Size         size;              /* size of region */
        SsAlloc      alloc;             /* allocation function pointer */
        SsFree       free;              /* deallocation function pointer */
        SsCtl        ctl;               /* control request function pointer */

    } SRegInfo;


#ifdef SS_OLD_THREAD

/* types for SGetThread(), SGetMutex, etc. */
    typedef Void    *(SThrd) ARGS((Void *));

    typedef S32     SThrdId;           /* thread Id */
    typedef S32     SMtxId;            /* mutex Id */
    typedef S32     SCondId;           /* condition Id */

#endif /* SS_OLD_THREAD */

#include "ss_dep.x"

#endif /* SS */
#endif /* PORTVER */
#endif /* MT */
#endif /* WINNT_IATM */
#endif /* SSRYLIB */
#endif /* SSLIB */
#endif /* VW */
#endif /* VX */
#endif /* PS */
#endif /* MSVER2 */
#endif /* MOSVER */


/* functions */

    typedef S16  (*PAIFS16) ARGS((Ent ent,Inst inst,Region region,Reason reason ));
#ifndef VX
    typedef S16  (*PATFS16) ARGS((Prior prior,Route route,Ent ent,Inst inst,Buffer *mBuf));
#else
    typedef void  (*PATFS16) ARGS((void *vPtr));
#endif
    typedef S16  (*ActvTsk) ARGS((Pst *pst, Buffer *mBuf));
#ifdef ENB_RELAY
    typedef struct uProc UProc;  /* forward definition - uproc */
#ifdef RYINT1
    typedef void (*ISTsk) ARGS((Inst inst));
#else  /* for backward compatibility */
    typedef void (*ISTsk) ARGS((UProc *uProc));
#endif /* RYINT1 */

    struct uProc
    {
        Inst inst;                         /* instance */
        ProcId low;                        /* procId low value */
        ProcId high;                       /* procId high value */
        ActvTsk actvTsk;                   /* activation function for drvr task */ 
        U16 isFlag;                        /* interrupt service flag */
        ISTsk isTsk;                       /* interrupt service task */
    };


#endif /* ENB_RELAY */


/* functions */
    EXTERN  S16 SInit ARGS((void));
    
    
    EXTERN  Void prntMem ARGS((Data *strtAdr,S16 len));
    EXTERN  Void prntMsg ARGS((Buffer *mBuf));
    EXTERN  Void prntMsg1 ARGS((Buffer *mBuf,S16 src,S16 dst));
    EXTERN  S16 tst ARGS((void ));
    EXTERN  S16 rdConQ ARGS((Data data));

    EXTERN  S16 SPkS8 ARGS((S8 val,Buffer *mBuf));
    EXTERN  S16 SPkU8 ARGS((U8 val,Buffer *mBuf));
    EXTERN  S16 SPkS16 ARGS((S16 val,Buffer *mBuf));
    EXTERN  S16 SPkU16 ARGS((U16 val,Buffer *mBuf));
    EXTERN  S16 SPkS32 ARGS((S32 val,Buffer *mBuf));
    EXTERN  S16 SPkU32 ARGS((U32 val,Buffer *mBuf));
    EXTERN  S16 SUnpkS8 ARGS((S8 *val,Buffer *mBuf));
    EXTERN  S16 SUnpkU8 ARGS((U8 *val,Buffer *mBuf));
    EXTERN  S16 SUnpkS16 ARGS((S16 *val,Buffer *mBuf));
    EXTERN  S16 SUnpkU16 ARGS((U16 *val,Buffer *mBuf));
    EXTERN  S16 SUnpkS32 ARGS((S32 *val,Buffer *mBuf));
    EXTERN  S16 SUnpkU32 ARGS((U32 *val,Buffer *mBuf));
    EXTERN  S16 SPrint ARGS((Txt *buf));
    EXTERN  S16 SDisplay ARGS((S16 chan,Txt *buf));
    EXTERN  S16 SPrntMsg ARGS((Buffer *mBuf,S16 src,S16 dst));
    EXTERN  S16 SInitQueue ARGS((Queue *q));
#ifndef SS_ENABLE_MACROS
    EXTERN  INLINE S16 SQueueFirst ARGS((Buffer *buf,Queue *q));
    EXTERN  INLINE S16 SQueueLast ARGS((Buffer *buf,Queue *q));
    EXTERN  INLINE S16 SDequeueFirst ARGS((Buffer * *bufPtr,Queue *q));
    EXTERN  INLINE S16 SDequeueLast ARGS((Buffer * *bufPtr,Queue *q));
#endif /* SS_ENABLE_MACROS */
    EXTERN  S16 SFlushQueue ARGS((Queue *q));
    EXTERN  S16 SCatQueue ARGS((Queue *q1,Queue *q2,Order order));
    EXTERN  S16 SFndLenQueue ARGS((Queue *q,QLen *lngPtr));
    EXTERN  S16 SExamQueue ARGS((Buffer **bufPtr,Queue *q,QLen idx));
    EXTERN  S16 SAddQueue ARGS((Buffer *buf,Queue *q,QLen idx));
    EXTERN  S16 SRemQueue ARGS((Buffer **bufPtr,Queue *q,QLen idx));
    EXTERN  INLINE S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
    EXTERN  INLINE S16 SGetDBufBySize ARGS((Region region,Pool pool,Size size, Buffer * *bufPtr));
    EXTERN  INLINE S16 SPutDBuf ARGS((Region region,Pool pool,Buffer *buf));
    EXTERN  S16 SGetSBuf ARGS((Region region,Pool pool,Data * *bufPtr,Size size));
    EXTERN  S16 SPutSBuf ARGS((Region region,Pool pool,Data *buf,Size size));
    EXTERN  S16 SGetSMem ARGS((Region region,Size size,Pool *poolPtr));
    EXTERN  S16 SPutSMem ARGS((Region region,Pool pool));
    EXTERN  S16 SGetMsg ARGS((Region region,Pool pool,Buffer * *mBufPtr));
    EXTERN  S16 SPutMsg ARGS((Buffer *mBuf));
    EXTERN  S16 SInitMsg ARGS((Buffer *mBuf));
    EXTERN  S16 SAddPreMsg ARGS((Data data,Buffer *mBuf));
    EXTERN  S16 SAddPstMsg ARGS((Data data,Buffer *mBuf));
    EXTERN  S16 SRemPreMsg ARGS((Data *dataPtr,Buffer *mBuf));
    EXTERN  S16 SRemPstMsg ARGS((Data *dataPtr,Buffer *mBuf));
    EXTERN  S16 SAddPreMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
    EXTERN  S16 SAddPstMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
    EXTERN  S16 SGetPstMsgMult ARGS((MsgLen cnt,Buffer *mBuf));
    EXTERN  S16 SRemPreMsgMult ARGS((Data *dst,MsgLen cnt,Buffer *mBuf));
    EXTERN  S16 SRemPstMsgMult ARGS((Data *dst,MsgLen cnt,Buffer *mBuf));
    EXTERN  S16 SRepMsg ARGS((Data data,Buffer *mBuf,MsgLen idx));
    EXTERN  S16 SExamMsg ARGS((Data *dataPtr,Buffer *mBuf,MsgLen idx));
    EXTERN  S16 SFndLenMsg ARGS((Buffer *mBuf,MsgLen *lngPtr));
    EXTERN  S16 SCatMsg ARGS((Buffer *mBuf1,Buffer *mBuf2,Order order));
    EXTERN  S16 SSegMsg ARGS((Buffer *mBuf1,MsgLen idx,Buffer **mBuf2));
    EXTERN  S16 SCpyMsgFix ARGS((Buffer *srcMbuf,MsgLen srcIdx,MsgLen cnt,
                                 Data *dstBuf,MsgLen *cCnt));
    EXTERN  S16 SCpyFixMsg ARGS((Data *srcBuf,Buffer *dstMbuf,
                                 MsgLen dstIdx,MsgLen cnt,MsgLen *cCnt));
    EXTERN  S16 SCompressMsg ARGS((Buffer *mBuf));
    EXTERN  S16 SCpyMsgMsg ARGS((Buffer *mBuf, Region region, Pool pool, 
                                 Buffer **dstBuf));
    EXTERN  S16 SAddMsgRef ARGS((Buffer *mBuf, Region region, Pool pool, 
                                 Buffer **dstBuf));
    EXTERN  S16 SChkRes ARGS((Region region,Pool pool,Status *status));
    EXTERN  S16 SSetDateTime ARGS((DateTime *dt));
    EXTERN  S16 SGetDateTime ARGS((DateTime *dt));
    EXTERN  S16 SGetSysTime ARGS((Ticks *sysTime));
    EXTERN  S16 SRandom ARGS((Random *value));
    EXTERN  S16 SError ARGS((Seq seq,Reason reason));
    EXTERN  Void SLogError ARGS((Ent ent, Inst inst, ProcId procId, Txt *file,
                                 S32 line, ErrCls errCls, ErrCode errCode,
                                 ErrVal errVal, Txt *errDesc));
    EXTERN  S16 SRegInit ARGS((Ent ent,Inst inst,PAIFS16 initFnct));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -