diff --git a/disas.c b/disas.c index 0ae70c22f7275f4ca4ea6a40592615bcaebd6983..45878fad2f32227b911b33d3a8653d79a00e3dec 100644 --- a/disas.c +++ b/disas.c @@ -392,16 +392,6 @@ monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length, return 0; } -static int GCC_FMT_ATTR(2, 3) -monitor_fprintf(FILE *stream, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - monitor_vprintf((Monitor *)stream, fmt, ap); - va_end(ap); - return 0; -} - /* Disassembler for the monitor. See target_disas for a description of flags. */ void monitor_disas(Monitor *mon, CPUState *cpu, diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 611541d1cb401ca089b76fb39afbc5bb124c5e4b..c64f523eb5d72614f3a7d424d45e780575145fc7 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -37,6 +37,7 @@ struct MonitorDef { const MonitorDef *target_monitor_defs(void); CPUArchState *mon_get_cpu_env(void); +CPUState *mon_get_cpu(void); void hmp_info_mem(Monitor *mon, const QDict *qdict); void hmp_info_tlb(Monitor *mon, const QDict *qdict); diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index bc6cb6d1852afc1414edbf5f51d3eb87aeb912f8..91b95ae90a798c6bb2612303a5608134ea7bab9c 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -34,6 +34,7 @@ int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp); void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); +int monitor_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3); void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); int monitor_get_cpu_index(void); diff --git a/monitor.c b/monitor.c index 476872ca6e3abd372f4f61a3246ae057bb0537af..4f1ba2f6669726fd93e881b9febc40bc6065a03d 100644 --- a/monitor.c +++ b/monitor.c @@ -372,8 +372,7 @@ void monitor_printf(Monitor *mon, const char *fmt, ...) va_end(ap); } -static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream, - const char *fmt, ...) +int monitor_fprintf(FILE *stream, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -957,7 +956,7 @@ int monitor_set_cpu(int cpu_index) return 0; } -static CPUState *mon_get_cpu(void) +CPUState *mon_get_cpu(void) { if (!cur_mon->mon_cpu) { monitor_set_cpu(0);