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
ddf727a3
Commit
ddf727a3
authored
Dec 05, 2013
by
Pietro Fezzardi
Committed by
Alessandro Rubini
Mar 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-sim: FIX insert_pending()
parent
61c0b772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
sim-socket.c
time-sim/sim-socket.c
+6
-6
No files found.
time-sim/sim-socket.c
View file @
ddf727a3
...
...
@@ -7,6 +7,7 @@
/* Socket interface for GNU/Linux (and most likely other posix systems) */
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
...
...
@@ -28,7 +29,7 @@ static int compare_pending(struct sim_pending_pkt *p1,
if
(
p1
->
delay_ns
<
p2
->
delay_ns
)
return
1
;
/* same expire time ---> higher priority to the slave be
ac
use it has to
/* same expire time ---> higher priority to the slave be
ca
use it has to
* handle Sync and Follow_Up in a row. If both are for the slave handle
* PP_NP_EVT first */
if
(
p1
->
delay_ns
==
p2
->
delay_ns
)
{
...
...
@@ -46,15 +47,14 @@ static int insert_pending(struct sim_ppg_arch_data *data,
struct
sim_pending_pkt
*
pkt
,
tmp
;
int
i
=
data
->
n_pending
;
pkt
=
&
data
->
pending
[
i
];
*
pkt
=
*
new
;
pkt
--
;
data
->
pending
[
i
]
=
*
new
;
pkt
=
&
data
->
pending
[
i
-
1
];
while
(
compare_pending
(
new
,
pkt
)
&&
(
i
>
0
))
{
tmp
=
*
pkt
;
*
pkt
=
*
new
;
*
new
=
tmp
;
*
(
pkt
+
1
)
=
tmp
;
pkt
--
;
new
--
;
i
--
;
}
data
->
n_pending
++
;
return
0
;
...
...
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