diff --git a/test/data/Whitespace/project/ma in.c b/test/data/Whitespace/project/ma in.c deleted file mode 100644 index 2e169c3..0000000 --- a/test/data/Whitespace/project/ma in.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "RTE_Components.h" -#include CMSIS_device_header - -int main(void) { - return 0; -} diff --git a/test/data/Whitespace/project/project.cproject.yml b/test/data/Whitespace/project/project.cproject.yml deleted file mode 100644 index 3f24303..0000000 --- a/test/data/Whitespace/project/project.cproject.yml +++ /dev/null @@ -1,14 +0,0 @@ -project: - - components: - - component: ARM::CMSIS:CORE - - component: ARM::Device:Startup&C Startup - - groups: - - group: Source - files: - - file: ./ma in.c - - group: Header - files: - - file: ./tes t/tes t.h - diff --git a/test/data/Whitespace/project/tes t/tes t.h b/test/data/Whitespace/project/tes t/tes t.h deleted file mode 100644 index ac96203..0000000 --- a/test/data/Whitespace/project/tes t/tes t.h +++ /dev/null @@ -1 +0,0 @@ -#define TES_T 1 diff --git a/test/data/Whitespace/solution.csolution.yml b/test/data/Whitespace/solution.csolution.yml deleted file mode 100644 index 0392558..0000000 --- a/test/data/Whitespace/solution.csolution.yml +++ /dev/null @@ -1,31 +0,0 @@ -solution: - created-for: CMSIS-Toolbox@2.2.1 - cdefault: - - packs: - - pack: ARM::Cortex_DFP - - pack: ARM::CMSIS - - target-types: - - type: ARMCM0 - device: ARMCM0 - - build-types: - - type: AC6 - compiler: AC6 - - - type: GCC - compiler: GCC - misc: - - Library: - - -lm - - -lc - - # - type: IAR - # compiler: IAR - - - type: CLANG - compiler: CLANG - - projects: - - project: ./project/project.cproject.yml diff --git a/test/data/trustzone/nonsecurecode/main_ns.c b/test/data/trustzone/nonsecurecode/main_ns.c deleted file mode 100644 index e349db2..0000000 --- a/test/data/trustzone/nonsecurecode/main_ns.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "interface.h" // Interface API -#include "cmsis_os2.h" // ARM::CMSIS:RTOS2:Keil RTX5 - -static osStatus_t Status; - -static osThreadId_t ThreadAdd_Id; -static osThreadId_t ThreadMul_Id; - -static const osThreadAttr_t ThreadAttr = { - .tz_module = 1U, -}; - -void AddThread (void *argument); -void MulThread (void *argument); - -extern volatile int valueA; -extern volatile int valueB; - -volatile int valueA; -volatile int valueB; - - -static int Addition (int val1, int val2) { - return (val1 + val2); -} - -__attribute__((noreturn)) -void AddThread (void *argument) { - (void)argument; - - for (;;) { - valueA = function_1 (valueA); - valueA = function_2 (Addition, valueA, 2); - osDelay(2U); - } -} - -static int Multiply (int val1, int val2) { - uint32_t flags; - - flags = osThreadFlagsWait (1U, osFlagsWaitAny, osWaitForever); - if (flags == 1U) { - return (val1*val2); - } - else { - return (0); - } -} - - -__attribute__((noreturn)) -void MulThread (void *argument) { - (void)argument; - - for (;;) { - valueB = function_1 (valueB); - valueB = function_2 (Multiply, valueB, 2); - } -} - - -int main (void) { - Status = osKernelInitialize(); - - ThreadAdd_Id = osThreadNew(AddThread, NULL, &ThreadAttr); - ThreadMul_Id = osThreadNew(MulThread, NULL, &ThreadAttr); - - Status = osKernelStart(); - - for(;;); -} - - - diff --git a/test/data/trustzone/nonsecurecode/nonsecure.cproject.yml b/test/data/trustzone/nonsecurecode/nonsecure.cproject.yml deleted file mode 100644 index 4fdb5c2..0000000 --- a/test/data/trustzone/nonsecurecode/nonsecure.cproject.yml +++ /dev/null @@ -1,18 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/cproject.schema.json - -project: - misc: - - for-compiler: AC6 - C: [-fshort-enums, -fshort-wchar] - add-path: - - $OutDir(Secure)$ - components: - - component: C Startup - - component: CMSIS CORE - - component: Keil RTX5 Library_NS - groups: - - group: Non-secure Code - files: - - file: main_ns.c - - file: $Source(Secure)$/interface.h - - file: $Output(Secure)$_CMSE_Lib.o diff --git a/test/data/trustzone/securecode/interface.c b/test/data/trustzone/securecode/interface.c deleted file mode 100644 index 1336adc..0000000 --- a/test/data/trustzone/securecode/interface.c +++ /dev/null @@ -1,24 +0,0 @@ -#include - -#include "interface.h" - -/* typedef for non-secure callback functions */ -typedef funcptr funcptr_NS __attribute__((cmse_nonsecure_call)); - -/* Non-secure callable (entry) function */ -int function_1(int x) __attribute__((cmse_nonsecure_entry)) { - return x+5; -} - -/* Non-secure callable (entry) function, calling a non-secure callback function */ -int function_2(funcptr callback, int x, int y) __attribute__((cmse_nonsecure_entry)) { - funcptr_NS callback_NS; // non-secure callback function pointer - int res; - - /* return function pointer with cleared LSB */ - callback_NS = (funcptr_NS)cmse_nsfptr_create(callback); - res = callback_NS (x, y); - - return (res*10); -} - diff --git a/test/data/trustzone/securecode/interface.h b/test/data/trustzone/securecode/interface.h deleted file mode 100644 index 71b7f6c..0000000 --- a/test/data/trustzone/securecode/interface.h +++ /dev/null @@ -1,6 +0,0 @@ -// function pointer -typedef int(*funcptr)(int,int); - -/* Non-secure callable functions */ -extern int function_1(int x); -extern int function_2(funcptr callback, int x, int y); diff --git a/test/data/trustzone/securecode/main_s.c b/test/data/trustzone/securecode/main_s.c deleted file mode 100644 index 0f1afbc..0000000 --- a/test/data/trustzone/securecode/main_s.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Use CMSE intrinsics */ -#include - -#include "RTE_Components.h" -#include CMSIS_device_header - -#ifndef START_NS -#define START_NS (0x200000U) -#endif - -typedef void (*funcptr) (void) __attribute__((cmse_nonsecure_call)); - -int main(void) { - funcptr ResetHandler; - - __TZ_set_MSP_NS(*((uint32_t *)(START_NS))); - ResetHandler = (funcptr)(*((uint32_t *)((START_NS) + 4U))); - ResetHandler(); - - while (1) { - __NOP(); - } -} - diff --git a/test/data/trustzone/securecode/secure.cproject.yml b/test/data/trustzone/securecode/secure.cproject.yml deleted file mode 100644 index 458ebba..0000000 --- a/test/data/trustzone/securecode/secure.cproject.yml +++ /dev/null @@ -1,17 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/cproject.schema.json - -project: - processor: - trustzone: secure - components: - - component: C Startup - - component: CMSIS CORE - groups: - - group: Secure Code - files: - - file: main_s.c - - group: CMSE - files: - - file: interface.c - - file: interface.h - - file: tz_context.c diff --git a/test/data/trustzone/securecode/tz_context.c b/test/data/trustzone/securecode/tz_context.c deleted file mode 100644 index 2bcb8d8..0000000 --- a/test/data/trustzone/securecode/tz_context.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "RTE_Components.h" -#include CMSIS_device_header -#include "tz_context.h" - -__attribute__((cmse_nonsecure_entry)) -uint32_t TZ_InitContextSystem_S(void) { - return 1U; -} - -__attribute__((cmse_nonsecure_entry)) -TZ_MemoryId_t TZ_AllocModuleContext_S(TZ_ModuleId_t module) { - (void)module; - return 1U; -} - -__attribute__((cmse_nonsecure_entry)) -uint32_t TZ_FreeModuleContext_S(TZ_MemoryId_t id) { - (void)id; - return 1U; -} - - -__attribute__((cmse_nonsecure_entry)) -uint32_t TZ_LoadContext_S(TZ_MemoryId_t id) { - (void)id; - return 2U; -} - -__attribute__((cmse_nonsecure_entry)) -uint32_t TZ_StoreContext_S(TZ_MemoryId_t id) { - (void)id; - return 2U; -} - diff --git a/test/data/trustzone/solution.csolution.yml b/test/data/trustzone/solution.csolution.yml deleted file mode 100644 index bed4803..0000000 --- a/test/data/trustzone/solution.csolution.yml +++ /dev/null @@ -1,27 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/csolution.schema.json - -solution: - target-types: - - type: CM33 - device: ARMCM33_DSP_FP_TZ - - type: CM35P - device: ARMCM35P_DSP_FP_TZ - - build-types: - - type: Debug - compiler: AC6 - misc: - - for-compiler: AC6 - C: - - -O1 - - -g - - type: Release - compiler: AC6 - misc: - - for-compiler: AC6 - C: - - -O3 - - projects: - - project: ./securecode/secure.cproject.yml - - project: ./nonsecurecode/nonsecure.cproject.yml