#ifndef HV_LOG_H #define HV_LOG_H #include "hv/types.h" enum log_kind { LOG_BOOT = 1, LOG_TRAP = 2, LOG_POLICY = 3, LOG_HVC = 4, LOG_ABORT = 5, LOG_MONITOR = 6, LOG_PANIC = 7, LOG_SELFTEST = 8, }; enum log_action { LOG_ACT_NONE = 0, LOG_ACT_EMULATE_READ, LOG_ACT_EMULATE_WRITE, LOG_ACT_WRITE_MASK, LOG_ACT_DENY_SKIP, LOG_ACT_DENY_UNDEF, LOG_ACT_PAUSE, LOG_ACT_PANIC, }; struct log_event { uint64_t seq; uint64_t cpu; uint64_t vcpu; uint64_t timestamp; uint32_t kind; uint32_t ec; uint64_t iss; uint64_t elr; uint64_t far; uint64_t hpfar; uint64_t sysreg_key; uint32_t is_read; uint32_t rt; uint64_t operand; uint64_t result; uint32_t action; uint32_t reason; uint64_t pstate; const char *name; }; void log_init(void); void log_event_commit(const struct log_event *event); void log_simple(enum log_kind kind, uint32_t reason, uint64_t a, uint64_t b); void log_dump(unsigned limit); void log_clear(void); bool log_selftest(void); #endif