Moved code around for clarity, preparing for "fastcalls".

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15768 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2022-09-06 17:59:37 +00:00
parent 0882a9fa97
commit c1d2a487bb
3 changed files with 25 additions and 9 deletions

View File

@ -1259,4 +1259,21 @@ void __port_do_syscall_entry(uint32_t n) {
__set_PSP((uint32_t)newctxp);
}
/**
* @brief Redefined syscall return vector with VRQ handling.
*/
void __port_do_syscall_return(void) {
thread_t *tp;
struct port_extctx *ectxp;
tp = __sch_get_currthread();
ectxp = (struct port_extctx *)__port_syscall_get_u_psp(tp);
#if SB_CFG_ENABLE_VRQ == TRUE
__sb_vrq_check_pending((sb_class_t *)tp->ctx.syscall.p, ectxp);
#else
__set_PSP((uint32_t)ectxp);
#endif
}
/** @} */

View File

@ -366,16 +366,14 @@ void sb_api_vrq_return(struct port_extctx *ectxp) {
}
/**
* @brief Redefined syscall return vector with VRQ handling.
* @brief Checks for pending VRQs, creates a return context if any.
*
* @param[in] sbp pointer to a @p sb_class_t structure
* @param[in] ectxp current return context
*
* @notapi
*/
void __port_do_syscall_return(void) {
thread_t *tp;
struct port_extctx *ectxp;
sb_class_t *sbp;
tp = __sch_get_currthread();
ectxp = (struct port_extctx *)__port_syscall_get_u_psp(tp);
sbp = (sb_class_t *)tp->ctx.syscall.p;
void __sb_vrq_check_pending(sb_class_t *sbp, struct port_extctx *ectxp) {
/* Processing pending VRQs if enabled.*/
if (((sbp->vrq_isr & SB_VRQ_ISR_DISABLED) == 0U)) {

View File

@ -77,6 +77,7 @@ extern "C" {
void sb_api_vrq_enable(struct port_extctx *ectxp);
void sb_api_vrq_getisr(struct port_extctx *ectxp);
void sb_api_vrq_return(struct port_extctx *ectxp);
void __sb_vrq_check_pending(sb_class_t *sbp, struct port_extctx *ectxp);
#ifdef __cplusplus
}
#endif