浏览代码

[libcpu][cm33] 安全相关的函数使用宏进行隔离

tangyuxin 4 年之前
父节点
当前提交
2e9fc0c4ff
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      libcpu/arm/cortex-m33/trustzone.c

+ 8 - 0
libcpu/arm/cortex-m33/trustzone.c

@@ -10,11 +10,19 @@
 
 #include <rtthread.h>
 
+#ifdef ARM_CM33_ENABLE_TRUSTZONE
 extern void TZ_InitContextSystem_S(void);
 extern rt_uint32_t TZ_AllocModuleContext_S (rt_uint32_t module);
 extern rt_uint32_t TZ_FreeModuleContext_S(rt_uint32_t id);
 extern rt_uint32_t TZ_LoadContext_S(rt_uint32_t id);
 extern rt_uint32_t TZ_StoreContext_S(rt_uint32_t id);
+#else
+void TZ_InitContextSystem_S(void){}
+rt_uint32_t TZ_AllocModuleContext_S (rt_uint32_t module){return 0;}
+rt_uint32_t TZ_FreeModuleContext_S(rt_uint32_t id) {return 0;}
+rt_uint32_t TZ_LoadContext_S(rt_uint32_t id){return 0;};
+rt_uint32_t TZ_StoreContext_S(rt_uint32_t id){return 0;};
+#endif
 extern int tzcall(int id, rt_ubase_t arg0, rt_ubase_t arg1, rt_ubase_t arg2);
 
 #define TZ_INIT_CONTEXT_ID     (0x1001)