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 U32 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 U16 Size; /* size (for number of bytes per region or per s-pool) */
58 typedef U32 Size; /* size (for number of bytes per region or per s-pool) */
59 typedef S32 PtrOff; /* signed pointer offset */
62 typedef U32 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 U16 Random; /* random number */
72 typedef S16 Seq; /* sequence */
73 /* ssi_x_001.main_64 Additions */
74 typedef U32 CoreId; /* core id */
77 typedef U32 ErrCls; /* Error Class */
79 typedef U32 ErrCode; /* Error Code */
81 typedef U32 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 U32 wsU32[2]; /* workspace unsigned 32 bit values (optional) */
165 U16 wsU16[1]; /* workspace unsigned 16 bit values (optional) */
166 U8 wsU8[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 U8 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 U8 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 U8 spare1; /* spare for alignment */
268 U16 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 U8 spare1; /* spare 1 */
283 U16 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 U16 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 U16 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 U8 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 U8 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 U8 spare1; /* spare for alignment */
469 U16 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 U16 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 U8 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 U8 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 U8 spare1; /* spare for alignment */
633 U16 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 U8 spare1; /* spare 1 */
648 U16 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 U8 SSTskId; /* System Task Id */
691 #else /* SS_MULTIPLE_PROCS */
692 typedef U16 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 U8 SSTskId; /* System Task Id */
713 #else /* SS_MULTIPLE_PROCS */
714 typedef U16 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 U8 *b_rptr; /* 1st unread data byte of buffer */
734 U8 *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 U8 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 *, U32, Data **, U32, U32, U8*, U8, Bool));
778 typedef S16 (*SsAlloc) ARGS((Void *, Size *, U32, Data **, U32, U8*, U8, Bool));
779 #endif /* SSI_DEBUG_LEVEL1 */
780 typedef S16 (*SsFree) ARGS((Void *, Data *, Size, U32, U8*, U8, Bool));
781 typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));
782 #elif defined(SS_LIGHT_MEM_LEAK_STS)
783 typedef S16 (*SsAlloc) ARGS((Void *, Size *, U32 , Data **, U32, U32 , U8 *));
784 typedef S16 (*SsFree) ARGS((Void *, Data *, Size, U32, U8 *));
785 typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));
787 #ifdef SSI_DEBUG_LEVEL1
788 typedef S16 (*SsAlloc) ARGS((Void *, Size *, U32, Data **, U32));
790 #ifdef T2K_MEM_LEAK_DBG
791 typedef S16 (*SsAlloc) ARGS((Void *, Size *, U32, Data **,char*, U32));
793 typedef S16 (*SsAlloc) ARGS((Void *, Size *, U32, Data **));
795 #endif /* SSI_DEBUG_LEVEL1 */
796 #ifdef T2K_MEM_LEAK_DBG
797 typedef S16 (*SsFree) ARGS((Void *, Data *, Size,char*, U32));
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 U32 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 S16 (*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 S16 (*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 U16 isFlag; /* interrupt service flag */
922 ISTsk isTsk; /* interrupt service task */
926 #endif /* ENB_RELAY */
930 EXTERN S16 SChekMemUtilization ARGS((Region region,Bool *memAlarm));
932 EXTERN Void prntMem ARGS((Data *strtAdr,S16 len));
933 EXTERN Void prntMsg ARGS((Buffer *mBuf));
934 EXTERN Void prntMsg1 ARGS((Buffer *mBuf,S16 src,S16 dst));
935 EXTERN S16 tst ARGS((void ));
936 EXTERN S16 rdConQ ARGS((Data data));
938 EXTERN S16 SPkS8 ARGS((S8 val,Buffer *mBuf));
939 EXTERN S16 SPkU8 ARGS((U8 val,Buffer *mBuf));
940 EXTERN S16 SPkS16 ARGS((S16 val,Buffer *mBuf));
941 EXTERN S16 SPkU16 ARGS((U16 val,Buffer *mBuf));
942 EXTERN S16 SPkS32 ARGS((S32 val,Buffer *mBuf));
943 EXTERN S16 SPkU32 ARGS((U32 val,Buffer *mBuf));
944 /* ssi_x_001.main_49 : added packing of F32 and F64*/
946 EXTERN S16 SPkF32 ARGS((F32 val,Buffer *mBuf));
947 EXTERN S16 SPkF64 ARGS((F64 val,Buffer *mBuf));
948 #endif /* SS_FLOAT */
949 EXTERN S16 SUnpkS8 ARGS((S8 *val,Buffer *mBuf));
950 EXTERN S16 SUnpkU8 ARGS((U8 *val,Buffer *mBuf));
951 EXTERN S16 SUnpkS16 ARGS((S16 *val,Buffer *mBuf));
952 EXTERN S16 SUnpkU16 ARGS((U16 *val,Buffer *mBuf));
953 EXTERN S16 SUnpkS32 ARGS((S32 *val,Buffer *mBuf));
954 EXTERN S16 SUnpkU32 ARGS((U32 *val,Buffer *mBuf));
955 /* ssi_x_001.main_49 : added unpacking of F32 and F64*/
957 EXTERN S16 SUnpkF32 ARGS((F32 *val,Buffer *mBuf));
958 EXTERN S16 SUnpkF64 ARGS((F64 *val,Buffer *mBuf));
959 #endif /* SS_FLOAT */
960 EXTERN S16 SPrint ARGS((Txt *buf));
961 EXTERN S16 SDisplay ARGS((S16 chan,Txt *buf));
962 EXTERN S16 SPrntMsg ARGS((Buffer *mBuf,S16 src,S16 dst));
963 EXTERN S16 SInitQueue ARGS((Queue *q));
964 #ifndef SS_ENABLE_MACROS
965 EXTERN S16 SQueueFirst ARGS((Buffer *buf,Queue *q));
966 EXTERN S16 SQueueLast ARGS((Buffer *buf,Queue *q));
967 EXTERN S16 SDequeueFirst ARGS((Buffer * *bufPtr,Queue *q));
968 EXTERN S16 SDequeueLast ARGS((Buffer * *bufPtr,Queue *q));
969 #endif /* SS_ENABLE_MACROS */
970 EXTERN S16 SFlushQueue ARGS((Queue *q));
971 EXTERN S16 SCatQueue ARGS((Queue *q1,Queue *q2,Order order));
972 EXTERN S16 SFndLenQueue ARGS((Queue *q,QLen *lngPtr));
973 EXTERN S16 SExamQueue ARGS((Buffer **bufPtr,Queue *q,QLen idx));
974 EXTERN S16 SAddQueue ARGS((Buffer *buf,Queue *q,QLen idx));
975 EXTERN 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 EXTERN S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,char*,U32));
981 EXTERN S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf,char*,U32));
982 EXTERN S16 SAttachPtrToBufNew ARGS((Region region, Pool pool, Data
983 *ptr, MsgLen totalLen, Buffer** mBuf, char* file, U32 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 EXTERN S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,U32 line,U8 *fnName));
988 EXTERN S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf, U32 line, U8 *fnName));
991 EXTERN S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
992 EXTERN 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 EXTERN S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,char*,U32));
999 EXTERN S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf,char*,U32));
1000 #elif SS_LIGHT_MEM_LEAK_STS
1001 EXTERN S16 SGetDBufNew ARGS((Region region,Pool pool,Buffer * *bufPtr,U32 line,U8 *fnName));
1002 EXTERN S16 SPutDBufNew ARGS((Region region,Pool pool,Buffer *buf, U32 line, U8 *fnName));
1004 EXTERN S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
1005 EXTERN S16 SPutDBuf ARGS((Region region,Pool pool,Buffer *buf));
1007 #endif /* SS_ENABLE_MACROS */
1008 EXTERN S16 SPutMsgToRegion ARGS((Region region, Buffer *buf));
1009 #ifdef SS_USE_ICC_MEMORY
1010 EXTERN 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 EXTERN S16 SGetMsgNew ARGS((Region region, Pool pool, Buffer * *mBufPtr, U32 line, U8 *fnName));
1017 EXTERN S16 SGetSBufNew ARGS((Region region,Pool pool, Data * *bufPtr, Size size, U32 line, U8* fnName));
1018 EXTERN S16 SPutMsgNew ARGS((Buffer *mBuf, U32 line, U8 *fnName));
1019 EXTERN S16 SPutSBufNew ARGS((Region region, Pool pool, Data *buf, Size size, U32 line, U8 *fnName));
1020 #else /*SS_LIGHT_MEM_LEAK_STS */
1021 #ifdef SS_HISTOGRAM_SUPPORT
1022 EXTERN S16 SPutMsgNew ARGS((Buffer *mBuf, U32 line, U8 *fileName));
1023 EXTERN S16 SGetMsgNew ARGS((Region region, Pool pool, Buffer * *mBufPtr, U32 line, U8 *fileName));
1024 EXTERN S16 SGetSBufNew ARGS((Region region,Pool pool, Data * *bufPtr, Size size, U32 line, U8 *fileName));
1025 EXTERN S16 SPutSBufNew ARGS((Region region, Pool pool, Data *buf, Size size, U32 line, U8 *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 EXTERN S16 SPutMsgNew ARGS((Buffer *mBuf,char*, U32));
1033 EXTERN S16 SGetMsgNew ARGS((Region region, Pool pool, Buffer * *mBufPtr, char*,U32));
1035 EXTERN S16 SPutMsg ARGS((Buffer *mBuf));
1036 EXTERN 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 EXTERN S16 SPutMsgRmi ARGS((char *file, int line, Buffer *mBuf));
1042 EXTERN 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 EXTERN S16 SGetSBuf1 ARGS((Region region,Pool pool, Data * *bufPtr, Size size, char* file, U32 line));
1047 EXTERN void DumpStaticMemLeakFiles ARGS((void));
1048 EXTERN void DumpT2kMemLeakInfoToFile ARGS((void));
1049 #define SPutSBuf(region,pool,buf,size) SPutSBuf1(region,pool,buf,size,__FILE__,__LINE__)
1050 EXTERN S16 SPutSBuf1 ARGS((Region region, Pool pool, Data *buf, Size size, char*, U32));
1052 EXTERN S16 SGetSBuf ARGS((Region region,Pool pool, Data * *bufPtr, Size size));
1053 EXTERN S16 SPutSBuf ARGS((Region region, Pool pool, Data *buf, Size size));
1055 #endif /* SS_HISTOGRAM_SUPPORT */
1056 #endif /*SS_LIGHT_MEM_LEAK_STS */
1058 #ifdef T2K_MEM_LEAK_DBG
1059 #define SGetSBufWls(region,pool,bufPtr,size) SGetSBufWls1(region,pool,bufPtr,size,__FILE__,__LINE__)
1060 #define SPutSBufWls(region,pool,bufPtr,size) SPutSBufWls1(region,pool,bufPtr,size,__FILE__,__LINE__)
1061 EXTERN S16 SPutSBufWls1(Region region, Pool pool, Data *ptr, Size size,char* file, U32 line);
1062 EXTERN S16 SGetSBufWls1(Region region, Pool pool, Data **ptr, Size size,char* file, U32 line);
1063 #define SAttachWlsPtrToMBuf(region,pool,bufPtr,rPtr,size,pLen,mBuf) SAttachWlsPtrToMBuf1(region,pool,bufPtr,rPtr,size,pLen,mBuf,__FILE__,__LINE__)
1064 EXTERN S16 SAttachWlsPtrToMBuf1(Region region, Pool pool, Data *ptr, Data *readPtr, MsgLen totalLen, MsgLen ptrLen, Buffer** mBuf,char* file, U32 line);
1065 #define SAttachPtrToMBuf(region,pool,bufPtr,size,pLen,mBuf) SAttachPtrToMBuf1(region,pool,bufPtr,size,pLen,mBuf,__FILE__,__LINE__)
1068 EXTERN S16 SPutSBufWls(Region region, Pool pool, Data *ptr, Size size);
1069 EXTERN S16 SGetSBufWls(Region region, Pool pool, Data **ptr, Size size);
1070 EXTERN S16 SAttachWlsPtrToMBuf(Region region, Pool pool, Data *ptr, Data *readPtr, MsgLen totalLen, MsgLen ptrLen, Buffer** mBuf);
1073 EXTERN S16 SGetStaticBuffer ARGS((Region region,Pool pool, Data * *bufPtr, Size size, U8 memType));
1074 EXTERN S16 SPutStaticBuffer ARGS((Region region, Pool pool, Data *buf, Size size, U8 memType));
1075 /* ssi_x_001.main_65: Additions */
1076 #ifdef SS_SEUM_CAVIUM
1077 EXTERN S16 ssInitRcvWork ARGS((void));
1078 EXTERN S16 SConvPtrPhy ARGS(( Buffer **mBuf));
1079 EXTERN S16 SConvPhyPtr ARGS((Buffer **workPtr));
1080 EXTERN S16 SCpyFpaMsg ARGS((Buffer *srcBuf, Region dstRegion,Pool dstPool, Buffer **dstBuf));
1081 EXTERN S16 SCpyMsgFpa ARGS(( Buffer *srcBuf, Buffer **dstBuf));
1082 EXTERN S16 SPutFpaMsg ARGS(( Buffer *fpaBuf));
1083 #endif /* SS_SEUM_CAVIUM */
1085 EXTERN S16 SGetSMem ARGS((Region region,Size size,Pool *poolPtr));
1086 EXTERN S16 SPutSMem ARGS((Region region,Pool pool));
1087 EXTERN S16 SInitMsg ARGS((Buffer *mBuf));
1088 EXTERN S16 SAddPreMsg ARGS((Data data,Buffer *mBuf));
1089 EXTERN S16 SAddPstMsg ARGS((Data data,Buffer *mBuf));
1090 /* ssi_x_001.main_70 - Added prototype for SAddPreMsgMultInOrder */
1091 EXTERN S16 SAddPreMsgMultInOrder ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1092 EXTERN S16 SRemPreMsg ARGS((Data *dataPtr,Buffer *mBuf));
1093 EXTERN S16 SRemPreMsgRegion ARGS((Region region, Data *dataPtr,Buffer *mBuf));
1094 EXTERN S16 SCatMsgRegion ARGS((Region region, Buffer *mBuf1,Buffer *mBuf2,Order order));
1095 EXTERN S16 SSegMsgRegion ARGS((Region region, Buffer *mBuf1,MsgLen idx,Buffer **mBuf2));
1096 EXTERN int SCreatePThread ARGS((pthread_t* tid, pthread_attr_t* attr, void *(*start_routine) (void *), void* arg));
1097 EXTERN S16 SRemPstMsg ARGS((Data *dataPtr,Buffer *mBuf));
1098 #ifdef T2K_MEM_LEAK_DBG
1099 #define SAddPreMsgMult(src, cnt, mBuf) SAddPreMsgMult1(src, cnt, mBuf, __FILE__,__LINE__)
1100 #define SAddPstMsgMult(src, cnt, mBuf) SAddPstMsgMult1(src, cnt, mBuf, __FILE__,__LINE__)
1102 EXTERN S16 SAddPreMsgMult1 ARGS((Data *src,MsgLen cnt,Buffer *mBuf, char *file, U32 line));
1103 EXTERN S16 SAddPstMsgMult1 ARGS((Data *src,MsgLen cnt,Buffer *mBuf, char *file, U32 line));
1105 EXTERN S16 SAddPreMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1106 EXTERN S16 SAddPstMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1108 EXTERN S16 SGetPstMsgMult ARGS((MsgLen cnt,Buffer *mBuf));
1109 EXTERN S16 SRemPreMsgMult ARGS((Data *dst,MsgLen cnt,Buffer *mBuf));
1110 EXTERN S16 SRemPstMsgMult ARGS((Data *dst,MsgLen cnt,Buffer *mBuf));
1111 EXTERN S16 SRepMsg ARGS((Data data,Buffer *mBuf,MsgLen idx));
1112 EXTERN S16 SExamMsg ARGS((Data *dataPtr,Buffer *mBuf,MsgLen idx));
1113 /*ssi_x_001.main_60 */
1114 EXTERN S16 SGetDataFrmMsg ARGS ((Buffer *mBuf, Data *dataPtr, MsgLen idx, MsgLen dataLen));
1115 EXTERN S16 SFndLenMsg ARGS((Buffer *mBuf,MsgLen *lngPtr));
1116 EXTERN S16 SCatMsg ARGS((Buffer *mBuf1,Buffer *mBuf2,Order order));
1117 #ifdef T2K_MEM_LEAK_DBG
1118 #define SSegMsg(mBuf1, idx, mBuf2) SSegMsgNew(mBuf1, idx, mBuf2, __FILE__, __LINE__)
1119 EXTERN S16 SSegMsgNew ARGS((Buffer *mBuf1,MsgLen idx,Buffer **mBuf2,char*,U32));
1121 EXTERN S16 SSegMsg ARGS((Buffer *mBuf1,MsgLen idx,Buffer **mBuf2));
1123 EXTERN S16 SSwapMsg ARGS((Buffer *mBuf1, Buffer *mBuf2));
1124 EXTERN S16 SCpyMsgFix ARGS((Buffer *srcMbuf,MsgLen srcIdx,MsgLen cnt,
1125 Data *dstBuf,MsgLen *cCnt));
1126 EXTERN S16 SCpyFixMsg ARGS((Data *srcBuf,Buffer *dstMbuf,
1127 MsgLen dstIdx,MsgLen cnt,MsgLen *cCnt));
1128 EXTERN S16 SCompressMsg ARGS((Buffer *mBuf));
1129 #ifdef T2K_MEM_LEAK_DBG
1130 #define SAddMsgRef(mBuf,region,pool,dstBuf) SAddMsgRefNew(mBuf,region,pool,dstBuf,__FILE__,__LINE__)
1131 #define SCpyMsgMsg(mBuf,region,pool, dstBuf) SCpyMsgMsgNew(mBuf,region,pool, dstBuf, __FILE__, __LINE__)
1132 EXTERN S16 SAddMsgRefNew ARGS((Buffer *mBuf, Region region, Pool pool,
1133 Buffer **dstBuf,char*,U32));
1134 EXTERN S16 SCpyMsgMsgNew ARGS((Buffer *mBuf, Region region, Pool pool,
1135 Buffer **dstBuf,char* , U32));
1137 EXTERN S16 SCpyMsgMsg ARGS((Buffer *mBuf, Region region, Pool pool,
1139 EXTERN S16 SAddMsgRef ARGS((Buffer *mBuf, Region region, Pool pool,
1141 EXTERN S16 SIncMsgRef(Buffer *srcBuf, Region dstRegion, Pool dstPool, Buffer **dstBuf);
1144 /* EXTERN S16 SIncMsgRef ARGS((Buffer *srcBuf, Buffer **dstBuf)); */
1145 EXTERN Void SIncMsgLen ARGS((Buffer *mBuf));
1148 EXTERN S16 SChkRes ARGS((Region region,Pool pool,Status *status));
1149 EXTERN S16 SChkResUtl ARGS((Region region,U8 *wSum));
1150 EXTERN S16 SSetDateTime ARGS((DateTime *dt));
1151 EXTERN S16 SGetDateTime ARGS((DateTime *dt));
1153 EXTERN Void SResetMBuf ARGS ((Buffer *mBuf));
1155 /* ssi_x_001.main_57 : Additions */
1156 /* ssi_x_001.main_58 : Additions */
1157 /* ssi_x_001.main_60 : Modifications */
1158 EXTERN S16 SGetEpcTime ARGS((EpcTime *et));
1159 /* ssi_x_001.main_48: Added Timestamp changes */
1160 EXTERN S16 SGetTimeStamp ARGS(( S8 *ts));
1161 EXTERN S16 SGetSysTime ARGS((Ticks *sysTime));
1162 EXTERN S16 SGetRefTime ARGS((U32 refTime, U32 *sec, U32 *usec));
1163 EXTERN S16 SRandom ARGS((Random *value));
1164 EXTERN S16 SError ARGS((Seq seq,Reason reason));
1165 EXTERN Void SLogError ARGS((Ent ent, Inst inst, ProcId procId, Txt *file,
1166 S32 line, ErrCls errCls, ErrCode errCode,
1167 ErrVal errVal, Txt *errDesc));
1168 /* ssi_x_001.main_49 : added prototype for SGetSystemTsk() */
1169 EXTERN U32 SGetSystemTsk ARGS ((Void));
1170 /* changes to support multiple processors in single SSI */
1171 /* multiple proc id changes:
1172 these functions are not supported with multiple proc Ids */
1173 #ifndef SS_MULTIPLE_PROCS
1174 EXTERN S16 SRegInit ARGS((Ent ent,Inst inst,PAIFS16 initFnct));
1175 EXTERN S16 SRegActvTsk ARGS((Ent ent,Inst inst,Ttype ttype,Prior prior,
1177 #endif /* SS_MULTIPLE_PROCS */
1179 /* multiple proc id changes: procId added and time function type modified */
1180 #ifndef SS_MULTIPLE_PROCS
1181 EXTERN S16 SRegCfgTmr ARGS((Ent ent,
1187 /* ssi_x_001.main_53 */
1188 EXTERN S16 SRegCfgTmrMt ARGS((Ent ent,
1192 PAIFTMRS16 tmrFnctMt));
1194 EXTERN S16 SDeregCfgTmr ARGS((Ent ent,
1200 /* ssi_x_001.main_53 */
1201 EXTERN S16 SDeregCfgTmrMt ARGS((Ent ent,
1205 PAIFTMRS16 tmrFnctMt));
1208 EXTERN S16 SRegCfgTmr ARGS((ProcId proc,
1213 PAIFTMRS16 tmrFnct));
1214 EXTERN S16 SDeregCfgTmr ARGS((ProcId proc,
1219 PAIFTMRS16 tmrFnct));
1220 #endif /* SS_MULTIPLE_PROCS */
1222 EXTERN S16 SPstTsk ARGS((Pst *pst, Buffer *mBuf));
1224 #ifdef SS_ROUTE_MSG_CORE1
1225 EXTERN S16 SPstTskIcpu ARGS((Pst *pst, Buffer *mBuf));
1229 EXTERN S16 SRegDrvrTsk ARGS((Inst inst, ProcId low, ProcId high,
1230 ActvTsk actvTsk, ISTsk isTsk));
1231 /*ssi_x_001.main_56*/
1232 EXTERN S16 SDeregDrvrTsk ARGS((Inst channel));
1233 #endif /* ENB_RELAY */
1235 #ifdef SS_RTR_SUPPORT
1236 EXTERN S16 SRegRtrTsk ARGS((Route *, Cntr, ActvTsk));
1237 EXTERN S16 SDeregRtrTsk ARGS((Route *, Cntr));
1238 #endif /* SS_RTR_SUPPORT */
1240 #ifdef SS_USE_ZBC_MEMORY
1241 EXTERN S16 SAttachPtrToBuf ARGS((
1249 /* multi-core support ssi_x_001.main_55 */
1250 /*ssi_x_001.main_68 Added SS_AFFINITY_SUPPORT*/
1251 #if defined(SS_MULTICORE_SUPPORT) || defined(SS_AFFINITY_SUPPORT)
1253 typedef S8 SsAffinityMode;
1257 U32 numCores; /* total number of cores available */
1258 U32 threadsPerCore; /* total number of threads available per core */
1259 U32 threadRegister[SS_MAX_CORES]; /* available threads per core */
1262 EXTERN S16 SRegCpuInfo ARGS((SCpuInfo *cpuInfo));
1263 EXTERN S16 SSetAffinity ARGS((SSTskId *tskId, SsAffinityMode mode, U32 coreId, SSTskId *tskAssociatedTskId));
1264 EXTERN S16 SGetAffinity ARGS((SSTskId *tskId, U32 *coreId));
1266 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT*/
1268 #ifdef SS_AEHDPR_SUPPORT
1269 EXTERN S16 SSetAehDpr ARGS((ProcId procId, VectNmb vectNmb,PISR pisr,PTR ptr1,PDPR pdpr,PTR ptr2));
1270 EXTERN S16 SRemoveAehDpr ARGS((ProcId chipNum, VectNmb vectNmb));
1272 EXTERN S16 SAddDBufPst ARGS((Buffer *mBuf, Buffer *dBuf));
1273 EXTERN S16 SAddDBufPre ARGS((Buffer *mBuf, Buffer *dBuf));
1274 EXTERN S16 SRemDBufPst ARGS((Buffer *mBuf, Buffer **dBuf));
1275 EXTERN S16 SRemDBufPre ARGS((Buffer *mBuf, Buffer **dBuf));
1276 EXTERN S16 SGetDataRx ARGS((Buffer *dBuf, MsgLen pad, Data **dat, MsgLen *mLen));
1277 EXTERN S16 SGetDataTx ARGS((Buffer *dBuf, Data **dat, MsgLen *mLen));
1278 EXTERN S16 SUpdMsg ARGS((Buffer *mBuf, Buffer *dBuf, MsgLen mLen));
1279 EXTERN S16 SCacheFlush ARGS( (U16 cache_type, Data *addr, Size size));
1280 EXTERN S16 SCacheInvalidate ARGS( (U16 cache_type, Data *addr, Size size));
1281 EXTERN S16 SAlignDBufEven ARGS((Buffer *dBuf));
1282 EXTERN S16 SAlignDBuf ARGS((Buffer *dBuf, U32 align));
1283 EXTERN S16 SInitNxtDBuf ARGS((Buffer *mBuf));
1284 EXTERN S16 SGetNxtDBuf ARGS((Buffer *mBuf, Buffer **dBuf));
1285 EXTERN S16 SChkNxtDBuf ARGS((Buffer *mBuf));
1286 EXTERN S16 SSetIntPend ARGS((U16 id, Bool flag));
1287 EXTERN S16 SChkMsg ARGS((Buffer *mBuf));
1288 EXTERN S16 SDeregInitTskTmr ARGS((Ent ent,Inst inst));
1289 EXTERN S16 SExitTsk ARGS((void ));
1290 EXTERN S16 SExitInt ARGS((void ));
1291 EXTERN S16 SHoldInt ARGS((void ));
1292 EXTERN S16 SRelInt ARGS((void ));
1293 EXTERN S16 SEnbInt ARGS((void ));
1294 EXTERN S16 SDisInt ARGS((void ));
1295 EXTERN S16 SGetVect ARGS((VectNmb vectNmb,PIF *vectFnct));
1296 EXTERN S16 SPutVect ARGS((VectNmb vectNmb,PIF vectFnct));
1298 EXTERN S16 SPutIsrDpr ARGS((VectNmb vectNmb, Void *context, PIF isrFnct,
1300 EXTERN S16 SSyncInt ARGS((U16 adapterNmb, PFVOID syncFnct,
1301 Void *syncContext));
1303 EXTERN S16 SInitSema ARGS((Region region, Sema *sema));
1304 EXTERN S16 SRelSema ARGS((Region region, Sema sema));
1305 EXTERN S16 SGetSema ARGS((Region region, Sema sema));
1306 EXTERN S16 SActvInit ARGS((Ent ent,Inst inst,Region region,Reason reason));
1307 EXTERN S16 SActvTsk ARGS((Prior prior,Route route,Ent srcEnt,
1308 Inst srcInst,Buffer *mBuf));
1309 EXTERN S16 SActvTmr ARGS((void ));
1310 EXTERN S16 SGetOpt ARGS((int argc,char **argv,char *opts));
1311 /* multiple proc id changes:
1312 These functions not supported with multiple procIds */
1313 #ifndef SS_MULTIPLE_PROCS
1314 EXTERN S16 SGetEntInst ARGS((Ent *ent, Inst *inst));
1315 EXTERN S16 SSetEntInst ARGS((Ent ent, Inst inst));
1316 EXTERN ProcId SFndProcId ARGS((void));
1317 EXTERN Void SSetProcId ARGS((ProcId pId));
1318 #endif /* SS_MULTIPLE_PROCS */
1320 EXTERN S16 SGetDBufSiz ARGS((Region region, Pool pool, S16 *size));
1321 EXTERN S16 SGetStrtIdx ARGS((Region region, Pool pool, S16 *idx));
1322 EXTERN S16 SGetEndIdx ARGS((Region region, Pool pool, S16 *idx));
1323 EXTERN S16 SGetStrtPad ARGS((Region region, Pool pool, S16 *pad));
1324 /* multiple proc id changes: control block retrieval function */
1325 #ifdef SS_MULTIPLE_PROCS
1326 EXTERN S16 SGetXxCb ARGS((ProcId proc, Ent ent, Inst inst, Void **xxCb));
1327 #endif /* SS_MULTIPLE_PROCS */
1331 * These routines are only available for multi-threaded
1332 * system service implementations
1334 EXTERN S16 SGetMutex ARGS((MtMtxId *mId));
1335 EXTERN S16 SPutMutex ARGS((MtMtxId mId));
1336 EXTERN S16 SLockMutex ARGS((MtMtxId mId));
1337 EXTERN S16 SUnlockMutex ARGS((MtMtxId mId));
1338 EXTERN S16 SGetCond ARGS((MtCondId *cId));
1339 EXTERN S16 SPutCond ARGS((MtCondId cId));
1340 EXTERN S16 SCondWait ARGS((MtMtxId mId,MtCondId cId));
1341 EXTERN S16 SCondSignal ARGS((MtCondId cId));
1342 EXTERN S16 SCondBroadcast ARGS((MtCondId cId));
1343 EXTERN S16 SGetThread ARGS((MtThrd thrd, MtThrdFlags thr_flgs,
1344 Ptr arg, MtThrdId *thrdId));
1345 EXTERN S16 SPutThread ARGS((MtThrdId thrdId));
1346 EXTERN Void SThreadYield ARGS((void));
1347 EXTERN Void SThreadExit ARGS((Ptr *status));
1348 EXTERN Void SSetThrdPrior ARGS((MtThrdId tId, MtThrdPrior tPr));
1349 EXTERN Void SGetThrdPrior ARGS((MtThrdId tId, MtThrdPrior *tPr));
1352 EXTERN Void SExit ARGS((Void));
1354 /* multiple proc id changes: procId added */
1355 #ifndef SS_MULTIPLE_PROCS
1357 EXTERN S16 SRegTTsk ARGS((Ent ent,
1363 /* ssi_x_001.main_60 */
1364 EXTERN S16 SRegCbTsk ARGS((Ent ent,
1367 EXTERN S16 SDeregTTsk ARGS((Ent ent, Inst inst));
1371 EXTERN S16 SRegTTsk ARGS((ProcId proc,
1378 EXTERN S16 SDeregTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1380 EXTERN S16 SRegCbTsk ARGS((ProcId proc,
1384 #endif /* SS_MULTIPLE_PROCS */
1386 EXTERN S16 SCreateSTsk ARGS((SSTskPrior tskPrior, SSTskId *tskId));
1387 EXTERN S16 SDestroySTsk ARGS((SSTskId tskId));
1388 /* multiple proc id changes: procId added */
1389 #ifndef SS_MULTIPLE_PROCS
1391 EXTERN S16 SAttachTTsk ARGS((Ent ent, Inst inst, SSTskId tskId));
1392 EXTERN S16 SDetachTTsk ARGS((Ent ent, Inst inst));
1396 EXTERN S16 SAttachTTsk ARGS((ProcId proc, Ent ent, Inst inst, SSTskId tskId));
1397 EXTERN S16 SDetachTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1399 #endif /* SS_MULTIPLE_PROCS */
1400 EXTERN S16 SRegRegion ARGS((Region region, SRegInfo *regInfo));
1401 EXTERN S16 SDeregRegion ARGS((Region region));
1402 EXTERN S16 SRegDynRegion ARGS((Region region, SRegInfo *regInfo));
1403 /*ssi_x_001.main_62-prototype for SAlloc and SFree, gaurded under flag*/
1405 /* ssi_x_001.main_57 : Additions */
1406 #ifdef SS_HISTOGRAM_SUPPORT
1407 EXTERN S16 SAlloc ARGS((Region region, Size *size, U32 flags, Data **ptr,U32 line, U8 *fileName, U8 entId));
1408 EXTERN S16 SFree ARGS((Region region, Data *ptr, Size size, U32 line, U8 *fileName, U8 entId));
1410 #ifdef T2K_MEM_LEAK_DBG
1411 #define SAlloc(region,size,flags,ptr) SAllocNew(region,size,flags,ptr,file,line)
1412 #define SFree(region,ptr,size) SFreeNew(region,ptr,size,file,line)
1413 EXTERN S16 SAllocNew ARGS((Region region, Size *size, U32 flags, Data **ptr,char*,U32));
1414 EXTERN S16 SFreeNew ARGS((Region region, Data *ptr, Size size,char*,U32));
1415 #elif defined(SS_LIGHT_MEM_LEAK_STS)
1416 EXTERN S16 SAlloc ARGS((Region region, Size *size, U32 flags, Data **ptr,U32 line, U8 *fnName));
1417 EXTERN S16 SFree ARGS((Region region, Data *ptr, Size size, U32 line, U8 *fnName));
1419 EXTERN S16 SAlloc ARGS((Region region, Size *size, U32 flags, Data **ptr));
1420 EXTERN S16 SFree ARGS((Region region, Data *ptr, Size size));
1423 EXTERN S16 SGetBufRegionPool ARGS((Buffer *mBuf, Region *region, Pool *pool));
1424 #endif /* SS_ENABLE_MACROS */
1426 #ifdef SS_OLD_THREAD
1427 EXTERN S16 SGetMutex ARGS((SMtxId *mId));
1428 EXTERN S16 SPutMutex ARGS((SMtxId mId));
1429 EXTERN S16 SLockMutex ARGS((SMtxId mId));
1430 EXTERN S16 SUnlockMutex ARGS((SMtxId mId));
1431 EXTERN S16 SGetCond ARGS((SCondId *cId));
1432 EXTERN S16 SPutCond ARGS((SCondId cId));
1433 EXTERN S16 SCondWait ARGS((SMtxId mId,SCondId cId));
1434 EXTERN S16 SCondSignal ARGS((SCondId cId));
1435 EXTERN S16 SCondBroadcast ARGS((SCondId cId));
1436 EXTERN S16 SGetThread ARGS((SThrd thrd, S32 thr_flgs,
1437 Ptr arg, SThrdId *thrdId));
1438 EXTERN S16 SPutThread ARGS((SThrdId thrdId));
1439 EXTERN Void SThreadYield ARGS((void));
1440 EXTERN Void SThreadExit ARGS((Ptr status));
1441 EXTERN Void SSetThrdPrior ARGS((SThrdId tId, S32 tPr));
1442 EXTERN Void SGetThrdPrior ARGS((SThrdId tId, S32 *tPr));
1443 EXTERN Void SExit ARGS((void));
1444 #else /* SS_OLD_THREAD */
1445 EXTERN S16 SThreadYield ARGS((void));
1446 #endif /* SS_OLD_THREAD */
1448 EXTERN S16 SInitLock ARGS((SLockId *lock,U8 type));
1449 EXTERN S16 SLock ARGS((SLockId *lock));
1450 EXTERN S16 SUnlock ARGS((SLockId *lock));
1451 EXTERN S16 SDestroyLock ARGS((SLockId *lock));
1454 EXTERN S16 SInitSemaphore ARGS((SsSemaId *sem, U8 value));
1455 EXTERN S16 SWaitSemaphore ARGS((SsSemaId *sem));
1456 EXTERN S16 SPostSemaphore ARGS((SsSemaId *sem));
1457 EXTERN S16 SDestroySemaphore ARGS((SsSemaId *sem));
1459 /* multiple proc id changes:
1460 new function required to implement multiple procIds */
1461 #ifdef SS_MULTIPLE_PROCS
1462 EXTERN S16 SAddProcIdLst ARGS((U16 numPIds, ProcId *pIdLst));
1463 EXTERN S16 SRemProcIdLst ARGS((U16 numPIds, ProcId *pIdLst));
1464 EXTERN S16 SGetProcIdLst ARGS((U16 *numPIds, ProcId *pIdLst));
1465 #endif /* SS_MULTIPLE_PROCS */
1469 #ifdef SS_SEGV_SIG_HDLR
1470 #ifndef SS_MULTIPLE_PROCS
1471 EXTERN S16 SRegIntrptHdlr ARGS((Ent ent, Inst inst, PFS16 intrptActvFn));
1473 EXTERN S16 SRegIntrptHdlr ARGS((ProcId proc, Ent ent, Inst inst, PFS16 intrptActvFn));
1474 #endif/*SS_MULTIPLE_PROCS*/
1475 #endif /* SS_SEGV_SIG_HDLR */
1479 #ifndef SS_MULTIPLE_PROCS
1480 EXTERN S16 SRegTTsk ARGS((Ent ent,
1486 /* ssi_x_001.main_60 */
1487 EXTERN S16 SRegCbTsk ARGS((Ent ent,
1490 EXTERN S16 SDeregTTsk ARGS((Ent ent, Inst inst));
1491 EXTERN S16 SAttachTTsk ARGS((Ent ent, Inst inst, SSTskId tskId));
1492 EXTERN S16 SDetachTTsk ARGS((Ent ent, Inst inst));
1494 EXTERN S16 SRegTTsk ARGS((ProcId proc,
1501 EXTERN S16 SRegCbTsk ARGS((ProcId proc,
1505 EXTERN S16 SDeregTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1506 EXTERN S16 SAttachTTsk ARGS((ProcId proc, Ent ent, Inst inst, SSTskId tskId));
1507 EXTERN S16 SDetachTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1508 #endif /* SS_MULTIPLE_PROCS */
1510 EXTERN S16 SCreateSTsk ARGS((SSTskPrior tskPrior, SSTskId *tskId));
1511 EXTERN S16 SDestroySTsk ARGS((SSTskId tskId));
1512 #ifndef SS_ENABLE_MACROS
1513 EXTERN S16 SGetBufRegionPool ARGS((Buffer *mBuf, Region *region, Pool *pool));
1514 #endif /* SS_ENABLE_MACROS */
1516 EXTERN S16 SInitLock ARGS((SLockId *lock,U8 type));
1517 EXTERN S16 SLock ARGS((SLockId *lock));
1518 EXTERN S16 SUnlock ARGS((SLockId *lock));
1519 EXTERN S16 SDestroyLock ARGS((SLockId *lock));
1521 EXTERN S16 SInitSemaphore ARGS((SsSemaId *sem, U8 value));
1522 EXTERN S16 SWaitSemaphore ARGS((SsSemaId *sem));
1523 EXTERN S16 SPostSemaphore ARGS((SsSemaId *sem));
1524 EXTERN S16 SDestroySemaphore ARGS((SsSemaId *sem));
1525 /* functions required to implement multiple procIds */
1526 #ifdef SS_MULTIPLE_PROCS
1527 EXTERN S16 SAddProcIdLst ARGS((U16 numPIds, ProcId *pIdLst));
1528 EXTERN S16 SRemProcIdLst ARGS((U16 numPIds, ProcId *pIdLst));
1529 EXTERN S16 SGetProcIdLst ARGS((U16 *numPIds, ProcId *pIdLst));
1530 #endif /* SS_MULTIPLE_PROCS */
1532 #endif /* PORTVER */
1535 /* function prototypes */
1537 /* stack manager initialization function */
1538 /* multiple proc id changes: procId added */
1539 #ifndef SS_MULTIPLE_PROCS
1540 EXTERN S16 smActvInit ARGS((Ent ent, Inst inst, Region region, Reason reason));
1541 #else /* SS_MULTIPLE_PROCS */
1542 EXTERN S16 smActvInit ARGS((ProcId proc,
1548 #endif /* SS_MULTIPLE_PROCS */
1550 /* stack manager external initialization function */
1551 EXTERN S16 smInitExt ARGS((void));
1553 /* stack manager activation function */
1554 EXTERN S16 smActvTsk ARGS((Pst *pst, Buffer *mBuf));
1556 /* ssi_x_001.main_54 */
1557 #ifdef SS_SID_CHANGE
1558 /* ssi_x_001.main_53 */
1559 EXTERN S16 SGetInDepSId ARGS((SystemId *s));
1560 EXTERN S16 SGetDepSId ARGS((SystemId *s));
1565 #define SS_INITDCHN(chn) (chn)->next = NULLP; (chn)->prev = NULLP
1566 #define SS_INITQUE(qu) \
1567 SS_INITDCHN(&(qu)->dChn); (qu)->crntSize = 0
1568 #define SS_QLEN(bq) ((bq)->crntSize)
1569 #define SS_MLEN(mb) ((mb)->t.msg.msgLen)
1571 /* ssi_x_001.main_50 : Added declarations for mutex related functions
1572 * to protect demand queue and memory allocation
1574 /* ssi_x_001.main_51 : Added control flag as these are only used by windows */
1576 EXTERN S16 WTInitLock ARGS((SLockId *lock,U8 type));
1577 EXTERN S16 WTLock ARGS((SLockId *lock));
1578 EXTERN S16 WTUnlock ARGS((SLockId *lock));
1579 EXTERN S16 WTDestroyLock ARGS((SLockId *lock));
1580 #endif /* End of SS_WIN */
1581 /* ssi_x_001.main_57 : Additions */
1582 #ifdef SS_LOGGER_SUPPORT
1583 EXTERN S16 SRegLogCfg ARGS(( U8 mode, S8 *path, U32 size, S8 *IPA, U16 port));
1584 EXTERN S16 SWrtLogBuf ARGS(( Txt *buf ));
1585 /* ssi_x_001.main_60 */
1586 EXTERN S16 SDeregLogCfg ARGS((Void ));
1587 #endif /* SS_LOGGER_SUPPORT */
1589 #ifdef SS_HISTOGRAM_SUPPORT
1590 EXTERN S16 SRegForHstGrm ARGS((Ent ent));
1591 EXTERN S16 SHstGrmInfoShow ARGS((Ent *entId));
1592 EXTERN S16 SFillEntIds ARGS((Void));
1593 EXTERN S16 SGetEntInd ARGS((Ent *entId, U8 *fileName));
1594 #endif /* SS_HISTOGRAM_SUPPORT */
1595 /* ssi_x_001.main_68 Multiple declaration removed , one already in cm_task.x */
1596 /* ssi_x_001.main_61: Lock support guraded under the flag */
1597 #ifdef SS_LOCK_SUPPORT
1598 EXTERN S16 SLockNew ARGS((SLockInfo *LockId, U8 lockType));
1599 EXTERN S16 SInitLockNew ARGS((SLockInfo *LockId, U8 lockType));
1600 EXTERN S16 SUnlockNew ARGS((SLockInfo *LockId, U8 lockType));
1601 EXTERN S16 SDestroyLockNew ARGS((SLockInfo *LockId, U8 lockType));
1602 #endif /* SS_LOCK_SUPPORT */
1603 EXTERN S8* SGetConfigPath ARGS((Void));
1605 /* ssi_x_001.main_66 : Added new Buffer manegement APIs */
1606 EXTERN S16 SCpyPartMsg ARGS((Buffer *srcBuf, MsgLen idx, MsgLen cnt, Buffer *dstBuf));
1607 EXTERN S16 SRepPartMsg ARGS((Buffer *srcBuf, MsgLen idx, MsgLen cnt, Buffer *dstBuf));
1608 EXTERN S16 SMovPartMsg ARGS((Buffer *srcBuf, MsgLen idx, Buffer *dstBuf));
1609 EXTERN S16 SPkMsgMult ARGS((Data *src, MsgLen cnt, Buffer *mBuf));
1610 EXTERN S16 SGetReadPtr ARGS((Buffer *mBuf, U8** data, MsgLen *len));
1615 SS_NON_SHARABLE_MEMORY
1617 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1618 EXTERN S16 SReInitTmr ARGS((Void ));
1620 /* ssi_x_001.main_69: Added MSPD debug macro */
1623 extern char ys_global_printbuf[256];
1624 EXTERN Void rbCallstackShow ARGS((Void));
1625 EXTERN Void rbCallstackShowForCore ARGS((U32 coreId));
1626 EXTERN U32 MacGetTick ARGS ((void));
1629 extern U64 glblTtiCnt;
1632 EXTERN S16 SStartTask ARGS((VOLATILE U32 *startTime, U32 tarkId));
1633 EXTERN S16 SStopTask ARGS((VOLATILE U32 startTime,U32 taskId));
1634 #ifdef MSPD_MLOG_NEW
1635 /* Removed for C++ Compilation
1636 EXTERN unsigned int MLogTask (unsigned int taskid, unsigned int resourceid ,
1637 unsigned int ticksstart,unsigned int ticksstop);
1641 #if defined(MSPD) && defined(MSPD_DBG_ENABLE)
1642 #define MSPD_DBG_RLC(...)
1643 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1645 #define MSPD_DBG(...) do { \
1646 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1647 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "%s():%u @%lu ", __func__, __LINE__, ysGT); \
1648 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1649 ssMemlog(_local_printbuf, _len2); \
1652 #define MSPD_DBG(...) do { \
1653 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1654 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "%s():%u @%u ", __func__, __LINE__, ysGT); \
1655 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1656 ssMemlog(_local_printbuf, _len2); \
1659 #define MSPD_DBG_RAW(...) do { \
1660 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1661 int _len = snprintf(_local_printbuf,SS_MEMLOG_MAXSTRLEN, __VA_ARGS__); \
1662 ssMemlog(_local_printbuf, _len); \
1665 #define MSPD_LOG(...) do { \
1666 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1667 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN,"%s():%u @%lu ", __func__, __LINE__, ysGT); \
1668 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1669 ssMemlog(_local_printbuf, _len2); \
1672 #define MSPD_LOG(...) do { \
1673 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1674 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN,"%s():%u @%u ", __func__, __LINE__, ysGT); \
1675 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1676 ssMemlog(_local_printbuf, _len2); \
1681 #define MSPD_ERR(...) do { \
1682 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1683 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "ERROR: %s():%u @%lu ", __func__, __LINE__, ysGT); \
1684 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1685 ssMemlog(_local_printbuf, _len2); \
1688 #define MSPD_ERR(...) do { \
1689 char _local_printbuf[SS_MEMLOG_MAXSTRLEN]; \
1690 int _len1 = snprintf(_local_printbuf, SS_MEMLOG_MAXSTRLEN, "ERROR: %s():%u @%u ", __func__, __LINE__, ysGT); \
1691 int _len2 = snprintf(&_local_printbuf[_len1],SS_MEMLOG_MAXSTRLEN - _len1, __VA_ARGS__) + _len1; \
1692 ssMemlog(_local_printbuf, _len2); \
1697 EXTERN Void ssMlogInit(Void);
1698 EXTERN Void ssMlogIncrCounter(Void);
1699 EXTERN Void ssMemlogInit(Void);
1700 EXTERN Void ssMemlog(char *, U32 size);
1701 EXTERN Void ssMemlogWrite(Void);
1703 #endif /* TENB_T2K3K_SPECIFIC_CHANGES */
1710 EXTERN Void SIncrementTtiCount(Void);
1711 EXTERN Ticks SGetTtiCount(Void);
1712 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1713 EXTERN Void mtStopHndlr(Void);
1716 #ifdef TENB_RTLIN_CHANGES
1717 EXTERN Void ysPrntBkTrace(Void);
1718 EXTERN Void ssMlogInit(Void);
1719 EXTERN Void ssMlogIncrCounter(Void);
1721 #ifdef SS_THR_REG_MAP
1722 EXTERN Void ssRegMainThread(Void);
1725 #ifdef T2K_MEM_LEAK_DBG
1726 #define ssGetDBufOfSize(region,size,dBuf) ssGetDBufOfSizeNew(region,size,dBuf,__FILE__,__LINE__)
1727 PUBLIC S16 ssGetDBufOfSizeNew ARGS((Region region, Size size, Buffer **dBuf,char*,U32));
1729 EXTERN S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf);
1732 /* ssi_x_001.main_69: Added MSPD debug macro */
1734 EXTERN void SEND_DBG_MSG(U8 *str, ...);
1737 #endif /* __SSIX__ */
1740 /********************************************************************30**
1743 **********************************************************************/