Eliminate need to specify Syslink_Override_Params on QNX
[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / family / omap5430 / Platform.c
1 /*
2  *  @file   Platform.c
3  *
4  *  @brief      Implementation of Platform initialization logic.
5  *
6  *  ============================================================================
7  *
8  *  Copyright (c) 2010-2014, Texas Instruments Incorporated
9  *
10  *  Redistribution and use in source and binary forms, with or without
11  *  modification, are permitted provided that the following conditions
12  *  are met:
13  *
14  *  *  Redistributions of source code must retain the above copyright
15  *     notice, this list of conditions and the following disclaimer.
16  *
17  *  *  Redistributions in binary form must reproduce the above copyright
18  *     notice, this list of conditions and the following disclaimer in the
19  *     documentation and/or other materials provided with the distribution.
20  *
21  *  *  Neither the name of Texas Instruments Incorporated nor the names of
22  *     its contributors may be used to endorse or promote products derived
23  *     from this software without specific prior written permission.
24  *
25  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *  Contact information for paper mail:
37  *  Texas Instruments
38  *  Post Office Box 655303
39  *  Dallas, Texas 75265
40  *  Contact information:
41  *  http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
42  *  DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
43  *  ============================================================================
44  *
45  */
48 /* Standard header files */
49 #include <ti/syslink/Std.h>
51 /* Utilities & Osal headers */
52 #include <ti/syslink/utils/Gate.h>
53 #include <ti/syslink/utils/GateMutex.h>
54 #include <ti/syslink/utils/Memory.h>
55 #include <ti/syslink/utils/Trace.h>
56 #include <ti/ipc/MultiProc.h>
57 #include <_MultiProc.h>
58 #include <ti/syslink/utils/OsalPrint.h>
59 #include <ti/syslink/utils/String.h>
61 /* SysLink device specific headers */
62 #include <ProcDefs.h>
63 #include <Processor.h>
64 #include <OMAP5430BenelliHal.h>
65 #include <OMAP5430BenelliHalReset.h>
66 #include <OMAP5430BenelliHalMmu.h>
67 #include <OMAP5430BenelliProc.h>
68 #include <Omap5430IpcInt.h>
70 /* Module level headers */
71 #include <_MessageQCopy.h>
72 #include <ti/ipc/MessageQCopy.h>
73 #include <_MessageQCopyDefs.h>
75 #include <ti/syslink/ProcMgr.h>
76 #include <_ProcMgr.h>
77 #include <ti/syslink/inc/knl/Platform.h>
78 #include <ElfLoader.h>
80 #include <ti/ipc/Ipc.h>
81 #include <_Ipc.h>
82 #include <_MultiProc.h>
83 #include <IpcKnl.h>
84 #include <ipu_pm.h>
85 #include <GateHWSpinlock.h>
87 #if defined (__cplusplus)
88 extern "C" {
89 #endif
92 /** ============================================================================
93  *  Macros.
94  *  ============================================================================
95  */
96 #define RESETVECTOR_SYMBOL          "_Ipc_ResetVector"
98 #define IPC_MEM_VRING0          0xA0000000
99 #define IPC_MEM_VRING1          0xA0004000
100 #define IPC_MEM_VRING2          0xA0008000
101 #define IPC_MEM_VRING3          0xA000c000
103 #define HWSPINLOCK_BASE             0x4A0F6000
104 #define HWSPINLOCK_SIZE             0x1000
105 #define HWSPINLOCK_OFFSET           0x800
107 #ifndef SYSLINK_SYSBIOS_SMP
108 #define CORE0 "CORE0"
109 #else
110 #define CORE0 "IPU"
111 #endif
113 /** ============================================================================
114  *  Application specific configuration, please change these value according to
115  *  your application's need.
116  *  ============================================================================
117  */
118 /*!
119  *  @brief  Structure defining config parameters for overall System.
120  */
121 typedef struct Platform_Config {
122     MultiProc_Config                multiProcConfig;
123     /*!< Multiproc config parameter */
125     MessageQCopy_Config             MQCopyConfig;
126     /*!< Notify config parameter */
128     ProcMgr_Config                  procMgrConfig;
129     /*!< Processor manager config parameter */
131     ipu_pm_config                   ipu_pm_config;
132     /* ipu_pm config parameter */
134     ElfLoader_Config                elfLoaderConfig;
135     /*!< Elf loader config parameter */
137     GateHWSpinlock_Config           gateHWSpinlockConfig;
138     /*!< GateHWSpinlock config parameter */
139 } Platform_Config;
142 /* Struct embedded into slave binary */
143 typedef struct Platform_SlaveConfig {
144     UInt32  cacheLineSize;
145     UInt32  brOffset;
146 } Platform_SlaveConfig;
148 typedef struct Platform_SlaveSRConfig {
149     UInt32 entryBase;
150     UInt32 entryLen;
151     UInt32 ownerProcId;
152     UInt32 id;
153     UInt32 createHeap;
154     UInt32 cacheLineSize;
155 } Platform_SlaveSRConfig;
157 /* Shared region configuration information for host side. */
158 typedef struct Platform_HostSRConfig {
159     UInt16 refCount;
160 } Platform_HostSRConfig;
162 /*! @brief structure for platform instance */
163 typedef struct Platform_Object {
164     /*!< Flag to indicate platform initialization status */
165     ProcMgr_Handle                pmHandle;
166     /*!< Handle to the ProcMgr instance used */
167     union{
168         struct {
169             OMAP5430BENELLIPROC_Handle    pHandle;
170             /*!< Handle to the Processor instance used */
171             /*!< Handle to the PwrMgr instance used */
172             ElfLoader_Handle             ldrHandle;
173             /*!< Handle to the Loader instance used */
174             UInt32                       fileId;
175             /*!< File ID of loaded image, needed for un-loading */
176         } ipu0;
177 #ifndef SYSLINK_SYSBIOS_SMP
178         struct {
179             OMAP5430BENELLIPROC_Handle    pHandle;
180             /*!< Handle to the Processor instance used */
181             /*!< Handle to the PwrMgr instance used */
182             /* NOTE: no loader used for ipu1, both cores loaded at once */
183             /*!< Handle to the Loader instance used */
184         } ipu1;
185 #endif
186         struct {
187             OMAP5430BENELLIPROC_Handle    pHandle;
188             /*!< Handle to the Processor instance used */
189             /*!< Handle to the PwrMgr instance used */
190             ElfLoader_Handle              ldrHandle;
191             /*!< Handle to the Loader instance used */
192         } dsp;
193     } sHandles;
194     /*!< Slave specific handles */
195     Platform_SlaveConfig          slaveCfg;
196     /*!< Slave embedded config */
197     Platform_SlaveSRConfig *      slaveSRCfg;
198     /*!< Shared region details from slave */
199 } Platform_Object, *Platform_Handle;
202 /*! @brief structure for platform instance */
203 typedef struct Platform_Module_State {
204     Bool              multiProcInitFlag;
205     /*!< MultiProc Initialize flag */
206     Bool              ipu_pm_init_flag;
207     /*!< ipu_pm Initialize flag */
208     Bool              procMgrInitFlag;
209     /*!< Processor manager Initialize flag */
210     Bool              elfLoaderInitFlag;
211     /*!< Elf loader Initialize flag */
212     Bool              ipcIntInitFlag;
213     /*!< IpcInt Initialize flag */
214     Bool              platformInitFlag;
215     /*!< Flag to indicate platform initialization status */
216     Bool              mqcopyInitFlag;
217     /*!< MQCopy Initialize flag */
218     Bool              platform_mem_init_flag;
219     /*!< Flag to indicate platform initialization status */
220     Bool              gateHWSpinlockInitFlag;
221     /*!< GateHWSpinlock Initialize flag */
222     Ptr               gateHWSpinlockVAddr;
223     /*!< GateHWSpinlock Virtual Address */
224 } Platform_Module_State;
227 /* =============================================================================
228  * GLOBALS
229  * =============================================================================
230  */
231 static Platform_Object Platform_objects [MultiProc_MAXPROCESSORS];
232 static Platform_Module_State Platform_Module_state;
233 static Platform_Module_State * Platform_module = &Platform_Module_state;
235 Int32 _Platform_setup  (Ipc_Config * cfg);
236 Int32 _Platform_destroy (void);
238 extern unsigned int syslink_ipu_mem_size;
239 extern unsigned int syslink_dsp_mem_size;
241 /*
242  * Variable used to override default parameters
243  * Use a string of form
244  * String Syslink_Override_Params = "ProcMgr.proc[DSP].mmuEnable=TRUE;"
245  *                                  "ProcMgr.proc[IPU].mmuEnable=TRUE;";
246  */
247 String Syslink_Override_Params = "";
250 /** ============================================================================
251  *  APIs.
252  *  ============================================================================
253  */
254 /* Function to read slave memory */
255 Int32
256 _Platform_readSlaveMemory (UInt16   procId,
257                            UInt32   addr,
258                            Ptr      value,
259                            UInt32 * numBytes);
261 /* Function to write slave memory */
262 Int32
263 _Platform_writeSlaveMemory (UInt16   procId,
264                             UInt32   addr,
265                             Ptr      value,
266                             UInt32 * numBytes);
267 /*!
268  *  @brief      Function to get the default values for configurations.
269  *
270  *  @param      config   Configuration values.
271  */
272 Void
273 Platform_getConfig (Platform_Config * config)
275     GT_1trace (curTrace, GT_ENTER, "Platform_getConfig", config);
277     GT_assert (curTrace, (config != NULL));
279 #if !defined(SYSLINK_BUILD_OPTIMIZE)
280     if (config == NULL) {
281         GT_setFailureReason (curTrace,
282                              GT_4CLASS,
283                              "Platform_getConfig",
284                              Platform_E_INVALIDARG,
285                              "Argument of type (Platform_getConfig *) passed "
286                              "is null!");
287     }
288     else {
289 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
291         /* Get the gatepeterson default config */
292         MultiProc_getConfig (&config->multiProcConfig);
294         /* Get the PROCMGR default config */
295         ProcMgr_getConfig (&config->procMgrConfig);
297         /* Get the ElfLoader default config */
298         ElfLoader_getConfig(&config->elfLoaderConfig);
300         /* Get the HWSpinlock default config */
301         GateHWSpinlock_getConfig (&config->gateHWSpinlockConfig);
302 #if !defined(SYSLINK_BUILD_OPTIMIZE)
303     }
304 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
306     GT_0trace (curTrace, GT_LEAVE, "Platform_getConfig");
309 /*!
310  *  @brief      Function to override the default confiuration values.
311  *
312  *  @param      config   Configuration values.
313  */
314 Int32
315 Platform_overrideConfig (Platform_Config * config, Ipc_Config * cfg)
317     Int32  status = Platform_S_SUCCESS;
318     /*Char   hexString[16];*/
320     GT_1trace (curTrace, GT_ENTER, "Platform_overrideConfig", config);
322     GT_assert (curTrace, (config != NULL));
324 #if !defined(SYSLINK_BUILD_OPTIMIZE)
325     if (config == NULL) {
326         /*! @retval Platform_E_INVALIDARG Argument of type
327          *  (Platform_Config *) passed is null*/
328         status = Platform_E_INVALIDARG;
329         GT_setFailureReason (curTrace,
330                              GT_4CLASS,
331                              "Platform_overrideConfig",
332                              status,
333                              "Argument of type (Platform_getConfig *) passed "
334                              "is null!");
335     }
336     else {
337 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
338         cfg->params = Memory_alloc(NULL,
339                                    String_len(Syslink_Override_Params) + 1, 0,
340                                    NULL);
341         if (cfg->params) {
342             String_cpy(cfg->params, Syslink_Override_Params);
343         }
345         _ProcMgr_saveParams(cfg->params, String_len(cfg->params));
347         /* Set the MultiProc config as defined in SystemCfg.c */
348         config->multiProcConfig = _MultiProc_cfg;
350         /* Override the PROCMGR default config */
352         /* Override the MessageQCopy default config */
353         config->MQCopyConfig.intId[1] = 58;
354         config->MQCopyConfig.intId[2] = 58;
355         config->MQCopyConfig.intId[3] = 58;
357         config->ipu_pm_config.int_id = 58;
358 #ifdef SYSLINK_SYSBIOS_SMP
359         config->ipu_pm_config.num_procs = 2;
360         config->ipu_pm_config.proc_ids[0] = 1; // IPU is set as 1 above
361         config->ipu_pm_config.proc_ids[1] = 2; // DSP is set as 2 above
362 #else
363         config->ipu_pm_config.num_procs = 3;
364         config->ipu_pm_config.proc_ids[0] = 1; // CORE0 is set as 1 above
365         config->ipu_pm_config.proc_ids[1] = 2; // CORE1 is set as 2 above
366         config->ipu_pm_config.proc_ids[2] = 3; // DSP is set as 3 above
367 #endif
369 #if !defined(SYSLINK_BUILD_OPTIMIZE)
370     }
371 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
373     GT_1trace (curTrace, GT_ENTER, "Platform_overrideConfig", status);
375     /*! @retval Platform_S_SUCCESS operation was successful */
376     return status;
379 /*!
380  *  @brief      Function to setup platform.
381  *              TBD: logic would change completely in the final system.
382  */
383 Int32
384 Platform_setup (Ipc_Config * cfg)
386     Int32                   status      = Platform_S_SUCCESS;
387     Platform_Config         _config;
388     Platform_Config *       config;
389     Omap5430IpcInt_Config   omap5430cfg;
390     Memory_MapInfo    minfo;
392     Platform_getConfig (&_config);
393     config = &_config;
395 /* Initialize PlatformMem */
396     status = MemoryOS_setup();
397 #if !defined(SYSLINK_BUILD_OPTIMIZE)
398     if (status < 0) {
399         GT_setFailureReason (curTrace,
400                              GT_4CLASS,
401                              "Platform_setup",
402                              status,
403                              "platform_mem_setup!");
404     } else {
405 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
406         Platform_module->platform_mem_init_flag = TRUE;
407 #if !defined(SYSLINK_BUILD_OPTIMIZE)
408     }
409 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
411     Platform_overrideConfig (config, cfg);
413     status = MultiProc_setup (&(config->multiProcConfig));
414 #if !defined(SYSLINK_BUILD_OPTIMIZE)
415     if (status < 0) {
416         GT_setFailureReason (curTrace,
417                              GT_4CLASS,
418                              "Platform_setup",
419                              status,
420                              "MultiProc_setup failed!");
421     }
422     else {
423 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
424             Platform_module->multiProcInitFlag = TRUE;
425 #if !defined(SYSLINK_BUILD_OPTIMIZE)
426     }
427 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
429 /* Initialize PROCMGR */
430     if (status >= 0) {
431         status = ProcMgr_setup (&(config->procMgrConfig));
432 #if !defined(SYSLINK_BUILD_OPTIMIZE)
433         if (status < 0) {
434             GT_setFailureReason (curTrace,
435                                  GT_4CLASS,
436                                  "Platform_setup",
437                                  status,
438                                  "ProcMgr_setup failed!");
439         }
440         else {
441 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
442             Platform_module->procMgrInitFlag = TRUE;
443 #if !defined(SYSLINK_BUILD_OPTIMIZE)
444         }
445 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
446     }
448     /* Initialize IpcInt required for VirtQueue/MessageQCopy. */
449     if (status >= 0) {
450         /* Do the IPC interrupt setup for the full platform (cfg is not used) */
451         Omap5430IpcInt_setup(&omap5430cfg);
452         Platform_module->ipcIntInitFlag = TRUE;
453     }
455 /* Initialize Elf loader */
456     if (status >= 0) {
457         status = ElfLoader_setup (&config->elfLoaderConfig);
458 #if !defined(SYSLINK_BUILD_OPTIMIZE)
459         if (status < 0) {
460             GT_setFailureReason (curTrace,
461                                  GT_4CLASS,
462                                  "Platform_setup",
463                                  status,
464                                  "ElfLoader_setup failed!");
465         }
466         else {
467 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
468             Platform_module->elfLoaderInitFlag = TRUE;
469 #if !defined(SYSLINK_BUILD_OPTIMIZE)
470         }
471 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
472     }
474 /* Initialize ipu_pm */
475     if (status >= 0) {
476         status = ipu_pm_setup (&config->ipu_pm_config);
477 #if !defined(SYSLINK_BUILD_OPTIMIZE)
478         if (status < 0) {
479             GT_setFailureReason (curTrace,
480                                  GT_4CLASS,
481                                  "Platform_setup",
482                                  status,
483                                  "ipu_pm_setup failed!");
484         }
485         else {
486 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
487             Platform_module->ipu_pm_init_flag = TRUE;
488 #if !defined(SYSLINK_BUILD_OPTIMIZE)
489         }
490 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
491     }
493 /* Initialize MessageQCopy */
494     if (status >= 0) {
495         status = MessageQCopy_setup (&config->MQCopyConfig);
496 #if !defined(SYSLINK_BUILD_OPTIMIZE)
497         if (status < 0) {
498             GT_setFailureReason (curTrace,
499                                  GT_4CLASS,
500                                  "Platform_setup",
501                                  status,
502                                  "MessageQCopy_setup failed!");
503         }
504         else {
505 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
506             Platform_module->mqcopyInitFlag = TRUE;
507 #if !defined(SYSLINK_BUILD_OPTIMIZE)
508         }
509 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
510     }
512     if (status >= 0) {
513         Memory_set (Platform_objects,
514                     0,
515                     (sizeof (Platform_Object) * MultiProc_getNumProcessors()));
516     }
518     if (status >= 0) {
519         /* Doing per remote-proc init stuff */
520         status = _Platform_setup (cfg);
521 #if !defined(SYSLINK_BUILD_OPTIMIZE)
522         if (status < 0) {
523             GT_setFailureReason (curTrace,
524                                  GT_4CLASS,
525                                  "Platform_setup",
526                                  status,
527                                  "_Platform_setup failed!");
528         }
529         else {
530 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
531             Platform_module->platformInitFlag = TRUE;
532 #if !defined(SYSLINK_BUILD_OPTIMIZE)
533         }
534 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
535     }
536     if (status >= 0) {
537         minfo.src  = HWSPINLOCK_BASE;
538         minfo.size = HWSPINLOCK_SIZE;
539         minfo.isCached = FALSE;
540         status = Memory_map (&minfo);
541         if (status < 0) {
542            GT_setFailureReason (curTrace,
543                                 GT_4CLASS,
544                                 "Platform_setup",
545                                 status,
546                                 "Memory_map failed!");
547         }
548         else {
549             Platform_module->gateHWSpinlockVAddr = (Ptr)minfo.dst;
550             config->gateHWSpinlockConfig.numLocks = 32;
551             config->gateHWSpinlockConfig.baseAddr = minfo.dst  + HWSPINLOCK_OFFSET;
552             status = GateHWSpinlock_setup (&config->gateHWSpinlockConfig);
553 #if !defined(SYSLINK_BUILD_OPTIMIZE)
554             if (status < 0) {
555                 GT_setFailureReason (curTrace,
556                                      GT_4CLASS,
557                                      "Platform_setup",
558                                      status,
559                                      "GateHWSpinlock_setup failed!");
560             }
561             else {
562 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
563                 Platform_module->gateHWSpinlockInitFlag = TRUE;
564 #if !defined(SYSLINK_BUILD_OPTIMIZE)
565             }
566 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
567         }
568     }
570     if (status < 0) {
571         Platform_destroy();
572     }
574     return status;
578 /*!
579  *  @brief      Function to destroy the System.
580  *
581  *  @sa         Platform_setup
582  */
583 Int32
584 Platform_destroy (void)
586     Int32  status = Platform_S_SUCCESS;
587     Memory_UnmapInfo minfo;
589     GT_0trace (curTrace, GT_ENTER, "Platform_destroy");
591     /* Finalize Platform-specific destroy */
592     if (Platform_module->platformInitFlag == TRUE) {
593         status = _Platform_destroy ();
594 #if !defined(SYSLINK_BUILD_OPTIMIZE)
595         if (status < 0) {
596             GT_setFailureReason (curTrace,
597                                  GT_4CLASS,
598                                  "Platform_destroy",
599                                  status,
600                                  "Platform_destroy failed!");
601         }
602         else {
603 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
604             Platform_module->platformInitFlag = FALSE;
605 #if !defined(SYSLINK_BUILD_OPTIMIZE)
606         }
607 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
608     }
610     /* Finalize MessageQCopy */
611     if (Platform_module->mqcopyInitFlag == TRUE) {
612         status = MessageQCopy_destroy ();
613 #if !defined(SYSLINK_BUILD_OPTIMIZE)
614         if (status < 0) {
615             GT_setFailureReason (curTrace,
616                                  GT_4CLASS,
617                                  "Platform_destroy",
618                                  status,
619                                  "MessageQCopy_destroy failed!");
620         }
621         else {
622 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
623             Platform_module->mqcopyInitFlag = FALSE;
624 #if !defined(SYSLINK_BUILD_OPTIMIZE)
625         }
626 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
627     }
629     /* Finalize ipu_pm */
630     if (Platform_module->ipu_pm_init_flag == TRUE) {
631         status = ipu_pm_destroy ();
632 #if !defined(SYSLINK_BUILD_OPTIMIZE)
633         if (status < 0) {
634             GT_setFailureReason (curTrace,
635                                  GT_4CLASS,
636                                  "Platform_destroy",
637                                  status,
638                                  "ipu_pm_destroy failed!");
639         }
640         else {
641 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
642             Platform_module->ipu_pm_init_flag = FALSE;
643 #if !defined(SYSLINK_BUILD_OPTIMIZE)
644         }
645 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
646     }
648     /* Finalize Elf loader */
649     if (Platform_module->elfLoaderInitFlag == TRUE) {
650         status = ElfLoader_destroy ();
651 #if !defined(SYSLINK_BUILD_OPTIMIZE)
652         if (status < 0) {
653             GT_setFailureReason (curTrace,
654                                  GT_4CLASS,
655                                  "Platform_destroy",
656                                  status,
657                                  "ElfLoader_destroy failed!");
658         }
659         else {
660 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
661             Platform_module->elfLoaderInitFlag = FALSE;
662 #if !defined(SYSLINK_BUILD_OPTIMIZE)
663         }
664 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
665     }
667     if (Platform_module->ipcIntInitFlag == TRUE) {
668         Omap5430IpcInt_destroy ();
669         Platform_module->ipcIntInitFlag = FALSE;
670     }
672     /* Finalize PROCMGR */
673     if (Platform_module->procMgrInitFlag == TRUE) {
674         status = ProcMgr_destroy ();
675 #if !defined(SYSLINK_BUILD_OPTIMIZE)
676         if (status < 0) {
677             GT_setFailureReason (curTrace,
678                                  GT_4CLASS,
679                                  "Platform_destroy",
680                                  status,
681                                  "ProcMgr_destroy failed!");
682         }
683         else {
684 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
685             Platform_module->procMgrInitFlag = FALSE;
686 #if !defined(SYSLINK_BUILD_OPTIMIZE)
687         }
688 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
689     }
691     /* Finalize MultiProc */
692     if (Platform_module->multiProcInitFlag == TRUE) {
693         status = MultiProc_destroy ();
694 #if !defined(SYSLINK_BUILD_OPTIMIZE)
695         if (status < 0) {
696             GT_setFailureReason (curTrace,
697                                  GT_4CLASS,
698                                  "Platform_destroy",
699                                  status,
700                                  "MultiProc_destroy failed!");
701         }
702         else {
703 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
704             Platform_module->multiProcInitFlag = FALSE;
705 #if !defined(SYSLINK_BUILD_OPTIMIZE)
706         }
707 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
708     }
710     if (status >= 0) {
711         Memory_set (Platform_objects,
712                     0,
713                     (sizeof (Platform_Object) * MultiProc_getNumProcessors()));
714     }
716     if (Platform_module->gateHWSpinlockInitFlag == TRUE) {
717         status = GateHWSpinlock_destroy();
718 #if !defined(SYSLINK_BUILD_OPTIMIZE)
719         if (status < 0) {
720             GT_setFailureReason (curTrace,
721                                  GT_4CLASS,
722                                  "Platform_destroy",
723                                  status,
724                                  "GateHWSpinlock_destroy failed!");
725         }
726         else {
727 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
728             Platform_module->gateHWSpinlockInitFlag = FALSE;
729 #if !defined(SYSLINK_BUILD_OPTIMIZE)
730         }
731 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
732     }
734     if (Platform_module->gateHWSpinlockVAddr) {
735         minfo.addr = (UInt32)Platform_module->gateHWSpinlockVAddr;
736         minfo.size = HWSPINLOCK_SIZE;
737         minfo.isCached = FALSE;
738         status = Memory_unmap(&minfo);
739 #if !defined(SYSLINK_BUILD_OPTIMIZE)
740         if (status < 0) {
741             GT_setFailureReason (curTrace,
742                                  GT_4CLASS,
743                                  "Platform_destroy",
744                                  status,
745                                  "Memory_unmap failed!");
746         }
747 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
748         Platform_module->gateHWSpinlockVAddr = NULL;
749     }
751     if (Platform_module->platform_mem_init_flag == TRUE) {
752         status = MemoryOS_destroy();
753 #if !defined(SYSLINK_BUILD_OPTIMIZE)
754         if (status < 0) {
755             GT_setFailureReason (curTrace,
756                                  GT_4CLASS,
757                                  "Platform_destroy",
758                                  status,
759                                  "MemoryOS_destroy failed!");
760         }
761         else {
762 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
763             Platform_module->platform_mem_init_flag = FALSE;
764 #if !defined(SYSLINK_BUILD_OPTIMIZE)
765         }
766 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
767     }
769     GT_1trace (curTrace, GT_LEAVE, "Platform_destroy", status);
771     /*! @retval Platform_S_SUCCESS Operation successful */
772     return status;
775 /*!
776  *  @brief      Function to setup platform.
777  *              TBD: logic would change completely in the final system.
778  */
779 Int32
780 _Platform_setup (Ipc_Config * cfg)
782     Int32                       status              = Platform_S_SUCCESS;
783     ProcMgr_Params              params;
784     OMAP5430BENELLIPROC_Config  ipu0ProcConfig;
785 #ifndef SYSLINK_SYSBIOS_SMP
786     OMAP5430BENELLIPROC_Config  ipu1ProcConfig;
787 #endif
788     OMAP5430BENELLIPROC_Config  dspProcConfig;
789     OMAP5430BENELLIPROC_Params  ipu0ProcParams;
790 #ifndef SYSLINK_SYSBIOS_SMP
791     OMAP5430BENELLIPROC_Params  ipu1ProcParams;
792 #endif
793     OMAP5430BENELLIPROC_Params  dspProcParams;
794     ElfLoader_Params            elfLoaderParams;
795     ElfLoader_Handle            ldrHandle;
796     UInt16                      procId;
797     Platform_Handle             handle;
798     Bool                        core0Setup          = FALSE;
799 #ifndef SYSLINK_SYSBIOS_SMP
800     Bool                        core1Setup          = FALSE;
801 #endif
802     Bool                        dspSetup            = FALSE;
804     GT_0trace (curTrace, GT_ENTER, "_Platform_setup");
806     /* Get MultiProc ID by name. */
807     procId = MultiProc_getId (CORE0);
809     handle = &Platform_objects [procId];
811     OMAP5430BENELLIPROC_get_config(&ipu0ProcConfig, procId );
812     status = OMAP5430BENELLIPROC_setup (&ipu0ProcConfig, procId);
813     if (status < 0) {
814         GT_setFailureReason (curTrace,
815                              GT_4CLASS,
816                              "_Platform_setup",
817                              status,
818                              "OMAP5430PROC_setup failed!");
819     }
820     else {
821         core0Setup = TRUE;
822         /* Create an instance of the Processor object for
823          * OMAP5430 */
824         OMAP5430BENELLIPROC_Params_init (NULL, &ipu0ProcParams, procId);
826         handle->sHandles.ipu0.pHandle = OMAP5430BENELLIPROC_create (
827                                                       procId,
828                                                       &ipu0ProcParams);
830         /* Create an instance of the Elf Loader object */
831         ElfLoader_Params_init (NULL, &elfLoaderParams);
832         handle->sHandles.ipu0.ldrHandle = ElfLoader_create (procId,
833                                                           &elfLoaderParams);
835         if (handle->sHandles.ipu0.pHandle == NULL) {
836             status = Platform_E_FAIL;
837             GT_setFailureReason (curTrace,
838                                  GT_4CLASS,
839                                  "_Platform_setup",
840                                  status,
841                                  "OMAP5430PROC_create failed!");
842         }
843         else if (handle->sHandles.ipu0.ldrHandle ==  NULL) {
844             status = Platform_E_FAIL;
845             GT_setFailureReason (curTrace,
846                                  GT_4CLASS,
847                                  "_Platform_setup",
848                                  status,
849                                  "Failed to create loader instance!");
850         }
851         else {
852             /* Initialize parameters */
853             ProcMgr_Params_init (NULL, &params);
854             params.procHandle = handle->sHandles.ipu0.pHandle;
855             params.loaderHandle = handle->sHandles.ipu0.ldrHandle;
856             ldrHandle = params.loaderHandle;
857             String_cpy (params.rstVectorSectionName,
858                         RESETVECTOR_SYMBOL);
859             handle->pmHandle = ProcMgr_create (procId, &params);
860             if (handle->pmHandle == NULL) {
861                 status = Platform_E_FAIL;
862                 GT_setFailureReason (curTrace,
863                                      GT_4CLASS,
864                                      "_Platform_setup",
865                                      status,
866                                      "ProcMgr_create failed!");
867             }
868         }
869     }
871 #ifndef SYSLINK_SYSBIOS_SMP
872     if (status >= 0) {
873         /* Get MultiProc ID by name. */
874         procId = MultiProc_getId ("CORE1");
876         handle = &Platform_objects [procId];
877         OMAP5430BENELLIPROC_get_config (&ipu1ProcConfig, procId );
878         status = OMAP5430BENELLIPROC_setup (&ipu1ProcConfig, procId);
879         if (status < 0) {
880             GT_setFailureReason (curTrace,
881                                  GT_4CLASS,
882                                  "_Platform_setup",
883                                  status,
884                                  "OMAP5430PROC_setup failed!");
885         }
886         else {
887             core1Setup = TRUE;
888             /* Create an instance of the Processor object for
889              * OMAP5430 */
890             OMAP5430BENELLIPROC_Params_init(NULL, &ipu1ProcParams,procId);
892             handle->sHandles.ipu1.pHandle = OMAP5430BENELLIPROC_create(procId,
893                                                           &ipu1ProcParams);
895             /* Don't create an instance of the Elf Loader - not needed */
897             if (handle->sHandles.ipu1.pHandle == NULL) {
898                 status = Platform_E_FAIL;
899                 GT_setFailureReason (curTrace,
900                                      GT_4CLASS,
901                                      "_Platform_setup",
902                                      status,
903                                      "OMAP5430PROC_create failed!");
904             }
905             else {
906                 /* Initialize parameters */
907                 ProcMgr_Params_init (NULL, &params);
908                 params.procHandle = handle->sHandles.ipu1.pHandle;
909                 /* Use the same loader handle as ipu0 to avoid ProcMgr errors */
910                 params.loaderHandle = ldrHandle;
911                 String_cpy (params.rstVectorSectionName,
912                             RESETVECTOR_SYMBOL);
913                 handle->pmHandle = ProcMgr_create (procId, &params);
914                 if (handle->pmHandle == NULL) {
915                     status = Platform_E_FAIL;
916                     GT_setFailureReason (curTrace,
917                                          GT_4CLASS,
918                                          "_Platform_setup",
919                                          status,
920                                          "ProcMgr_create failed!");
921                 }
922             }
923         }
924     }
925 #endif
927     if (status >= 0) {
928         /* Get MultiProc ID by name. */
929         procId = MultiProc_getId ("DSP");
931         handle = &Platform_objects [procId];
932         OMAP5430BENELLIPROC_get_config(&dspProcConfig, procId);
933         status = OMAP5430BENELLIPROC_setup (&dspProcConfig, procId);
934         if (status < 0) {
935             GT_setFailureReason (curTrace,
936                                  GT_4CLASS,
937                                  "_Platform_setup",
938                                  status,
939                                  "OMAP5430PROC_setup failed!");
940         }
941         else {
942             dspSetup = TRUE;
943             /* Create an instance of the Processor object for
944                        * OMAP5430 */
945             OMAP5430BENELLIPROC_Params_init (NULL, &dspProcParams, procId);
947             handle->sHandles.dsp.pHandle = OMAP5430BENELLIPROC_create (
948                                                           procId,
949                                                           &dspProcParams);
951             /* Create an instance of the Elf Loader object */
952             ElfLoader_Params_init (NULL, &elfLoaderParams);
953             handle->sHandles.dsp.ldrHandle = ElfLoader_create (procId,
954                                                           &elfLoaderParams);
956             if (handle->sHandles.dsp.pHandle == NULL) {
957                 status = Platform_E_FAIL;
958                 GT_setFailureReason (curTrace,
959                                      GT_4CLASS,
960                                      "_Platform_setup",
961                                      status,
962                                      "OMAP5430PROC_create failed!");
963             }
964             else if (handle->sHandles.dsp.ldrHandle ==  NULL) {
965                 status = Platform_E_FAIL;
966                 GT_setFailureReason (curTrace,
967                                      GT_4CLASS,
968                                      "_Platform_setup",
969                                      status,
970                                      "Failed to create loader instance!");
971             }
972             else {
973                 /* Initialize parameters */
974                 ProcMgr_Params_init (NULL, &params);
975                 params.procHandle = handle->sHandles.dsp.pHandle;
976                 params.loaderHandle = handle->sHandles.dsp.ldrHandle;
977                 String_cpy (params.rstVectorSectionName,
978                             RESETVECTOR_SYMBOL);
979                 handle->pmHandle = ProcMgr_create (procId, &params);
980                 if (handle->pmHandle == NULL) {
981                     status = Platform_E_FAIL;
982                     GT_setFailureReason (curTrace,
983                                          GT_4CLASS,
984                                          "_Platform_setup",
985                                          status,
986                                          "ProcMgr_create failed!");
987                 }
988             }
989         }
990     }
992     if (status < 0) {
993         /* Cleanup in case of error */
994 #ifndef SYSLINK_SYSBIOS_SMP
995         procId = MultiProc_getId ("CORE1");
996         handle = &Platform_objects [procId];
997         if (handle->pmHandle) {
998             ProcMgr_delete(&handle->pmHandle);
999             handle->pmHandle = NULL;
1000         }
1001         if (handle->sHandles.ipu1.pHandle) {
1002             OMAP5430BENELLIPROC_delete(&handle->sHandles.ipu1.pHandle);
1003             handle->sHandles.ipu1.pHandle = NULL;
1004         }
1005         if (core1Setup)
1006             OMAP5430BENELLIPROC_destroy(procId);
1007 #endif
1009         procId = MultiProc_getId (CORE0);
1011         handle = &Platform_objects [procId];
1012         if (handle->pmHandle) {
1013             ProcMgr_delete(&handle->pmHandle);
1014             handle->pmHandle = NULL;
1015         }
1016         if (handle->sHandles.ipu0.ldrHandle) {
1017             ElfLoader_delete(&handle->sHandles.ipu0.ldrHandle);
1018             handle->sHandles.ipu0.ldrHandle = NULL;
1019         }
1020         if (handle->sHandles.ipu0.pHandle) {
1021             OMAP5430BENELLIPROC_delete(&handle->sHandles.ipu0.pHandle);
1022             handle->sHandles.ipu0.pHandle = NULL;
1023         }
1024         if (core0Setup)
1025             OMAP5430BENELLIPROC_destroy(procId);
1027         procId = MultiProc_getId ("DSP");
1028         handle = &Platform_objects [procId];
1029         if (handle->pmHandle) {
1030             ProcMgr_delete(&handle->pmHandle);
1031             handle->pmHandle = NULL;
1032         }
1033         if (handle->sHandles.dsp.ldrHandle) {
1034             ElfLoader_delete(&handle->sHandles.dsp.ldrHandle);
1035             handle->sHandles.dsp.ldrHandle = NULL;
1036         }
1037         if (handle->sHandles.dsp.pHandle) {
1038             OMAP5430BENELLIPROC_delete(&handle->sHandles.dsp.pHandle);
1039             handle->sHandles.dsp.pHandle = NULL;
1040         }
1041         if (dspSetup)
1042             OMAP5430BENELLIPROC_destroy(procId);
1043     }
1044     GT_1trace (curTrace, GT_LEAVE, "_Platform_setup", status);
1046     /*! @retval Platform_S_SUCCESS operation was successful */
1047     return status;
1051 /*!
1052  *  @brief      Function to setup platform.
1053  *              TBD: logic would change completely in the final system.
1054  */
1055 Int32
1056 _Platform_destroy (void)
1058     Int32           status    = Platform_S_SUCCESS;
1059     Int32           tmpStatus = Platform_S_SUCCESS;
1060     Platform_Handle handle;
1061     /*UInt16          procId;*/
1063     /* Get MultiProc ID by name. */
1065     GT_0trace (curTrace, GT_ENTER, "_Platform_destroy");
1067 #ifndef SYSLINK_SYSBIOS_SMP
1068     /* ------------------------- ipu1 cleanup ------------------------------- */
1069     handle = &Platform_objects [MultiProc_getId ("CORE1")];
1070     if (handle->pmHandle != NULL) {
1071         tmpStatus = ProcMgr_delete (&handle->pmHandle);
1072         GT_assert (curTrace, (tmpStatus >= 0));
1073         if ((status >= 0) && (tmpStatus < 0)) {
1074             status = tmpStatus;
1075 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1076             GT_setFailureReason (curTrace,
1077                                  GT_4CLASS,
1078                                  "_Platform_destroy",
1079                                  status,
1080                                  "ProcMgr_delete failed!");
1081 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1082         }
1083     }
1085     /* Delete the Processor, Loader and PwrMgr instances */
1087     if (handle->sHandles.ipu1.pHandle != NULL) {
1088         tmpStatus = OMAP5430BENELLIPROC_delete (&handle->sHandles.ipu1.pHandle);
1089         GT_assert (curTrace, (tmpStatus >= 0));
1090         if ((status >= 0) && (tmpStatus < 0)) {
1091             status = tmpStatus;
1092 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1093             GT_setFailureReason (curTrace,
1094                                  GT_4CLASS,
1095                                  "_Platform_destroy",
1096                                  status,
1097                                  "OMAP5430PROC_delete failed!");
1098 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1099         }
1100     }
1102     tmpStatus = OMAP5430BENELLIPROC_destroy (MultiProc_getId ("CORE1"));
1103     GT_assert (curTrace, (tmpStatus >= 0));
1104     if ((status >= 0) && (tmpStatus < 0)) {
1105         status = tmpStatus;
1106 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1107         GT_setFailureReason (curTrace,
1108                              GT_4CLASS,
1109                              "_Platform_destroy",
1110                              status,
1111                              "OMAP5430PROC_destroy failed!");
1112 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1113     }
1114 #endif
1116     /* ------------------------- ipu0 cleanup ------------------------------- */
1117     handle = &Platform_objects [MultiProc_getId (CORE0)];
1118     if (handle->pmHandle != NULL) {
1119         tmpStatus = ProcMgr_delete (&handle->pmHandle);
1120         GT_assert (curTrace, (tmpStatus >= 0));
1121         if ((status >= 0) && (tmpStatus < 0)) {
1122             status = tmpStatus;
1123 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1124             GT_setFailureReason (curTrace,
1125                                  GT_4CLASS,
1126                                  "_Platform_destroy",
1127                                  status,
1128                                  "ProcMgr_delete failed!");
1129 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1130         }
1131     }
1133     /* Delete the Processor, Loader and PwrMgr instances */
1135     if (handle->sHandles.ipu0.ldrHandle != NULL) {
1136         tmpStatus = ElfLoader_delete (&handle->sHandles.ipu0.ldrHandle);
1137         GT_assert (curTrace, (tmpStatus >= 0));
1138         if ((status >= 0) && (tmpStatus < 0)) {
1139             status = tmpStatus;
1140 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1141             GT_setFailureReason (curTrace,
1142                                  GT_4CLASS,
1143                                  "_Platform_destroy",
1144                                  status,
1145                                  "Failed to delete loader instance!");
1146 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1147         }
1148     }
1150     if (handle->sHandles.ipu0.pHandle != NULL) {
1151         tmpStatus = OMAP5430BENELLIPROC_delete (&handle->sHandles.ipu0.pHandle);
1152         GT_assert (curTrace, (tmpStatus >= 0));
1153         if ((status >= 0) && (tmpStatus < 0)) {
1154             status = tmpStatus;
1155 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1156             GT_setFailureReason (curTrace,
1157                                  GT_4CLASS,
1158                                  "_Platform_destroy",
1159                                  status,
1160                                  "OMAP5430PROC_delete failed!");
1161 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1162         }
1163     }
1165     tmpStatus = OMAP5430BENELLIPROC_destroy (MultiProc_getId (CORE0));
1166     GT_assert (curTrace, (tmpStatus >= 0));
1167     if ((status >= 0) && (tmpStatus < 0)) {
1168         status = tmpStatus;
1169 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1170         GT_setFailureReason (curTrace,
1171                              GT_4CLASS,
1172                              "_Platform_destroy",
1173                              status,
1174                              "OMAP5430PROC_destroy failed!");
1175 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1176     }
1178     /* ------------------------- dsp cleanup ------------------------------- */
1179     handle = &Platform_objects [MultiProc_getId ("DSP")];
1180     if (handle->pmHandle != NULL) {
1181         tmpStatus = ProcMgr_delete (&handle->pmHandle);
1182         GT_assert (curTrace, (tmpStatus >= 0));
1183         if ((status >= 0) && (tmpStatus < 0)) {
1184             status = tmpStatus;
1185 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1186             GT_setFailureReason (curTrace,
1187                                  GT_4CLASS,
1188                                  "_Platform_destroy",
1189                                  status,
1190                                  "ProcMgr_delete failed!");
1191 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1192         }
1193     }
1195     /* Delete the Processor, Loader and PwrMgr instances */
1197     if (handle->sHandles.dsp.ldrHandle != NULL) {
1198         tmpStatus = ElfLoader_delete (&handle->sHandles.dsp.ldrHandle);
1199         GT_assert (curTrace, (tmpStatus >= 0));
1200         if ((status >= 0) && (tmpStatus < 0)) {
1201             status = tmpStatus;
1202 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1203             GT_setFailureReason (curTrace,
1204                                  GT_4CLASS,
1205                                  "_Platform_destroy",
1206                                  status,
1207                                  "Failed to delete loader instance!");
1208 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1209         }
1210     }
1212     if (handle->sHandles.dsp.pHandle != NULL) {
1213         tmpStatus = OMAP5430BENELLIPROC_delete (&handle->sHandles.dsp.pHandle);
1214         GT_assert (curTrace, (tmpStatus >= 0));
1215         if ((status >= 0) && (tmpStatus < 0)) {
1216             status = tmpStatus;
1217 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1218             GT_setFailureReason (curTrace,
1219                                  GT_4CLASS,
1220                                  "_Platform_destroy",
1221                                  status,
1222                                  "OMAP5430PROC_delete failed!");
1223 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1224         }
1225     }
1227     tmpStatus = OMAP5430BENELLIPROC_destroy (MultiProc_getId ("DSP"));
1228     GT_assert (curTrace, (tmpStatus >= 0));
1229     if ((status >= 0) && (tmpStatus < 0)) {
1230         status = tmpStatus;
1231 #if !defined(SYSLINK_BUILD_OPTIMIZE)
1232         GT_setFailureReason (curTrace,
1233                              GT_4CLASS,
1234                              "_Platform_destroy",
1235                              status,
1236                              "OMAP5430PROC_destroy failed!");
1237 #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
1238     }
1240     GT_1trace (curTrace, GT_LEAVE, "_Platform_destroy", status);
1242     /*! @retval Platform_S_SUCCESS operation was successful */
1243     return status;
1247 #if defined (__cplusplus)
1249 #endif /* defined (__cplusplus) */