/*
 *  Copyright 2009 by Texas Instruments Incorporated.
 *
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *
 */

/* THIS FILE WAS GENERATED BY ti.sysbios.genx */

/*
 *  ======== multicoreLoopback.cfg ========   
 *
 */

/* Load and use the various BIOS modules. */
var Memory  = xdc.useModule('xdc.runtime.Memory');
var BIOS    = xdc.useModule('ti.sysbios.BIOS');
var HWI     = xdc.useModule('ti.sysbios.family.c64p.Hwi');
var ECM     = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var SEM     = xdc.useModule('ti.sysbios.knl.Semaphore');
var Task    = xdc.useModule('ti.sysbios.knl.Task');
var Idle    = xdc.useModule('ti.sysbios.knl.Idle');
var Log     = xdc.useModule('xdc.runtime.Log');
var Diags   = xdc.useModule('xdc.runtime.Diags'); 

/* Load and use the CSL, CPPI, QMSS and SRIO packages */
var cslSettings = xdc.useModule ('ti.csl.Settings');
var Cppi = xdc.loadPackage('ti.drv.cppi'); 
var Qmss = xdc.loadPackage('ti.drv.qmss'); 
var Srio = xdc.loadPackage('ti.drv.srio'); 

var System = xdc.useModule('xdc.runtime.System');
SysStd  = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;

/*
 * Enable Event Groups here and registering of ISR for specific GEM INTC is done
 * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
 */
ECM.eventGroupHwiNum[0] = 7;
ECM.eventGroupHwiNum[1] = 8;
ECM.eventGroupHwiNum[2] = 9;
ECM.eventGroupHwiNum[3] = 10;

/* Load and use the IPC packages */
var Ipc          = xdc.useModule('ti.sdo.ipc.Ipc');
var Settings     = xdc.module('ti.sdo.ipc.family.Settings');
var ListMP       = xdc.useModule('ti.sdo.ipc.ListMP');
var GateMP       = xdc.useModule('ti.sdo.ipc.GateMP');
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
var HeapMemMP    = xdc.useModule('ti.sdo.ipc.heaps.HeapMemMP');
var MultiProc    = xdc.useModule('ti.sdo.utils.MultiProc');

/* Create a default system heap using ti.bios.HeapMem. */
var heapMemParams1         = new HeapMem.Params;
heapMemParams1.size        = 0x30000  ;
heapMemParams1.sectionName = "systemHeap";
Program.global.heap0       = HeapMem.create(heapMemParams1);

/* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0;

Program.sectMap["systemHeap"] = Program.platform.stackMemory;

/* Configure the shared memory heap for shared memory allocations required by the
 * CPPI and QMSS Libraries */
SharedRegion.translate = false;

var memmap = Program.cpu.memoryMap;

Startup = xdc.useModule('xdc.runtime.Startup');    
Startup.firstFxns.$add('&myStartupFxn');

 MultiProc.setConfig(null, ["CORE0", "CORE1", "CORE2", "CORE3","CORE4", "CORE5", "CORE6", "CORE7"]);  
/*  MultiProc.setConfig(null, ["CORE0", "CORE1", "CORE2", "CORE3"]);  */


/* Synchronize all processors (this will be done in Ipc_start) */
Ipc.procSync = Ipc.ProcSync_ALL;

/* To avoid wasting shared memory for Notify and MessageQ transports */

for (var i = 0; i < MultiProc.numProcessors; i++) {
    Ipc.setEntryMeta({
        remoteProcId: i,
        setupNotify: false,
        setupMessageQ: false,
    });
}

/* Create a shared memory */
SharedRegion.setEntryMeta(0,
    { base: 0x0C020000,
      len: 0x00200000,
      ownerProcId: 0,
      isValid: true,
      name: "sharemem",
    });
  
/*
 *  @(#) ti.sysbios.genx; 2, 0, 0, 0,275; 4-29-2009 15:45:06; /db/vtree/library/trees/avala/avala-k25x/src/
 */


