mirror of https://github.com/xemu-project/xemu.git
hw/intc/arm_gic: modernise the DPRINTF
While I was debugging the icount issues I realised a bunch of the messages look quite similar. I've fixed this by including __func__ in the debug print. At the same time I move the a modern if (GATE) style printf which ensures the compiler can check for format string errors even if the code gets optimised away in the non-DEBUG_GIC case. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
6568da459b
commit
68bf93ce9d
|
@ -26,15 +26,20 @@
|
||||||
#include "qemu/log.h"
|
#include "qemu/log.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
//#define DEBUG_GIC
|
/* #define DEBUG_GIC */
|
||||||
|
|
||||||
#ifdef DEBUG_GIC
|
#ifdef DEBUG_GIC
|
||||||
#define DPRINTF(fmt, ...) \
|
#define DEBUG_GIC_GATE 1
|
||||||
do { fprintf(stderr, "arm_gic: " fmt , ## __VA_ARGS__); } while (0)
|
|
||||||
#else
|
#else
|
||||||
#define DPRINTF(fmt, ...) do {} while(0)
|
#define DEBUG_GIC_GATE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DPRINTF(fmt, ...) do { \
|
||||||
|
if (DEBUG_GIC_GATE) { \
|
||||||
|
fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static const uint8_t gic_id_11mpcore[] = {
|
static const uint8_t gic_id_11mpcore[] = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x90, 0x13, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1
|
0x00, 0x00, 0x00, 0x00, 0x90, 0x13, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue