Few bugs fixed.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15628 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2022-05-17 13:05:50 +00:00
parent d6e1b49664
commit 47e2903468
2 changed files with 39 additions and 22 deletions

View File

@ -216,34 +216,42 @@ void sbVRQTriggerFromISR(sb_class_t *sbp, sb_vrqmask_t vmask) {
void sb_api_vrq_setwt(struct port_extctx *ectxp) {
sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
uint32_t m;
m = ectxp->r0;
ectxp->r0 = sbp->vrq_wtmask;
sbp->vrq_wtmask |= ectxp->r0;
sbp->vrq_wtmask |= m;
vrq_check_trigger(sbp, ectxp);
}
void sb_api_vrq_clrwt(struct port_extctx *ectxp) {
sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
uint32_t m;
m = ectxp->r0;
ectxp->r0 = sbp->vrq_wtmask;
sbp->vrq_wtmask &= ~ectxp->r0;
sbp->vrq_wtmask &= ~m;
}
void sb_api_vrq_seten(struct port_extctx *ectxp) {
sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
uint32_t m;
m = ectxp->r0;
ectxp->r0 = sbp->vrq_enmask;
sbp->vrq_enmask |= ectxp->r0;
sbp->vrq_enmask |= m;
vrq_check_trigger(sbp, ectxp);
}
void sb_api_vrq_clren(struct port_extctx *ectxp) {
sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
uint32_t m;
m = ectxp->r0;
ectxp->r0 = sbp->vrq_enmask;
sbp->vrq_enmask &= ~ectxp->r0;
sbp->vrq_enmask &= ~m;
}
void sb_api_vrq_disable(struct port_extctx *ectxp) {

View File

@ -191,6 +191,13 @@ typedef uint32_t eventflags_t;
"r" (r2), "r" (r3) : "memory")
/** @} */
/**
* @brief VRQ return pseudo-instruction.
*
* @api
*/
#define __sb_vrq_return() __syscall0(255)
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
@ -839,41 +846,53 @@ static inline void sbSleepMicroseconds(time_usecs_t usecs) {
/**
* @brief VRQ @p setwt pseudo-instruction.
*
* @param[in] m VRQs mask
*
* @api
*/
static inline void __sb_vrq_setwt(void) {
static inline uint32_t __sb_vrq_setwt(uint32_t m) {
__syscall0(248);
__syscall1r(248, m);
return r0;
}
/**
* @brief VRQ @p clrwt pseudo-instruction.
*
* @param[in] m VRQs mask
*
* @api
*/
static inline void __sb_vrq_clrwt(void) {
static inline uint32_t __sb_vrq_clrwt(uint32_t m) {
__syscall0(249);
__syscall1r(249, m);
return r0;
}
/**
* @brief VRQ @p seten pseudo-instruction.
*
* @param[in] m VRQs mask
*
* @api
*/
static inline void __sb_vrq_seten(void) {
static inline uint32_t __sb_vrq_seten(uint32_t m) {
__syscall0(250);
__syscall1r(250, m);
return r0;
}
/**
* @brief VRQ @p clren pseudo-instruction.
*
* @param[in] m VRQs mask
*
* @api
*/
static inline void __sb_vrq_clren(void) {
static inline uint32_t __sb_vrq_clren(uint32_t m) {
__syscall0(251);
__syscall1r(251, m);
return r0;
}
/**
@ -907,16 +926,6 @@ static inline uint32_t __sb_vrq_getisr(void) {
return r0;
}
/**
* @brief VRQ return pseudo-instruction.
*
* @api
*/
static inline void __sb_vrq_return(void) {
__syscall0(255);
}
#endif /* SBUSER_H */
/** @} */