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
Kirill Smelkov
linux
Commits
0696d74b
Commit
0696d74b
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] m68k: fix do_settimeofday() for new API
parent
4dc04b05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
arch/m68k/kernel/time.c
arch/m68k/kernel/time.c
+10
-6
No files found.
arch/m68k/kernel/time.c
View file @
0696d74b
...
@@ -138,10 +138,13 @@ void do_gettimeofday(struct timeval *tv)
...
@@ -138,10 +138,13 @@ 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
)
{
{
extern
unsigned
long
wall_jiffies
;
extern
unsigned
long
wall_jiffies
;
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 the xtime.tv_nsec
/* This is revolting. We need to set the xtime.tv_nsec
* correctly. However, the value in this location is
* correctly. However, the value in this location is
...
@@ -149,19 +152,20 @@ void do_settimeofday(struct timeval *tv)
...
@@ -149,19 +152,20 @@ void do_settimeofday(struct timeval *tv)
* Discover what correction gettimeofday
* Discover what correction gettimeofday
* would have done, and then undo it!
* would have done, and then undo it!
*/
*/
tv
->
tv_
usec
-=
mach_gettimeoffset
();
tv
->
tv_
nsec
-=
1000
*
(
mach_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
--
;
}
}
xtime
.
tv_sec
=
tv
->
tv_sec
;
xtime
.
tv_sec
=
tv
->
tv_sec
;
xtime
.
tv_nsec
=
tv
->
tv_
usec
*
1000
;
xtime
.
tv_nsec
=
tv
->
tv_
nsec
;
time_adjust
=
0
;
/* stop active adjtime() */
time_adjust
=
0
;
/* stop active adjtime() */
time_status
|=
STA_UNSYNC
;
time_status
|=
STA_UNSYNC
;
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
;
}
}
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