Move all to deprecated folder.

This commit is contained in:
2016-11-16 21:57:57 +01:00
parent 01738a7684
commit 05de7d6c04
9777 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
/*
* ======== package.bld ========
* Build script for wolfSSL library
*/
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* make command to search for the srcs */
Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
/* WOLFSSL sources */
var wolfSSLObjList = [
"wolfcrypt/src/aes.c",
"wolfcrypt/src/arc4.c",
"wolfcrypt/src/asm.c",
"wolfcrypt/src/asn.c",
"wolfcrypt/src/blake2b.c",
"wolfcrypt/src/camellia.c",
"wolfcrypt/src/chacha.c",
"wolfcrypt/src/coding.c",
"wolfcrypt/src/des3.c",
"wolfcrypt/src/dh.c",
"wolfcrypt/src/dsa.c",
"wolfcrypt/src/ecc.c",
"wolfcrypt/src/error.c",
"wolfcrypt/src/hc128.c",
"wolfcrypt/src/hmac.c",
"wolfcrypt/src/integer.c",
"wolfcrypt/src/logging.c",
"wolfcrypt/src/md4.c",
"wolfcrypt/src/md5.c",
"wolfcrypt/src/memory.c",
"wolfcrypt/src/poly1305.c",
"wolfcrypt/src/pwdbased.c",
"wolfcrypt/src/rabbit.c",
"wolfcrypt/src/random.c",
"wolfcrypt/src/rsa.c",
"wolfcrypt/src/sha.c",
"wolfcrypt/src/sha256.c",
"wolfcrypt/src/sha512.c",
"wolfcrypt/src/tfm.c",
"wolfcrypt/src/wc_port.c",
"src/internal.c",
"src/io.c",
"src/keys.c",
"src/ssl.c",
"src/tls.c",
];
for each (var targ in Build.targets) {
var libOptions = {incs: wolfsslPathInclude};
var lib = Pkg.addLibrary("lib/" + Pkg.name, targ, libOptions);
lib.addObjects(wolfSSLObjList);
}

View File

@@ -0,0 +1,7 @@
/*!
* ======== ti.net.wolfssl ========
* wolfSSL library for TI-RTOS
*
*/
package ti.net.wolfssl {
}

View File

@@ -0,0 +1,12 @@
/*
* ======== package.xs ========
*/
/*
* ======== getLibs ========
* Contribute wolfSSL library.
*/
function getLibs(prog)
{
return ("lib/" + this.$name + ".a" + prog.build.target.suffix);
}

View File

@@ -0,0 +1,29 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2003FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x8000;
define symbol __ICFEDIT_size_heap__ = 0x10000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };

View File

@@ -0,0 +1,81 @@
/*
* ======== benchmark.cfg ========
*/
/* ================ General configuration ================ */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
BIOS.heapSize = 86016;
Task.idleTaskStackSize = 768;
/*
* Program.stack is ignored with IAR. Use the project options in
* IAR Embedded Workbench to alter the system stack size.
*/
if (!Program.build.target.$name.match(/iar/)) {
/*
* Reducing the system stack size (used by ISRs and Swis) to reduce
* RAM usage.
*/
Program.stack = 2048;
}
/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
SysMin.bufSize = 128;
System.SupportProxy = SysMin;
/* Enable Semihosting for GNU targets to print to CCS console */
if (Program.build.target.$name.match(/gnu/)) {
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}
/* ================ NDK configuration ================ */
var Ndk = xdc.loadPackage('ti.ndk.config');
var Global = xdc.useModule('ti.ndk.config.Global');
var Tcp = xdc.useModule('ti.ndk.config.Tcp');
Global.IPv6 = false;
Global.stackLibType = Global.MIN;
Global.pktNumFrameBufs = 10;
Global.memRawPageCount = 6;
Global.ndkThreadStackSize = 1536;
Global.lowTaskStackSize = 1024;
Global.normTaskStackSize = 1024;
Global.highTaskStackSize = 1024;
Tcp.transmitBufSize = 1024;
Tcp.receiveBufSize = 1024;
/* ================ Driver configuration ================ */
var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
TIRTOS.useEMAC = true;
TIRTOS.useGPIO = true;
/* ================ wolfSSL configuration ================ */
try {
var wolfSSL = xdc.loadPackage('ti.net.wolfssl');
}
catch (e) {
print("Error: Could not find wolfSSL library! Make sure the wolfSSL library"
+ " is built and package path is updated for the build tool"
+ " to find the library. More detailed wolfSSL build instructions"
+ " can be found in the TI-RTOS user guide.");
}

View File

@@ -0,0 +1,106 @@
/*
* ======== main.c ========
* Entry point for Benchmark application
*/
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Swi.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/hal/Timer.h>
static int initialized = 0;
static double msTicks = 0;
static Timer_Handle hdl = NULL;
double current_time(int reset);
static void tick(unsigned int arg0);
void msTimer_init(void);
void runBenchmarks(UArg arg0, UArg arg1);
extern int benchmark_test(void* args);
/*
* ======== runBenchmarks ========
* Run the wolfSSL benchmark application
*/
void runBenchmarks(UArg arg0, UArg arg1)
{
void *args = NULL;
msTimer_init();
System_printf("Running benchmarks...\n");
System_flush();
benchmark_test(args);
System_printf("Benchmarks completed.\n");
BIOS_exit(0);
}
/*
* ======== ticks ========
* Keeps track of time in millisec
*/
static void tick(unsigned int arg0)
{
Swi_disable();
msTicks++;
Swi_enable();
}
/*
* ======== current_time ========
* Returns the time in sec (double precision)
*/
double current_time(int reset)
{
if (reset) {
msTicks = 0;
}
return (msTicks/1000);
}
/*
* ======== msTimer_init ========
* Sets up a BIOS timer with millisec period
*/
void msTimer_init(void)
{
Timer_Params params;
if (initialized) {
return;
}
Timer_Params_init(&params);
params.period = 1000;
params.periodType = Timer_PeriodType_MICROSECS;
params.runMode = Timer_RunMode_CONTINUOUS;
params.startMode = Timer_StartMode_AUTO;
hdl = Timer_create(-1, (ti_sysbios_hal_Timer_FuncPtr)tick,
&params, NULL);
if (!hdl) {
System_abort("msTimer_init: Timer creation failed.\n");
}
/* Set flag indicating that initialization has completed */
initialized = 1;
}
/*
* ======== main ========
*/
int main(int argc, char** argv)
{
/* Initialize the defaults and set the parameters. */
Task_Handle handle;
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.stackSize = 65535;
handle = Task_create(runBenchmarks, &taskParams, NULL);
if (handle == NULL) {
System_printf("main: Failed to create new Task.\n");
}
BIOS_start();
}

View File

@@ -0,0 +1,53 @@
/*
* ======== package.bld ========
* Build script for benchmark application
*/
if ((typeof(TivaWareDir) == undefined) || (TivaWareDir == "")) {
throw("ERROR: NO VALID TIVAWARE PATH DEFINED!!!");
}
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* make command to search for the srcs */
Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
var srcs = [
"main.c",
"wolfcrypt/benchmark/benchmark.c",
"examples/boards/EK_TM4C1294XL/EK_TM4C1294XL.c",
];
for each (var targ in Build.targets) {
var lnkOpts = "";
var platform = "ti.platforms.tiva:TM4C1294NCPDT:1";
if (targ.$name.match(/^ti/)) {
lnkOpts = " -l" + TivaWareDir + "/driverlib/ccs/Debug/driverlib.lib";
lnkOpts += " -x ";
}
else if (targ.$name.match(/^iar/)) {
lnkOpts = TivaWareDir + "/driverlib/ewarm/Exe/driverlib.a"
+ " --config TM4C1294NC.icf";
platform = "ti.platforms.tiva:TM4C1294NCPDT";
/* Floating point print support */
var suffix = targ.$orig.lnkOpts.suffix;
targ.$orig.lnkOpts.suffix = suffix.replace(/PrintfSmall/, "PrintfFull");
}
else if (targ.$name.match(/^gnu/)) {
targ.$orig.lnkOpts.suffix += " -L" + TivaWareDir + "/driverlib/gcc "
+ " -Wl,--start-group -ldriver -Wl,--end-group ";
targ.$orig.bspLib = "rdimon";
}
var exeOptions = { incs: wolfsslPathInclude
+ " -DNO_MAIN_DRIVER -D_INCLUDE_NIMU_CODE -DBENCH_EMBEDDED "
+ " -DTIVAWARE -DPART_TM4C1294NCPDT",
lopts: lnkOpts
};
var exe = Pkg.addExecutable("benchmark", targ, platform, exeOptions);
exe.addObjects(srcs);
}

View File

@@ -0,0 +1,6 @@
/*
* ======== ti.net.wolfssl.tests.wolfcrypt.benchmark ========
* wc_ Benchmark Application
*/
package ti.net.wolfssl.tests.wolfcrypt.benchmark {
}

View File

@@ -0,0 +1,29 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2003FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x8000;
define symbol __ICFEDIT_size_heap__ = 0x10000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };

View File

@@ -0,0 +1,56 @@
/*
* ======== main.c ========
* Entry point to wolfcrypt Test Application
*/
/* XDCtools Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/runtime/System.h>
/* func_args from test.h, so don't have to pull in other junk */
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
extern int wolfcrypt_test(void* args);
/*
* ======== testwolfcrypt ========
* Run the wolfcrypt test
*/
void testwolfcrypt(UArg arg0, UArg arg1)
{
System_printf("Running wolfcrypt tests...\n");
System_flush();
wolfcrypt_test((void *)arg0);
System_printf("Tests completed.\n");
BIOS_exit(0);
}
/*
* ======== main ========
*/
int main(int argc, char** argv)
{
func_args args;
args.argc = argc;
args.argv = argv;
/* Initialize the defaults and set the parameters. */
Task_Handle handle;
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.arg0 = (UArg)&args;
taskParams.stackSize = 65535;
handle =Task_create(testwolfcrypt, &taskParams, NULL);
if (handle == NULL) {
System_printf("main: Failed to create new Task.\n");
return (-1);
}
BIOS_start();
}

View File

@@ -0,0 +1,49 @@
/*
* ======== package.bld ========
* Build script for wolfcrypt Test
*/
if ((typeof(TivaWareDir) == undefined) || (TivaWareDir == "")) {
throw("ERROR: NO VALID TIVAWARE PATH DEFINED!!!");
}
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
/* make command to search for the srcs */
Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))";
var srcs = [
"main.c",
"wolfcrypt/test/test.c",
"examples/boards/EK_TM4C1294XL/EK_TM4C1294XL.c",
];
for each (var targ in Build.targets) {
var lnkOpts = "";
var platform = "ti.platforms.tiva:TM4C1294NCPDT:1";
if (targ.$name.match(/^ti/)) {
lnkOpts = " -l" + TivaWareDir + "/driverlib/ccs/Debug/driverlib.lib";
lnkOpts += " -x ";
}
else if (targ.$name.match(/^iar/)) {
lnkOpts = TivaWareDir + "/driverlib/ewarm/Exe/driverlib.a"
+ " --config TM4C1294NC.icf";
platform = "ti.platforms.tiva:TM4C1294NCPDT";
}
else if (targ.$name.match(/^gnu/)) {
targ.$orig.lnkOpts.suffix += " -L" + TivaWareDir + "/driverlib/gcc "
+ " -Wl,--start-group -ldriver -Wl,--end-group ";
targ.$orig.bspLib = "rdimon";
}
var exeOptions = { incs: wolfsslPathInclude
+ " -DNO_MAIN_DRIVER -D_INCLUDE_NIMU_CODE -DBENCH_EMBEDDED "
+ " -DTIVAWARE -DPART_TM4C1294NCPDT",
lopts: lnkOpts,
};
var exe = Pkg.addExecutable("test", targ, platform, exeOptions);
exe.addObjects(srcs);
}

View File

@@ -0,0 +1,6 @@
/*
* ======== ti.net.wolfssl.tests.wolfcrypt.test ========
* wolfcrypt Test Application
*/
package ti.net.wolfssl.tests.wolfcrypt.test {
}

View File

@@ -0,0 +1,80 @@
/*
* ======== test.cfg ========
*/
/* ================ General configuration ================ */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
BIOS.heapSize = 86016;
Task.idleTaskStackSize = 768;
/*
* Program.stack is ignored with IAR. Use the project options in
* IAR Embedded Workbench to alter the system stack size.
*/
if (!Program.build.target.$name.match(/iar/)) {
/*
* Reducing the system stack size (used by ISRs and Swis) to reduce
* RAM usage.
*/
Program.stack = 2048;
}
/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
SysMin.bufSize = 128;
System.SupportProxy = SysMin;
/* Enable Semihosting for GNU targets to print to CCS console */
if (Program.build.target.$name.match(/gnu/)) {
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}
/* ================ NDK configuration ================ */
var Ndk = xdc.loadPackage('ti.ndk.config');
var Global = xdc.useModule('ti.ndk.config.Global');
var Tcp = xdc.useModule('ti.ndk.config.Tcp');
Global.IPv6 = false;
Global.stackLibType = Global.MIN;
Global.pktNumFrameBufs = 10;
Global.memRawPageCount = 6;
Global.ndkThreadStackSize = 1536;
Global.lowTaskStackSize = 1024;
Global.normTaskStackSize = 1024;
Global.highTaskStackSize = 1024;
Tcp.transmitBufSize = 1024;
Tcp.receiveBufSize = 1024;
/* ================ Driver configuration ================ */
var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
TIRTOS.useEMAC = true;
TIRTOS.useGPIO = true;
/* ================ wolfSSL configuration ================ */
try {
var wolfSSL = xdc.loadPackage('ti.net.wolfssl');
}
catch (e) {
print("Error: Could not find wolfSSL library! Make sure the wolfSSL library"
+ " is built and package path is updated for the build tool"
+ " to find the library. More detailed wolfSSL build instructions"
+ " can be found in the TI-RTOS user guide.");
}