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

📄 win_ss.h

📁 中国石油二期加油站IC系统后台通讯软件
💻 H
字号:

/********************************************************************20**
 
     Name:     WINSS -- implementation specific definitions
 
     Type:     C include file
 
     Desc:     Various macro definitions demanded by systems services.
               The contents of these are for the WINSS implementation.
 
     File:     win_ss.h
 
     Sid:      win_ss.h 1.0  -  7/13/01 10:33:09
 
     Prg:      kp
 
*********************************************************************21*/


#ifndef __WINSSH__
#define __WINSSH__


/* --- interface to SS --- */

#define WIN_OUTPUT_FILE					"TR SSI"


#define TMRHNDLR_STK					0x20000
/*
#define TMR_PRIO						90
*/
#define	TMR_PRIO                        THREAD_PRIORITY_ABOVE_NORMAL 	

#define ISRHNDLR_STK					0x5000
/*
#define ISR_PRIO						89
*/
#define ISR_PRIO						THREAD_PRIORITY_HIGHEST

/* general */


#define SS_PROC_ID                      PID_STK(1)

/* task related */
#define SS_MAX_ENT                      255
#define SS_MAX_INST                     8

#define SS_MAX_TTSKS                    30
#define SS_MAX_STSKS                    30

#ifdef SS_DRVR_SUPPORT
    #define SS_MAX_DRVRTSKS				70
    #define SS_MAX_ISRCMD				100

#endif

#ifdef SS_RTR_SUPPORT
    #define SS_MAX_RTRTSKS				5
#endif


/* timer related */
#define SS_MAX_TMRS						15


/* memory related */
#define SS_MAX_REGS						5
#define SS_MAX_POOLS_PER_REG			5


/* locks */
#define SS_STSKTBL_LOCK                 SS_LOCK_MUTEX
#define SS_STSKENTRY_LOCK               SS_LOCK_MUTEX
#define SS_TMRTBL_LOCK                  SS_LOCK_MUTEX
#define SS_DMNDQ_LOCK                   SS_LOCK_MUTEX
#define SS_DRVRENTRY_LOCK               SS_LOCK_MUTEX
#define SS_RTRENTRY_LOCK                SS_LOCK_MUTEX


/* types needed by common SSI code */
#define SsSemaId						SEM_ID
#define SLockId							SEM_ID


/* calls needed by common SSI code */
#define SInitLock(l, t)					WinInitMutex(l)
#define SLock(l)                        WinLockMutex(l) 
#define SUnlock(l)                      WinUnlockMutex(l)
#define SDestroyLock(l)                 WinDestroyMutex(l)

#define ssInitSema(s, c)				WinInitSema(s, c)
#define ssWaitSema(s)					WinWaitSema(s)
#define ssPostSema(s)					WinPostSema(s)
#define ssDestroySema(s)				WinDestroySema(s)
/*
#define ssLockTsk()                     taskLock()
#define ssUnlockTsk()                   taskUnlock()

#define SS_CHECK_CUR_STSK(t)            (taskIdSelf() == (t)->dep.tId)
*/
#define ssInitLockTsk()					SInitLock(&tskMutex,0)
#define ssLockTsk()                     SLock(&tskMutex)
#define ssUnlockTsk()                   SUnlock(&tskMutex)
#define ssDestroyLockTsk()              SDestroyLock(&tskMutex)

#define SS_CHECK_CUR_STSK(t)            (GetCurrentThreadId() == (t)->dep.tId)

#define ssdPstTsk(p, m, t)



/* --- internal to MTSS-Solaris --- */


/* number of nanoseconds per 100 milliseconds (used in nanosleep()) */
#define WIN_TICK_CNT             10
#define TMR_SECOND				100


/* interrupt service flags */
#define WIN_IS_SET               0
#define WIN_IS_UNSET             1
#define WIN_IS_RESET             2


/* memory block sizes and counts for memory manager configuration */
#define WIN_MBUF_NMB_BUFS        40000            /* (SsMblk + SsDblk +   */
#define WIN_MBUF_DSIZE           72              /*  SsMsgInfo)          */

#define WIN_DBUF_NMB_BUFS        40000            /* data buffers for the */
#define WIN_DBUF_DSIZE           256             /* message              */


/* memory pool data size definitions for pool-to-size mapping table */
#define WIN_POOL_3_DSIZE         (WIN_DBUF_DSIZE-(sizeof(SsMblk)+sizeof(SsDblk)))
#define WIN_POOL_2_DSIZE         (WIN_DBUF_DSIZE-(sizeof(SsMblk)+sizeof(SsDblk)))
#define WIN_POOL_1_DSIZE         (WIN_DBUF_DSIZE-(sizeof(SsMblk)+sizeof(SsDblk)))
#define WIN_POOL_0_DSIZE         (WIN_DBUF_DSIZE-(sizeof(SsMblk)+sizeof(SsDblk)))


/* memory size used for heap by the memory manager (512KB) */
/* Modified by Spine.zhang for move the definition to makefile */
#ifndef TRI_MEM_SIZE
#define WIN_HEAP_SIZE            (1024 * 1024 * 10)
#else
#define WIN_HEAP_SIZE            TRI_MEM_SIZE
#endif


/* memory region size, allocated and passed to memory manager */
#define WIN_MEM_REG_SIZE         (WIN_HEAP_SIZE + \
                                 (WIN_MBUF_NMB_BUFS * WIN_MBUF_DSIZE) + \
                                 (WIN_DBUF_NMB_BUFS * WIN_DBUF_DSIZE))
                                 

/*** add by shang, 2002-1-10 ***/

#define POOL_SIZE               WIN_POOL_0_DSIZE
/*** add by shang is over ***/


#endif  /*  __WINSSH__  */


  
/********************************************************************30**

         End of file: win_ss.h 1.0  -  7/13/01 10:33:09

*********************************************************************31*/


/********************************************************************40**

        Notes:

*********************************************************************41*/

/********************************************************************50**

*********************************************************************51*/

   
/********************************************************************60**

        Revision history:

*********************************************************************61*/

/********************************************************************90**

     ver       pat    init                  description
------------ -------- ---- ----------------------------------------------

*********************************************************************91*/

⌨️ 快捷键说明

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