Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
f858c2e8
Commit
f858c2e8
authored
Aug 13, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email 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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
13 deletions
+30
-13
wrs_dump_shmem.c
userspace/tools/wrs_dump_shmem.c
+0
-13
wrs_dump_shmem.h
userspace/tools/wrs_dump_shmem.h
+30
-0
No files found.
userspace/tools/wrs_dump_shmem.c
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
[]
=
{
...
...
userspace/tools/wrs_dump_shmem.h
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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment