#ifndef _REGISTERS_C_
#define _REGISTERS_C_
-#ifndef STATIC_INLINE_REGISTERS
-#define STATIC_INLINE_REGISTERS STATIC_INLINE
-#endif
-
-
#include <ctype.h>
#include "basics.h"
#endif
-INLINE_REGISTERS void
+INLINE_REGISTERS\
+(void)
registers_dump(registers *registers)
{
int i;
for (i = 0; i < 8; i++) {
printf_filtered("GPR %2d:", i*4);
for (j = 0; j < 4; j++) {
- printf_filtered(" 0x%08x", registers->gpr[i*4 + j]);
+ printf_filtered(" 0x%08lx", (long)registers->gpr[i*4 + j]);
}
printf_filtered("\n");
}
}
-STATIC_INLINE_REGISTERS sprs
+STATIC_INLINE_REGISTERS\
+(sprs)
find_spr(const char name[])
{
sprs spr;
return nr_of_sprs;
}
-STATIC_INLINE_REGISTERS int
+STATIC_INLINE_REGISTERS\
+(int)
are_digits(const char *digits)
{
while (isdigit(*digits))
}
-INLINE_REGISTERS register_descriptions
+INLINE_REGISTERS\
+(register_descriptions)
register_description(const char reg[])
{
register_descriptions description;
description.index = 0;
description.size = sizeof(msreg);
}
+ else if (!strcmp(reg, "fpscr")) {
+ description.type = reg_fpscr;
+ description.index = 0;
+ description.size = sizeof(fpscreg);
+ }
else if (!strncmp(reg, "sr", 2) && are_digits(reg + 2)) {
description.type = reg_sr;
description.index = atoi(reg+2);
description.index = spr_ctr;
description.size = sizeof(spreg);
}
+ else if (!strcmp(reg, "insns")) {
+ description.type = reg_insns;
+ description.index = spr_ctr;
+ description.size = sizeof(unsigned_word);
+ }
+ else if (!strcmp(reg, "stalls")) {
+ description.type = reg_stalls;
+ description.index = spr_ctr;
+ description.size = sizeof(unsigned_word);
+ }
+ else if (!strcmp(reg, "cycles")) {
+ description.type = reg_cycles;
+ description.index = spr_ctr;
+ description.size = sizeof(unsigned_word);
+ }
+#ifdef WITH_ALTIVEC
+ else if (reg[0] == 'v' && reg[1] == 'r' && are_digits(reg + 2)) {
+ description.type = reg_vr;
+ description.index = atoi(reg+2);
+ description.size = sizeof(vreg);
+ }
+ else if (!strcmp(reg, "vscr")) {
+ description.type = reg_vscr;
+ description.index = 0;
+ description.size = sizeof(vscreg);
+ }
+#endif
+#ifdef WITH_E500
+ else if (reg[0] == 'e' && reg[1] == 'v' && are_digits(reg + 2)) {
+ description.type = reg_evr;
+ description.index = atoi(reg+2);
+ description.size = sizeof(unsigned64);
+ }
+ else if (reg[0] == 'r' && reg[1] == 'h' && are_digits(reg + 2)) {
+ description.type = reg_gprh;
+ description.index = atoi(reg+2);
+ description.size = sizeof(gpreg);
+ }
+ else if (!strcmp(reg, "acc")) {
+ description.type = reg_acc;
+ description.index = 0;
+ description.size = sizeof(unsigned64);
+ }
+#endif
else {
sprs spr = find_spr(reg);
if (spr != nr_of_sprs) {