Hi Alan,
Looks like you are working under IPC model, and you need something to do in core/spm. If you can provide more details then it will be great.
From the code change itself, it has no problem, I am planning a re-structure on this part so if there are issues we can fix them later one. But when we look at the service programming model, we need to know the newly added SVC function is really an 'spm/core' function.
Calling an SVC typically happen when we want to access privileged resource (registers or restricted memory), or some other customized behaviours. We need to be careful when we adding core functionalities because TF-M IPC model maintains a very small core and provide only necessary core functionalities (scheduling, spm). There are PSA RoT Services who has a higher privileged level already, and secure partition can access the peripheral they want.
Thanks.
/Ken
-----Original Message----- From: TF-M tf-m-bounces@lists.trustedfirmware.org On Behalf Of DeMars, Alan via TF-M Sent: Thursday, October 10, 2019 4:38 AM To: 'tf-m@lists.trustedfirmware.org' tf-m@lists.trustedfirmware.org Subject: [TF-M] augmenting the SVC_Handler_IPC() to support custom services
I need to add custom SPM APIs to augment our SP services. Consequently, I need to extend the set of SVCs supported in SVC_Handler_IPC().
I propose to modify the SVC_Handler_IPC() function's 'default' handler to invoke a locally defined weak function such as below:
default: return (custom_ipc_svc_handlers(svc_num, ctx, lr));
__attribute__((weak)) int32_t custom_ipc_svc_handlers(tfm_svc_number_t svc_num, uint32_t *ctx, uint32_t lr) { LOG_MSG("Unknown SVC number requested!"); return PSA_ERROR_GENERIC_ERROR; }
This will allow a 'strong'ly defined custom_ipc_svc_handlers() function to be invoked if provided.
Is this OK?
Another approach is for me to hijack the root SVC handler in the secure vector table, but this seems too heavy handed to me.
Alan -- TF-M mailing list TF-M@lists.trustedfirmware.org https://lists.trustedfirmware.org/mailman/listinfo/tf-m
tf-m@lists.trustedfirmware.org