librfn
An ad-hoc utility library
regdump.h
Go to the documentation of this file.
1 /*
2  * regdump.h
3  *
4  * Part of librfn (a general utility library from redfelineninja.org.uk)
5  *
6  * Copyright (C) 2014 Daniel Thompson <daniel@redfelineninja.org.uk>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published
10  * by the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  */
13 
14 #ifndef RF_REGDUMP_H_
15 #define RF_REGDUMP_H_
16 
17 #include <inttypes.h>
18 #include <stdio.h>
19 #include <stdint.h>
20 
29 #ifdef CONFIG_REGDUMP64
30 typedef uint64_t uintreg_t;
31 #define PRIxreg PRIx64
32 #else
33 typedef uint32_t uintreg_t;
34 #define PRIxreg PRIx32
35 #endif
36 
55 typedef struct regdump_desc {
56  const char *name;
59 
63 #define REGDUMP_STATE_VAR_INIT 0
64 
74 int fregdump_single(FILE *f, uintreg_t reg, const regdump_desc_t *desc,
75  int *state);
76 
80 void fregdump(FILE *f, uintreg_t reg, const regdump_desc_t *desc);
81 
88 int regdump_single(uintreg_t reg, const regdump_desc_t *desc, int *state);
89 
93 void regdump(uintreg_t reg, const regdump_desc_t *desc);
94 
96 #endif // RF_REGDUMP_H_
struct regdump_desc regdump_desc_t
Register description structure.
const char * name
Definition: regdump.h:56
Register description structure.
Definition: regdump.h:55
uint32_t uintreg_t
Definition: regdump.h:33
uintreg_t mask
Definition: regdump.h:57
fibre_state_t state
Definition: fibre.c:30
int fregdump_single(FILE *f, uintreg_t reg, const regdump_desc_t *desc, int *state)
Dump single line of register output to file.
Definition: regdump.c:19
void fregdump(FILE *f, uintreg_t reg, const regdump_desc_t *desc)
Dump the current register status to file.
Definition: regdump.c:38
void regdump(uintreg_t reg, const regdump_desc_t *desc)
Dump the current register status to stdout.
Definition: regdump.c:50
int regdump_single(uintreg_t reg, const regdump_desc_t *desc, int *state)
Dump single line of register output to stdout.
Definition: regdump.c:45