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
a3340842
Commit
a3340842
authored
May 20, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr-api.h: avoid a libgcc 64-bit division
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
e31d29b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
wr-api.h
proto-ext-whiterabbit/wr-api.h
+11
-2
No files found.
proto-ext-whiterabbit/wr-api.h
View file @
a3340842
...
...
@@ -6,6 +6,7 @@
#ifndef __WREXT_WR_API_H__
#define __WREXT_WR_API_H__
#include <ppsi/lib.h>
#include "wr-constants.h"
/*
...
...
@@ -50,10 +51,18 @@ static inline struct wr_dsport *WR_DSPOR(struct pp_instance *ppi)
static
inline
Integer32
phase_to_cf_units
(
Integer32
phase
)
{
return
(
Integer32
)
((
int64_t
)
phase
*
65536LL
/
1000LL
);
uint64_t
ph64
;
if
(
phase
>=
0
)
{
ph64
=
phase
*
65536LL
;
__div64_32
(
&
ph64
,
1000
);
return
ph64
;
}
else
{
ph64
=
-
phase
*
65536LL
;
__div64_32
(
&
ph64
,
1000
);
return
-
ph64
;
}
}
/* Pack/Unkpack White rabbit message in the suffix of PTP announce message */
void
msg_pack_announce_wr_tlv
(
struct
pp_instance
*
ppi
);
void
msg_unpack_announce_wr_tlv
(
void
*
buf
,
MsgAnnounce
*
ann
);
...
...
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