Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
8857d1dd
Commit
8857d1dd
authored
Aug 13, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/wrs_dump_shmem_ppsi: move ppsi related types from wrs repo
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
cbb75993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
1 deletion
+127
-1
dump-info_ppsi.h
tools/dump-info_ppsi.h
+2
-0
wrs_dump_shmem_ppsi.c
tools/wrs_dump_shmem_ppsi.c
+125
-1
No files found.
tools/dump-info_ppsi.h
View file @
8857d1dd
...
...
@@ -29,6 +29,8 @@ enum dump_type_ppsi {
dump_type_TimeInterval
,
dump_type_RelativeDifference
,
dump_type_FixedDelta
,
dump_type_Timestamp
,
dump_type_scaledPicoseconds
,
/* and this is ours */
dump_type_yes_no_Boolean
,
...
...
tools/wrs_dump_shmem_ppsi.c
View file @
8857d1dd
#include <stdio.h>
#include <ppsi/ppsi.h>
#include <ppsi-wrs.h>
#include "dump-info_ppsi.h"
#include "wrs_dump_shmem.h"
/* map for fields of ppsi structures */
#undef DUMP_STRUCT
#define DUMP_STRUCT struct pp_globals
...
...
@@ -355,6 +355,130 @@ struct dump_info wrs_arch_data_info [] = {
};
#endif
int
dump_one_field_type_ppsi_wrs
(
int
type
,
int
size
,
void
*
p
)
{
int
i
;
switch
(
type
)
{
case
dump_type_yes_no_Boolean
:
case
dump_type_ppi_state
:
case
dump_type_ppi_state_Enumeration8
:
case
dump_type_wr_config
:
case
dump_type_wr_config_Enumeration8
:
case
dump_type_wr_role
:
case
dump_type_wr_role_Enumeration8
:
case
dump_type_pp_pdstate
:
case
dump_type_exstate
:
case
dump_type_pp_servo_flag
:
case
dump_type_pp_servo_state
:
case
dump_type_wr_state
:
case
dump_type_ppi_profile
:
case
dump_type_ppi_proto
:
case
dump_type_ppi_flag
:
if
(
size
==
1
)
i
=
*
(
uint8_t
*
)
p
;
else
if
(
size
==
2
)
i
=
*
(
uint16_t
*
)(
p
);
else
i
=
*
(
uint32_t
*
)(
p
);
break
;
default:
i
=
0
;
}
return
i
;
}
void
dump_one_field_ppsi_wrs
(
int
type
,
int
size
,
void
*
p
,
int
i
)
{
struct
pp_time
*
t
=
p
;
struct
PortIdentity
*
pi
=
p
;
struct
ClockQuality
*
cq
=
p
;
TimeInterval
*
ti
=
p
;
RelativeDifference
*
rd
=
p
;
char
buf
[
128
];
char
*
char_p
;
Timestamp
*
ts
=
p
;
/* check the size of Boolean, which is declared as Enum */
if
(
type
==
dump_type_Boolean
)
{
switch
(
size
)
{
case
1
:
type
=
dump_type_UInteger8
;
break
;
case
2
:
type
=
dump_type_UInteger16
;
break
;
case
4
:
default:
type
=
dump_type_UInteger32
;
break
;
}
}
switch
(
type
)
{
case
dump_type_UInteger64
:
printf
(
"%lld
\n
"
,
*
(
unsigned
long
long
*
)
p
);
break
;
case
dump_type_Integer64
:
printf
(
"%lld
\n
"
,
*
(
long
long
*
)
p
);
break
;
case
dump_type_Integer32
:
printf
(
"%i
\n
"
,
*
(
int
*
)
p
);
break
;
case
dump_type_UInteger32
:
printf
(
"%u
\n
"
,
*
(
uint32_t
*
)
p
);
break
;
case
dump_type_UInteger8
:
case
dump_type_Integer8
:
case
dump_type_Enumeration8
:
case
dump_type_Boolean
:
printf
(
"%i
\n
"
,
*
(
unsigned
char
*
)
p
);
break
;
case
dump_type_UInteger4
:
printf
(
"%i
\n
"
,
*
(
unsigned
char
*
)
p
&
0xF
);
break
;
case
dump_type_UInteger16
:
printf
(
"%i
\n
"
,
*
(
unsigned
short
*
)
p
);
break
;
case
dump_type_Integer16
:
printf
(
"%i
\n
"
,
*
(
short
*
)
p
);
break
;
case
dump_type_Timestamp
:
printf
(
"%s
\n
"
,
timestampToString
(
ts
,
buf
));
break
;
case
dump_type_TimeInterval
:
printf
(
"%s
\n
"
,
timeIntervalToString
(
*
ti
,
buf
));
break
;
case
dump_type_RelativeDifference
:
printf
(
"%s
\n
"
,
relativeDifferenceToString
(
*
rd
,
buf
));
break
;
case
dump_type_ClockIdentity
:
/* Same as binary */
for
(
i
=
0
;
i
<
sizeof
(
ClockIdentity
);
i
++
)
printf
(
"%02x%c"
,
((
unsigned
char
*
)
p
)[
i
],
i
==
sizeof
(
ClockIdentity
)
-
1
?
'\n'
:
':'
);
break
;
case
dump_type_PortIdentity
:
/* Same as above plus port */
for
(
i
=
0
;
i
<
sizeof
(
ClockIdentity
);
i
++
)
printf
(
"%02x%c"
,
((
unsigned
char
*
)
p
)[
i
],
i
==
sizeof
(
ClockIdentity
)
-
1
?
'.'
:
':'
);
printf
(
"%04x (%i)
\n
"
,
pi
->
portNumber
,
pi
->
portNumber
);
break
;
case
dump_type_ClockQuality
:
printf
(
"class=%i, accuracy=0x%02x (%i), logvariance=%i
\n
"
,
cq
->
clockClass
,
cq
->
clockAccuracy
,
cq
->
clockAccuracy
,
cq
->
offsetScaledLogVariance
);
break
;
case
dump_type_scaledPicoseconds
:
printf
(
"%lld
\n
"
,
(
*
(
unsigned
long
long
*
)
p
)
>>
16
);
break
;
}
}
extern
struct
dump_info
shm_head
[
5
];
int
dump_ppsi_mem
(
struct
wrs_shm_head
*
head
)
...
...
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