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
bf67f3bf
Commit
bf67f3bf
authored
Mar 18, 2013
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pp-instance.h: pointer to pp_globals in each pp_instance
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
05e8a274
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
0 deletions
+12
-0
posix-startup.c
arch-gnu-linux/posix-startup.c
+1
-0
pp-instance.h
include/ppsi/pp-instance.h
+3
-0
ppsi.h
include/ppsi/ppsi.h
+5
-0
bare-startup.c
lib-bare/bare-startup.c
+3
-0
No files found.
arch-gnu-linux/posix-startup.c
View file @
bf67f3bf
...
@@ -54,6 +54,7 @@ int main(int argc, char **argv)
...
@@ -54,6 +54,7 @@ int main(int argc, char **argv)
}
}
ppi
=
&
ppg
->
pp_instances
[
i
];
ppi
=
&
ppg
->
pp_instances
[
i
];
ppi
->
glbs
=
ppg
;
/* FIXME check all of these calloc's, since some stuff will be
/* FIXME check all of these calloc's, since some stuff will be
* part of pp_globals */
* part of pp_globals */
...
...
include/ppsi/pp-instance.h
View file @
bf67f3bf
...
@@ -137,6 +137,9 @@ struct pp_instance {
...
@@ -137,6 +137,9 @@ struct pp_instance {
struct
pp_servo
*
servo
;
struct
pp_servo
*
servo
;
unsigned
long
flags
;
/* ppi-specific flags (diag mainly) */
unsigned
long
flags
;
/* ppi-specific flags (diag mainly) */
/* Pointer to global instance owning this pp_instance*/
struct
pp_globals
*
glbs
;
/* Operations that may be different in each instance */
/* Operations that may be different in each instance */
struct
pp_network_operations
*
n_ops
;
struct
pp_network_operations
*
n_ops
;
struct
pp_time_operations
*
t_ops
;
struct
pp_time_operations
*
t_ops
;
...
...
include/ppsi/ppsi.h
View file @
bf67f3bf
...
@@ -31,6 +31,11 @@ static inline struct pp_runtime_opts *OPTS(struct pp_instance *ppi)
...
@@ -31,6 +31,11 @@ static inline struct pp_runtime_opts *OPTS(struct pp_instance *ppi)
return
ppi
->
rt_opts
;
return
ppi
->
rt_opts
;
}
}
static
inline
struct
pp_globals
*
GLBS
(
struct
pp_instance
*
ppi
)
{
return
ppi
->
glbs
;
}
static
inline
struct
DSDefault
*
DSDEF
(
struct
pp_instance
*
ppi
)
static
inline
struct
DSDefault
*
DSDEF
(
struct
pp_instance
*
ppi
)
{
{
return
ppi
->
defaultDS
;
return
ppi
->
defaultDS
;
...
...
lib-bare/bare-startup.c
View file @
bf67f3bf
...
@@ -19,6 +19,7 @@ void ppsi_clear_bss(void)
...
@@ -19,6 +19,7 @@ void ppsi_clear_bss(void)
*
ptr
=
0
;
*
ptr
=
0
;
}
}
static
struct
pp_globals
ppg_static
;
static
struct
pp_instance
ppi_static
;
static
struct
pp_instance
ppi_static
;
CONST_VERBOSITY
int
pp_diag_verbosity
=
0
;
CONST_VERBOSITY
int
pp_diag_verbosity
=
0
;
...
@@ -32,10 +33,12 @@ static struct pp_servo servo;
...
@@ -32,10 +33,12 @@ static struct pp_servo servo;
int
ppsi_main
(
int
argc
,
char
**
argv
)
int
ppsi_main
(
int
argc
,
char
**
argv
)
{
{
struct
pp_globals
*
ppg
=
&
ppg_static
;
struct
pp_instance
*
ppi
=
&
ppi_static
;
/* no malloc, one instance */
struct
pp_instance
*
ppi
=
&
ppi_static
;
/* no malloc, one instance */
PP_PRINTF
(
"bare: starting. Compiled on %s
\n
"
,
__DATE__
);
PP_PRINTF
(
"bare: starting. Compiled on %s
\n
"
,
__DATE__
);
ppi
->
glbs
=
ppg
;
ppi
->
defaultDS
=
&
defaultDS
;
ppi
->
defaultDS
=
&
defaultDS
;
ppi
->
currentDS
=
&
currentDS
;
ppi
->
currentDS
=
&
currentDS
;
ppi
->
parentDS
=
&
parentDS
;
ppi
->
parentDS
=
&
parentDS
;
...
...
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