Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Beam Positoning Monitor - Software
Commits
bb50e84f
Commit
bb50e84f
authored
May 27, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/dev_io/dev_io*: remove external polling to new devio_loop ()
parent
d3dedfe1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
42 deletions
+28
-42
dev_io.c
src/dev_io/dev_io.c
+17
-23
dev_io_cfg.c
src/dev_io/dev_io_cfg.c
+11
-19
No files found.
src/dev_io/dev_io.c
View file @
bb50e84f
...
...
@@ -233,10 +233,14 @@ int main (int argc, char *argv[])
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_INFO
,
"[dev_io] Slot number: 0x%08X
\n
"
,
dev_id
);
/* FIXME: give some time for the process to terminate gracefully */
sleep
(
4
);
/* Kill DEVIO cfg as we've already got our slot number */
kill
(
child_devio_cfg_pid
,
DEVIO_KILL_CFG_SIGNAL
);
/* Wait child */
hutils_wait_chld
();
/* Destroy libclient */
bpm_client_destroy
(
&
client_cfg
);
#endif
/* We don't need it anymore */
...
...
@@ -280,33 +284,23 @@ int main (int argc, char *argv[])
goto
err_devio
;
}
/* err = devio_init_poller_sm (devio); */
err
=
devio_init_poller_sm
(
devio
);
/* Step 1: Loop though all the SDB records and intialize (boot) the
* smio modules*/
/* Step 2: Optionally, register the necessary smio modules specifying
* its ID and calling devio_register_sm */
/* Step 3: Poll all PIPE's sockets to determine if we have something to
* handle, like messages from smios */
/* Step 3.5: If we do, call devio_handle_smio () and treat its
* request as appropriate */
err
=
devio_loop
(
devio
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] devio_init_poller_sm error!
\n
"
);
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] devio_loop error: %s
\n
"
,
devio_err_str
(
err
));
goto
err_devio
;
}
while
(
!
zsys_interrupted
)
{
/* Step 1: Loop though all the SDB records and intialize (boot) the
* smio modules*/
/* Step 2: Optionally, register the necessary smio modules specifying
* its ID and calling devio_register_sm */
/* Step 3: Poll all PIPE's sockets to determine if we have something to
* handle, like messages from smios */
/* Step 3.5: If we do, call devio_handle_smio () and treat its
* request as appropriate */
/* devio_poll_all_sm (devio); */
err
=
devio_poll_all_sm
(
devio
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] devio_poll_all_sm error. Exiting ...
\n
"
);
goto
err_devio
;
}
/* wait child */
hutils_wait_chld
();
}
/* wait child */
hutils_wait_chld
();
err_devio:
devio_destroy
(
&
devio
);
...
...
src/dev_io/dev_io_cfg.c
View file @
bb50e84f
...
...
@@ -196,29 +196,21 @@ int main (int argc, char *argv[])
goto
err_devio
;
}
err
=
devio_init_poller_sm
(
devio
);
/* Step 1: Loop though all the SDB records and intialize (boot) the
* smio modules*/
/* Step 2: Optionally, register the necessary smio modules specifying
* its ID and calling devio_register_sm */
/* Step 3: Poll all PIPE's sockets to determine if we have something to
* handle, like messages from smios */
/* Step 3.5: If we do, call devio_handle_smio () and treat its
* request as appropriate */
err
=
devio_loop
(
devio
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] devio_init_poller_sm error!
\n
"
);
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] devio_loop error: %s
\n
"
,
devio_err_str
(
err
));
goto
err_devio
;
}
while
(
!
zsys_interrupted
)
{
/* Step 1: Loop though all the SDB records and intialize (boot) the
* smio modules*/
/* Step 2: Optionally, register the necessary smio modules specifying
* its ID and calling devio_register_sm */
/* Step 3: Poll all PIPE's sockets to determine if we have something to
* handle, like messages from smios */
/* Step 3.5: If we do, call devio_handle_smio () and treat its
* request as appropriate */
err
=
devio_poll_all_sm
(
devio
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] devio_poll2_all_sm error. Exiting ...
\n
"
);
goto
err_devio
;
}
}
err_devio:
devio_destroy
(
&
devio
);
err_exit:
...
...
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