12345678910111213141516171819202122232425262728293031 |
- #ifndef SP_BTR_H
- #define SP_BTR_H
- #pragma once
- #include "array.h"
- #include "sp_def.h"
- // boot record utility functions
- typedef struct sp_btr_reocrd_t {
- unsigned int tm_start;
- sp_version_t version;
- unsigned int tm_shutdown;
- int shutdown_reason; // 重启原因
- int shutdown_reason_cnt;
- int shutdown_way; // 重启方式。包括3中重启类型:框架重启、操作系统重启、电源重启
- int shutdown_way_cnt;
- }sp_btr_reocrd_t;
- typedef struct sp_btr_context_t {
- sp_btr_reocrd_t last_boot_info;
- unsigned int cur_start_time;
- sp_version_t cur_version;
- }sp_btr_context_t;
- SPBASE_API int sp_btr_write_on_start(const char *bootrec_path, sp_version_t *version, sp_btr_context_t **p_ctx);
- SPBASE_API int sp_btr_write_on_shutdown(const char *bootrec_path, sp_btr_context_t *ctx, int reason, int way);
- sp_btr_reocrd_t* sp_btr_get_rec_before(const char *bootrec_path, sp_btr_context_t *ctx, unsigned int before_this_time);
- #endif // SP_BTR_H
|