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
7bdf7669
Commit
7bdf7669
authored
Apr 02, 2013
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All datasets except Port DS moved to struct pp_globals
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
315f56a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
23 deletions
+25
-23
posix-startup.c
arch-gnu-linux/posix-startup.c
+6
-6
wrc_ptp_ppsi.c
arch-wrpc/wrc_ptp_ppsi.c
+4
-4
pp-instance.h
include/ppsi/pp-instance.h
+7
-5
ppsi.h
include/ppsi/ppsi.h
+4
-4
bare-startup.c
lib-bare/bare-startup.c
+4
-4
No files found.
arch-gnu-linux/posix-startup.c
View file @
7bdf7669
...
...
@@ -58,19 +58,19 @@ int main(int argc, char **argv)
/* FIXME check all of these calloc's, since some stuff will be
* part of pp_globals */
ppi
->
defaultDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
defaultDS
));
ppi
->
currentDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
currentDS
));
ppi
->
parentDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
parentDS
));
GLBS
(
ppi
)
->
defaultDS
=
calloc
(
1
,
sizeof
(
*
GLBS
(
ppi
)
->
defaultDS
));
GLBS
(
ppi
)
->
currentDS
=
calloc
(
1
,
sizeof
(
*
GLBS
(
ppi
)
->
currentDS
));
GLBS
(
ppi
)
->
parentDS
=
calloc
(
1
,
sizeof
(
*
GLBS
(
ppi
)
->
parentDS
));
ppi
->
portDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
portDS
));
ppi
->
timePropertiesDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
timePropertiesDS
));
GLBS
(
ppi
)
->
timePropertiesDS
=
calloc
(
1
,
sizeof
(
*
GLBS
(
ppi
)
->
timePropertiesDS
));
GLBS
(
ppi
)
->
servo
=
calloc
(
1
,
sizeof
(
*
GLBS
(
ppi
)
->
servo
));
ppi
->
arch_data
=
calloc
(
1
,
sizeof
(
struct
posix_arch_data
));
ppi
->
n_ops
=
&
posix_net_ops
;
ppi
->
t_ops
=
&
posix_time_ops
;
if
((
!
ppi
->
defaultDS
)
||
(
!
ppi
->
currentDS
)
||
(
!
ppi
->
parentDS
)
||
(
!
ppi
->
portDS
)
||
(
!
ppi
->
timePropertiesDS
)
if
((
!
GLBS
(
ppi
)
->
defaultDS
)
||
(
!
GLBS
(
ppi
)
->
currentDS
)
||
(
!
GLBS
(
ppi
)
->
parentDS
)
||
(
!
ppi
->
portDS
)
||
(
!
GLBS
(
ppi
)
->
timePropertiesDS
)
||
(
!
GLBS
(
ppi
)
->
frgn_master
)
||
(
!
ppi
->
arch_data
)
)
exit
(
__LINE__
);
...
...
arch-wrpc/wrc_ptp_ppsi.c
View file @
7bdf7669
...
...
@@ -46,11 +46,7 @@ static struct pp_globals ppg_static; /* forward declaration */
/* despite the name, ppi_static is not static: tests/measure_t24p.c uses it */
struct
pp_instance
ppi_static
=
{
.
glbs
=
&
ppg_static
,
.
defaultDS
=
&
defaultDS
,
.
currentDS
=
&
currentDS
,
.
parentDS
=
&
parentDS
,
.
portDS
=
&
portDS
,
.
timePropertiesDS
=
&
timePropertiesDS
,
.
n_ops
=
&
wrpc_net_ops
,
.
t_ops
=
&
wrpc_time_ops
,
};
...
...
@@ -60,6 +56,10 @@ static struct pp_globals ppg_static = {
.
nports
=
1
,
.
pp_instances
=
&
ppi_static
,
.
servo
=
&
servo
,
.
defaultDS
=
&
defaultDS
,
.
currentDS
=
&
currentDS
,
.
parentDS
=
&
parentDS
,
.
timePropertiesDS
=
&
timePropertiesDS
,
};
int
wrc_ptp_init
()
...
...
include/ppsi/pp-instance.h
View file @
7bdf7669
...
...
@@ -159,12 +159,7 @@ struct pp_instance {
TimeInternal
cField
;
/* transp. clocks */
TimeInternal
last_rcv_time
,
last_snt_time
;
/* two temporaries */
/* Data sets */
DSDefault
*
defaultDS
;
/* page 65 */
DSCurrent
*
currentDS
;
/* page 67 */
DSParent
*
parentDS
;
/* page 68 */
DSPort
*
portDS
;
/* page 72 */
DSTimeProperties
*
timePropertiesDS
;
/* page 70 */
unsigned
long
timeouts
[
__PP_TO_ARRAY_SIZE
];
UInteger16
recv_sync_sequence_id
;
...
...
@@ -191,6 +186,13 @@ struct pp_globals {
struct
pp_frgn_master
frgn_master
[
PP_NR_FOREIGN_RECORDS
];
struct
pp_servo
*
servo
;
/* Data sets */
DSDefault
*
defaultDS
;
/* page 65 */
DSCurrent
*
currentDS
;
/* page 67 */
DSParent
*
parentDS
;
/* page 68 */
DSTimeProperties
*
timePropertiesDS
;
/* page 70 */
/* FIXME Here include all is common to many interfaces */
};
...
...
include/ppsi/ppsi.h
View file @
7bdf7669
...
...
@@ -38,17 +38,17 @@ static inline struct pp_globals *GLBS(struct pp_instance *ppi)
static
inline
struct
DSDefault
*
DSDEF
(
struct
pp_instance
*
ppi
)
{
return
ppi
->
defaultDS
;
return
GLBS
(
ppi
)
->
defaultDS
;
}
static
inline
struct
DSCurrent
*
DSCUR
(
struct
pp_instance
*
ppi
)
{
return
ppi
->
currentDS
;
return
GLBS
(
ppi
)
->
currentDS
;
}
static
inline
struct
DSParent
*
DSPAR
(
struct
pp_instance
*
ppi
)
{
return
ppi
->
parentDS
;
return
GLBS
(
ppi
)
->
parentDS
;
}
static
inline
struct
DSPort
*
DSPOR
(
struct
pp_instance
*
ppi
)
...
...
@@ -58,7 +58,7 @@ static inline struct DSPort *DSPOR(struct pp_instance *ppi)
static
inline
struct
DSTimeProperties
*
DSPRO
(
struct
pp_instance
*
ppi
)
{
return
ppi
->
timePropertiesDS
;
return
GLBS
(
ppi
)
->
timePropertiesDS
;
}
static
inline
struct
pp_net_path
*
NP
(
struct
pp_instance
*
ppi
)
...
...
lib-bare/bare-startup.c
View file @
7bdf7669
...
...
@@ -39,11 +39,11 @@ int ppsi_main(int argc, char **argv)
PP_PRINTF
(
"bare: starting. Compiled on %s
\n
"
,
__DATE__
);
ppi
->
glbs
=
ppg
;
ppi
->
defaultDS
=
&
defaultDS
;
ppi
->
currentDS
=
&
currentDS
;
ppi
->
parentDS
=
&
parentDS
;
GLBS
(
ppi
)
->
defaultDS
=
&
defaultDS
;
GLBS
(
ppi
)
->
currentDS
=
&
currentDS
;
GLBS
(
ppi
)
->
parentDS
=
&
parentDS
;
ppi
->
portDS
=
&
portDS
;
ppi
->
timePropertiesDS
=
&
timePropertiesDS
;
GLBS
(
ppi
)
->
timePropertiesDS
=
&
timePropertiesDS
;
GLBS
(
ppi
)
->
servo
=
&
servo
;
ppi
->
arch_data
=
NULL
;
ppi
->
n_ops
=
&
bare_net_ops
;
...
...
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