Commit 9620a3ab authored by Adam Wujek's avatar Adam Wujek 💬

arch/lm32: export stats structure

Export stats structure to be read by wrpc-dump
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 80e3e6b9
......@@ -83,7 +83,6 @@
//#define MICO32_FULL_CONTEXT_SAVE_RESTORE
/* Exception handlers - Must be 32 bytes long. */
.section .boot, "ax", @progbits
......@@ -109,7 +108,7 @@ _reset_handler:
.int 0x01234567
.short 0x89ab, 0xcdef
/* Pointer to structures, for the dumping tool */
.word softpll, fifo_log, ppi_static, 0
.word softpll, fifo_log, ppi_static, stats
.org 0xa0
.global uptime_sec
......
......@@ -247,6 +247,28 @@ struct dump_info dump_info[] = {
DUMP_FIELD(uint16_t, tag_count),
/* FIXME: aux_state and ptracker_state -- variable-len arrays */
#undef DUMP_STRUCT
#define DUMP_STRUCT struct spll_stats
DUMP_HEADER("stats"),
DUMP_FIELD(uint32_t, magic),
DUMP_FIELD(int, ver),
DUMP_FIELD(int, sequence),
DUMP_FIELD(int, mode),
DUMP_FIELD(int, irq_cnt),
DUMP_FIELD(int, seq_state),
DUMP_FIELD(int, align_state),
DUMP_FIELD(int, H_lock),
DUMP_FIELD(int, M_lock),
DUMP_FIELD(int, H_y),
DUMP_FIELD(int, M_y),
DUMP_FIELD(int, del_cnt),
DUMP_FIELD(int, start_cnt),
DUMP_FIELD_SIZE(char, commit_id, 32),
DUMP_FIELD_SIZE(char, build_date, 16),
DUMP_FIELD_SIZE(char, build_time, 16),
DUMP_FIELD_SIZE(char, build_by, 32),
DUMP_HEADER("end"),
};
......@@ -224,7 +224,8 @@ void print_version(void)
__GIT_VER__, __GIT_USR__, __TIME__, __DATE__);
}
/* all of these are 0 by default */
unsigned long spll_off, fifo_off, ppi_off, ppg_off, servo_off, ds_off;
unsigned long spll_off, fifo_off, ppi_off, ppg_off, servo_off, ds_off,
stats_off;
/* Use: wrs_dump_memory <file> <hex-offset> <name> */
int main(int argc, char **argv)
......@@ -295,12 +296,14 @@ int main(int argc, char **argv)
if (argc == 4)
dumpname = argv[3];
/* If we have a new binary file, pick the pointers */
/* If we have a new binary file, pick the pointers
* Magic numbers are taken from crt0.S or disassembly of wrc.bin */
if (!strncmp(mapaddr + 0x80, "WRPC----", 8)) {
spll_off = wrpc_get_l32(mapaddr + 0x90);
fifo_off = wrpc_get_l32(mapaddr + 0x94);
ppi_off = wrpc_get_l32(mapaddr + 0x98);
stats_off = wrpc_get_l32(mapaddr + 0x9c);
if (ppi_off) { /* This is 0 for wrs */
ppg_off = wrpc_get_pointer(mapaddr + ppi_off,
"pp_instance", "glbs");
......@@ -376,6 +379,12 @@ int main(int argc, char **argv)
dump_many_fields(mapaddr + newoffset, "DSTimeProperties");
}
if (!strcmp(dumpname, "stats"))
stats_off = offset;
if (stats_off) {
printf("stats at 0x%lx\n", stats_off);
dump_many_fields(mapaddr + stats_off, "stats");
}
exit(0);
}
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