Commit d687940f authored by Adam Wujek's avatar Adam Wujek

tools/wrpc-dump: add dump_type_timing_mode

Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 99a6b4b7
......@@ -316,7 +316,7 @@ struct dump_info dump_info[] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT struct wrpc_arch_data_t
DUMP_HEADER("wrpc_arch_data_t"),
DUMP_FIELD(int,timingMode),
DUMP_FIELD(timing_mode, timingMode),
#endif
#undef DUMP_STRUCT
......
......@@ -51,6 +51,7 @@ enum dump_type {
dump_type_ip_address,
dump_type_delay_mechanism,
dump_type_protocol_extension,
dump_type_timing_mode,
};
/* because of the sizeof later on, we need these typedefs */
......@@ -65,6 +66,7 @@ typedef Boolean yes_no_Boolean;
typedef uint8_t yes_no;
typedef int delay_mechanism;
typedef int protocol_extension;
typedef int timing_mode;
/*
* This is generated with the target compiler, and then linked
......
......@@ -54,7 +54,7 @@ sdb-wrpc.bin: sdbfs
$(SDBFS)/gensdbfs $< $@
wrpc-dump: wrpc-dump.c dump-info-host.o time_lib.o
$(CC) $(CFLAGS) -include $(AUTOCONF) -include $(AUTOCONF_PPSI) -I../ppsi/include -I../ppsi/arch-wrpc/include -I.. \
$(CC) $(CFLAGS) -include $(AUTOCONF) -include $(AUTOCONF_PPSI) -I../ppsi/include -I../ppsi/arch-wrpc -I../ppsi/arch-wrpc/include -I.. \
-I ../softpll \
$^ -o $@
......
......@@ -17,6 +17,7 @@
#include <arch/lm32/crt0.h>
#include <dump-info.h>
#include <wrpc.h>
#include "time_lib.h"
/* We have a problem: ppsi is built for wrpc, so it has ntoh[sl] wrong */
......@@ -290,6 +291,21 @@ void dump_one_field(void *addr, struct dump_info *info, char *info_prefix)
print_str(char_p);
printf("\n");
break;
case dump_type_timing_mode:
i = wrpc_get_i32(p);
switch(i) {
ENUM_TO_P_IN_CASE(WRC_MODE_UNKNOWN, char_p);
ENUM_TO_P_IN_CASE(WRC_MODE_GM, char_p);
ENUM_TO_P_IN_CASE(WRC_MODE_MASTER, char_p);
ENUM_TO_P_IN_CASE(WRC_MODE_SLAVE, char_p);
ENUM_TO_P_IN_CASE(WRC_MODE_ABSCAL, char_p);
default:
char_p = "Unknown";
}
printf("%d", i);
print_str(char_p);
printf("\n");
break;
}
}
void dump_many_fields(void *addr, char *name, char *prefix)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment