diff options
Diffstat (limited to 'os/hal/osal')
-rw-r--r-- | os/hal/osal/chibios/osal.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/os/hal/osal/chibios/osal.h b/os/hal/osal/chibios/osal.h index 937b0f38e..55141960b 100644 --- a/os/hal/osal/chibios/osal.h +++ b/os/hal/osal/chibios/osal.h @@ -119,6 +119,13 @@ #if 0
/**
+ * @brief Type of a system status word.
+ */
+typedef uint32_t syssts_t;
+#endif
+
+#if 0
+/**
* @brief Type of a message.
*/
typedef int32_t msg_t;
@@ -390,6 +397,35 @@ static inline void osalSysUnlockFromISR(void) { }
/**
+ * @brief Returns the execution context and enters the kernel lock mode.
+ * @details This functions enters into a critical zone and can be called
+ * from any context. Because its flexibility it is less efficient
+ * than @p chSysLock() which is preferable when the calling context
+ * is known.
+ *
+ * @return The previous system status, the encoding of this
+ * status word is architecture-dependent and opaque.
+ *
+ * @xclass
+ */
+static inline syssts_t osalSysGetAndLockX(void) {
+
+ return chSysGetAndLockX();
+}
+
+/**
+ * @brief Restores the specified execution status.
+ *
+ * @param[in] sts the system status to be restored.
+ *
+ * @xclass
+ */
+static inline void osalSysRestoreLockX(syssts_t sts) {
+
+ chSysRestoreLockX(sts);
+}
+
+/**
* @brief Polled delay.
* @note The real delay is always few cycles in excess of the specified
* value.
|