From 986a2998932e978e63fc3b7ead1fef81f7aad52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 7 Jul 2013 13:05:05 +0200 Subject: gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids polluting the global namespace with a non-prefixed macro and makes it obvious in the call sites that we return. Semi-automatic conversion using, e.g., sed -i 's/GET_REGL(/return gdb_get_regl(mem_buf, /g' target-*/gdbstub.c followed by manual tweaking for sparc's GET_REGA() and Coding Style. Acked-by: Michael Walle (for lm32) Acked-by: Max Filippov (for xtensa) Signed-off-by: Andreas Färber --- target-sparc/gdbstub.c | 54 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'target-sparc') diff --git a/target-sparc/gdbstub.c b/target-sparc/gdbstub.c index 914f586ab3..460c0b7197 100644 --- a/target-sparc/gdbstub.c +++ b/target-sparc/gdbstub.c @@ -19,80 +19,80 @@ */ #ifdef TARGET_ABI32 -#define GET_REGA(val) GET_REG32(val) +#define gdb_get_rega(buf, val) gdb_get_reg32(buf, val) #else -#define GET_REGA(val) GET_REGL(val) +#define gdb_get_rega(buf, val) gdb_get_regl(buf, val) #endif static int cpu_gdb_read_register(CPUSPARCState *env, uint8_t *mem_buf, int n) { if (n < 8) { /* g0..g7 */ - GET_REGA(env->gregs[n]); + return gdb_get_rega(mem_buf, env->gregs[n]); } if (n < 32) { /* register window */ - GET_REGA(env->regwptr[n - 8]); + return gdb_get_rega(mem_buf, env->regwptr[n - 8]); } #if defined(TARGET_ABI32) || !defined(TARGET_SPARC64) if (n < 64) { /* fprs */ if (n & 1) { - GET_REG32(env->fpr[(n - 32) / 2].l.lower); + return gdb_get_reg32(mem_buf, env->fpr[(n - 32) / 2].l.lower); } else { - GET_REG32(env->fpr[(n - 32) / 2].l.upper); + return gdb_get_reg32(mem_buf, env->fpr[(n - 32) / 2].l.upper); } } /* Y, PSR, WIM, TBR, PC, NPC, FPSR, CPSR */ switch (n) { case 64: - GET_REGA(env->y); + return gdb_get_rega(mem_buf, env->y); case 65: - GET_REGA(cpu_get_psr(env)); + return gdb_get_rega(mem_buf, cpu_get_psr(env)); case 66: - GET_REGA(env->wim); + return gdb_get_rega(mem_buf, env->wim); case 67: - GET_REGA(env->tbr); + return gdb_get_rega(mem_buf, env->tbr); case 68: - GET_REGA(env->pc); + return gdb_get_rega(mem_buf, env->pc); case 69: - GET_REGA(env->npc); + return gdb_get_rega(mem_buf, env->npc); case 70: - GET_REGA(env->fsr); + return gdb_get_rega(mem_buf, env->fsr); case 71: - GET_REGA(0); /* csr */ + return gdb_get_rega(mem_buf, 0); /* csr */ default: - GET_REGA(0); + return gdb_get_rega(mem_buf, 0); } #else if (n < 64) { /* f0-f31 */ if (n & 1) { - GET_REG32(env->fpr[(n - 32) / 2].l.lower); + return gdb_get_reg32(mem_buf, env->fpr[(n - 32) / 2].l.lower); } else { - GET_REG32(env->fpr[(n - 32) / 2].l.upper); + return gdb_get_reg32(mem_buf, env->fpr[(n - 32) / 2].l.upper); } } if (n < 80) { /* f32-f62 (double width, even numbers only) */ - GET_REG64(env->fpr[(n - 32) / 2].ll); + return gdb_get_reg64(mem_buf, env->fpr[(n - 32) / 2].ll); } switch (n) { case 80: - GET_REGL(env->pc); + return gdb_get_regl(mem_buf, env->pc); case 81: - GET_REGL(env->npc); + return gdb_get_regl(mem_buf, env->npc); case 82: - GET_REGL((cpu_get_ccr(env) << 32) | - ((env->asi & 0xff) << 24) | - ((env->pstate & 0xfff) << 8) | - cpu_get_cwp64(env)); + return gdb_get_regl(mem_buf, (cpu_get_ccr(env) << 32) | + ((env->asi & 0xff) << 24) | + ((env->pstate & 0xfff) << 8) | + cpu_get_cwp64(env)); case 83: - GET_REGL(env->fsr); + return gdb_get_regl(mem_buf, env->fsr); case 84: - GET_REGL(env->fprs); + return gdb_get_regl(mem_buf, env->fprs); case 85: - GET_REGL(env->y); + return gdb_get_regl(mem_buf, env->y); } #endif return 0; -- cgit v1.2.3