xref: /openbmc/qemu/linux-user/cpu_loop-common.h (revision 90c84c56)
1cd71c089SLaurent Vivier /*
2cd71c089SLaurent Vivier  *  qemu user cpu loop
3cd71c089SLaurent Vivier  *
4cd71c089SLaurent Vivier  *  Copyright (c) 2003-2008 Fabrice Bellard
5cd71c089SLaurent Vivier  *
6cd71c089SLaurent Vivier  *  This program is free software; you can redistribute it and/or modify
7cd71c089SLaurent Vivier  *  it under the terms of the GNU General Public License as published by
8cd71c089SLaurent Vivier  *  the Free Software Foundation; either version 2 of the License, or
9cd71c089SLaurent Vivier  *  (at your option) any later version.
10cd71c089SLaurent Vivier  *
11cd71c089SLaurent Vivier  *  This program is distributed in the hope that it will be useful,
12cd71c089SLaurent Vivier  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13cd71c089SLaurent Vivier  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14cd71c089SLaurent Vivier  *  GNU General Public License for more details.
15cd71c089SLaurent Vivier  *
16cd71c089SLaurent Vivier  *  You should have received a copy of the GNU General Public License
17cd71c089SLaurent Vivier  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
18cd71c089SLaurent Vivier  */
19cd71c089SLaurent Vivier 
20cd71c089SLaurent Vivier #ifndef CPU_LOOP_COMMON_H
21cd71c089SLaurent Vivier #define CPU_LOOP_COMMON_H
22cd71c089SLaurent Vivier 
23cd71c089SLaurent Vivier #include "exec/log.h"
24cd71c089SLaurent Vivier 
25cd71c089SLaurent Vivier #define EXCP_DUMP(env, fmt, ...)                                        \
26cd71c089SLaurent Vivier do {                                                                    \
27cd71c089SLaurent Vivier     CPUState *cs = ENV_GET_CPU(env);                                    \
28cd71c089SLaurent Vivier     fprintf(stderr, fmt , ## __VA_ARGS__);                              \
29*90c84c56SMarkus Armbruster     cpu_dump_state(cs, stderr, 0);                                      \
30cd71c089SLaurent Vivier     if (qemu_log_separate()) {                                          \
31cd71c089SLaurent Vivier         qemu_log(fmt, ## __VA_ARGS__);                                  \
32cd71c089SLaurent Vivier         log_cpu_state(cs, 0);                                           \
33cd71c089SLaurent Vivier     }                                                                   \
34cd71c089SLaurent Vivier } while (0)
35cd71c089SLaurent Vivier 
36cd71c089SLaurent Vivier void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs);
37cd71c089SLaurent Vivier #endif
38