summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPragat Chaudhari2014-08-26 10:47:24 -0500
committerPragat Chaudhari2014-08-26 10:47:24 -0500
commit9f78363560b503c412e44771fb18210943bd82a8 (patch)
treef507600287dc88b260e3ab099be824ba0e703206
parent51013cb2279dce359a4a15609d3e08108c9da7ac (diff)
parentacbff9e8067a964a4fb41f5bdc417cc51e092c1a (diff)
downloadtcp3d-lld-9f78363560b503c412e44771fb18210943bd82a8.tar.gz
tcp3d-lld-9f78363560b503c412e44771fb18210943bd82a8.tar.xz
tcp3d-lld-9f78363560b503c412e44771fb18210943bd82a8.zip
Merge branch 'releases/mcsdk_03.01.00.00'
-rw-r--r--Settings.xdc.xdt10
-rw-r--r--build/buildlib.xs69
-rwxr-xr-xconfig.bld10
-rw-r--r--docs/ReleaseNotes_TCP3DDriver.docbin139264 -> 142848 bytes
-rw-r--r--docs/ReleaseNotes_TCP3DDriver.pdfbin87315 -> 88822 bytes
-rwxr-xr-xexample/k2h/c66/bios/sample_config.cfg1
-rwxr-xr-xexample/k2k/c66/bios/sample_config.cfg1
-rw-r--r--example/k2l/c66/bios/sample_config.cfg1
-rwxr-xr-xpackage.xdc4
-rw-r--r--package.xs18
-rwxr-xr-xsrc/Module.xs19
-rw-r--r--src/tcp3d_drv.c2
-rw-r--r--test/Module.xs18
13 files changed, 104 insertions, 49 deletions
diff --git a/Settings.xdc.xdt b/Settings.xdc.xdt
index 56cebde..491a151 100644
--- a/Settings.xdc.xdt
+++ b/Settings.xdc.xdt
@@ -19,5 +19,15 @@
19module Settings 19module Settings
20{ 20{
21 config string tcp3dVersionString = `packageVersion`; 21 config string tcp3dVersionString = `packageVersion`;
22 /*! This variable is to control the device type selection.
23 * By default this variable is set to NULL.
24 *
25 * To use TCP3D for the selected device, add the following lines to config
26 * file and set the deviceType correctly:
27 *
28 * var tcp3d = xdc.useModule ('ti.drv.tcp3d.Settings');
29 * tcp3d.deviceType = "k2k";
30 */
31 metaonly config string deviceType = "k2k";
22} 32}
23 33
diff --git a/build/buildlib.xs b/build/buildlib.xs
index b90358e..773eed8 100644
--- a/build/buildlib.xs
+++ b/build/buildlib.xs
@@ -7,7 +7,7 @@
7 * This file contains common routines that are used by the various TCP3D driver 7 * This file contains common routines that are used by the various TCP3D driver
8 * components. 8 * components.
9 * 9 *
10 * Copyright (C) 2011, Texas Instruments, Inc. 10 * Copyright (C) 2011-2014, Texas Instruments, Inc.
11 *****************************************************************************/ 11 *****************************************************************************/
12 12
13/************************************************************************** 13/**************************************************************************
@@ -21,19 +21,19 @@ function listAllFiles(ext, dir, recurse)
21{ 21{
22 var srcFile = []; 22 var srcFile = [];
23 var d; 23 var d;
24 24
25 /* If recurse parameter is not specified we default to recursive search. */ 25 /* If recurse parameter is not specified we default to recursive search. */
26 if (recurse == null) 26 if (recurse == null)
27 recurse = true; 27 recurse = true;
28 28
29 if (dir == undefined) 29 if (dir == undefined)
30 d = "."; 30 d = ".";
31 else 31 else
32 d = dir; 32 d = dir;
33 33
34 /* Get access to the current directory. */ 34 /* Get access to the current directory. */
35 var file = new java.io.File(d); 35 var file = new java.io.File(d);
36 36
37 /* Check if the file exists and it is a directory. */ 37 /* Check if the file exists and it is a directory. */
38 if (file.exists() && file.isDirectory()) 38 if (file.exists() && file.isDirectory())
39 { 39 {
@@ -53,7 +53,7 @@ function listAllFiles(ext, dir, recurse)
53 { 53 {
54 /* Generate the directory Name in which we will recurse. */ 54 /* Generate the directory Name in which we will recurse. */
55 var directoryName = d + "/" + fileList[i].getName(); 55 var directoryName = d + "/" + fileList[i].getName();
56 56
57 /* Get a list of all files in this directory */ 57 /* Get a list of all files in this directory */
58 var fileListing = listAllFiles (ext, directoryName, recurse); 58 var fileListing = listAllFiles (ext, directoryName, recurse);
59 if (fileListing != null) 59 if (fileListing != null)
@@ -191,7 +191,11 @@ function createMake(makefile)
191 makefile.writeLine("\n# Clean Rule"); 191 makefile.writeLine("\n# Clean Rule");
192 makefile.writeLine("clean:: clean_package"); 192 makefile.writeLine("clean:: clean_package");
193 makefile.writeLine("# Clean Top Level Object Directory "); 193 makefile.writeLine("# Clean Top Level Object Directory ");
194 makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/"); 194 makefile.writeLine("clean_package:")
195 for each (var libdir in devices)
196 {
197 makefile.writeLine("\t$(RMDIR) $(LIBDIR)/"+libdir.toString()+"/*/");
198 }
195 makefile.writeLine("\t$(RMDIR) package/cfg"); 199 makefile.writeLine("\t$(RMDIR) package/cfg");
196 } 200 }
197 else 201 else
@@ -209,7 +213,7 @@ function createMake(makefile)
209 return makefile; 213 return makefile;
210} 214}
211 215
212function createLibMake(makelibname,targetname, objectPath) 216function createLibMake(device, makelibname,targetname, objectPath)
213{ 217{
214 var tooldir; 218 var tooldir;
215 var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)",""); 219 var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");
@@ -291,13 +295,14 @@ function createLibMake(makelibname,targetname, objectPath)
291 /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/ 295 /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/
292 libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep"); 296 libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");
293 libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map"); 297 libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");
294 libmakefile.writeLine("OBJDIR = $(LIBDIR)/obj"); 298 libmakefile.writeLine("OBJDIR = $(LIBDIR)/" + device.toString() + "/obj");
299 libmakefile.writeLine("DEVOBJDIR = $(LIBDIR)/" + device.toString() + "/obj");
295 300
296 return libmakefile; 301 return libmakefile;
297 302
298} 303}
299 304
300function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName) 305function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName, objDir)
301{ 306{
302 var sourcestring = (srcString + fileExt).toString().toUpperCase(); 307 var sourcestring = (srcString + fileExt).toString().toUpperCase();
303 var compileflagstring = sourcestring + "FLAGS"; 308 var compileflagstring = sourcestring + "FLAGS";
@@ -332,8 +337,8 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
332 makefilename.writeLine(compileflagstring+" = "+compileflags +" \n"); 337 makefilename.writeLine(compileflagstring+" = "+compileflags +" \n");
333 makefilename.writeLine("# Make Rule for the "+srcString+" Files"); 338 makefilename.writeLine("# Make Rule for the "+srcString+" Files");
334 339
335 makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", $(OBJDIR)/%.$(OBJEXT), $(" + sourcestring + "))"); 340 makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", "+objDir+"/%.$(OBJEXT), $(" + sourcestring + "))");
336 makefilename.writeLine("\n$("+objectliststring+"): $(OBJDIR)/%.$(OBJEXT): %."+fileExt); 341 makefilename.writeLine("\n$("+objectliststring+"): "+objDir+"/%.$(OBJEXT): %."+fileExt);
337 if(fileExt == "c") 342 if(fileExt == "c")
338 { 343 {
339 makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ..."); 344 makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ...");
@@ -378,11 +383,11 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
378 * Utility function which will build a specific library 383 * Utility function which will build a specific library
379 **************************************************************************/ 384 **************************************************************************/
380var makefilelocal; 385var makefilelocal;
381function buildLibrary (libOptions, libName, target, libFiles) 386function buildLibrary (device, libOptions, libName, target, libFiles)
382{ 387{
383 var lldFullLibraryPath = "./lib/c66/" + libName; 388 var lldFullLibraryPath = "./lib/" + device.toString() + "/" + libName;
384 var lldFullBuildPath = "./build/c66/" + libName; 389 var lldFullBuildPath = "./build/" + device.toString() + "/" + libName;
385 var lldFullLibraryPathMake = "$(LIBDIR)/" + "c66/" + libName; 390 var lldFullLibraryPathMake = "$(LIBDIR)/" + device.toString() + "/" + libName;
386 391
387 /* Create Main make file in the root of package folder */ 392 /* Create Main make file in the root of package folder */
388 makefilelocal = createMake(makefilelocal); 393 makefilelocal = createMake(makefilelocal);
@@ -396,7 +401,7 @@ function buildLibrary (libOptions, libName, target, libFiles)
396 makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@"); 401 makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@");
397 402
398 /* Create Library make file in the lib folder */ 403 /* Create Library make file in the lib folder */
399 var makefilelib= createLibMake(lib+".mk",target,objectPath); 404 var makefilelib= createLibMake(device, lib+".mk",target,objectPath);
400 405
401 /* Rule to clean library in main makefile */ 406 /* Rule to clean library in main makefile */
402 makefilelocal.writeLine("# Rule to clean "+libMake+" library"); 407 makefilelocal.writeLine("# Rule to clean "+libMake+" library");
@@ -433,34 +438,38 @@ function buildLibrary (libOptions, libName, target, libFiles)
433 } 438 }
434 if(cfiles.length > 0) 439 if(cfiles.length > 0)
435 { 440 {
436 makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target); 441 makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target, "$(OBJDIR)");
437 librule += " $(COMMONSRCCOBJS)"; 442 librule += " $(COMMONSRCCOBJS)";
438 } 443 }
439 if(afiles.length > 0) 444 if(afiles.length > 0)
440 { 445 {
441 makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target); 446 makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target, "$(OBJDIR)");
442 librule += " $(COMMONSRCASMOBJS)"; 447 librule += " $(COMMONSRCASMOBJS)";
443 } 448 }
444 if(safiles.length > 0) 449 if(safiles.length > 0)
445 { 450 {
446 makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target); 451 makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target, "$(OBJDIR)");
447 librule += " $(COMMONSRCSAOBJS)"; 452 librule += " $(COMMONSRCSAOBJS)";
448 } 453 }
449 454
450 makefilelib.writeLine(librule); 455 makefilelib.writeLine(librule);
451 makefilelib.writeLine("\t@echo archiving $? into $@ ..."); 456 makefilelib.writeLine("\t@echo archiving $? into $@ ...");
452 makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/c66 ]; then $(MKDIR) $(LIBDIR)/c66 ; fi;"); 457 makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/" + device.toString() + " ]; then $(MKDIR) $(LIBDIR)/" + device.toString() + " ; fi;");
453 makefilelib.writeLine("\t$(ARIN) $@ $?"); 458 makefilelib.writeLine("\t$(ARIN) $@ $?");
454 makefilelib.close(); 459 makefilelib.close();
455 460
456 /* Create the Epilogue; which executes after all the builds are completed. 461 /* Create the Epilogue; which executes after all the builds are completed.
457 * This is used to generate the benchmark information for the built library. 462 * This is used to generate the benchmark information for the built library.
458 * Also add the benchmarking information file to the package. */ 463 * Also add the benchmarking information file to the package. */
459 Pkg.makeEpilogue += ".libraries: benchmarking_" + target.suffix + "\n"; 464
460 Pkg.makeEpilogue += "benchmarking_" + target.suffix + ":"; 465 /* Put the temp file in object directory since javascript doesn't have a built in tmpname,
461 Pkg.makeEpilogue += "\n\t ofd6x.exe -x " + lldFullLibraryPath + ".a" + target.suffix + " > tmp.xml"; 466 * and don't want --jobs=# with # > 1 to result in collisions */
462 Pkg.makeEpilogue += "\n\t sectti.exe tmp.xml > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt"; 467 var tempFile = "$(LIBDIR)/" + device.toString() + "/obj/tmp_" + target.suffix + ".xml";
463 Pkg.makeEpilogue += "\n\t $(RM) tmp.xml\n\n"; 468 Pkg.makeEpilogue += ".libraries: benchmarking_" + device + "_" + target.suffix + "\n";
469 Pkg.makeEpilogue += "benchmarking_" + device + "_" + target.suffix + ":";
470 Pkg.makeEpilogue += "\n\t ofd6x -x " + lldFullLibraryPath + ".a" + target.suffix + " > " + tempFile;
471 Pkg.makeEpilogue += "\n\t sectti " + tempFile + " > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt";
472 Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
464 Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt"; 473 Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";
465 Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullBuildPath + ".a" + target.suffix + ".mk"; 474 Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullBuildPath + ".a" + target.suffix + ".mk";
466 Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix; 475 Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix;
@@ -468,8 +477,7 @@ function buildLibrary (libOptions, libName, target, libFiles)
468 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */ 477 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */
469 Pkg.makeEpilogue += "clean::\n"; 478 Pkg.makeEpilogue += "clean::\n";
470 Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n"; 479 Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n";
471 // Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + ".mk\n"; 480 Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + device.toString() + " \n\n";
472 Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + "c66/ \n\n";
473 481
474 return lib; 482 return lib;
475} 483}
@@ -533,3 +541,4 @@ function createMiniPkg(pkgName)
533 Pkg.makeEpilogue += "clean::\n"; 541 Pkg.makeEpilogue += "clean::\n";
534 Pkg.makeEpilogue += "\t $(RM) packages/" + pkgName + "_mini.tar\n"; 542 Pkg.makeEpilogue += "\t $(RM) packages/" + pkgName + "_mini.tar\n";
535} 543}
544
diff --git a/config.bld b/config.bld
index 1434638..9243e0f 100755
--- a/config.bld
+++ b/config.bld
@@ -79,7 +79,7 @@ if (coverityAnalysis == "ON") {
79 }, 79 },
80 ]; 80 ];
81 81
82 /* Run the coverity filters on the LE Build only. */ 82 /* Run the coverity filters on the C66 LE ELF Build only. */
83 C66LE.profiles["release"].filters = coverityFilter; 83 C66LE.profiles["release"].filters = coverityFilter;
84} 84}
85 85
@@ -109,3 +109,11 @@ if (miniBuild == "ON")
109 109
110/* List all the build targets here. */ 110/* List all the build targets here. */
111Build.targets = [ C66LE, C66BE ]; 111Build.targets = [ C66LE, C66BE ];
112
113/* List of all devices that combine to make the hyplnk library.
114 */
115var devices = [ "k2k/c66", "k2h/c66", "k2l/c66" ];
116
117/* order must exactly match list in "var devices" */
118var devicesCCOpt = [ " -DDEVICE_K2K", " -DDEVICE_K2H", " -DDEVICE_K2L" ];
119
diff --git a/docs/ReleaseNotes_TCP3DDriver.doc b/docs/ReleaseNotes_TCP3DDriver.doc
index f4fa4b8..e981a0e 100644
--- a/docs/ReleaseNotes_TCP3DDriver.doc
+++ b/docs/ReleaseNotes_TCP3DDriver.doc
Binary files differ
diff --git a/docs/ReleaseNotes_TCP3DDriver.pdf b/docs/ReleaseNotes_TCP3DDriver.pdf
index 933dd29..f913c75 100644
--- a/docs/ReleaseNotes_TCP3DDriver.pdf
+++ b/docs/ReleaseNotes_TCP3DDriver.pdf
Binary files differ
diff --git a/example/k2h/c66/bios/sample_config.cfg b/example/k2h/c66/bios/sample_config.cfg
index c026bbe..e19671f 100755
--- a/example/k2h/c66/bios/sample_config.cfg
+++ b/example/k2h/c66/bios/sample_config.cfg
@@ -125,6 +125,7 @@ xdc.loadPackage('ti.sdo.edma3.drv');
125 125
126/* Load the TCP3D package */ 126/* Load the TCP3D package */
127var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings'); 127var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');
128Tcp3d.deviceType = "k2h";
128 129
129/* Load the CSL package */ 130/* Load the CSL package */
130var Csl = xdc.useModule('ti.csl.Settings'); 131var Csl = xdc.useModule('ti.csl.Settings');
diff --git a/example/k2k/c66/bios/sample_config.cfg b/example/k2k/c66/bios/sample_config.cfg
index 8db8b75..48e2e7b 100755
--- a/example/k2k/c66/bios/sample_config.cfg
+++ b/example/k2k/c66/bios/sample_config.cfg
@@ -125,6 +125,7 @@ xdc.loadPackage('ti.sdo.edma3.drv');
125 125
126/* Load the TCP3D package */ 126/* Load the TCP3D package */
127var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings'); 127var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');
128Tcp3d.deviceType = "k2k";
128 129
129/* Load the CSL package */ 130/* Load the CSL package */
130var Csl = xdc.useModule('ti.csl.Settings'); 131var Csl = xdc.useModule('ti.csl.Settings');
diff --git a/example/k2l/c66/bios/sample_config.cfg b/example/k2l/c66/bios/sample_config.cfg
index 1e13599..e823bef 100644
--- a/example/k2l/c66/bios/sample_config.cfg
+++ b/example/k2l/c66/bios/sample_config.cfg
@@ -125,6 +125,7 @@ xdc.loadPackage('ti.sdo.edma3.drv');
125 125
126/* Load the TCP3D package */ 126/* Load the TCP3D package */
127var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings'); 127var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');
128Tcp3d.deviceType = "k2l";
128 129
129/* Load the CSL package */ 130/* Load the CSL package */
130var Csl = xdc.useModule('ti.csl.Settings'); 131var Csl = xdc.useModule('ti.csl.Settings');
diff --git a/package.xdc b/package.xdc
index 5b7f308..596360f 100755
--- a/package.xdc
+++ b/package.xdc
@@ -6,10 +6,10 @@
6 * DESCRIPTION: 6 * DESCRIPTION:
7 * This file contains the package specification for the TCP3D Driver 7 * This file contains the package specification for the TCP3D Driver
8 * 8 *
9 * Copyright (C) 2012, Texas Instruments, Inc. 9 * Copyright (C) 2012, 2014, Texas Instruments, Inc.
10 *****************************************************************************/ 10 *****************************************************************************/
11 11
12package ti.drv.tcp3d[2, 01, 00, 00] { 12package ti.drv.tcp3d[2, 01, 00, 02] {
13 module Settings; 13 module Settings;
14} 14}
15 15
diff --git a/package.xs b/package.xs
index 37b1ffc..3807f3c 100644
--- a/package.xs
+++ b/package.xs
@@ -28,6 +28,23 @@ function getLibs(prog)
28 print ("\tSystem environment LIBDIR variable defined : " + lib); 28 print ("\tSystem environment LIBDIR variable defined : " + lib);
29 } 29 }
30 30
31 /* Device types supported */
32 var deviceTypes = [
33 'k2k',
34 'k2h',
35 'k2l',
36 ];
37
38 /* Search for the supported devices (defined in config.bld) */
39 for each(var device in deviceTypes)
40 {
41 if (this.Settings.deviceType.equals(device))
42 {
43 lib = lib + "/" + device;
44 break;
45 }
46 }
47
31 /* Get target folder, if applicable */ 48 /* Get target folder, if applicable */
32 if ( java.lang.String(suffix).contains('66') ) 49 if ( java.lang.String(suffix).contains('66') )
33 lib = lib + "/c66"; 50 lib = lib + "/c66";
@@ -35,6 +52,7 @@ function getLibs(prog)
35 /* Get library name with path */ 52 /* Get library name with path */
36 lib = lib + "/" + name; 53 lib = lib + "/" + name;
37 if (java.io.File(this.packageBase + lib).exists()) { 54 if (java.io.File(this.packageBase + lib).exists()) {
55 print ("\tLinking with library " + this.$name + ":" + lib);
38 return lib; 56 return lib;
39 } 57 }
40 58
diff --git a/src/Module.xs b/src/Module.xs
index 14fd941..d42f0c8 100755
--- a/src/Module.xs
+++ b/src/Module.xs
@@ -20,8 +20,6 @@ var tcp3dLibFiles = [
20 "src/tcp3d_betaState.c", 20 "src/tcp3d_betaState.c",
21]; 21];
22 22
23var devicesCCOpt = [ " -DDEVICE_K2K" ];
24
25/* Other files for packaging */ 23/* Other files for packaging */
26var tcp3dOtherFiles = [ 24var tcp3dOtherFiles = [
27 "src/tcp3d_drv_priv.h", 25 "src/tcp3d_drv_priv.h",
@@ -37,15 +35,18 @@ var tcp3dOtherFiles = [
37 **************************************************************************/ 35 **************************************************************************/
38function modBuild() 36function modBuild()
39{ 37{
40 /* Build the libraries for all the targets specified. */ 38 for (var device=0; device < devices.length; device++)
41 for (var targets=0; targets < Build.targets.length; targets++)
42 { 39 {
43 var libOptions = { 40 /* Build the libraries for all the targets specified. */
44 incs: tcp3dIncludePath, 41 for (var targets=0; targets < Build.targets.length; targets++)
45 copts: devicesCCOpt, 42 {
46 }; 43 var libOptions = {
44 incs: tcp3dIncludePath,
45 copts: devicesCCOpt[device],
46 };
47 47
48 libUtility.buildLibrary (libOptions, Pkg.name, Build.targets[targets], tcp3dLibFiles); 48 libUtility.buildLibrary (devices[device], libOptions, Pkg.name, Build.targets[targets], tcp3dLibFiles);
49 }
49 } 50 }
50 51
51 /* Add all the .c files to the release package. */ 52 /* Add all the .c files to the release package. */
diff --git a/src/tcp3d_drv.c b/src/tcp3d_drv.c
index 39ad454..097ee45 100644
--- a/src/tcp3d_drv.c
+++ b/src/tcp3d_drv.c
@@ -214,7 +214,7 @@ Tcp3d_Result Tcp3d_init( IN Tcp3d_MemBuffer bufs[],
214 CSL_Tcp3d_cfgRegs *tcp3dCfgRegs; 214 CSL_Tcp3d_cfgRegs *tcp3dCfgRegs;
215 215
216 /* Check for valid instance number */ 216 /* Check for valid instance number */
217 if ( drvInitParams->instNum > TCP3D_DRV_MAX_NUM_INSTANCES ) 217 if ( drvInitParams->instNum >= TCP3D_DRV_MAX_NUM_INSTANCES )
218 { 218 {
219 /* Return error */ 219 /* Return error */
220 tcp3dResult = TCP3D_DRV_INVALID_INSTANCE_NUMBER; 220 tcp3dResult = TCP3D_DRV_INVALID_INSTANCE_NUMBER;
diff --git a/test/Module.xs b/test/Module.xs
index eea6e4d..10a17ab 100644
--- a/test/Module.xs
+++ b/test/Module.xs
@@ -38,32 +38,37 @@ var otherFiles = [
38function modBuild() 38function modBuild()
39{ 39{
40 /* Add all the .c files to the release package. */ 40 /* Add all the .c files to the release package. */
41 var testFiles = libUtility.listAllFiles (".c", "test"); 41 var testFiles = libUtility.listAllFiles (".c", "test", true);
42 for (var k = 0 ; k < testFiles.length; k++) 42 for (var k = 0 ; k < testFiles.length; k++)
43 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k]; 43 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
44 44
45 /* Add all the .h files to the release package. */ 45 /* Add all the .h files to the release package. */
46 var testFiles = libUtility.listAllFiles (".h", "test"); 46 var testFiles = libUtility.listAllFiles (".h", "test", true);
47 for (var k = 0 ; k < testFiles.length; k++)
48 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
49
50 /* Add all the make files to the release package. */
51 var testFiles = libUtility.listAllFiles ("makefile", "test", true);
47 for (var k = 0 ; k < testFiles.length; k++) 52 for (var k = 0 ; k < testFiles.length; k++)
48 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k]; 53 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
49 54
50 /* Add all the .cfg files to the release package. */ 55 /* Add all the .cfg files to the release package. */
51 var testFiles = libUtility.listAllFiles (".cfg", "test"); 56 var testFiles = libUtility.listAllFiles (".cfg", "test", true);
52 for (var k = 0 ; k < testFiles.length; k++) 57 for (var k = 0 ; k < testFiles.length; k++)
53 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k]; 58 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
54 59
55 /* Add all the .cmd files to the release package. */ 60 /* Add all the .cmd files to the release package. */
56 var testFiles = libUtility.listAllFiles (".cmd", "test"); 61 var testFiles = libUtility.listAllFiles (".cmd", "test", true);
57 for (var k = 0 ; k < testFiles.length; k++) 62 for (var k = 0 ; k < testFiles.length; k++)
58 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k]; 63 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
59 64
60 /* Add all the .txt files to the release package. */ 65 /* Add all the .txt files to the release package. */
61 var testFiles = libUtility.listAllFiles (".txt", "test"); 66 var testFiles = libUtility.listAllFiles (".txt", "test", true);
62 for (var k = 0 ; k < testFiles.length; k++) 67 for (var k = 0 ; k < testFiles.length; k++)
63 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k]; 68 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
64 69
65 /* Add all the .ini files to the release package. */ 70 /* Add all the .ini files to the release package. */
66 var testFiles = libUtility.listAllFiles (".ini", "test"); 71 var testFiles = libUtility.listAllFiles (".ini", "test", true);
67 for (var k = 0 ; k < testFiles.length; k++) 72 for (var k = 0 ; k < testFiles.length; k++)
68 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k]; 73 Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
69 74
@@ -71,3 +76,4 @@ function modBuild()
71 for (var k = 0 ; k < otherFiles.length; k++) 76 for (var k = 0 ; k < otherFiles.length; k++)
72 Pkg.otherFiles[Pkg.otherFiles.length++] = otherFiles[k]; 77 Pkg.otherFiles[Pkg.otherFiles.length++] = otherFiles[k];
73} 78}
79