534f02640f2d95217315974ff528ca06717434ff
[o-du/l2.git] / src / cm / ssi.x
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /********************************************************************20**
20   
21      Name:     system services interface
22   
23      Type:     C include file
24   
25      Desc:     Structures, variables and typedefs required by the
26                System Services service user.
27   
28      File:     ssi.x
29   
30 *********************************************************************21*/
31   
32 #ifndef __SSIX__
33 #define __SSIX__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39
40 \f   
41 /* typedefs */
42
43 typedef S16 Status;               /* status */
44
45 typedef uint32_t Ticks;                /* system clock ticks */
46
47 #ifdef LONG_MSG
48 typedef S32 MsgLen;               /* message length */
49 #else
50 typedef S16 MsgLen;               /* message length */
51 #endif
52
53 typedef S16 Order;                /* message or queue order */
54
55 #ifdef DOS
56 typedef uint16_t Size;                 /* size (for number of bytes per region or per s-pool) */
57 #else
58 typedef uint32_t Size;                 /* size (for number of bytes per region or per s-pool) */
59 typedef S32 PtrOff;               /* signed pointer offset */
60 #endif
61
62 typedef uint32_t QLen;                 /* queue length */
63
64 typedef QLen BufQLen;             /* buffer queue length */
65
66 typedef S16 RegSize;              /* region size (for number of regions per processor) */
67
68 typedef S16 DPoolSize;            /* dynamic pool size (for number of buffers per d-pool) */
69
70 typedef uint16_t Random;               /* random number */
71
72 typedef S16 Seq;                  /* sequence */
73 /* ssi_x_001.main_64 Additions */
74 typedef uint32_t CoreId;               /* core id */
75
76 /* Error */
77 typedef uint32_t ErrCls;               /* Error Class */
78
79 typedef uint32_t ErrCode;              /* Error Code  */
80
81 typedef uint32_t ErrVal;               /* Error Value */
82
83 typedef S16 VectNmb;              /* vector number */
84
85 typedef S16 Ttype;                /* task type */
86
87 typedef S8 Sema;                  /* semaphore */
88
89
90 /* post */
91
92 \f
93 /*
94    This section contains specific typedefs, structures and
95    prototypes for the following operating systems:
96
97    MOS      - MOSVER
98    MOS, v2  - MSVER2
99    psos     - PS
100    vrtxsa   - VX
101    vxworks  - VW
102    sslib    - system service library for elvis
103    other    - 
104  
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.
107
108 */
109
110 \f
111 #ifdef MOSVER                     /* mos version */
112 /* mos typedefs, structures and prototypes */
113
114 /* forward definitions */
115  
116 #ifndef CMFILE_REORG_1
117 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
118 #endif
119  
120 typedef struct ss_queue Queue;    /* forward definition - queue */
121
122 /* chain */
123  
124 typedef struct chn                /* chain */
125 {
126    Buffer *fwd;                   /* forward */
127    Buffer *bck;                   /* backward */
128 } Chn;
129  
130 typedef Chn Chain;                /* chain */
131  
132 /* queue - typdef'd earlier */
133
134 struct ss_queue                   /* queue - typdef'd earlier */
135 {
136    Chn chn;                       /* chain */
137    QLen crntSize;                 /* current size */
138    QLen maxSize;                  /* maximum size */
139 };
140   
141 /* buffer - typedef'd earlier */
142   
143 struct ss_buffer                  /* buffer - typdef'd earlier */
144 {
145    Chn chn;                       /* chain */
146    Mem mem;                       /* memory */
147    S8 bufType;                    /* buffer type */
148    union {
149   
150       struct
151       {
152          MsgLen strtIdx;          /* start index */
153          MsgLen endIdx;           /* end index */
154          MsgLen size;             /* size */
155          Data data[DSIZE];        /* data */
156       } dat;                      /* data buffer */
157   
158       struct
159       {
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 */
168   
169       struct
170       {
171          Buffer *entry[MAXEXTENT];/* entry */
172       } ext;                      /* extension buffer */
173  
174       struct
175       {
176          Size size;               /* size */
177       } stc;                      /* static buffer */
178  
179       struct
180       {
181          MsgLen strtIdx;          /* start index */
182          MsgLen endIdx;           /* end index */
183          MsgLen size;             /* size */
184          Data *data;              /* data pointer */
185       } dma;                      /* dma buffer */
186  
187    } t;
188 };
189
190  S16 msOptInd;
191  S8  *msOptArg;
192  Txt **msArgv;
193  S16 msArgc;
194
195 #else 
196 #ifdef MSVER2                     /* mos version 2 */
197
198 /* forward definitions */
199 #ifndef CMFILE_REORG_1
200 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
201 #endif
202  
203 typedef struct sBuf SBuf;         /* forward definition - static buffer */
204  
205 typedef struct ss_queue Queue;    /* forward definition - queue */
206
207 /* buffer identifier */
208
209 /* dynamic chain (4b ALIGNED) */
210  
211 typedef struct dChn               /* dynamic chain */
212 {
213    Buffer *prev;                  /* previous */
214    Buffer *crnt;                  /* current */
215    Buffer *next;                  /* next */
216 } DChn;
217  
218 /* static chain (4b ALIGNED)*/
219  
220 typedef struct sChn               /* static chain */
221 {
222    SBuf *fwd;                     /* forward */
223 } SChn;
224  
225 /* buffer queue (4b ALIGNED) */
226   
227 typedef struct bufQ               /* buffer queue */
228 {
229    DChn dChn;                     /* dynamic chain */
230    BufQLen crntSize;              /* current size */
231 } BufQ;
232 /* queue (4b ALIGNED) */
233   
234 struct ss_queue                   /* queue - typdef'd earlier */
235 {
236    DChn dChn;                     /* dynamic chain */
237    QLen crntSize;                 /* current size */
238 };
239   
240 /* 4Byte aligned */
241 typedef struct ss_dat             /* data buffer */
242 {
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) */
249 } Dat;
250
251 /* 4Byte aligned */
252 typedef struct ss_msg             /* message buffer */
253 {
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 */
259 } Msg;
260   
261 /* buffer - typedef'd earlier */
262   
263 struct ss_buffer                  /* buffer - typedef'd earlier */
264 {
265    DChn dChn;                     /* dynamic chain */
266    S8 bufType;                    /* buffer type */
267    uint8_t spare1;                     /* spare for alignment */
268    uint16_t spare2;                    /* spare for alignment */
269    union {
270       Dat dat;                    /* data buffer */
271       Msg msg;                    /* message buffer */
272    } t;
273 };
274
275 /* static buffer - typedef'd earlier */
276   
277 struct sBuf                       /* static buffer - typedef'd earlier */
278 {
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 */
284 };
285
286  S16 msOptInd;
287  S8  *msOptArg;
288  Txt **msArgv;
289  S16 msArgc;
290
291 #else
292 #ifdef PS                         /* psos version */
293 /* psos typedefs, structures and prototypes */
294
295 /* forward definitions */
296  
297 #ifndef CMFILE_REORG_1
298 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
299 #endif
300  
301 typedef struct ss_queue Queue;       /* forward definition - queue */
302
303 /* chain */
304  
305 typedef struct chn                /* chain */
306 {
307    Buffer *fwd;                   /* forward */
308    Buffer *bck;                   /* backward */
309 } Chn;
310
311 /* queue - typdef'd earlier */
312
313 struct ss_queue                   /* queue - typdef'd earlier */
314 {
315    Chn chn;                       /* chain */
316    QLen crntSize;                 /* current size */
317    QLen maxSize;                  /* maximum size */
318 };
319
320 /* buffer - typedef'd earlier */
321   
322 struct ss_buffer                  /* buffer - typedef'd earlier */
323 {
324    Chn chn;                       /* chain */
325    Mem mem;                       /* memory */
326    S8 bufType;                    /* buffer type */
327    union {
328   
329       struct
330       {
331          MsgLen strtIdx;          /* start index */
332          MsgLen endIdx;           /* end index */
333          MsgLen size;             /* size */
334          Data data[DSIZE];        /* data */
335       } dat;                      /* data buffer */
336   
337       struct
338       {
339          Queue bq;                /* buffer queue */
340          MsgLen msgLen;           /* message length */
341          S16 refCnt;              /* reference count */
342       } msg;                      /* message buffer */
343   
344       struct
345       {
346          Buffer *entry[MAXEXTENT];/* entry */
347       } ext;                      /* extension buffer */
348  
349       struct
350       {
351          Size size;               /* size */
352       } stc;                      /* static buffer */
353
354       struct
355       {
356          MsgLen strtIdx;          /* start index */
357          MsgLen endIdx;           /* end index */
358          MsgLen size;             /* size */
359          Data *data;              /* data pointer */
360       } dma;                      /* dma buffer */
361  
362    } t;
363 };
364
365 #else
366 #ifdef VX                         /* vrtxsa version */
367 /* vrtxsa typedefs, structures and prototypes */
368
369 /* forward definitions */
370  
371 #ifndef CMFILE_REORG_1
372 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
373 #endif
374  
375 typedef struct ss_queue Queue;       /* forward definition - queue */
376
377 /* buffer - typedef'd earlier */
378
379 struct ss_buffer                  /* buffer - typedef'd earlier */
380 {
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 */
387 };
388
389 /* chain */
390  
391 typedef struct chn                /* chain */
392 {
393    Buffer *fwd;                   /* forward */
394    Buffer *bck;                   /* backward */
395 } Chn;
396
397 /* queue - typdef'd earlier */
398  
399 struct ss_queue                   /* queue - typdef'd earlier */
400 {
401    Chn chn;                       /* chain */
402    QLen crntSize;                 /* current size */
403    QLen maxSize;                  /* maximum size */
404 };
405
406 #else
407 #ifdef VW                         /* vxworks version */
408 /* vxworks typedefs, structures and prototypes */
409
410 /* forward definitions */
411  
412 #ifndef CMFILE_REORG_1
413 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
414 #endif
415  
416 typedef struct ss_queue Queue;    /* forward definition - queue */
417
418 typedef struct dChn               /* dynamic chain */
419 {
420    Buffer *prev;                    /* previous */
421    Buffer *crnt;                    /* current */
422    Buffer *next;                    /* next */
423 } DChn;
424  
425 /* static chain (4b ALIGNED)*/
426  
427 /* buffer queue (4b ALIGNED) */
428   
429 typedef struct bufQ               /* buffer queue */
430 {
431    DChn dChn;                     /* dynamic chain */
432    BufQLen crntSize;              /* current size */
433 } BufQ;
434   
435 /* queue (4b ALIGNED) */
436   
437 struct ss_queue                   /* queue - typdef'd earlier */
438 {
439    DChn dChn;                     /* dynamic chain */
440    QLen crntSize;                 /* current size */
441 };
442   
443 typedef struct ss_dat             /* data buffer */
444 {
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 */
451 } Dat;
452
453 typedef struct ss_msg             /* message buffer */
454 {
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 */
460 } Msg;
461   
462 /* buffer - typedef'd earlier */
463   
464 struct ss_buffer                  /* buffer - typedef'd earlier */
465 {
466    DChn dChn;                     /* dynamic chain */
467    S8 bufType;                    /* buffer type */
468    uint8_t spare1;                     /* spare for alignment */
469    uint16_t spare2;                    /* spare for alignment */
470    union {
471       Dat dat;                    /* data buffer */
472       Msg msg;                    /* message buffer */
473    } t;
474 };
475
476 #else
477 #ifdef SSLIB                      /* system service library */
478 /* forward definitions */
479 #ifndef CMFILE_REORG_1
480 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
481 #endif
482  
483 typedef struct sBuf SBuf;         /* forward definition - static buffer */
484  
485 typedef struct ss_queue Queue;    /* forward definition - queue */
486
487
488 /* queue - typdef'd earlier */
489  
490 struct ss_queue                   /* queue - typdef'd earlier */
491 {
492    S16 dummy;                     /* dummy placeholder */
493 };
494
495 /* buffer - typedef'd earlier */
496   
497 struct ss_buffer                  /* buffer - typedef'd earlier */
498 {
499    S32 sIdx;                      /* start index */
500    S32 len;                       /* buffer length */
501    S8 dat[MAXBUFSIZ];             /* data */
502 };
503
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 */
509 #endif
510  
511 typedef struct sBuf SBuf;         /* forward definition - static buffer */
512  
513 typedef struct ss_queue Queue;    /* forward definition - queue */
514
515  
516 typedef S16 RyBufId;
517 /* dynamic chain (aligned) */
518 typedef struct ryDChn                 /* dynamic chain */
519 {
520    RyBufId back;                      /* backward (2b) */
521    RyBufId crnt;                      /* current  (2b) */
522    RyBufId next;                      /* next     (2b) */
523    RyBufId pad;                       /* pad      (2b) */
524 } RyDChn;
525 /* 
526  * queue - typdef'd earlier 
527  * This is exactly same as RyBufQ
528  */
529 struct ss_queue                   /* queue - typdef'd earlier */
530 {
531    RyDChn dChn;
532    QLen crntSize;                 /* current size */
533    uint16_t  ryChanId;                 /* relay channel Id */
534 };
535
536 /* buffer - typedef'd earlier */
537   
538 struct ss_buffer                  /* buffer - typedef'd earlier */
539 {
540    S32 sIdx;                      /* start index */
541    S32 len;                       /* buffer length */
542    S8 dat[MAXBUFSIZ];             /* data */
543 };
544
545 #else                             /* portable/other version */
546 #ifdef WINNT_IATM                 /* Windows NT Integrated ATM */
547
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) */
551 #endif /* CFG_APP */
552
553 typedef struct _NDIS_PACKET Buffer; /* forward definition - buffer */
554
555 #endif /* CMFILE_REORG_1 */
556
557 typedef struct ss_queue Queue;      /* forward definition - queue */
558
559 /* Trillium Queue is built upon the NDIS library list functions.
560  * No spin locks are applied for queues.
561  */
562
563 struct ss_queue {
564    LIST_ENTRY ListHead;           /* LIST_ENTRY to support NDIS list calls */
565    QLen CurQLen;                  /* current queue length */
566    QLen MaxQLen;                  /* maximum queue length */
567 };
568 #else  /* WINNT_IATM */
569 #ifdef MT                         /* multi-threaded version */
570 /* multi-threaded typedefs, structures and prototypes */
571
572 /* forward definitions */
573  
574 #ifndef CMFILE_REORG_1
575 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
576 #endif
577  
578 typedef struct ss_queue Queue;    /* forward definition - queue */
579
580 typedef struct sBuf      SBuf;    /* forward definition - static buffer */
581
582 typedef struct dChn               /* dynamic chain */
583 {
584    Buffer *prev;                    /* previous */
585    Buffer *crnt;                    /* current */
586    Buffer *next;                    /* next */
587 } DChn;
588
589 /* static chain (4b ALIGNED)*/
590 typedef struct sChn
591 {
592    SBuf *fwd;                     /* forward */
593 } SChn;
594  
595 /* static chain (4b ALIGNED)*/
596  
597 /* buffer queue (4b ALIGNED) */
598   
599 /* queue (4b ALIGNED) */
600   
601 struct ss_queue                   /* queue - typdef'd earlier */
602 {
603    DChn dChn;                     /* dynamic chain */
604    QLen crntSize;                 /* current size */
605 };
606   
607 typedef struct ss_dat             /* data buffer */
608 {
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 */
615 } Dat;
616
617 typedef struct ss_msg             /* message buffer */
618 {
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 */
624 } Msg;
625   
626 /* buffer - typedef'd earlier */
627   
628 struct ss_buffer                  /* buffer - typedef'd earlier */
629 {
630    DChn dChn;                     /* dynamic chain */
631    S8 bufType;                    /* buffer type */
632    uint8_t spare1;                     /* spare for alignment */
633    uint16_t spare2;                    /* spare for alignment */
634    union {
635       Dat dat;                    /* data buffer */
636       Msg msg;                    /* message buffer */
637    } t;
638 };
639
640 /* static buffer - typedef'd earlier */
641   
642 struct sBuf
643 {
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 */
649 };
650
651 typedef S32 MtRwLockId;
652 typedef S32 MtSemaId;
653 typedef S32 MtCondId;
654 typedef S32 MtMtxId;
655 typedef S32 MtThrdId;
656 typedef S32 MtThrdFlags;
657 typedef S32 MtThrdPrior;
658
659 typedef Void *(MtThrd) ARGS((Void *)); 
660
661 #else  /* not MT */
662 #ifdef PORTVER
663 /* portable typedefs, structures and prototypes */
664
665 /* forward definitions */
666  
667 #ifndef CMFILE_REORG_1
668 typedef struct ss_buffer Buffer;  /* forward definition - buffer */
669 #endif
670  
671 typedef struct ss_queue Queue;       /* forward definition - queue */
672
673 /* queue - typdef'd earlier */
674  
675 struct ss_queue                   /* queue - typdef'd earlier */
676 {
677    S16 dummy;                     /* dummy placeholder */
678 };
679  
680 /* buffer - typedef'd earlier */
681   
682 struct ss_buffer                  /* buffer - typedef'd earlier */
683 {
684    S16 dummy;                     /* dummy placeholder */
685 };
686
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 */
694
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 */
702
703 /* for SGetOpt() */
704  S16 msOptInd;
705  S8  *msOptArg;
706  Txt **msArgv;
707  S16 msArgc;
708
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 */
716
717 typedef S32 SSTskPrior;          /* System Task Priority */
718
719 #ifndef CMFILE_REORG_1
720
721 /* Buffer type is necessary */
722 typedef struct ssmsgb Buffer;
723
724 #endif /* CMFILE_REORG_1 */
725
726 /* message block */
727 struct ssmsgb
728 {
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 */
736 };
737
738 /* Queue data structure */
739 typedef struct ssQueue
740 {
741    Buffer *head;                     /* head of queue */
742    Buffer *tail;                     /* tail of queue */
743    QLen   crntSize;                  /* current szie of queue */
744
745 } Queue;
746
747
748 /* Memory CTL operations structure */
749 typedef struct sMemCtl
750 {
751    uint8_t op;                           /* operation */
752
753    union
754    {
755       struct
756       {
757          Data *vaddr;               /* virtual address */
758          Data **paddr;              /* physical address */
759       } vtop;
760
761       struct
762       {
763          Size size;                 /* size */
764          Status *status;            /* status */
765       } chkres;
766    } u;
767
768 } SMemCtl;
769
770
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));
777 #else
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 *));
786 #else
787 #ifdef SSI_DEBUG_LEVEL1
788 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **, uint32_t));
789 #else
790 #ifdef T2K_MEM_LEAK_DBG
791 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **,char*, uint32_t));
792 #else
793 typedef S16 (*SsAlloc) ARGS((Void *, Size *, uint32_t, Data **));
794 #endif
795 #endif /* SSI_DEBUG_LEVEL1 */
796 #ifdef T2K_MEM_LEAK_DBG
797 typedef S16 (*SsFree) ARGS((Void *, Data *, Size,char*, uint32_t));
798 #else
799 typedef S16 (*SsFree) ARGS((Void *, Data *, Size));
800 #endif
801 typedef S16 (*SsCtl) ARGS((Void *, Event, SMemCtl *));
802 #endif /* SS_HISTOGRAM_SUPPORT */
803
804
805 /* region information structure -- passed to SRegRegion() */
806 typedef struct sRegInfo
807 {
808    Void         *regCb;            /* region control block pointer */
809    uint32_t          flags;             /* region characteristics flags  */
810 /* ssi_x_001.main_64 Additions */
811 #ifdef SS_CAVIUM
812    cvmx_arena_list_t  regArena;    /* arena for the region */
813 #endif
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 */
819
820 } SRegInfo;
821
822
823 #ifdef SS_OLD_THREAD
824
825 /* types for SGetThread(), SGetMutex, etc. */
826 typedef Void    *(SThrd) ARGS((Void *));
827
828 typedef S32     SThrdId;           /* thread Id */
829 typedef S32     SMtxId;            /* mutex Id */
830 typedef S32     SCondId;           /* condition Id */
831
832 #endif /* SS_OLD_THREAD */
833
834 /*ssi_x_001.main_63 ss_dep.x guarded under flag*/
835 #ifdef SS_CAVIUM
836 #include "jz_dep.x"
837 #else
838 #ifdef SS_4GMX_LCORE
839 #include "ss_dep.x"
840 #else
841 #include "ss_dep.x"
842 #endif /* SS_4GMX_LCORE */
843 #endif/*SS_CAVIUM*/
844
845 #endif /* SS */
846 #endif /* PORTVER */
847 #endif /* MT */
848 #endif /* WINNT_IATM */
849 #endif /* SSRYLIB */
850 #endif /* SSLIB */
851 #endif /* VW */
852 #endif /* VX */
853 #endif /* PS */
854 #endif /* MSVER2 */
855 #endif /* MOSVER */
856 /* ssi_x_001.main_57 : Additions */
857 #ifdef SS_HISTOGRAM_SUPPORT  
858 /*
859 typedef struct entInfo
860 {
861    uint8_t                 entid;
862 }EntInfo;
863
864 typedef struct secondIndex
865 {
866     EntInfo           info[26];
867 }SecondIndex;
868
869 typedef struct firstIndex
870 {
871     SecondIndex       info[26];
872 }FirstIndex; */
873 #endif /* SS_HISTOGRAM_SUPPORT */
874
875 \f
876 /* functions */
877
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. */
885
886 typedef S16  (*PAIFTMRS16) ARGS((Ent ent, Inst inst));
887 #else
888 typedef uint8_t (*PAIFS16) ARGS((ProcId proc, 
889                               Ent ent,
890                               Inst inst,
891                               Region region,
892                               Reason reason,
893                               Void **xxCb));
894
895 /* time activation function typedef */
896 typedef S16  (*PAIFTMRS16) ARGS((ProcId proc, 
897                                  Ent ent,
898                                  Inst inst));
899 #endif /* SS_MULTIPLE_PROCS */
900
901 #ifndef VX
902 typedef S16  (*PATFS16) ARGS((Prior prior,Route route,Ent ent,Inst inst,Buffer *mBuf));
903 #else
904 typedef void  (*PATFS16) ARGS((void *vPtr));
905 #endif
906 typedef S16  (*ActvTsk) ARGS((Pst *pst, Buffer *mBuf));
907 #ifdef ENB_RELAY
908 typedef struct uProc UProc;  /* forward definition - uproc */
909 #ifdef RYINT1
910 typedef void (*ISTsk) ARGS((Inst inst));
911 #else  /* for backward compatibility */
912 typedef void (*ISTsk) ARGS((UProc *uProc));
913 #endif /* RYINT1 */
914
915 struct uProc
916 {
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 */
923 };
924  
925
926 #endif /* ENB_RELAY */
927
928 \f
929 /* functions */
930 S16 SChekMemUtilization ARGS((Region region,Bool *memAlarm));
931
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));
937
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*/
945 #ifdef SS_FLOAT
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*/
956 #ifdef SS_FLOAT
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));
989 #else
990
991 S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
992 S16 SPutDBuf ARGS((Region region,Pool pool,Buffer *buf));
993 #endif
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));
1003 #else
1004 S16 SGetDBuf ARGS((Region region,Pool pool,Buffer * *bufPtr));
1005 S16 SPutDBuf ARGS((Region region,Pool pool,Buffer *buf));
1006 #endif
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 */
1012
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));
1026 #else
1027 /*ssi_x_001.main_67 : RMIOS specific changes*/
1028 #ifndef SS_RMIOS
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));
1034 #else
1035 S16 SPutMsg ARGS((Buffer *mBuf));
1036 S16 SGetMsg ARGS((Region region, Pool pool, Buffer * *mBufPtr));
1037 #endif
1038 #else
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));
1043 #endif
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));
1051 #else
1052 S16 SGetSBuf ARGS((Region region,Pool pool, Data * *bufPtr, Size size));
1053 S16 SPutSBuf ARGS((Region region, Pool pool, Data *buf, Size size));
1054 #endif
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);
1060 #endif
1061 #ifdef INTEL_WLS
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__)
1070
1071 #else
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);
1075 #endif
1076 #endif
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 */
1088
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__)
1105
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));
1108 #else
1109 S16 SAddPreMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1110 S16 SAddPstMsgMult ARGS((Data *src,MsgLen cnt,Buffer *mBuf));
1111 #endif
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));
1124 #else
1125 S16 SSegMsg ARGS((Buffer *mBuf1,MsgLen idx,Buffer **mBuf2));
1126 #endif
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));
1140 #else
1141 S16 SCpyMsgMsg ARGS((Buffer *mBuf, Region region, Pool pool, 
1142             Buffer **dstBuf));
1143 S16 SAddMsgRef ARGS((Buffer *mBuf, Region region, Pool pool, 
1144             Buffer **dstBuf));
1145 S16 SIncMsgRef(Buffer *srcBuf, Region dstRegion, Pool dstPool, Buffer **dstBuf);
1146
1147 #ifdef SS_RBUF
1148 /*  S16 SIncMsgRef ARGS((Buffer *srcBuf, Buffer **dstBuf)); */
1149 Void SIncMsgLen ARGS((Buffer *mBuf));
1150 #endif
1151 #endif
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));
1156 #ifdef L2_OPTMZ
1157 Void SResetMBuf ARGS ((Buffer *mBuf));
1158 #endif
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,
1180                               ActvTsk actvTsk));
1181 #endif /* SS_MULTIPLE_PROCS */
1182
1183 /* multiple proc id changes: procId added and time function type modified */ 
1184 #ifndef SS_MULTIPLE_PROCS
1185 S16 SRegCfgTmr ARGS((Ent ent,
1186                              Inst inst,
1187                              S16 period,
1188                              S16 units,
1189                              PFS16 tmrFnct));
1190 #ifdef SS_MT_TMR
1191 /* ssi_x_001.main_53 */
1192 S16 SRegCfgTmrMt ARGS((Ent ent,
1193                                Inst inst,
1194                                S16 period,
1195                                S16 units,
1196                                PAIFTMRS16 tmrFnctMt));
1197 #endif
1198 S16 SDeregCfgTmr ARGS((Ent ent,
1199                                Inst inst,
1200                                S16 period,
1201                                S16 units,
1202                                PFS16 tmrFnct));
1203 #ifdef SS_MT_TMR
1204 /* ssi_x_001.main_53 */
1205 S16 SDeregCfgTmrMt ARGS((Ent ent,
1206                                  Inst inst,
1207                                  S16 period,
1208                                  S16 units,
1209                                  PAIFTMRS16 tmrFnctMt));
1210 #endif
1211 #else
1212 S16 SRegCfgTmr ARGS((ProcId proc, 
1213                              Ent ent,
1214                              Inst inst,
1215                              S16 period,
1216                              S16 units,
1217                              PAIFTMRS16 tmrFnct));
1218 S16 SDeregCfgTmr ARGS((ProcId proc, 
1219                                Ent ent,
1220                                Inst inst,
1221                                S16 period,
1222                                S16 units,
1223                                PAIFTMRS16 tmrFnct));
1224 #endif /* SS_MULTIPLE_PROCS */
1225
1226 S16 SPstTsk ARGS((Pst *pst, Buffer *mBuf));
1227
1228 #ifdef SS_ROUTE_MSG_CORE1
1229 S16 SPstTskIcpu ARGS((Pst *pst, Buffer *mBuf));
1230 #endif
1231
1232 #ifdef ENB_RELAY
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 */
1238
1239 #ifdef SS_RTR_SUPPORT
1240 S16 SRegRtrTsk ARGS((Route *, Cntr, ActvTsk));
1241 S16 SDeregRtrTsk ARGS((Route *, Cntr));
1242 #endif /* SS_RTR_SUPPORT */
1243
1244 #ifdef SS_USE_ZBC_MEMORY
1245 S16 SAttachPtrToBuf ARGS((
1246 Region   region,
1247 Pool     pool,
1248 Data    *ptr,
1249 MsgLen   totalLen,
1250 Buffer** mBuf
1251 ));
1252 #endif
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)
1256
1257 typedef S8 SsAffinityMode;
1258
1259
1260 typedef struct {
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 */
1264 } SCpuInfo;
1265
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));
1269
1270 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT*/
1271
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));
1275 #endif
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));
1301 #ifdef WINNT_KERN
1302 S16 SPutIsrDpr ARGS((VectNmb vectNmb, Void *context, PIF isrFnct, 
1303                              PIF dprFnct));
1304 S16 SSyncInt   ARGS((uint16_t adapterNmb, PFVOID syncFnct, 
1305                              Void *syncContext));
1306 #endif
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 */
1323
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 */
1332
1333 #ifdef MT
1334 /*
1335  * These routines are only available for multi-threaded
1336  * system service implementations
1337  */
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));
1354 #endif /* MT */
1355
1356 Void SExit ARGS((Void));
1357 #ifdef SS
1358 /* multiple proc id changes: procId added */ 
1359 #ifndef SS_MULTIPLE_PROCS
1360
1361 S16 SRegTTsk ARGS((Ent ent, 
1362                           Inst inst, 
1363                           Ttype type, 
1364                           Prior prior, 
1365                           PAIFS16 initTsk, 
1366                           ActvTsk actvTsk));
1367 /* ssi_x_001.main_60 */
1368 S16 SRegCbTsk ARGS((Ent ent, 
1369                           Inst inst, 
1370                           ActvTsk actvTsk));
1371 S16 SDeregTTsk ARGS((Ent ent, Inst inst));
1372
1373 #else
1374
1375 S16 SRegTTsk ARGS((ProcId proc, 
1376                           Ent ent, 
1377                           Inst inst, 
1378                           Ttype type, 
1379                           Prior prior, 
1380                           PAIFS16 initTsk, 
1381                           ActvTsk actvTsk));
1382 S16 SDeregTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1383
1384 S16 SRegCbTsk ARGS((ProcId proc,
1385                                                                   Ent ent, 
1386                           Inst inst, 
1387                           ActvTsk actvTsk));
1388 #endif /* SS_MULTIPLE_PROCS */
1389
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
1394
1395 S16 SAttachTTsk ARGS((Ent ent, Inst inst, SSTskId tskId));
1396 S16 SDetachTTsk ARGS((Ent ent, Inst inst));
1397
1398 #else
1399
1400 S16 SAttachTTsk ARGS((ProcId proc, Ent ent, Inst inst, SSTskId tskId));
1401 S16 SDetachTTsk ARGS((ProcId proc, Ent ent, Inst inst));
1402
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*/
1408 #ifndef SS_FAP
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));
1413 #else
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));
1422 #else
1423 S16 SAlloc ARGS((Region region, Size *size, uint32_t flags, Data **ptr));
1424 S16 SFree ARGS((Region region, Data *ptr, Size size));
1425 #endif
1426 #endif
1427 S16 SGetBufRegionPool ARGS((Buffer *mBuf, Region *region, Pool *pool));
1428 #endif /* SS_ENABLE_MACROS */
1429
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 */
1451
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));
1456
1457
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));
1462
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 */
1470
1471 #endif /* SS */
1472
1473 #ifdef SS_SEGV_SIG_HDLR
1474 #ifndef SS_MULTIPLE_PROCS
1475 S16 SRegIntrptHdlr ARGS((Ent ent, Inst inst, PFS16 intrptActvFn));
1476 #else
1477 S16 SRegIntrptHdlr ARGS((ProcId proc, Ent ent, Inst inst, PFS16 intrptActvFn));
1478 #endif/*SS_MULTIPLE_PROCS*/
1479 #endif /* SS_SEGV_SIG_HDLR */
1480
1481 #ifdef PORTVER
1482 /* procId added */ 
1483 #ifndef SS_MULTIPLE_PROCS
1484 S16 SRegTTsk ARGS((Ent ent, 
1485                           Inst inst, 
1486                           Ttype type, 
1487                           Prior prior, 
1488                           PAIFS16 initTsk, 
1489                           ActvTsk actvTsk));
1490 /* ssi_x_001.main_60 */
1491 S16 SRegCbTsk ARGS((Ent ent, 
1492                           Inst inst, 
1493                           ActvTsk actvTsk));
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));
1497 #else
1498 S16 SRegTTsk ARGS((ProcId proc, 
1499                           Ent ent, 
1500                           Inst inst, 
1501                           Ttype type, 
1502                           Prior prior, 
1503                           PAIFS16 initTsk, 
1504                           ActvTsk actvTsk));
1505 S16 SRegCbTsk ARGS((ProcId proc,
1506                                                                   Ent ent, 
1507                           Inst inst, 
1508                           ActvTsk actvTsk));
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 */
1513
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 */
1519
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));
1524
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 */
1535
1536 #endif /* PORTVER */
1537
1538 \f  
1539 /* function prototypes */
1540  
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, 
1547                             Ent ent, 
1548                             Inst inst, 
1549                             Region region, 
1550                             Reason reason,
1551                             Void **xxCb));
1552 #endif /* SS_MULTIPLE_PROCS */
1553
1554 /* stack manager external initialization function */
1555 S16 smInitExt ARGS((void));
1556  
1557 /* stack manager activation function */
1558 S16 smActvTsk ARGS((Pst *pst, Buffer *mBuf));
1559
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));
1565 #endif
1566
1567 /* Macros... */
1568  
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)
1574
1575 /* ssi_x_001.main_50 : Added declarations for mutex related functions
1576  * to protect demand queue and memory allocation 
1577  */
1578 /* ssi_x_001.main_51 : Added control flag as these are only used by windows */
1579 #ifdef SS_WIN
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 */
1592
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));
1608
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));
1615
1616 typedef enum
1617 {
1618    SS_SHARABLE_MEMORY,
1619    SS_NON_SHARABLE_MEMORY
1620 }ssMemoryType;
1621 #ifdef TENB_T2K3K_SPECIFIC_CHANGES                              
1622 S16 SReInitTmr ARGS((Void ));                            
1623 #endif
1624 /* ssi_x_001.main_69: Added MSPD debug macro */
1625 #ifdef MSPD
1626 uint32_t ysGT;
1627 char ys_global_printbuf[256];
1628 Void rbCallstackShow ARGS((Void));
1629 Void rbCallstackShowForCore ARGS((uint32_t coreId));
1630 uint32_t MacGetTick ARGS ((void));
1631 #endif /* MSPD */
1632 #ifdef LTE_L2_MEAS
1633 uint64_t  glblTtiCnt;
1634 #endif
1635
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);
1642 --*/
1643 #endif
1644
1645 #if defined(MSPD) && defined(MSPD_DBG_ENABLE)
1646 #define MSPD_DBG_RLC(...) 
1647 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1648 #ifndef ALIGN_64BIT
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); \
1654 } while (0)
1655 #else
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); \
1661 } while (0)
1662 #endif
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); \
1667 } while (0)
1668 #ifndef ALIGN_64BIT
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); \
1674 } while (0)
1675 #else
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); \
1681 } while (0)
1682
1683 #endif
1684 #ifndef ALIGN_64BIT
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); \
1690 } while (0)
1691 #else
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); \
1697 } while (0)
1698
1699 #endif
1700
1701 Void ssMlogInit(Void);
1702 Void ssMlogIncrCounter(Void);
1703 Void ssMemlogInit(Void);
1704 Void ssMemlog(char *, uint32_t size);
1705 Void ssMemlogWrite(Void);
1706
1707 #endif /* TENB_T2K3K_SPECIFIC_CHANGES */
1708 #endif
1709
1710 #ifdef __cplusplus
1711 }
1712 #endif
1713
1714 Void SIncrementTtiCount(Void);
1715 Ticks SGetTtiCount(Void);
1716 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
1717 Void mtStopHndlr(Void);
1718 #endif
1719
1720 #ifdef TENB_RTLIN_CHANGES
1721 Void ysPrntBkTrace(Void);
1722 Void ssMlogInit(Void);
1723 Void ssMlogIncrCounter(Void);
1724 #endif
1725 #ifdef SS_THR_REG_MAP
1726 Void ssRegMainThread(Void);
1727 #endif
1728
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));
1732 #else
1733 S16 ssGetDBufOfSize(Region region,Size size,Buffer **dBuf);
1734 #endif
1735
1736 /* ssi_x_001.main_69: Added MSPD debug macro */
1737 #ifdef MSPD
1738 void SEND_DBG_MSG(uint8_t *str, ...);
1739 #endif
1740
1741 #endif /* __SSIX__ */
1742
1743 \f
1744 /********************************************************************30**
1745   
1746          End of file
1747 **********************************************************************/