esp: check command buffer length before write(CVE-2016-4439)
[qemu/ar7.git] / include / exec / log.h
blobba1c9b56823897f7c0431996c2e43131c06b59e6
1 #ifndef QEMU_EXEC_LOG_H
2 #define QEMU_EXEC_LOG_H
4 #include "qemu/log.h"
5 #include "qom/cpu.h"
6 #include "disas/disas.h"
8 /* cpu_dump_state() logging functions: */
9 /**
10 * log_cpu_state:
11 * @cpu: The CPU whose state is to be logged.
12 * @flags: Flags what to log.
14 * Logs the output of cpu_dump_state().
16 static inline void log_cpu_state(CPUState *cpu, int flags)
18 if (qemu_log_enabled()) {
19 cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
23 /**
24 * log_cpu_state_mask:
25 * @mask: Mask when to log.
26 * @cpu: The CPU whose state is to be logged.
27 * @flags: Flags what to log.
29 * Logs the output of cpu_dump_state() if loglevel includes @mask.
31 static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
33 if (qemu_loglevel & mask) {
34 log_cpu_state(cpu, flags);
38 #ifdef NEED_CPU_H
39 /* disas() and target_disas() to qemu_logfile: */
40 static inline void log_target_disas(CPUState *cpu, target_ulong start,
41 target_ulong len, int flags)
43 target_disas(qemu_logfile, cpu, start, len, flags);
46 static inline void log_disas(void *code, unsigned long size)
48 disas(qemu_logfile, code, size);
51 #if defined(CONFIG_USER_ONLY)
52 /* page_dump() output to the log file: */
53 static inline void log_page_dump(void)
55 page_dump(qemu_logfile);
57 #endif
58 #endif
60 #endif