Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wrpc-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
wr-cores
wrpc-sw
Commits
75881c80
Commit
75881c80
authored
11 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
softpll_ng: avoid a libgcc 64-bit division, using ppsi/lib
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
89cc3e49
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
softpll/softpll_ng.c
+17
-0
17 additions, 0 deletions
softpll/softpll_ng.c
with
17 additions
and
0 deletions
softpll/softpll_ng.c
+
17
−
0
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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment