summaryrefslogtreecommitdiffstats
path: root/c6x
diff options
context:
space:
mode:
Diffstat (limited to 'c6x')
-rwxr-xr-x[-rw-r--r--]c6x/do_fips7
-rw-r--r--c6x/fips_algvs.mak14
-rwxr-xr-x[-rw-r--r--]c6x/fips_standalone_sha10
-rwxr-xr-x[-rw-r--r--]c6x/incore6x0
-rwxr-xr-x[-rw-r--r--]c6x/run6x0
-rwxr-xr-xc6x/run6x.js91
6 files changed, 111 insertions, 1 deletions
diff --git a/c6x/do_fips b/c6x/do_fips
index c1c29fcf83..4045e605ce 100644..100755
--- a/c6x/do_fips
+++ b/c6x/do_fips
@@ -1,6 +1,11 @@
#!/bin/sh
-perl Configure c64xplus fipscanisteronly no-engine
+if ! which cl6x > /dev/null 2>&1; then
+ echo 'fatal: cl6x is not on $PATH'
+ exit 1
+fi
+
+perl Configure ${C6XPLATFORM:-c64xplus} fipscanisteronly no-engine
perl util/mkfiles.pl > MINFO
perl util/mk1mf.pl auto > c6x/fips.mak
make -f c6x/fips.mak
diff --git a/c6x/fips_algvs.mak b/c6x/fips_algvs.mak
new file mode 100644
index 0000000000..7f67927fbd
--- /dev/null
+++ b/c6x/fips_algvs.mak
@@ -0,0 +1,14 @@
+CC=cl6x
+CFLAGS=-mv$${C6XSILICON:-6400+} -o2 -I. -Ic6x/inc -Ifips -DNO_SYS_TYPES_H
+OBJ_D=c6x/tmp
+OUT_D=c6x
+
+all: $(OUT_D)/fips_algvs.out
+
+$(OBJ_D)/fips_algvs.obj: test/fips_algvs.c
+ $(CC) --obj_directory=$(OBJ_D) $(CFLAGS) -c $<
+
+$(OUT_D)/fips_algvs.out: $(OBJ_D)/fips_algvs.obj $(OUT_D)/fipscanister.obj c6x/fips_algvs.cmd
+ $(OUT_D)/fips_standalone_sha1 -verify $(OUT_D)/fipscanister.obj
+ $(CC) -z -o $@ -m $(OUT_D)/fips_algvs.map $< $(OUT_D)/fipscanister.obj c6x/fips_algvs.cmd
+ $(OUT_D)/incore6x $@ || rm $@
diff --git a/c6x/fips_standalone_sha1 b/c6x/fips_standalone_sha1
index ea2268cb4e..ea2268cb4e 100644..100755
--- a/c6x/fips_standalone_sha1
+++ b/c6x/fips_standalone_sha1
diff --git a/c6x/incore6x b/c6x/incore6x
index be73aca2d9..be73aca2d9 100644..100755
--- a/c6x/incore6x
+++ b/c6x/incore6x
diff --git a/c6x/run6x b/c6x/run6x
index aecfabeb04..aecfabeb04 100644..100755
--- a/c6x/run6x
+++ b/c6x/run6x
diff --git a/c6x/run6x.js b/c6x/run6x.js
new file mode 100755
index 0000000000..6d94949751
--- /dev/null
+++ b/c6x/run6x.js
@@ -0,0 +1,91 @@
+#!/usr/bin/env dss.sh
+//
+// Debug Server Scripting C6x launcher.
+//
+
+importPackage(Packages.com.ti.debug.engine.scripting);
+importPackage(Packages.com.ti.ccstudio.scripting.environment);
+importPackage(Packages.java.lang);
+
+if (arguments.length == 0) {
+ // Extract script name from eclipse
+ var regex = new RegExp("-dss\\.rhinoArgs\n(.*)");
+ var matches = regex.exec(environment["eclipse.commands"]);
+
+ System.err.println("Usage: " + matches[1] + " executable [args]");
+ System.err.println();
+ System.err.println("You're also required to set CCSTARGETCONFIG " +
+ "environment variable to appoint");
+ System.err.println("proper .ccxml file, customarily one of " +
+ "$HOME/ti/CCSTargetConfigurations/*.ccxml");
+ quit(1);
+}
+
+try {
+ var prog = arguments[0];
+ var script = ScriptingEnvironment.instance();
+
+ var debugServer = script.getServer("DebugServer.1");
+
+ // CCSTARGETCONFIG environment variable should point at proper .ccxml,
+ // customarily one of $HOME/ti/CCSTargetConfigurations/*.ccxml.
+ debugServer.setConfig(System.getenv("CCSTARGETCONFIG"));
+
+ var debugSession = debugServer.openSession("*", "*");
+
+ // Redirect GEL output to |prog|.gel file, so that it doesn't clobber
+ // standard output from the program...
+ var dot = prog.lastIndexOf(".");
+ var gel_out = prog + ".gel";
+ if (dot > 0) {
+ gel_out = prog.substr(0,dot) + ".gel";
+ }
+ debugSession.expression.evaluate('GEL_EnableFileOutput("'
+ + gel_out + '", 0, 0)');
+
+ debugSession.target.connect();
+
+ // It should be noted that "current working directory" for program
+ // executed on the target system is one where |prog| resides, and
+ // not where script executed [as one would expect]...
+ debugSession.memory.loadProgram(prog, arguments);
+
+ // Pull exit()'s address and set breakpoint, then just execute till
+ // it's reached...
+ var exitAddr = debugSession.symbol.getAddress("exit");
+ debugSession.breakpoint.add(exitAddr);
+
+ while (1) {
+ debugSession.target.run();
+
+ var PC = debugSession.expression.evaluate("PC");
+ if (PC == exitAddr) {
+ break;
+ }
+ }
+
+ // Snatch value passed to exit(), so that it can be passed down to
+ // shell as exit code from this script...
+ var exitCode = debugSession.expression.evaluate("A4");
+
+ // Last run to termination...
+ debugSession.target.run();
+ // Clean up...
+ debugSession.terminate();
+ debugServer.stop();
+
+ // It should be noted that there is kind of a bug in C6x run-time.
+ // Return value from main() is not passed to last implicit exit()
+ // call [as it would on other systems], but instead constant 1 is
+ // passed, which conventionally indicates an error. So that if one
+ // wants to pass specific exit code, or even 0 indicating "success",
+ // one has to call exit() explicitly instead of relying on value
+ // returned by main()...
+ quit(exitCode);
+
+} catch (e) {
+ // We catch everything, because default handler terminates script with
+ // "success" exit code upon exception...
+ System.err.println(e.rhinoException);
+ quit(139);
+}