1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /********************************************************************20**
21 Name: system services interface
25 Desc: Structures, variables and typedefs required by the
26 System Services service user.
30 *********************************************************************21*/
43 typedef S16 Status; /* status */
45 typedef uint32_t Ticks; /* system clock ticks */
48 typedef S32 MsgLen; /* message length */
50 typedef S16 MsgLen; /* message length */
53 typedef S16 Order; /* message or queue order */
56 typedef uint16_t Size; /* size (for number of bytes per region or per s-pool) */
58 typedef uint32_t Size; /* size (for number of bytes per region or per s-pool) */
59 typedef S32 PtrOff; /* signed pointer offset */
62 typedef uint32_t QLen; /* queue length */
64 typedef QLen BufQLen; /* buffer queue length */
66 typedef S16 RegSize; /* region size (for number of regions per processor) */
68 typedef S16 DPoolSize; /* dynamic pool size (for number of buffers per d-pool) */
70 typedef uint16_t Random; /* random number */
72 typedef S16 Seq; /* sequence */
73 /* ssi_x_001.main_64 Additions */
74 typedef uint32_t CoreId; /* core id */
77 typedef uint32_t ErrCls; /* Error Class */
79 typedef uint32_t ErrCode; /* Error Code */
81 typedef uint32_t ErrVal; /* Error Value */
83 typedef S16 VectNmb; /* vector number */
85 typedef S16 Ttype; /* task type */
87 typedef S8 Sema; /* semaphore */
94 This section contains specific typedefs, structures and
95 prototypes for the following operating systems:
102 sslib - system service library for elvis
105 The defines PORTVER, MOSVER and MSVER2 are mutually exclusive. The define PORTVER
106 must be set in conjunction with the define PS, VX, VW or other.
111 #ifdef MOSVER /* mos version */
112 /* mos typedefs, structures and prototypes */
114 /* forward definitions */
116 #ifndef CMFILE_REORG_1
117 typedef struct ss_buffer Buffer; /* forward definition - buffer */
120 typedef struct ss_queue Queue; /* forward definition - queue */
124 typedef struct chn /* chain */
126 Buffer *fwd; /* forward */
127 Buffer *bck; /* backward */
130 typedef Chn Chain; /* chain */
132 /* queue - typdef'd earlier */
134 struct ss_queue /* queue - typdef'd earlier */
137 QLen crntSize; /* current size */
138 QLen maxSize; /* maximum size */
141 /* buffer - typedef'd earlier */
143 struct ss_buffer /* buffer - typdef'd earlier */
146 Mem mem; /* memory */
147 S8 bufType; /* buffer type */
152 MsgLen strtIdx; /* start index */
153 MsgLen endIdx; /* end index */
154 MsgLen size; /* size */
155 Data data[DSIZE]; /* data */
156 } dat; /* data buffer */
160 Queue bq; /* buffer queue */
161 MsgLen msgLen; /* message length */
162 S16 refCnt; /* reference count */
163 Pst pst; /* post (optional) */
164 uint32_t wsUInt32[2]; /* workspace unsigned 32 bit values (optional) */
165 uint16_t wsUInt16[1]; /* workspace unsigned 16 bit values (optional) */
166 uint8_t wsUInt8[2]; /* workspace unsigned 8 bit values (optional) */
167 } msg; /* message buffer */
171 Buffer *entry[MAXEXTENT];/* entry */
172 } ext; /* extension buffer */
176 Size size; /* size */
177 } stc; /* static buffer */
181 MsgLen strtIdx; /* start index */
182 MsgLen endIdx; /* end index */
183 MsgLen size; /* size */
184 Data *data; /* data pointer */
185 } dma; /* dma buffer */
196 #ifdef MSVER2 /* mos version 2 */
198 /* forward definitions */
199 #ifndef CMFILE_REORG_1
200 typedef struct ss_buffer Buffer; /* forward definition - buffer */
203 typedef struct sBuf SBuf; /* forward definition - static buffer */
205 typedef struct ss_queue Queue; /* forward definition - queue */
207 /* buffer identifier */
209 /* dynamic chain (4b ALIGNED) */
211 typedef struct dChn /* dynamic chain */
213 Buffer *prev; /* previous */
214 Buffer *crnt; /* current */
215 Buffer *next; /* next */
218 /* static chain (4b ALIGNED)*/
220 typedef struct sChn /* static chain */
222 SBuf *fwd; /* forward */
225 /* buffer queue (4b ALIGNED) */
227 typedef struct bufQ /* buffer queue */
229 DChn dChn; /* dynamic chain */
230 BufQLen crntSize; /* current size */
232 /* queue (4b ALIGNED) */
234 struct ss_queue /* queue - typdef'd earlier */
236 DChn dChn; /* dynamic chain */
237 QLen crntSize; /* current size */
241 typedef struct ss_dat /* data buffer */
243 MsgLen strtIdx; /* start index (2b) */
244 MsgLen endIdx; /* end index (2b) */
245 MsgLen size; /* size (2b) */
246 Pool pool; /* size (1b); Not used for MOS as of now */
247 uint8_t spare; /* spare for alignment (1b) */
248 Data data[DSIZE]; /* data (4b) */
252 typedef struct ss_msg /* message buffer */
254 Queue bufQ; /* buffer queue */
255 Buffer *nxtDBuf; /* next DBuf */
256 MsgLen msgLen; /* message length */
257 Pool pool; /* size (1b); Not used for MOS as of now */
258 uint8_t spare; /* spare for alingment */
261 /* buffer - typedef'd earlier */
263 struct ss_buffer /* buffer - typedef'd earlier */
265 DChn dChn; /* dynamic chain */
266 S8 bufType; /* buffer type */
267 uint8_t spare1; /* spare for alignment */
268 uint16_t spare2; /* spare for alignment */
270 Dat dat; /* data buffer */
271 Msg msg; /* message buffer */
275 /* static buffer - typedef'd earlier */
277 struct sBuf /* static buffer - typedef'd earlier */
279 SChn sChn; /* static chain */
280 Size size; /* size */
281 S8 bufType; /* buffer type */
282 uint8_t spare1; /* spare 1 */
283 uint16_t spare2; /* spare 2 */
292 #ifdef PS /* psos version */
293 /* psos typedefs, structures and prototypes */
295 /* forward definitions */
297 #ifndef CMFILE_REORG_1
298 typedef struct ss_buffer Buffer; /* forward definition - buffer */
301 typedef struct ss_queue Queue; /* forward definition - queue */
305 typedef struct chn /* chain */
307 Buffer *fwd; /* forward */
308 Buffer *bck; /* backward */
311 /* queue - typdef'd earlier */
313 struct ss_queue /* queue - typdef'd earlier */
316 QLen crntSize; /* current size */
317 QLen maxSize; /* maximum size */
320 /* buffer - typedef'd earlier */
322 struct ss_buffer /* buffer - typedef'd earlier */
325 Mem mem; /* memory */
326 S8 bufType; /* buffer type */
331 MsgLen strtIdx; /* start index */
332 MsgLen endIdx; /* end index */
333 MsgLen size; /* size */
334 Data data[DSIZE]; /* data */
335 } dat; /* data buffer */
339 Queue bq; /* buffer queue */
340 MsgLen msgLen; /* message length */
341 S16 refCnt; /* reference count */
342 } msg; /* message buffer */
346 Buffer *entry[MAXEXTENT];/* entry */
347 } ext; /* extension buffer */
351 Size size; /* size */
352 } stc; /* static buffer */
356 MsgLen strtIdx; /* start index */
357 MsgLen endIdx; /* end index */
358 MsgLen size; /* size */
359 Data *data; /* data pointer */
360 } dma; /* dma buffer */
366 #ifdef VX /* vrtxsa version */
367 /* vrtxsa typedefs, structures and prototypes */
369 /* forward definitions */
371 #ifndef CMFILE_REORG_1
372 typedef struct ss_buffer Buffer; /* forward definition - buffer */
375 typedef struct ss_queue Queue; /* forward definition - queue */
377 /* buffer - typedef'd earlier */
379 struct ss_buffer /* buffer - typedef'd earlier */
381 Buffer *fwd; /* forward chain pointer for queues */
382 Buffer *bck; /* backward chain pointer for queues */
383 uint16_t mPid; /* VRTXsa memory partition ID */
384 S16 start; /* starting index of message in byte array */
385 S16 end; /* ending index of message in byte array */
386 uint16_t status; /* buffer status */
391 typedef struct chn /* chain */
393 Buffer *fwd; /* forward */
394 Buffer *bck; /* backward */
397 /* queue - typdef'd earlier */
399 struct ss_queue /* queue - typdef'd earlier */
402 QLen crntSize; /* current size */
403 QLen maxSize; /* maximum size */
407 #ifdef VW /* vxworks version */
408 /* vxworks typedefs, structures and prototypes */
410 /* forward definitions */
412 #ifndef CMFILE_REORG_1
413 typedef struct ss_buffer Buffer; /* forward definition - buffer */
416 typedef struct ss_queue Queue; /* forward definition - queue */
418 typedef struct dChn /* dynamic chain */
420 Buffer *prev; /* previous */
421 Buffer *crnt; /* current */
422 Buffer *next; /* next */
425 /* static chain (4b ALIGNED)*/
427 /* buffer queue (4b ALIGNED) */
429 typedef struct bufQ /* buffer queue */
431 DChn dChn; /* dynamic chain */
432 BufQLen crntSize; /* current size */
435 /* queue (4b ALIGNED) */
437 struct ss_queue /* queue - typdef'd earlier */
439 DChn dChn; /* dynamic chain */
440 QLen crntSize; /* current size */
443 typedef struct ss_dat /* data buffer */
445 MsgLen strtIdx; /* start index */
446 MsgLen endIdx; /* end index */
447 MsgLen size; /* size */
448 Pool pool; /* pool id */
449 uint8_t spare; /* spare */
450 Data *data; /* data */
453 typedef struct ss_msg /* message buffer */
455 Queue bufQ; /* buffer queue */
456 Buffer *nxtDBuf; /* next DBuf */
457 MsgLen msgLen; /* message length */
458 Pool pool; /* pool id */
459 uint8_t spare; /* spare */
462 /* buffer - typedef'd earlier */
464 struct ss_buffer /* buffer - typedef'd earlier */
466 DChn dChn; /* dynamic chain */
467 S8 bufType; /* buffer type */
468 uint8_t spare1; /* spare for alignment */
469 uint16_t spare2; /* spare for alignment */
471 Dat dat; /* data buffer */
472 Msg msg; /* message buffer */
477 #ifdef SSLIB /* system service library */
478 /* forward definitions */
479 #ifndef CMFILE_REORG_1
480 typedef struct ss_buffer Buffer; /* forward definition - buffer */
483 typedef struct sBuf SBuf; /* forward definition - static buffer */
485 typedef struct ss_queue Queue; /* forward definition - queue */
488 /* queue - typdef'd earlier */
490 struct ss_queue /* queue - typdef'd earlier */
492 S16 dummy; /* dummy placeholder */
495 /* buffer - typedef'd earlier */
497 struct ss_buffer /* buffer - typedef'd earlier */
499 S32 sIdx; /* start index */
500 S32 len; /* buffer length */
501 S8 dat[MAXBUFSIZ]; /* data */
504 #else /* portable/other version */
505 #ifdef SSRYLIB /* system service library */
506 /* forward definitions */
507 #ifndef CMFILE_REORG_1
508 typedef struct ss_buffer Buffer; /* forward definition - buffer */
511 typedef struct sBuf SBuf; /* forward definition - static buffer */
513 typedef struct ss_queue Queue; /* forward definition - queue */
517 /* dynamic chain (aligned) */
518 typedef struct ryDChn /* dynamic chain */
520 RyBufId back; /* backward (2b) */
521 RyBufId crnt; /* current (2b) */
522 RyBufId next; /* next (2b) */
523 RyBufId pad; /* pad (2b) */
526 * queue - typdef'd earlier
527 * This is exactly same as RyBufQ
529 struct ss_queue /* queue - typdef'd earlier */
532 QLen crntSize; /* current size */
533 uint16_t ryChanId; /* relay channel Id */
536 /* buffer - typedef'd earlier */
538 struct ss_buffer /* buffer - typedef'd earlier */
540 S32 sIdx; /* start index */
541 S32 len; /* buffer length */
542 S8 dat[MAXBUFSIZ]; /* data */
545 #else /* portable/other version */
546 #ifdef WINNT_IATM /* Windows NT Integrated ATM */
548 #ifndef CMFILE_REORG_1
549 #ifndef CFG_APP /* Don't include ndis.h for config app. */
550 #include "ndis.h" /* to support NDIS calls (listed above) */
553 typedef struct _NDIS_PACKET Buffer; /* forward definition - buffer */
555 #endif /* CMFILE_REORG_1 */
557 typedef struct ss_queue Queue; /* forward definition - queue */
559 /* Trillium Queue is built upon the NDIS library list functions.
560 * No spin locks are applied for queues.
564 LIST_ENTRY ListHead; /* LIST_ENTRY to support NDIS list calls */
565 QLen CurQLen; /* current queue length */
566 QLen MaxQLen; /* maximum queue length */
568 #else /* WINNT_IATM */
569 #ifdef MT /* multi-threaded version */
570 /* multi-threaded typedefs, structures and prototypes */
572 /* forward definitions */
574 #ifndef CMFILE_REORG_1
575 typedef struct ss_buffer Buffer; /* forward definition - buffer */
578 typedef struct ss_queue Queue; /* forward definition - queue */
580 typedef struct sBuf SBuf; /* forward definition - static buffer */
582 typedef struct dChn /* dynamic chain */
584 Buffer *prev; /* previous */
585 Buffer *crnt; /* current */
586 Buffer *next; /* next */
589 /* static chain (4b ALIGNED)*/
592 SBuf *fwd; /* forward */
595 /* static chain (4b ALIGNED)*/
597 /* buffer queue (4b ALIGNED) */
599 /* queue (4b ALIGNED) */
601 struct ss_queue /* queue - typdef'd earlier */
603 DChn dChn; /* dynamic chain */
604 QLen crntSize; /* current size */
607 typedef struct ss_dat /* data buffer */
609 MsgLen strtIdx; /* start index */
610 MsgLen endIdx; /* end index */
611 MsgLen size; /* size */
612 Pool pool; /* pool id */
613 uint8_t spare; /* spare */
614 Data *data; /* data */
617 typedef struct ss_msg /* message buffer */
619 Queue bufQ; /* buffer queue */
620 Buffer *nxtDBuf; /* next DBuf */
621 MsgLen msgLen; /* message length */
622 Pool pool; /* pool id */
623 uint8_t spare; /* spare */
626 /* buffer - typedef'd earlier */
628 struct ss_buffer /* buffer - typedef'd earlier */
630 DChn dChn; /* dynamic chain */
631 S8 bufType; /* buffer type */
632 uint8_t spare1; /* spare for alignment */
633 uint16_t spare2; /* spare for alignment */
635 Dat dat; /* data buffer */
636 Msg msg; /* message buffer */
640 /* static buffer - typedef'd earlier */
644 SChn sChn; /* static chain */
645 Size size; /* size */
646 S8 bufType; /* buffer type */
647 uint8_t spare1; /* spare 1 */
648 uint16_t spare2; /* spare 2 */
651 typedef S32 MtRwLockId;
652 typedef S32 MtSemaId;
653 typedef S32 MtCondId;
655 typedef S32 MtThrdId;
656 typedef S32 MtThrdFlags;
657 typedef S32 MtThrdPrior;
659 typedef Void *(MtThrd) ARGS((Void *));
663 /* portable typedefs, structures and prototypes */
665 /* forward definitions */
667 #ifndef CMFILE_REORG_1
668 typedef struct ss_buffer Buffer; /* forward definition - buffer */
671 typedef struct ss_queue Queue; /* forward definition - queue */
673 /* queue - typdef'd earlier */
675 struct ss_queue /* queue - typdef'd earlier */
677 S16 dummy; /* dummy placeholder */
680 /* buffer - typedef'd earlier */
682 struct ss_buffer /* buffer - typedef'd earlier */
684 S16 dummy; /* dummy placeholder */
687 /* task related stuff */
688 /* data range modified */
689 #ifndef SS_MULTIPLE_PROCS
690 typedef uint8_t SSTskId; /* System Task Id */
691 #else /* SS_MULTIPLE_PROCS */
692 typedef uint16_t SSTskId; /* System Task Id */
693 #endif /* SS_MULTIPLE_PROCS */
695 typedef S32 SSTskPrior; /* System Task Priority */
696 #ifdef SS_AEHDPR_SUPPORT
697 typedef Void (*PISR) ARGS((PTR cxt)); /* pointer to ISR function handler */
698 typedef Void (*PDPR) ARGS((PTR cxt)); /* pointer to DPR function handler */
699 #endif /* SS_AEHDPR_SUPPORT */
700 #else /* not PORTVER */
701 #ifdef SS /* Common System Services */
709 /* task related stuff */
710 /* data range modified */
711 #ifndef SS_MULTIPLE_PROCS
712 typedef uint8_t SSTskId; /* System Task Id */
713 #else /* SS_MULTIPLE_PROCS */
714 typedef uint16_t SSTskId; /* System Task Id */
715 #endif /* SS_MULTIPLE_PROCS */
717 typedef S32 SSTskPrior; /* System Task Priority */
719 #ifndef CMFILE_REORG_1
721 /* Buffer type is necessary */
722 typedef struct ssmsgb Buffer;
724 #endif /* CMFILE_REORG_1 */
729 S8 refCnt; /* Counter to Free Buff */
730 struct ssmsgb *b_next; /* next message */
731 struct ssmsgb *b_prev; /* previous message */
732 struct ssmsgb *b_cont; /* next message block */
733 uint8_t *b_rptr; /* 1st unread data byte of buffer */
734 uint8_t *b_wptr; /* 1st unwritten data byte of buffer */
735 struct ssdatab *b_datap; /* pointer to data block */
738 /* Queue data structure */
739 typedef struct ssQueue
741 Buffer *head; /* head of queue */
742 Buffer *tail; /* tail of queue */
743 QLen crntSize; /* current szie of queue */
748 /* Memory CTL operations structure */
749 typedef struct sMemCtl
751 uint8_t op; /* operation */
757 Data *vaddr; /* virtual address */
758 Data **paddr; /* physical address */
763 Size size; /* size */
764 Status *status; /* status */
771 /* memory management handler function types */
772 /* ssi_x_001.main_47 - addition for introducing additional parameter memType(static/dynamic) */
773 /* ssi_x_001.main_57 : Additions */
774 #ifdef SS_HISTOGRAM_SUPPORT
775 #ifdef SSI_DEBUG_LEVEL1
776 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **, uint32_t, uint32_t, uint8_t*, uint8_t, Bool));
778 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **, uint32_t, uint8_t*, uint8_t, Bool));
779 #endif /* SSI_DEBUG_LEVEL1 */
780 typedef S16 (*SsFree) ARGS((Void *, Data *, Size, uint32_t, uint8_t*, uint8_t, Bool));
781 typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));
782 #elif defined(SS_LIGHT_MEM_LEAK_STS)
783 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t , Data **, uint32_t, uint32_t , uint8_t *));
784 typedef S16 (*SsFree) ARGS((Void *, Data *, Size, uint32_t, uint8_t *));
785 typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));
787 #ifdef SSI_DEBUG_LEVEL1
788 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **, uint32_t));
790 #ifdef T2K_MEM_LEAK_DBG
791 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **,char*, uint32_t));
793 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **));
795 #endif /* SSI_DEBUG_LEVEL1 */
796 #ifdef T2K_MEM_LEAK_DBG
797 typedef S16 (*SsFree) ARGS((Void *, Data *, Size,char*, uint32_t));
799 typedef S16 (*SsFree) ARGS((Void *, Data *, Size));
801 typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));
802 #endif /* SS_HISTOGRAM_SUPPORT */
805 /* region information structure -- passed to SRegRegion() */
806 typedef struct sRegInfo
808 Void *regCb; /* region control block pointer */
809 uint32_t flags; /* region characteristics flags */
810 /* ssi_x_001.main_64 Additions */
812 cvmx_arena_list_t regArena; /* arena for the region */
814 Data *start; /* start address of region */
815 Size size; /* size of region */
816 SsAlloc alloc; /* allocation function pointer */
817 SsFree free; /* deallocation function pointer */
818 SsCtl ctl; /* control request function pointer */
825 /* types for SGetThread(), SGetMutex, etc. */
826 typedef Void *(SThrd) ARGS((Void *));
828 typedef S32 SThrdId; /* thread Id */
829 typedef S32 SMtxId; /* mutex Id */
830 typedef S32 SCondId; /* condition Id */
832 #endif /* SS_OLD_THREAD */
834 /*ssi_x_001.main_63 ss_dep.x guarded under flag*/
842 #endif /* SS_4GMX_LCORE */
848 #endif /* WINNT_IATM */
856 /* ssi_x_001.main_57 : Additions */
857 #ifdef SS_HISTOGRAM_SUPPORT
859 typedef struct entInfo
864 typedef struct secondIndex
869 typedef struct firstIndex
871 SecondIndex info[26];
873 #endif /* SS_HISTOGRAM_SUPPORT */
878 /* procId and control block added */
879 #ifndef SS_MULTIPLE_PROCS
880 typedef uint8_t (*PAIFS16) ARGS((Ent ent,Inst inst,Region region,Reason reason ));
881 /* ssi_x_001.main_54 */
882 /* ssi_x_001.main_53 */
883 /* ssi_x_001.main_69: Removed the SS_MT_TMR guard from PAIFTMRS16
884 timer activation function typedef. */
886 typedef S16 (*PAIFTMRS16) ARGS((Ent ent, Inst inst));
888 typedef uint8_t (*PAIFS16) ARGS((ProcId proc,
895 /* time activation function typedef */
896 typedef S16 (*PAIFTMRS16) ARGS((ProcId proc,
899 #endif /* SS_MULTIPLE_PROCS */
902 typedef S16 (*PATFS16) ARGS((Prior prior,Route route,Ent ent,Inst inst,Buffer *mBuf));
904 typedef void (*PATFS16) ARGS((void *vPtr));
906 typedef S16 (*ActvTsk) ARGS((Pst *pst, Buffer *mBuf));
908 typedef struct uProc UProc; /* forward definition - uproc */
910 typedef void (*ISTsk) ARGS((Inst inst));
911 #else /* for backward compatibility */
912 typedef void (*ISTsk) ARGS((UProc *uProc));
917 Inst inst; /* instance */
918 ProcId low; /* procId low value */
919 ProcId high; /* procId high value */
920 ActvTsk actvTsk; /* activation function for drvr task */
921 uint16_t isFlag; /* interrupt service flag */
922 ISTsk isTsk; /* interrupt service task */
926 #endif /* ENB_RELAY */
930 S16 SChekMemUtilization ARGS((Region region,Bool *memAlarm));
932 Void prntMem ARGS((Data *strtAdr,S16 len));
933 Void prntMsg ARGS((Buffer *mBuf));
934 Void prntMsg1 ARGS((Buffer *mBuf,S16 src,S16 dst));
935 uint8_t tst ARGS((void ));
936 S16 rdConQ ARGS((Data data));
938 S16 SPkS8 ARGS((S8 val,Buffer *mBuf));
939 S16 oduUnpackUInt8 ARGS((uint8_t val,Buffer *mBuf));
940 S16 SPkS16 ARGS((S16 val,Buffer *mBuf));
941 S16 oduUnpackUInt16 ARGS((uint16_t val,Buffer *mBuf));
942 S16 SPkS32 ARGS((S32 val,Buffer *mBuf));
943 S16 oduUnpackUInt32 ARGS((uint32_t val,Buffer *mBuf));
944 /* ssi_x_001.main_49 : added packing of F32 and F64*/
946 S16 SPkF32 ARGS((F32 val,Buffer *mBuf));
947 S16 SPkF64 ARGS((F64 val,Buffer *mBuf));
948 #endif /* SS_FLOAT */
949 S16 SUnpkS8 ARGS((S8 *val,Buffer *mBuf));
950 S16 oduPackUInt8 ARGS((uint8_t *val,Buffer *mBuf));
951 S16 SUnpkS16 ARGS((S16 *val,Buffer *mBuf));
952 S16 oduPackUInt16 ARGS((uint16_t *val,Buffer *mBuf));
953 S16 SUnpkS32 ARGS((S32 *val,Buffer *mBuf));
954 S16 oduPackUInt32 ARGS((uint32_t *val,Buffer *mBuf));
955 /* ssi_x_001.main_49 : added unpacking of F32 and F64*/
957 S16 SUnpkF32 ARGS((F32 *val,Buffer *mBuf));
958 S16 SUnpkF64 ARGS((F64 *val,Buffer *mBuf));
959 #endif /* SS_FLOAT */
960 S16 SPrint ARGS((Txt *buf));
961 S16 SDisplay ARGS((S16 chan,Txt *buf));
962 S16 SPrntMsg ARGS((Buffer *mBuf,S16 src,S16 dst));
963 S16 SInitQueue ARGS((Queue *q));
964 #ifndef SS_ENABLE_MACROS
965 S16 SQueueFirst ARGS((Buffer *buf,Queue *q));
966 S16 SQueueLast ARGS((Buffer *buf,Queue *q));
967 S16 SDequeueFirst ARGS((Buffer * *bufPtr,Queue *q));
968 S16 SDequeueLast ARGS((Buffer * *bufPtr,Queue *q));
969 #endif /* SS_ENABLE_MACROS */
970 S16 SFlushQueue ARGS((Queue *q));
971 S16 SCatQueue ARGS((Queue *q1,Queue *q2,Order order));
972 S16 SFndLenQueue ARGS((Queue *q,QLen *lngPtr));
973 S16 SExamQueue ARGS((Buffer **bufPtr,Queue *q,QLen idx));
974 S16 SAddQueue ARGS((Buffer *buf,Queue *q,QLen idx));
975 S16 SRemQueue ARGS((Buffer **bufPtr,Queue *q,QLen idx));
976 #ifndef SS_ENABLE_MACROS
977 #ifdef T2K_MEM_LEAK_DBG
978 #define SGetDBuf(region,pool,buf) SGetDBufNew(region,pool,buf,__FILE__,__LINE__)
979 #define SPutDBuf(region,pool,buf) SPutDBufNew(region,pool,buf,file,line)
980 S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,char*,uint32_t));
981 S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf,char*,uint32_t));
982 S16 SAttachPtrToBufNew ARGS((Region region, Pool pool, Data
983 *ptr, MsgLen totalLen, Buffer** mBuf, char* file, uint32_t line));
984 #define SAttachPtrToBuf(region,pool,ptr,totalLen,mBuf) SAttachPtrToBufNew(region,pool,ptr,totalLen,mBuf,__FILE__,__LINE__)
985 #define SPutZbcDBuf(region,buf) SPutZbcDBufNew(region,buf,__FILE__,__LINE__)
986 #elif SS_LIGHT_MEM_LEAK_STS
987 S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,uint32_t line,uint8_t *fnName));
988 S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf, uint32_t line, uint8_t *fnName));
991 S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
992 S16 SPutDBuf ARGS((Region region,Pool pool,Buffer *buf));
994 #else /* SS_ENABLE_MACROS */
995 #ifdef T2K_MEM_LEAK_DBG
996 #define SGetDBuf(region,pool,buf) SGetDBufNew(region,pool,buf,__FILE__,__LINE__)
997 #define SPutDBuf(region,pool,buf) SPutDBufNew(region,pool,buf,__FILE__,__LINE__)
998 S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,char*,uint32_t));
999 S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf,char*,uint32_t));
1000 #elif SS_LIGHT_MEM_LEAK_STS
1001 S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,uint32_t line,uint8_t *fnName));
1002 S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf, uint32_t line, uint8_t *fnName));
1004 S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
1005 S16 SPutDBuf ARGS((Region region,Pool pool,Buffer *buf));
1007 #endif /* SS_ENABLE_MACROS */
1008 S16 SPutMsgToRegion ARGS((Region region, Buffer *buf));
1009 #ifdef SS_USE_ICC_MEMORY
1010 Void *ssGetIccHdl ARGS((Region region));
1011 #endif /* SS_USE_ICC_MEMORY */
1013 /* ssi_x_001.main_57 : Additions */
1014 /* ssi_x_001.main_59 : Added compile time flag */
1015 #ifdef SS_LIGHT_MEM_LEAK_STS
1016 S16 SGetMsgNew ARGS((Region region, Pool pool, Buffer * *mBufPtr, uint32_t line, uint8_t *fnName));
1017 S16 SGetSBufNew ARGS((Region region,Pool pool, Data * *bufPtr, Size size, uint32_t line, uint8_t* fnName));
1018 S16 SPutMsgNew ARGS((Buffer *mBuf, uint32_t line, uint8_t *fnName));
1019 S16 SPutSBufNew ARGS((Region region, Pool pool, Data *buf, Size size, uint32_t line, uint8_t *fnName));
1020 #else /*SS_LIGHT_MEM_LEAK_STS */
1021 #ifdef SS_HISTOGRAM_SUPPORT
1022 S16 SPutMsgNew ARGS((Buffer *mBuf, uint32_t line, uint8_t *fileName));
1023 S16 SGetMsgNew ARGS((Region region, Pool pool, Buffer * *mBufPtr, uint32_t line, uint8_t *fileName));
1024 S16 SGetSBufNew ARGS((Region region,Pool pool, Data * *bufPtr, Size size, uint32_t line, uint8_t *fileName));
1025 S16 SPutSBufNew ARGS((Region region, Pool pool, Data *buf, Size size, uint32_t line, uint8_t *fileName));
1027 /*ssi_x_001.main_67 : RMIOS specific changes*/
1029 #ifdef T2K_MEM_LEAK_DBG
1030 #define SPutMsg(mBuf) SPutMsgNew(mBuf,__FILE__,__LINE__)
1031 #define SGetMsg(region,pool,mBuf) SGetMsgNew(region,pool,mBuf,__FILE__,__LINE__)
1032 S16 SPutMsgNew ARGS((Buffer *mBuf,char*, uint32_t));
1033 S16 SGetMsgNew ARGS((Region region, Pool pool, Buffer * *mBufPtr, char*,uint32_t));
1035 S16 SPutMsg ARGS((Buffer *mBuf));
1036 S16 SGetMsg ARGS((Region region, Pool pool, Buffer * *mBufPtr));
1039 #define SPutMsg(m) SPutMsgRmi(__FILE__, __LINE__, m)
1040 #define SGetMsg(r, p, m) SGetMsgRmi(__FILE__, __LINE__, r, p, m)
1041 S16 SPutMsgRmi ARGS((char *file, int line, Buffer *mBuf));
1042 S16 SGetMsgRmi ARGS((char *file, int line, Region region, Pool pool, Buffer * *mBufPtr));
1044 #if (defined(SSI_STATIC_MEM_LEAK_DETECTION)|| defined(T2K_MEM_LEAK_DBG))
1045 #define SGetSBuf(region,pool,bufPtr,size) SGetSBuf1(region,pool,bufPtr,size,__FILE__,__LINE__)
1046 S16 SGetSBuf1 ARGS((Region region,Pool pool, Data * *bufPtr, Size size, char* file, uint32_t line));
1047 void DumpStaticMemLeakFiles ARGS((void));
1048 void DumpT2kMemLeakInfoToFile ARGS((void));
1049 #define SPutSBuf(region,pool,buf,size) SPutSBuf1(region,pool,buf,size,__FILE__,__LINE__)
1050 S16 SPutSBuf1 ARGS((Region region, Pool pool, Data *buf, Size size, char*, uint32_t));
1052 S16 SGetSBuf ARGS((Region region,Pool pool, Data * *bufPtr, Size size));
1053 S16 SPutSBuf ARGS((Region region, Pool pool, Data *buf, Size size));
1055 #endif /* SS_HISTOGRAM_SUPPORT */
1056 #endif /*SS_LIGHT_MEM_LEAK_STS */
1057 #ifdef INTEL_WLS_MEM
1058 S16 SPutSBufWls(Region region, Pool pool, Data *ptr, Size size);
1059 S16 SGetSBufWls(Region region, Pool pool, Data **ptr, Size size);
1062 #ifdef T2K_MEM_LEAK_DBG
1063 #define SGetSBufWls(region,pool,bufPtr,size) SGetSBufWls1(region,pool,bufPtr,size,__FILE__,__LINE__)
1064 #define SPutSBufWls(region,pool,bufPtr,size) SPutSBufWls1(region,pool,bufPtr,size,__FILE__,__LINE__)
1065 S16 SPutSBufWls1(Region region, Pool pool, Data *ptr, Size size,char* file, uint32_t line);
1066 S16 SGetSBufWls1(Region region, Pool pool, Data **ptr, Size size,char* file, uint32_t line);
1067 #define SAttachWlsPtrToMBuf(region,pool,bufPtr,rPtr,size,pLen,mBuf) SAttachWlsPtrToMBuf1(region,pool,bufPtr,rPtr,size,pLen,mBuf,__FILE__,__LINE__)
1068 S16 SAttachWlsPtrToMBuf1(Region region, Pool pool, Data *ptr, Data *readPtr, MsgLen totalLen, MsgLen ptrLen, Buffer** mBuf,char* file, uint32_t line);
1069 #define SAttachPtrToMBuf(region,pool,bufPtr,size,pLen,mBuf) SAttachPtrToMBuf1(region,pool,bufPtr,size,pLen,mBuf,__FILE__,__LINE__)
1072 S16 SPutSBufWls(Region region, Pool pool, Data *ptr, Size size);
1073 S16 SGetSBufWls(Region region, Pool pool, Data **ptr, Size size);
1074 S16 SAttachWlsPtrToMBuf(Region region, Pool pool, Data *ptr, Data *readPtr, MsgLen totalLen, MsgLen ptrLen, Buffer** mBuf);
1077 S16 SGetStaticBuffer ARGS((Region region,Pool pool, Data * *bufPtr, Size size, uint8_t memType));
1078 S16 SPutStaticBuffer ARGS((Region region, Pool pool, Data *buf, Size size, uint8_t memType));
1079 /* ssi_x_001.main_65: Additions */
1080 #ifdef SS_SEUM_CAVIUM
1081 S16 ssInitRcvWork ARGS((void));
1082 S16 SConvPtrPhy ARGS(( Buffer **mBuf));
1083 S16 SConvPhyPtr ARGS((Buffer **workPtr));
1084 S16 SCpyFpaMsg ARGS((Buffer *srcBuf, Region dstRegion,Pool dstPool, Buffer **dstBuf));
1085 S16 SCpyMsgFpa ARGS(( Buffer *srcBuf, Buffer **dstBuf));
1086 S16 SPutFpaMsg ARGS(( Buffer *fpaBuf));
1087 #endif /* SS_SEUM_CAVIUM */
1089 S16 SGetSMem ARGS((Region region,Size size,Pool *poolPtr));
1090 S16 SPutSMem ARGS((Region region,Pool pool));
1091 S16 SInitMsg ARGS((Buffer *mBuf));
1092 S16 SAddPreMsg ARGS((Data data,Buffer *mBuf));
1093 S16 SAddPstMsg ARGS((Data data,Buffer *mBuf));
1094 /* ssi_x_001.main_70 - Added prototype for SAddPreMsgMultInOrder */
1095 S16 SAddPreMsgMultInOrder ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1096 S16 SRemPreMsg ARGS((Data *dataPtr,Buffer *mBuf));
1097 S16 SRemPreMsgRegion ARGS((Region region, Data *dataPtr,Buffer *mBuf));
1098 S16 SCatMsgRegion ARGS((Region region, Buffer *mBuf1,Buffer *mBuf2,Order order));
1099 S16 SSegMsgRegion ARGS((Region region, Buffer *mBuf1,MsgLen idx,Buffer **mBuf2));
1100 int SCreatePThread ARGS((pthread_t* tid, pthread_attr_t* attr, void *(*start_routine) (void *), void* arg));
1101 S16 SRemPstMsg ARGS((Data *dataPtr,Buffer *mBuf));
1102 #ifdef T2K_MEM_LEAK_DBG
1103 #define SAddPreMsgMult(src, cnt, mBuf) SAddPreMsgMult1(src, cnt, mBuf, __FILE__,__LINE__)
1104 #define SAddPstMsgMult(src, cnt, mBuf) SAddPstMsgMult1(src, cnt, mBuf, __FILE__,__LINE__)
1106 S16 SAddPreMsgMult1 ARGS((Data *src,MsgLen cnt,Buffer *mBuf, char *file, uint32_t line));
1107 S16 SAddPstMsgMult1 ARGS((Data *src,MsgLen cnt,Buffer *mBuf, char *file, uint32_t line));
1109 S16 SAddPreMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1110 S16 SAddPstMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1112 S16 SGetPstMsgMult ARGS((MsgLen cnt,Buffer *mBuf));
1113 S16 SRemPreMsgMult ARGS((Data *dst,MsgLen cnt,Buffer *mBuf));
1114 S16 SRemPstMsgMult ARGS((Data *dst,MsgLen cnt,Buffer *mBuf));
1115 S16 SRepMsg ARGS((Data data,Buffer *mBuf,MsgLen idx));
1116 S16 SExamMsg ARGS((Data *dataPtr,Buffer *mBuf,MsgLen idx));
1117 /*ssi_x_001.main_60 */
1118 S16 SGetDataFrmMsg ARGS ((Buffer *mBuf, Data *dataPtr, MsgLen idx, MsgLen dataLen));
1119 S16 SFndLenMsg ARGS((Buffer *mBuf,MsgLen *lngPtr));
1120 S16 SCatMsg ARGS((Buffer *mBuf1,Buffer *mBuf2,Order order));
1121 #ifdef T2K_MEM_LEAK_DBG
1122 #define SSegMsg(mBuf1, idx, mBuf2) SSegMsgNew(mBuf1, idx, mBuf2, __FILE__, __LINE__)
1123 S16 SSegMsgNew ARGS((Buffer *mBuf1,MsgLen idx,Buffer **mBuf2,char*,uint32_t));
1125 S16 SSegMsg ARGS((Buffer *mBuf1,MsgLen idx,Buffer **mBuf2));
1127 S16 SSwapMsg ARGS((Buffer *mBuf1, Buffer *mBuf2));
1128 S16 SCpyMsgFix ARGS((Buffer *srcMbuf,MsgLen srcIdx,MsgLen cnt,
1129 Data *dstBuf,MsgLen *cCnt));
1130 S16 SCpyFixMsg ARGS((Data *srcBuf,Buffer *dstMbuf,
1131 MsgLen dstIdx,MsgLen cnt,MsgLen *cCnt));
1132 S16 SCompressMsg ARGS((Buffer *mBuf));
1133 #ifdef T2K_MEM_LEAK_DBG
1134 #define SAddMsgRef(mBuf,region,pool,dstBuf) SAddMsgRefNew(mBuf,region,pool,dstBuf,__FILE__,__LINE__)
1135 #define SCpyMsgMsg(mBuf,region,pool, dstBuf) SCpyMsgMsgNew(mBuf,region,pool, dstBuf, __FILE__, __LINE__)
1136 S16 SAddMsgRefNew ARGS((Buffer *mBuf, Region region, Pool pool,
1137 Buffer **dstBuf,char*,uint32_t));
1138 S16 SCpyMsgMsgNew ARGS((Buffer *mBuf, Region region, Pool pool,
1139 Buffer **dstBuf,char* , uint32_t));
1141 S16 SCpyMsgMsg ARGS((Buffer *mBuf, Region region, Pool pool,
1143 S16 SAddMsgRef ARGS((Buffer *mBuf, Region region, Pool pool,
1145 S16 SIncMsgRef(Buffer *srcBuf, Region dstRegion, Pool dstPool, Buffer **dstBuf);
1148 /* S16 SIncMsgRef ARGS((Buffer *srcBuf, Buffer **dstBuf)); */
1149 Void SIncMsgLen ARGS((Buffer *mBuf));
1152 S16 SChkRes ARGS((Region region,Pool pool,Status *status));
1153 S16 SChkResUtl ARGS((Region region,uint8_t *wSum));
1154 S16 SSetDateTime ARGS((DateTime *dt));
1155 S16 SGetDateTime ARGS((DateTime *dt));
1157 Void SResetMBuf ARGS ((Buffer *mBuf));
1159 /* ssi_x_001.main_57 : Additions */
1160 /* ssi_x_001.main_58 : Additions */
1161 /* ssi_x_001.main_60 : Modifications */
1162 S16 SGetEpcTime ARGS((EpcTime *et));
1163 /* ssi_x_001.main_48: Added Timestamp changes */
1164 S16 SGetTimeStamp ARGS(( S8 *ts));
1165 S16 SGetSysTime ARGS((Ticks *sysTime));
1166 S16 SGetRefTime ARGS((uint32_t refTime, uint32_t *sec, uint32_t *usec));
1167 S16 SRandom ARGS((Random *value));
1168 S16 SError ARGS((Seq seq,Reason reason));
1169 Void SLogError ARGS((Ent ent, Inst inst, ProcId procId, Txt *file,
1170 S32 line, ErrCls errCls, ErrCode errCode,
1171 ErrVal errVal, Txt *errDesc));
1172 /* ssi_x_001.main_49 : added prototype for SGetSystemTsk() */
1173 uint32_t SGetSystemTsk ARGS ((Void));
1174 /* changes to support multiple processors in single SSI */
1175 /* multiple proc id changes:
1176 these functions are not supported with multiple proc Ids */
1177 #ifndef SS_MULTIPLE_PROCS
1178 S16 SRegInit ARGS((Ent ent,Inst inst,PAIFS16 initFnct));
1179 S16 SRegActvTsk ARGS((Ent ent,Inst inst,Ttype ttype,Prior prior,
1181 #endif /* SS_MULTIPLE_PROCS */
1183 /* multiple proc id changes: procId added and time function type modified */
1184 #ifndef SS_MULTIPLE_PROCS
1185 S16 SRegCfgTmr ARGS((Ent ent,
1191 /* ssi_x_001.main_53 */
1192 S16 SRegCfgTmrMt ARGS((Ent ent,
1196 PAIFTMRS16 tmrFnctMt));
1198 S16 SDeregCfgTmr ARGS((Ent ent,
1204 /* ssi_x_001.main_53 */
1205 S16 SDeregCfgTmrMt ARGS((Ent ent,
1209 PAIFTMRS16 tmrFnctMt));
1212 S16 SRegCfgTmr ARGS((ProcId proc,
1217 PAIFTMRS16 tmrFnct));
1218 S16 SDeregCfgTmr ARGS((ProcId proc,
1223 PAIFTMRS16 tmrFnct));
1224 #endif /* SS_MULTIPLE_PROCS */
1226 S16 SPstTsk ARGS((Pst *pst, Buffer *mBuf));
1228 #ifdef SS_ROUTE_MSG_CORE1
1229 S16 SPstTskIcpu ARGS((Pst *pst, Buffer *mBuf));
1233 S16 SRegDrvrTsk ARGS((Inst inst, ProcId low, ProcId high,
1234 ActvTsk actvTsk, ISTsk isTsk));
1235 /*ssi_x_001.main_56*/
1236 S16 SDeregDrvrTsk ARGS((Inst channel));
1237 #endif /* ENB_RELAY */
1239 #ifdef SS_RTR_SUPPORT
1240 S16 SRegRtrTsk ARGS((Route *, Cntr, ActvTsk));
1241 S16 SDeregRtrTsk ARGS((Route *, Cntr));
1242 #endif /* SS_RTR_SUPPORT */
1244 #ifdef SS_USE_ZBC_MEMORY
1245 S16 SAttachPtrToBuf ARGS((
1253 /* multi-core support ssi_x_001.main_55 */
1254 /*ssi_x_001.main_68 Added SS_AFFINITY_SUPPORT*/
1255 #if defined(SS_MULTICORE_SUPPORT) || defined(SS_AFFINITY_SUPPORT)
1257 typedef S8 SsAffinityMode;
1261 uint32_t numCores; /* total number of cores available */
1262 uint32_t threadsPerCore; /* total number of threads available per core */
1263 uint32_t threadRegister[SS_MAX_CORES]; /* available threads per core */
1266 S16 SRegCpuInfo ARGS((SCpuInfo *cpuInfo));
1267 S16 SSetAffinity ARGS((SSTskId *tskId, SsAffinityMode mode, uint32_t coreId, SSTskId *tskAssociatedTskId));
1268 S16 SGetAffinity ARGS((SSTskId *tskId, uint32_t *coreId));
1270 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT*/
1272 #ifdef SS_AEHDPR_SUPPORT
1273 S16 SSetAehDpr ARGS((ProcId procId, VectNmb vectNmb,PISR pisr,PTR ptr1,PDPR pdpr,PTR ptr2));
1274 S16 SRemoveAehDpr ARGS((ProcId chipNum, VectNmb vectNmb));
1276 S16 SAddDBufPst ARGS((Buffer *mBuf, Buffer *dBuf));
1277 S16 SAddDBufPre ARGS((Buffer *mBuf, Buffer *dBuf));
1278 S16 SRemDBufPst ARGS((Buffer *mBuf, Buffer **dBuf));
1279 S16 SRemDBufPre ARGS((Buffer *mBuf, Buffer **dBuf));
1280 S16 SGetDataRx ARGS((Buffer *dBuf, MsgLen pad, Data **dat, MsgLen *mLen));
1281 S16 SGetDataTx ARGS((Buffer *dBuf, Data **dat, MsgLen *mLen));
1282 S16 SUpdMsg ARGS((Buffer *mBuf, Buffer *dBuf, MsgLen mLen));
1283 S16 SCacheFlush ARGS( (uint16_t cache_type, Data *addr, Size size));
1284 S16 SCacheInvalidate ARGS( (uint16_t cache_type, Data *addr, Size size));
1285 S16 SAlignDBufEven ARGS((Buffer *dBuf));
1286 S16 SAlignDBuf ARGS((Buffer *dBuf, uint32_t align));
1287 S16 SInitNxtDBuf ARGS((Buffer *mBuf));
1288 S16 SGetNxtDBuf ARGS((Buffer *mBuf, Buffer **dBuf));
1289 S16 SChkNxtDBuf ARGS((Buffer *mBuf));
1290 S16 SSetIntPend ARGS((uint16_t id, Bool flag));
1291 S16 SChkMsg ARGS((Buffer *mBuf));
1292 S16 SDeregInitTskTmr ARGS((Ent ent,Inst inst));
1293 S16 SExitTsk ARGS((void ));
1294 S16 SExitInt ARGS((void ));
1295 S16 SHoldInt ARGS((void ));
1296 S16 SRelInt ARGS((void ));
1297 S16 SEnbInt ARGS((void ));
1298 S16 SDisInt ARGS((void ));
1299 S16 SGetVect ARGS((VectNmb vectNmb,PIF *vectFnct));
1300 S16 SPutVect ARGS((VectNmb vectNmb,PIF vectFnct));
1302 S16 SPutIsrDpr ARGS((VectNmb vectNmb, Void *context, PIF isrFnct,
1304 S16 SSyncInt ARGS((uint16_t adapterNmb, PFVOID syncFnct,
1305 Void *syncContext));
1307 S16 SInitSema ARGS((Region region, Sema *sema));
1308 S16 SRelSema ARGS((Region region, Sema sema));
1309 S16 SGetSema ARGS((Region region, Sema sema));
1310 S16 SActvInit ARGS((Ent ent,Inst inst,Region region,Reason reason));
1311 S16 SActvTsk ARGS((Prior prior,Route route,Ent srcEnt,
1312 Inst srcInst,Buffer *mBuf));
1313 S16 SActvTmr ARGS((void ));
1314 S16 SGetOpt ARGS((int argc,char **argv,char *opts));
1315 /* multiple proc id changes:
1316 These functions not supported with multiple procIds */
1317 #ifndef SS_MULTIPLE_PROCS
1318 S16 SGetEntInst ARGS((Ent *ent, Inst *inst));
1319 S16 SSetEntInst ARGS((Ent ent, Inst inst));
1320 ProcId SFndProcId ARGS((void));
1321 Void SSetProcId ARGS((ProcId pId));
1322 #endif /* SS_MULTIPLE_PROCS */
1324 S16 SGetDBufSiz ARGS((Region region, Pool pool, S16 *size));
1325 S16 SGetStrtIdx ARGS((Region region, Pool pool, S16 *idx));
1326 S16 SGetEndIdx ARGS((Region region, Pool pool, S16 *idx));
1327 S16 SGetStrtPad ARGS((Region region, Pool pool, S16 *pad));
1328 /* multiple proc id changes: control block retrieval function */
1329 #ifdef SS_MULTIPLE_PROCS
1330 S16 SGetXxCb ARGS((ProcId proc, Ent ent, Inst inst, Void **xxCb));
1331 #endif /* SS_MULTIPLE_PROCS */
1335 * These routines are only available for multi-threaded
1336 * system service implementations
1338 S16 SGetMutex ARGS((MtMtxId *mId));
1339 S16 SPutMutex ARGS((MtMtxId mId));
1340 S16 SLockMutex ARGS((MtMtxId mId));
1341 S16 SUnlockMutex ARGS((MtMtxId mId));
1342 S16 SGetCond ARGS((MtCondId *cId));
1343 S16 SPutCond ARGS((MtCondId cId));
1344 S16 SCondWait ARGS((MtMtxId mId,MtCondId cId));
1345 S16 SCondSignal ARGS((MtCondId cId));
1346 S16 SCondBroadcast ARGS((MtCondId cId));
1347 S16 SGetThread ARGS((MtThrd thrd, MtThrdFlags thr_flgs,
1348 Ptr arg, MtThrdId *thrdId));
1349 S16 SPutThread ARGS((MtThrdId thrdId));
1350 Void SThreadYield ARGS((void));
1351 Void SThreadExit ARGS((Ptr *status));
1352 Void SSetThrdPrior ARGS((MtThrdId tId, MtThrdPrior tPr));
1353 Void SGetThrdPrior ARGS((MtThrdId tId, MtThrdPrior *tPr));
1356 Void SExit ARGS((Void));
1358 /* multiple proc id changes: procId added */
1359 #ifndef SS_MULTIPLE_PROCS
1361 S16 SRegTTsk ARGS((Ent ent,
1367 /* ssi_x_001.main_60 */
1368 S16 SRegCbTsk ARGS((Ent ent,
1371 S16 SDeregTTsk ARGS((Ent ent, Inst inst));
1375 S16 SRegTTsk ARGS((ProcId proc,
1382 S16 SDeregTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1384 S16 SRegCbTsk ARGS((ProcId proc,
1388 #endif /* SS_MULTIPLE_PROCS */
1390 S16 SCreateSTsk ARGS((SSTskPrior tskPrior, SSTskId *tskId));
1391 S16 SDestroySTsk ARGS((SSTskId tskId));
1392 /* multiple proc id changes: procId added */
1393 #ifndef SS_MULTIPLE_PROCS
1395 S16 SAttachTTsk ARGS((Ent ent, Inst inst, SSTskId tskId));
1396 S16 SDetachTTsk ARGS((Ent ent, Inst inst));
1400 S16 SAttachTTsk ARGS((ProcId proc, Ent ent, Inst inst, SSTskId tskId));
1401 S16 SDetachTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1403 #endif /* SS_MULTIPLE_PROCS */
1404 S16 SRegRegion ARGS((Region region, SRegInfo *regInfo));
1405 S16 SDeregRegion ARGS((Region region));
1406 S16 SRegDynRegion ARGS((Region region, SRegInfo *regInfo));
1407 /*ssi_x_001.main_62-prototype for SAlloc and SFree, gaurded under flag*/
1409 /* ssi_x_001.main_57 : Additions */
1410 #ifdef SS_HISTOGRAM_SUPPORT
1411 S16 SAlloc ARGS((Region region, Size *size, uint32_t flags, Data **ptr,uint32_t line, uint8_t *fileName, uint8_t entId));
1412 S16 SFree ARGS((Region region, Data *ptr, Size size, uint32_t line, uint8_t *fileName, uint8_t entId));
1414 #ifdef T2K_MEM_LEAK_DBG
1415 #define SAlloc(region,size,flags,ptr) SAllocNew(region,size,flags,ptr,file,line)
1416 #define SFree(region,ptr,size) SFreeNew(region,ptr,size,file,line)
1417 S16 SAllocNew ARGS((Region region, Size *size, uint32_t flags, Data **ptr,char*,uint32_t));
1418 S16 SFreeNew ARGS((Region region, Data *ptr, Size size,char*,uint32_t));
1419 #elif defined(SS_LIGHT_MEM_LEAK_STS)
1420 S16 SAlloc ARGS((Region region, Size *size, uint32_t flags, Data **ptr,uint32_t line, uint8_t *fnName));
1421 S16 SFree ARGS((Region region, Data *ptr, Size size, uint32_t line, uint8_t *fnName));
1423 S16 SAlloc ARGS((Region region, Size *size, uint32_t flags, Data **ptr));
1424 S16 SFree ARGS((Region region, Data *ptr, Size size));
1427 S16 SGetBufRegionPool ARGS((Buffer *mBuf, Region *region, Pool *pool));
1428 #endif /* SS_ENABLE_MACROS */
1430 #ifdef SS_OLD_THREAD
1431 S16 SGetMutex ARGS((SMtxId *mId));
1432 S16 SPutMutex ARGS((SMtxId mId));
1433 S16 SLockMutex ARGS((SMtxId mId));
1434 S16 SUnlockMutex ARGS((SMtxId mId));
1435 S16 SGetCond ARGS((SCondId *cId));
1436 S16 SPutCond ARGS((SCondId cId));
1437 S16 SCondWait ARGS((SMtxId mId,SCondId cId));
1438 S16 SCondSignal ARGS((SCondId cId));
1439 S16 SCondBroadcast ARGS((SCondId cId));
1440 S16 SGetThread ARGS((SThrd thrd, S32 thr_flgs,
1441 Ptr arg, SThrdId *thrdId));
1442 S16 SPutThread ARGS((SThrdId thrdId));
1443 Void SThreadYield ARGS((void));
1444 Void SThreadExit ARGS((Ptr status));
1445 Void SSetThrdPrior ARGS((SThrdId tId, S32 tPr));
1446 Void SGetThrdPrior ARGS((SThrdId tId, S32 *tPr));
1447 Void SExit ARGS((void));
1448 #else /* SS_OLD_THREAD */
1449 S16 SThreadYield ARGS((void));
1450 #endif /* SS_OLD_THREAD */
1452 S16 SInitLock ARGS((SLockId *lock,uint8_t type));
1453 S16 SLock ARGS((SLockId *lock));
1454 S16 SUnlock ARGS((SLockId *lock));
1455 S16 SDestroyLock ARGS((SLockId *lock));
1458 S16 SInitSemaphore ARGS((SsSemaId *sem, uint8_t value));
1459 S16 SWaitSemaphore ARGS((SsSemaId *sem));
1460 S16 SPostSemaphore ARGS((SsSemaId *sem));
1461 S16 SDestroySemaphore ARGS((SsSemaId *sem));
1463 /* multiple proc id changes:
1464 new function required to implement multiple procIds */
1465 #ifdef SS_MULTIPLE_PROCS
1466 S16 SAddProcIdLst ARGS((uint16_t numPIds, ProcId *pIdLst));
1467 S16 SRemProcIdLst ARGS((uint16_t numPIds, ProcId *pIdLst));
1468 S16 SGetProcIdLst ARGS((uint16_t *numPIds, ProcId *pIdLst));
1469 #endif /* SS_MULTIPLE_PROCS */
1473 #ifdef SS_SEGV_SIG_HDLR
1474 #ifndef SS_MULTIPLE_PROCS
1475 S16 SRegIntrptHdlr ARGS((Ent ent, Inst inst, PFS16 intrptActvFn));
1477 S16 SRegIntrptHdlr ARGS((ProcId proc, Ent ent, Inst inst, PFS16 intrptActvFn));
1478 #endif/*SS_MULTIPLE_PROCS*/
1479 #endif /* SS_SEGV_SIG_HDLR */
1483 #ifndef SS_MULTIPLE_PROCS
1484 S16 SRegTTsk ARGS((Ent ent,
1490 /* ssi_x_001.main_60 */
1491 S16 SRegCbTsk ARGS((Ent ent,
1494 S16 SDeregTTsk ARGS((Ent ent, Inst inst));
1495 S16 SAttachTTsk ARGS((Ent ent, Inst inst, SSTskId tskId));
1496 S16 SDetachTTsk ARGS((Ent ent, Inst inst));
1498 S16 SRegTTsk ARGS((ProcId proc,
1505 S16 SRegCbTsk ARGS((ProcId proc,
1509 S16 SDeregTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1510 S16 SAttachTTsk ARGS((ProcId proc, Ent ent, Inst inst, SSTskId tskId));
1511 S16 SDetachTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1512 #endif /* SS_MULTIPLE_PROCS */
1514 S16 SCreateSTsk ARGS((SSTskPrior tskPrior, SSTskId *tskId));
1515 S16 SDestroySTsk ARGS((SSTskId tskId));
1516 #ifndef SS_ENABLE_MACROS
1517 S16 SGetBufRegionPool ARGS((Buffer *mBuf, Region *region, Pool *pool));
1518 #endif /* SS_ENABLE_MACROS */
1520 S16 SInitLock ARGS((SLockId *lock,uint8_t type));
1521 S16 SLock ARGS((SLockId *lock));
1522 S16 SUnlock ARGS((SLockId *lock));
1523 S16 SDestroyLock ARGS((SLockId *lock));
1525 S16 SInitSemaphore ARGS((SsSemaId *sem, uint8_t value));
1526 S16 SWaitSemaphore ARGS((SsSemaId *sem));
1527 S16 SPostSemaphore ARGS((SsSemaId *sem));
1528 S16 SDestroySemaphore ARGS((SsSemaId *sem));
1529 /* functions required to implement multiple procIds */
1530 #ifdef SS_MULTIPLE_PROCS
1531 S16 SAddProcIdLst ARGS((uint16_t numPIds, ProcId *pIdLst));
1532 S16 SRemProcIdLst ARGS((uint16_t numPIds, ProcId *pIdLst));
1533 S16 SGetProcIdLst ARGS((uint16_t *numPIds, ProcId *pIdLst));
1534 #endif /* SS_MULTIPLE_PROCS */
1536 #endif /* PORTVER */
1539 /* function prototypes */
1541 /* stack manager initialization function */
1542 /* multiple proc id changes: procId added */
1543 #ifndef SS_MULTIPLE_PROCS
1544 S16 smActvInit ARGS((Ent ent, Inst inst, Region region, Reason reason));
1545 #else /* SS_MULTIPLE_PROCS */
1546 S16 smActvInit ARGS((ProcId proc,
1552 #endif /* SS_MULTIPLE_PROCS */
1554 /* stack manager external initialization function */
1555 S16 smInitExt ARGS((void));
1557 /* stack manager activation function */
1558 S16 smActvTsk ARGS((Pst *pst, Buffer *mBuf));
1560 /* ssi_x_001.main_54 */
1561 #ifdef SS_SID_CHANGE
1562 /* ssi_x_001.main_53 */
1563 S16 SGetInDepSId ARGS((SystemId *s));
1564 S16 SGetDepSId ARGS((SystemId *s));
1569 #define SS_INITDCHN(chn) (chn)->next = NULLP; (chn)->prev = NULLP
1570 #define SS_INITQUE(qu) \
1571 SS_INITDCHN(&(qu)->dChn); (qu)->crntSize = 0
1572 #define SS_QLEN(bq) ((bq)->crntSize)
1573 #define SS_MLEN(mb) ((mb)->t.msg.msgLen)
1575 /* ssi_x_001.main_50 : Added declarations for mutex related functions
1576 * to protect demand queue and memory allocation
1578 /* ssi_x_001.main_51 : Added control flag as these are only used by windows */
1580 S16 WTInitLock ARGS((SLockId *lock,uint8_t type));
1581 S16 WTLock ARGS((SLockId *lock));
1582 S16 WTUnlock ARGS((SLockId *lock));
1583 S16 WTDestroyLock ARGS((SLockId *lock));
1584 #endif /* End of SS_WIN */
1585 /* ssi_x_001.main_57 : Additions */
1586 #ifdef SS_LOGGER_SUPPORT
1587 S16 SRegLogCfg ARGS(( uint8_t mode, S8 *path, uint32_t size, S8 *IPA, uint16_t port));
1588 S16 SWrtLogBuf ARGS(( Txt *buf ));
1589 /* ssi_x_001.main_60 */
1590 S16 SDeregLogCfg ARGS((Void ));
1591 #endif /* SS_LOGGER_SUPPORT */
1593 #ifdef SS_HISTOGRAM_SUPPORT
1594 S16 SRegForHstGrm ARGS((Ent ent));
1595 S16 SHstGrmInfoShow ARGS((Ent *entId));
1596 S16 SFillEntIds ARGS((Void));
1597 S16 SGetEntInd ARGS((Ent *entId, uint8_t *fileName));
1598 #endif /* SS_HISTOGRAM_SUPPORT */
1599 /* ssi_x_001.main_68 Multiple declaration removed , one already in cm_task.x */
1600 /* ssi_x_001.main_61: Lock support guraded under the flag */
1601 #ifdef SS_LOCK_SUPPORT
1602 S16 SLockNew ARGS((SLockInfo *LockId, uint8_t lockType));
1603 S16 SInitLockNew ARGS((SLockInfo *LockId, uint8_t lockType));
1604 S16 SUnlockNew ARGS((SLockInfo *LockId, uint8_t lockType));
1605 S16 SDestroyLockNew ARGS((SLockInfo *LockId, uint8_t lockType));
1606 #endif /* SS_LOCK_SUPPORT */
1607 S8* SGetConfigPath ARGS((Void));
1609 /* ssi_x_001.main_66 : Added new Buffer manegement APIs */
1610 S16 SCpyPartMsg ARGS((Buffer *srcBuf, MsgLen idx, MsgLen cnt, Buffer *dstBuf));
1611 S16 SRepPartMsg ARGS((Buffer *srcBuf, MsgLen idx, MsgLen cnt, Buffer *dstBuf));
1612 S16 SMovPartMsg ARGS((Buffer *srcBuf, MsgLen idx, Buffer *dstBuf));
1613 S16 SPkMsgMult ARGS((Data *src, MsgLen cnt, Buffer *mBuf));
1614 S16 SGetReadPtr ARGS((Buffer *mBuf, uint8_t** data, MsgLen *len));
1619 SS_NON_SHARABLE_MEMORY
1621 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1622 S16 SReInitTmr ARGS((Void ));
1624 /* ssi_x_001.main_69: Added MSPD debug macro */
1627 char ys_global_printbuf[256];
1628 Void rbCallstackShow ARGS((Void));
1629 Void rbCallstackShowForCore ARGS((uint32_t coreId));
1630 uint32_t MacGetTick ARGS ((void));
1633 uint64_t glblTtiCnt;
1636 S16 SStartTask ARGS((volatile uint32_t *startTime, uint32_t tarkId));
1637 S16 SStopTask ARGS((volatile uint32_t startTime,uint32_t taskId));
1638 #ifdef MSPD_MLOG_NEW
1639 /* Removed for C++ Compilation
1640 unsigned int MLogTask (unsigned int taskid, unsigned int resourceid ,
1641 unsigned int ticksstart,unsigned int ticksstop);
1645 #if defined(MSPD) && defined(MSPD_DBG_ENABLE)
1646 #define MSPD_DBG_RLC(...)
1647 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1649 #define MSPD_DBG(...) do { \
1650 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1651 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "%s():%u @%lu ", __func__, __LINE__, ysGT); \
1652 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1653 ssMemlog(_local_printbuf, _len2); \
1656 #define MSPD_DBG(...) do { \
1657 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1658 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "%s():%u @%u ", __func__, __LINE__, ysGT); \
1659 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1660 ssMemlog(_local_printbuf, _len2); \
1663 #define MSPD_DBG_RAW(...) do { \
1664 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1665 int _len = snprintf(_local_printbuf,SS_MEMLOG_MAXSTRLEN, __VA_ARGS__); \
1666 ssMemlog(_local_printbuf, _len); \
1669 #define MSPD_LOG(...) do { \
1670 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1671 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN,"%s():%u @%lu ", __func__, __LINE__, ysGT); \
1672 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1673 ssMemlog(_local_printbuf, _len2); \
1676 #define MSPD_LOG(...) do { \
1677 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1678 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN,"%s():%u @%u ", __func__, __LINE__, ysGT); \
1679 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1680 ssMemlog(_local_printbuf, _len2); \
1685 #define MSPD_ERR(...) do { \
1686 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1687 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "ERROR: %s():%u @%lu ", __func__, __LINE__, ysGT); \
1688 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1689 ssMemlog(_local_printbuf, _len2); \
1692 #define MSPD_ERR(...) do { \
1693 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1694 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "ERROR: %s():%u @%u ", __func__, __LINE__, ysGT); \
1695 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1696 ssMemlog(_local_printbuf, _len2); \
1701 Void ssMlogInit(Void);
1702 Void ssMlogIncrCounter(Void);
1703 Void ssMemlogInit(Void);
1704 Void ssMemlog(char *, uint32_t size);
1705 Void ssMemlogWrite(Void);
1707 #endif /* TENB_T2K3K_SPECIFIC_CHANGES */
1714 Void SIncrementTtiCount(Void);
1715 Ticks SGetTtiCount(Void);
1716 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1717 Void mtStopHndlr(Void);
1720 #ifdef TENB_RTLIN_CHANGES
1721 Void ysPrntBkTrace(Void);
1722 Void ssMlogInit(Void);
1723 Void ssMlogIncrCounter(Void);
1725 #ifdef SS_THR_REG_MAP
1726 Void ssRegMainThread(Void);
1729 #ifdef T2K_MEM_LEAK_DBG
1730 #define ssGetDBufOfSize(region,size,dBuf) ssGetDBufOfSizeNew(region,size,dBuf,__FILE__,__LINE__)
1731 S16 ssGetDBufOfSizeNew ARGS((Region region, Size size, Buffer **dBuf,char*,uint32_t));
1733 S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf);
1736 /* ssi_x_001.main_69: Added MSPD debug macro */
1738 void SEND_DBG_MSG(uint8_t *str, ...);
1741 #endif /* __SSIX__ */
1744 /********************************************************************30**
1747 **********************************************************************/