Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
85
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
f858c2e8
Commit
f858c2e8
authored
3 years ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
userspace/tools/wrs_dump_shmem: store the size of a type
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
80e926b7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userspace/tools/wrs_dump_shmem.c
+0
-13
0 additions, 13 deletions
userspace/tools/wrs_dump_shmem.c
userspace/tools/wrs_dump_shmem.h
+30
-0
30 additions, 0 deletions
userspace/tools/wrs_dump_shmem.h
with
30 additions
and
13 deletions
userspace/tools/wrs_dump_shmem.c
+
0
−
13
View file @
f858c2e8
...
...
@@ -386,19 +386,6 @@ void dump_many_fields(void *addr, struct dump_info *info, int ninfo, char *prefi
}
}
/* the macro below relies on an externally-defined structure type */
#define DUMP_FIELD(_type, _fname) { \
.name = #_fname ":", \
.type = dump_type_ ## _type, \
.offset = offsetof(DUMP_STRUCT, _fname), \
}
#define DUMP_FIELD_SIZE(_type, _fname, _size) { \
.name = #_fname ":", \
.type = dump_type_ ## _type, \
.offset = offsetof(DUMP_STRUCT, _fname), \
.size = _size, \
}
#undef DUMP_STRUCT
#define DUMP_STRUCT struct hal_shmem_header
struct
dump_info
hal_shmem_info
[]
=
{
...
...
This diff is collapsed.
Click to expand it.
userspace/tools/wrs_dump_shmem.h
+
30
−
0
View file @
f858c2e8
...
...
@@ -14,6 +14,7 @@
#define DUMP_FIELD(_type, _fname) { \
.name = #_fname ":", \
.type = dump_type_ ## _type, \
.size = sizeof(_type), \
.offset = offsetof(DUMP_STRUCT, _fname), \
}
#define DUMP_FIELD_SIZE(_type, _fname, _size) { \
...
...
@@ -69,6 +70,35 @@ enum dump_type {
dump_type_array_int
,
};
/* because of the sizeof later on, we need these typedefs */
typedef
void
*
pointer
;
typedef
struct
pp_time
pp_time
;
typedef
long
long
long_long
;
typedef
unsigned
long
unsigned_long
;
typedef
unsigned
char
unsigned_char
;
typedef
unsigned
short
unsigned_short
;
typedef
uint8_t
dummy
;
/* use the smallest */
typedef
struct
{
unsigned
char
addr
[
4
];}
ip_address
;
typedef
uint8_t
yes_no
;
typedef
int
link_up_status
;
typedef
int
ip_addr_status
;
typedef
int
sensor_temp
;
typedef
uint32_t
sfp_flags
;
typedef
uint8_t
sfp_dom_temp
;
typedef
uint8_t
sfp_dom_voltage
;
typedef
uint8_t
sfp_dom_bias_curr
;
typedef
uint8_t
sfp_dom_tx_power
;
typedef
uint8_t
sfp_dom_rx_power
;
typedef
int
port_mode
;
typedef
int
rtu_filtering_entry_dynamic
;
typedef
uint8_t
rtu_qmode
;
typedef
uint8_t
array_int
;
typedef
struct
timeval
timeval
;
typedef
int
spll_mode
;
typedef
int
spll_seq_state
;
typedef
int
spll_align_state
;
/*
* A structure to dump fields. This is meant to simplify things, see use here
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment