optee-os spike平台编译问题解决

解决optee-os 上拉下来源码出现编译不过的问题。  

commit 16c559719c3b5d3714bfb29178dbb0d38ac18f99 (HEAD -> master, origin/master, origin/HEAD)

CHK     out/riscv-plat-spike/conf.mk
  UPD     out/riscv-plat-spike/conf.mk
  CHK     out/riscv-plat-spike/include/generated/conf.h
  CC      out/riscv-plat-spike/core/include/generated/.asm-defines.s
  CHK     out/riscv-plat-spike/core/include/generated/asm-defines.h
  CC      out/riscv-plat-spike/core/arch/riscv/kernel/tee_time_rdtime.o
  CC      out/riscv-plat-spike/core/arch/riscv/kernel/boot.o
  AS      out/riscv-plat-spike/core/arch/riscv/kernel/entry.o
  CC      out/riscv-plat-spike/core/arch/riscv/kernel/abort.o
  AS      out/riscv-plat-spike/core/arch/riscv/kernel/thread_rv.o
core/arch/riscv/kernel/thread_rv.S: Assembler messages:
core/arch/riscv/kernel/thread_rv.S:294: Error: illegal operands `li a0,TEESMC_OPTEED_RETURN_CALL_DONE'
core/arch/riscv/kernel/thread_rv.S:359: Error: illegal operands `li a0,TEESMC_OPTEED_RETURN_CALL_DONE'
make: *** [mk/compile.mk:165: out/riscv-plat-spike/core/arch/riscv/kernel/thread_rv.o] Error 1


  CHK     out/riscv-plat-spike/conf.mk
  CHK     out/riscv-plat-spike/include/generated/conf.h
  CHK     out/riscv-plat-spike/core/include/generated/asm-defines.h
  AS      out/riscv-plat-spike/core/arch/riscv/kernel/thread_rv.o
  CC      out/riscv-plat-spike/core/arch/riscv/kernel/thread_arch.o
core/arch/riscv/kernel/thread_arch.c: In function 'thread_alloc_and_run':
core/arch/riscv/kernel/thread_arch.c:350:32: error: 'thread_std_smc_entry' undeclared (first use in this function); did you mean 'thread_shm_cache_entry'?
  350 |                                thread_std_smc_entry);
      |                                ^~~~~~~~~~~~~~~~~~~~
      |                                thread_shm_cache_entry
core/arch/riscv/kernel/thread_arch.c:350:32: note: each undeclared identifier is reported only once for each function it appears in
At top level:
cc1: note: unrecognized command-line option '-Wno-c2x-extensions' may have been intended to silence earlier diagnostics
make: *** [mk/compile.mk:165: out/riscv-plat-spike/core/arch/riscv/kernel/thread_arch.o] Error 1

git status ./

 no changes added to commit (use "git add" and/or "git commit -a")

diff --git a/core/arch/riscv/include/kernel/thread_private_arch.h b/core/arch/riscv/include/kernel/thread_private_arch.h
index 421e70b7..99f6e13c 100644
--- a/core/arch/riscv/include/kernel/thread_private_arch.h
+++ b/core/arch/riscv/include/kernel/thread_private_arch.h
@@ -59,6 +59,17 @@ void thread_init_tvec(void);
 void thread_trap_vect(void);
 void thread_trap_vect_end(void);
 
+/*
+ * Assembly function as the first function in a thread.  Handles a stdcall,
+ * a0-a3 holds the parameters. Hands over to __thread_std_smc_entry() when
+ * everything is set up and does some post processing once
+ * __thread_std_smc_entry() returns.
+ */
+void thread_std_smc_entry(uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3,
+              uint32_t a4, uint32_t a5);
+uint32_t __thread_std_smc_entry(uint32_t a0, uint32_t a1, uint32_t a2,
+                uint32_t a3, uint32_t a4, uint32_t a5);
+
 /*
  * Private functions made available for thread_rv.S
  */
diff --git a/core/arch/riscv/kernel/thread_arch.c b/core/arch/riscv/kernel/thread_arch.c
index dc9777b8..cebaf199 100644
--- a/core/arch/riscv/kernel/thread_arch.c
+++ b/core/arch/riscv/kernel/thread_arch.c
@@ -24,6 +24,7 @@
 #include <kernel/thread_private.h>
 #include <kernel/user_mode_ctx_struct.h>
 #include <kernel/virtualization.h>
+#include <kernel/thread_private.h>
 #include <mm/core_memprot.h>
 #include <mm/mobj.h>
 #include <mm/tee_mm.h>
diff --git a/core/arch/riscv/kernel/thread_rv.S b/core/arch/riscv/kernel/thread_rv.S
index 0bef45cb..4b7b91b8 100644
--- a/core/arch/riscv/kernel/thread_rv.S
+++ b/core/arch/riscv/kernel/thread_rv.S
@@ -11,6 +11,9 @@
 #include <mm/core_mmu.h>
 #include <riscv.h>
 #include <riscv_macros.S>
+#include <sm/optee_smc.h>
+#include <sm/teesmc_opteed.h>
+#include <sm/teesmc_opteed_macros.h>
 
 .macro get_thread_ctx res, tmp0
        lw      \tmp0, THREAD_CORE_LOCAL_CURR_THREAD(tp)
diff --git a/core/arch/riscv/plat-spike/platform_config.h b/core/arch/riscv/plat-spike/platform_config.h
index 2bfaef71..0a8e5a40 100644
--- a/core/arch/riscv/plat-spike/platform_config.h
+++ b/core/arch/riscv/plat-spike/platform_config.h
@@ -14,4 +14,9 @@
 #define HTIF_BASE      0x40008000
 #endif
 
+/* CLINT */
+#ifndef CLINT_BASE
+#define CLINT_BASE      0x02000000
+#endif
+
 #endif
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值