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
2e508205
Commit
2e508205
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] sh: fix do_settimeofday() for new API
parent
f02606c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
arch/sh/kernel/time.c
arch/sh/kernel/time.c
+9
-5
No files found.
arch/sh/kernel/time.c
View file @
2e508205
...
@@ -151,8 +151,11 @@ void do_gettimeofday(struct timeval *tv)
...
@@ -151,8 +151,11 @@ void do_gettimeofday(struct timeval *tv)
tv
->
tv_usec
=
usec
;
tv
->
tv_usec
=
usec
;
}
}
void
do_settimeofday
(
struct
timeval
*
tv
)
int
do_settimeofday
(
struct
timespec
*
tv
)
{
{
if
((
unsigned
long
)
tv
->
tv_nsec
>=
NSEC_PER_SEC
)
return
-
EINVAL
;
write_seqlock_irq
(
&
xtime_lock
);
write_seqlock_irq
(
&
xtime_lock
);
/*
/*
* This is revolting. We need to set "xtime" correctly. However, the
* This is revolting. We need to set "xtime" correctly. However, the
...
@@ -160,11 +163,11 @@ void do_settimeofday(struct timeval *tv)
...
@@ -160,11 +163,11 @@ void do_settimeofday(struct timeval *tv)
* wall time. Discover what correction gettimeofday() would have
* wall time. Discover what correction gettimeofday() would have
* made, and then undo it!
* made, and then undo it!
*/
*/
tv
->
tv_
usec
-=
do_gettimeoffset
();
tv
->
tv_
nsec
-=
1000
*
(
do_gettimeoffset
()
+
tv
->
tv_usec
-=
(
jiffies
-
wall_jiffies
)
*
(
1000000
/
HZ
);
(
jiffies
-
wall_jiffies
)
*
(
1000000
/
HZ
)
);
while
(
tv
->
tv_
u
sec
<
0
)
{
while
(
tv
->
tv_
n
sec
<
0
)
{
tv
->
tv_
usec
+=
1000000
;
tv
->
tv_
nsec
+=
NSEC_PER_SEC
;
tv
->
tv_sec
--
;
tv
->
tv_sec
--
;
}
}
...
@@ -174,6 +177,7 @@ void do_settimeofday(struct timeval *tv)
...
@@ -174,6 +177,7 @@ void do_settimeofday(struct timeval *tv)
time_maxerror
=
NTP_PHASE_LIMIT
;
time_maxerror
=
NTP_PHASE_LIMIT
;
time_esterror
=
NTP_PHASE_LIMIT
;
time_esterror
=
NTP_PHASE_LIMIT
;
write_sequnlock_irq
(
&
xtime_lock
);
write_sequnlock_irq
(
&
xtime_lock
);
return
0
;
}
}
/* last time the RTC clock got updated */
/* last time the RTC clock got updated */
...
...
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