Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
75881c80
Commit
75881c80
authored
May 20, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
softpll_ng: avoid a libgcc 64-bit division, using ppsi/lib
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
89cc3e49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
softpll_ng.c
softpll/softpll_ng.c
+17
-0
No files found.
softpll/softpll_ng.c
View file @
75881c80
...
...
@@ -398,11 +398,28 @@ int spll_check_lock(int channel)
&&
softpll
.
aux
[
channel
-
1
].
ld
.
locked
;
}
#ifdef CONFIG_PPSI
/* use __div64_32 from ppsi library to save libgcc memory */
static
int32_t
from_picos
(
int32_t
ps
)
{
extern
uint32_t
__div64_32
(
uint64_t
*
n
,
uint32_t
base
);
uint64_t
ups
=
ps
;
if
(
ps
>=
0
)
{
ups
*=
1
<<
HPLL_N
;
__div64_32
(
&
ups
,
CLOCK_PERIOD_PICOSECONDS
);
return
ups
;
}
ups
=
-
ps
*
(
1
<<
HPLL_N
);
__div64_32
(
&
ups
,
CLOCK_PERIOD_PICOSECONDS
);
return
-
ups
;
}
#else
/* previous implementation: ptp-noposix has no __div64_32 available */
static
int32_t
from_picos
(
int32_t
ps
)
{
return
(
int32_t
)
((
int64_t
)
ps
*
(
int64_t
)
(
1
<<
HPLL_N
)
/
(
int64_t
)
CLOCK_PERIOD_PICOSECONDS
);
}
#endif
static
int32_t
to_picos
(
int32_t
units
)
{
...
...
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