Skip to content

Commit

Permalink
Merge pull request #415 from KarlK90/fix/gd32vf103-port-status
Browse files Browse the repository at this point in the history
ports: riscv-eclic: chcore: add missing port lock functions
  • Loading branch information
fpoussin authored Jan 8, 2025
2 parents 13d24b4 + cb3b6ce commit 3ac181e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions os/common/ports/RISCV-ECLIC/chcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,23 @@ struct port_context {
}
#endif

/**
* @brief Returns a word representing a critical section status.
*
* @return The critical section status.
*/
#define port_get_lock_status() port_get_irq_status()

/**
* @brief Determines if in a critical section.
*
* @param[in] sts status word returned by @p port_get_lock_status()
* @return The current status.
* @retval false if running outside a critical section.
* @retval true if running within a critical section.
*/
#define port_is_locked(sts) !port_irq_enabled(sts)

/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
Expand Down

0 comments on commit 3ac181e

Please sign in to comment.