[SYSBIOS-374] Update ROV to handle static TIRTOS SemaphoreP structures
diff --git a/src/packages/xdc/rov/Model.xs b/src/packages/xdc/rov/Model.xs
index fcaf3cd..1b6ced6 100644
--- a/src/packages/xdc/rov/Model.xs
+++ b/src/packages/xdc/rov/Model.xs
@@ -1,5 +1,5 @@
 /* --COPYRIGHT--,EPL
- *  Copyright (c) 2008-2015 Texas Instruments Incorporated
+ *  Copyright (c) 2008-2017 Texas Instruments Incorporated
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -99,8 +99,8 @@
 
     /* getModuleDesc has been called on all modules. */
     Program.$private.allModsRead = true;
-    
-    /* 
+
+    /*
      * TODO - version checks to ensure package versions in recap file
      * match package versions found along XDCPATH.
      */
@@ -109,7 +109,7 @@
         recapPkgVers = mod.$package.$vers.toString();
         pathPkg = xdc.loadPackage(mod.$package.$name);
         pathPkgVers = pathPkg.$vers;
-    
+
         if (recapPkgVers != pathPkgVers) {
             throw new Error("xdc.rov.Model: Package " + mod.$package.$name
                 + " version mismatch: Executable built with "
@@ -121,29 +121,30 @@
     }
     */
 
-    Program.debugPrint("bitsPerChar = " + this.$private.recap.build.target.bitsPerChar);
+    Program.debugPrint("bitsPerChar = "
+        + this.$private.recap.build.target.bitsPerChar);
 
-    /* 
+    /*
      * Create the StringReader for reading dynamic strings. Create this first
      * in case the OFReader needs to fall back on it.
      */
     var strReader = initStringReader();
-    
+
     /* Create and initialize the object file reader. */
     var ofReader = initOFReader(executable);  
-    
+
     /* Bind the OFReader and StringReader to Program for looking up strings. */
     Program.$$bind('strReader', strReader);
     Program.$$bind('ofReader', ofReader);
-    
-    /* 
-     * Set up the printf Formatter for any views that will use it. 
+
+    /*
+     * Set up the printf Formatter for any views that will use it.
      * The formatter needs the symbol table for %r and the object
      * file reader for %s.
      */
     xdc.loadPackage('xdc.rta');
-    
-    /* 
+
+    /*
      * TODO - We should be able to get the java implementation directly;
      * we shouldn't need to create a wrapper. 
      */
@@ -160,24 +161,24 @@
         });
 
     xdc.jre.xdc.rta.Formatter.setSymbolTable(javaSymTab);
-    
+
     /* Tell the Formatter the target size of an Arg in bits */
     xdc.jre.xdc.rta.Formatter.setArgSize(
         this.$private.recap.build.target.stdTypes['t_IArg'].size *
         this.$private.recap.build.target.bitsPerChar);
-  
+
     /* Create the StructureDecoder and bind to Program. */
     var StructureDecoder = xdc.useModule('xdc.rov.StructureDecoder');
     var strDec = StructureDecoder.create(mem, this.$private.recap.build.target);
     Program.$$bind('strDec', strDec);
-    
+
     /* Create the StateReader and bind to Program. */
     var StateReader = xdc.useModule('xdc.rov.StateReader');
     var stateReader = StateReader.create(sym, strDec);
     Program.$$bind('stateReader', stateReader);
-    
+
     //Program.getModuleDesc('xdc.runtime.Text'); // ?????
-    
+
     this.$private.initialized = true;
 }
 
@@ -193,13 +194,13 @@
 
     /* Retrieve the MemoryImage java object. */
     var memReader = Model.getMemoryImageInst();
-    
+
     /* Create a StringReader instance using the memory reader instance. */
     var strReader = new xdc.jre.xdc.rov.StringReader(memReader);
-    
+
     /* Store the StringReader in the Model's $private object. */
     Model.$private.strReader = strReader;
-    
+
     return (strReader);
 }
 
@@ -216,37 +217,37 @@
 
     /* Retrieve the class name of the binary parser to use */
     var binaryParser = Model.$private.recap.build.target.binaryParser;
-   
+
     var ofReader;
-    
+
     /* Make sure the target defines a binary parser. */
     if (binaryParser != undefined) {
         try {
             /* Parse the package name from the class name so we can load it. */
             var parserPackage = 
                 binaryParser.substring(0, binaryParser.lastIndexOf('.'));
-    
+
             /* Load the parser's package */
             xdc.loadPackage(parserPackage);
-            
+
             /* Get the parser class */
             var binaryParserClass = Packages[binaryParser];
-            
+
             /* Create an instance of the ofReader */
             ofReader = new binaryParserClass();
-            
+
             /* Initialize the OFReader */
             ofReader.parse(executable);
-            
-            /* 
+
+            /*
              * Close the reader to release the file handle. The reader will 
              * reopen the file when a string lookup occurs.
              */
-            ofReader.close();   
+            ofReader.close();
         }
-        /* 
-         * If there was a problem creating the OFReader, use the 
-         * StringReader instead. 
+        /*
+         * If there was a problem creating the OFReader, use the
+         * StringReader instead.
          */
         catch (e) {
             print("Caught an exception while initializing the object " +
@@ -254,9 +255,9 @@
             ofReader = Model.$private.strReader;
         }
     }
-    /* 
+    /*
      * If the target doesn't define an object file reader, use the
-     * string reader. 
+     * string reader.
      */
     else {
         print("The target does not specify an object file reader; using the " +
@@ -266,13 +267,13 @@
 
     /* Store the object file reader in the Model. */
     Model.$private.ofReader = ofReader;
-    
+
     /* Initialize the formatter's OFReader */
     xdc.jre.xdc.rta.Formatter.setOFReader(ofReader);
-    
+
     return (ofReader);
 }
- 
+
 /*
  *  ======== reset ========
  */
@@ -331,7 +332,7 @@
     return (this.$private.ofReader);
 }
 
-/* 
+/*
  * ======== getModuleList ========
  * This function returns a JavaScript object representing the package
  * hierarchy and the modules, including the views they support.
@@ -342,25 +343,25 @@
     if (this.$private.modList) {
         return (this.$private.modList);
     }
-    
+
     var root = {name: "ModuleList", modules: [], subPkgs: []};
     root.children = new Array();
-   
+
     var pkg = root;
-    
+
     /* For each module in the system... */
     for (var i = 0; i < Program.moduleNames.length; i++) {
-        
+
         /* Break the module name into packages */
         var names = Program.moduleNames[i].split(".");
-        
+
         for (var j = 0; j < names.length; j++) {
             var fullName = getFullName(names, j);
-            
+
             /* If this is a module... */
             if (j == (names.length - 1)) {
                 var modDesc = Program.getModuleDesc(fullName);
-                
+
                 var module = {};
                 module.name = names[j];
                 module.fullName = fullName;
@@ -370,14 +371,14 @@
                 pkg.modules[pkg.modules.length] = module;
                 continue;
             }
-            
+
             /* If the package hasn't already been created */
             var index;
             if ((index = indexOfChild(pkg, fullName)) == -1) {
                 var newPkg = {
-                                name: names[j], 
+                                name: names[j],
                                 fullName: fullName,
-                                modules: [], 
+                                modules: [],
                                 subPkgs: []
                              };
                 pkg.subPkgs[pkg.subPkgs.length] = newPkg;
@@ -387,14 +388,14 @@
                 pkg = pkg.subPkgs[index];
             }
         }
-        
+
         /* Start back from the root. */
         pkg = root;
-    }        
-    
+    }
+
     /* Store off the computed module list. */
     this.$private.modList = root;
-    
+
     return (root);
 }
 
@@ -403,7 +404,7 @@
  *  Takes the array of names created by splitting a module's name
  *  by the periods '.' and finds the package name referenced at
  *  the given index.
- *  For example, for the module xdc.runtime.HeapStd, index 1 will return 
+ *  For example, for the module xdc.runtime.HeapStd, index 1 will return
  *  "xdc.runtime".
  */
 function getFullName(names, index)
@@ -451,8 +452,8 @@
  *  Reads constructed objects from object file and user specified json file
  *
  *  This function parses object file to find the constructed objects.
- *  Alternally the user can specify a json file with .rov.json extension with
- *  an array of constructed objects.
+ *  Alternatively, the user can specify a json file with .rov.json extension
+ *  with an array of constructed objects.
  *  Example:
  *     [
  *        {
@@ -568,6 +569,13 @@
                 var varObj = {};
                 varObj.name = varList[i].name;
                 varObj.type = varList[i].type;
+                if (varObj.type == "SemaphoreP_Struct"
+                    || varObj.type == "HwiP_Struct"
+                    || varObj.type == "SwiP_Struct"
+                    || varObj.type == "ClockP_Struct") {
+                    varObj.type = "ti_sysbios_knl_"
+                        + varObj.type.replace("P_Struct", "_Struct");
+                }
                 varObj.offset = 0;
                 if (varList[i].offset != undefined) {
                     varObj.offset = varList[i].offset;