diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2020-09-15 22:31:58 +0100 |
---|---|---|
committer | Manish Pandey <manish.pandey2@arm.com> | 2020-09-23 12:30:08 +0100 |
commit | 6b3840a0632c0a554ad5312de0a59bfc30867f42 (patch) | |
tree | 1367885078fad1a1ef2a3ac1e90dd30c44969908 | |
parent | 458d5534ef40440b29a5e9607732d588bed05274 (diff) | |
download | tf-a-tests-6b3840a0632c0a554ad5312de0a59bfc30867f42.tar.gz |
cactus: implement hvc call to get interrupt id
Since an SP cannot access GIC directly, it relies on SPMC(S-EL2) to
get the interrupt ID.
This patch introduces a new hvc call "SPM_INTERRUPT_GET" to get
interrupt ID in S-EL1.
Change-Id: I37626f907174ae57a24dc6b86e89d26ba8ebbddf
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
-rw-r--r-- | include/runtime_services/ffa_helpers.h | 1 | ||||
-rw-r--r-- | spm/common/sp_helpers.c | 11 | ||||
-rw-r--r-- | spm/common/sp_helpers.h | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/include/runtime_services/ffa_helpers.h b/include/runtime_services/ffa_helpers.h index 197879e00..2cc2c4670 100644 --- a/include/runtime_services/ffa_helpers.h +++ b/include/runtime_services/ffa_helpers.h @@ -23,6 +23,7 @@ typedef unsigned short ffa_vm_id_t; typedef unsigned short ffa_vm_count_t; typedef unsigned short ffa_vcpu_count_t; +typedef uint32_t ffa_int_id_t; #ifndef __ASSEMBLY__ diff --git a/spm/common/sp_helpers.c b/spm/common/sp_helpers.c index 234505199..1b650d378 100644 --- a/spm/common/sp_helpers.c +++ b/spm/common/sp_helpers.c @@ -75,6 +75,17 @@ void sp_sleep(uint32_t ms) * Hypervisor Calls Wrappers ******************************************************************************/ +ffa_int_id_t spm_interrupt_get(void) +{ + hvc_args args = { + .fid = SPM_INTERRUPT_GET + }; + + hvc_ret_values ret = tftf_hvc(&args); + + return ret.ret0; +} + void spm_debug_log(char c) { hvc_args args = { diff --git a/spm/common/sp_helpers.h b/spm/common/sp_helpers.h index 4f64a8279..ec9222789 100644 --- a/spm/common/sp_helpers.h +++ b/spm/common/sp_helpers.h @@ -13,6 +13,8 @@ #define SPM_VM_ID_FIRST SP_ID(1) +/* Should match with IDs defined in SPM/Hafnium */ +#define SPM_INTERRUPT_GET (0xFF04) #define SPM_DEBUG_LOG (0xBD000000) typedef struct { @@ -67,9 +69,7 @@ void sp_sleep(uint32_t ms); * Hypervisor Calls Wrappers */ -ffa_vcpu_count_t spm_vcpu_get_count(ffa_vm_id_t vm_id); - -ffa_vm_count_t spm_vm_get_count(void); +ffa_int_id_t spm_interrupt_get(void); void spm_debug_log(char c); |