diff options
author | Lucian Paul-Trifu <lucian.paultrifu@gmail.com> | 2022-09-01 11:19:57 +0100 |
---|---|---|
committer | Lucian Paul-Trifu <lucian.paultrifu@gmail.com> | 2022-09-02 15:14:36 +0100 |
commit | f9d78ea6f1b80654aec7e62e27bbc63b7f5ace67 (patch) | |
tree | c97f83845c963e1db2efff52fb39c58ecef925ce | |
parent | cc562c52deefde20f0a158cb4901371cafe68791 (diff) | |
download | trusted-firmware-a-f9d78ea6f1b80654aec7e62e27bbc63b7f5ace67.tar.gz |
feat(spmc): Dispatch FF-A Notification ABI calls
Change-Id: Ib64b13da4a881985c6b96a1808317ae6717c6e7e
-rw-r--r-- | services/std_svc/spm/el3_spmc/spmc.mk | 4 | ||||
-rw-r--r-- | services/std_svc/spm/el3_spmc/spmc_main.c | 45 |
2 files changed, 48 insertions, 1 deletions
diff --git a/services/std_svc/spm/el3_spmc/spmc.mk b/services/std_svc/spm/el3_spmc/spmc.mk index aa591d9f32..28214e0743 100644 --- a/services/std_svc/spm/el3_spmc/spmc.mk +++ b/services/std_svc/spm/el3_spmc/spmc.mk @@ -13,7 +13,9 @@ SPMC_SOURCES := $(addprefix services/std_svc/spm/el3_spmc/, \ spmc_setup.c \ logical_sp.c \ spmc_pm.c \ - spmc_shared_mem.c) + spmc_shared_mem.c \ + spmc_ffa_notifs.c \ + ) # Specify platform specific logical partition implementation. SPMC_LP_SOURCES := $(addprefix ${PLAT_DIR}/, \ diff --git a/services/std_svc/spm/el3_spmc/spmc_main.c b/services/std_svc/spm/el3_spmc/spmc_main.c index 9b8621a736..78f67f1a7e 100644 --- a/services/std_svc/spm/el3_spmc/spmc_main.c +++ b/services/std_svc/spm/el3_spmc/spmc_main.c @@ -26,6 +26,7 @@ #include <services/spmc_svc.h> #include <services/spmd_svc.h> #include "spmc.h" +#include "spmc_ffa_notifs.h" #include "spmc_shared_mem.h" #include <platform_def.h> @@ -1843,6 +1844,50 @@ uint64_t spmc_smc_handler(uint32_t smc_fid, void *handle, uint64_t flags) { + /* + * First, dispatch ABIs facing only one of the Normal World or the Secure + * World exclusively. + * + * Note: currently all call paths to this function already check whether + * the SMC comes from the Normal World or the Secure World. Therefore this + * function could be split into two: one that represents the Normal World + * interface and one that represents the Secure World interface, and have + * the right one called from the outset. + */ + if (secure_origin) { + switch (smc_fid) { + case FFA_NOTIFICATION_SET: + return spmc_ffa_notification_set(x1, x2, x3, x4, handle); + + default: + break; + } + } else { + switch (smc_fid) { + case FFA_NOTIFICATION_BITMAP_CREATE: + return spmc_ffa_notification_bitmap_create(x1, x2, handle); + + case FFA_NOTIFICATION_BITMAP_DESTROY: + return spmc_ffa_notification_bitmap_destroy(x1, handle); + + case FFA_NOTIFICATION_BIND: + return spmc_ffa_notification_bind(x1, x2, x3, x4, handle); + + case FFA_NOTIFICATION_UNBIND: + return spmc_ffa_notification_unbind(x1, x3, x4, handle); + + /* case FFA_NOTIFICATION_INFO_GET_SMC32: */ + case FFA_NOTIFICATION_INFO_GET_SMC64: + return spmc_ffa_notification_info_get(handle); + + case FFA_NOTIFICATION_GET: + return spmc_ffa_notification_get(x1, x2, handle); + + default: + break; + } + } + switch (smc_fid) { case FFA_VERSION: |