Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a9a93c8a
Commit
a9a93c8a
authored
Jun 14, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Jun 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ppc: fix do_settimeofday() for new API
parent
0696d74b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
arch/ppc/kernel/time.c
arch/ppc/kernel/time.c
+10
-6
No files found.
arch/ppc/kernel/time.c
View file @
a9a93c8a
...
...
@@ -239,10 +239,13 @@ void do_gettimeofday(struct timeval *tv)
tv
->
tv_usec
=
usec
;
}
void
do_settimeofday
(
struct
timeval
*
tv
)
int
do_settimeofday
(
struct
timespec
*
tv
)
{
unsigned
long
flags
;
int
tb_delta
,
new_usec
,
new_sec
;
int
tb_delta
,
new_nsec
,
new_sec
;
if
((
unsigned
long
)
tv
->
tv_nsec
>=
NSEC_PER_SEC
)
return
-
EINVAL
;
write_seqlock_irqsave
(
&
xtime_lock
,
flags
);
/* Updating the RTC is not the job of this code. If the time is
...
...
@@ -266,12 +269,12 @@ void do_settimeofday(struct timeval *tv)
tb_delta
=
tb_ticks_since
(
last_jiffy_stamp
(
smp_processor_id
()));
tb_delta
+=
(
jiffies
-
wall_jiffies
)
*
tb_ticks_per_jiffy
;
new_sec
=
tv
->
tv_sec
;
new_
usec
=
tv
->
tv_usec
-
mulhwu
(
tb_to_us
,
tb_delta
);
while
(
new_
usec
<
0
)
{
new_
nsec
=
tv
->
tv_nsec
-
1000
*
mulhwu
(
tb_to_us
,
tb_delta
);
while
(
new_
nsec
<
0
)
{
new_sec
--
;
new_
usec
+=
1000000
;
new_
nsec
+=
NSEC_PER_SEC
;
}
xtime
.
tv_nsec
=
(
new_usec
*
1000
)
;
xtime
.
tv_nsec
=
new_nsec
;
xtime
.
tv_sec
=
new_sec
;
/* In case of a large backwards jump in time with NTP, we want the
...
...
@@ -285,6 +288,7 @@ void do_settimeofday(struct timeval *tv)
time_maxerror
=
NTP_PHASE_LIMIT
;
time_esterror
=
NTP_PHASE_LIMIT
;
write_sequnlock_irqrestore
(
&
xtime_lock
,
flags
);
return
0
;
}
/* This function is only called on the boot processor */
...
...
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