include/tinyara/reboot_reason.h : Add macro for reboot reason
To use reboot reason, user should call prctl(PR_REBOOT_REASON_XXX, code) and include both sys/prctl.h and tinyara/reboot_reason.h
For easy use, add macro for read, write and clear the reboot reason.
/********************************************************************************************
* Included Files
********************************************************************************************/
+#include <sys/prctl.h>
typedef enum {
REBOOT_REASON_INITIALIZED = 0,
@@ -36,4 +37,12 @@ typedef enum {
REBOOT_UNKNOWN = 99,
} reboot_reason_code_t;
+#define WRITE_REBOOT_REASON(x) do { \
+ prctl(PR_REBOOT_REASON_WRITE, x); \
+ } while (0) \
+#define READ_REBOOT_REASON() prctl(PR_REBOOT_REASON_READ)
+#define CLEAR_REBOOT_REASON() do { \
+ prctl(PR_REBOOT_REASON_CLEAR); \
+ } while (0) \
+
#endif /* __INCLUDEREBOOT_REASON_H */
