diff mbox series

[1/1] arm-bsp/optee-os: corstone1000: Handling logging syscall correctly

Message ID 20230918180424.26148-2-emekcan.aras@arm.com
State New
Headers show
Series arm-bsp/optee-os: corstone1000: Handling logging syscall correctly | expand

Commit Message

Emekcan Aras Sept. 18, 2023, 6:04 p.m. UTC
From: Emekcan Aras <emekcan.aras@arm.com>

Enables handling logging messages correctly.

Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
---
 .../0001-Handle-logging-syscall.patch         | 32 +++++++++++++++++++
 .../optee/optee-os-corstone1000-common.inc    |  5 +++
 2 files changed, 37 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-security/optee/files/optee-os/corstone1000/0001-Handle-logging-syscall.patch
diff mbox series

Patch

diff --git a/meta-arm-bsp/recipes-security/optee/files/optee-os/corstone1000/0001-Handle-logging-syscall.patch b/meta-arm-bsp/recipes-security/optee/files/optee-os/corstone1000/0001-Handle-logging-syscall.patch
new file mode 100644
index 00000000..9c1d7816
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/optee/files/optee-os/corstone1000/0001-Handle-logging-syscall.patch
@@ -0,0 +1,32 @@ 
+From d6ee50f581b43b16733b8731369b071d609d5048 Mon Sep 17 00:00:00 2001
+From: Emekcan Aras <emekcan.aras@arm.com>
+Date: Thu, 31 Aug 2023 10:51:54 +0100
+Subject: [PATCH] Handle logging syscall
+
+Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
+Upstream-Status:  Inappropriate [Other]
+---
+ core/arch/arm/kernel/spmc_sp_handler.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/core/arch/arm/kernel/spmc_sp_handler.c b/core/arch/arm/kernel/spmc_sp_handler.c
+index 1f218a0df..0676e8898 100644
+--- a/core/arch/arm/kernel/spmc_sp_handler.c
++++ b/core/arch/arm/kernel/spmc_sp_handler.c
+@@ -1276,7 +1276,12 @@ void spmc_sp_msg_handler(struct thread_smc_args *args,
+ 			handle_console_log(args);
+ 			sp_enter(args, caller_sp);
+ 			break;
+-
++		case 0xdeadbeef:
++			ts_push_current_session(&caller_sp->ts_sess);
++			IMSG("%s", (char *)args->a1);
++			ts_pop_current_session();
++			sp_enter(args, caller_sp);
++			break;
+ 		default:
+ 			EMSG("Unhandled FFA function ID %#"PRIx32,
+ 			     (uint32_t)args->a0);
+-- 
+2.17.1
+
diff --git a/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc b/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc
index eaee7ae9..a883c345 100644
--- a/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc
+++ b/meta-arm-bsp/recipes-security/optee/optee-os-corstone1000-common.inc
@@ -1,3 +1,8 @@ 
+FILESEXTRAPATHS:prepend := "${THISDIR}/files/optee-os/corstone1000:"
+SRC_URI:append = " \
+                  file://0001-Handle-logging-syscall.patch \
+		  "
+
 COMPATIBLE_MACHINE = "corstone1000"
 
 OPTEEMACHINE = "corstone1000"