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
3fa27a54
Commit
3fa27a54
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] arm: fix do_settimeofday() for new API
parent
c948c5e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
arch/arm/kernel/time.c
arch/arm/kernel/time.c
+10
-6
No files found.
arch/arm/kernel/time.c
View file @
3fa27a54
...
...
@@ -172,8 +172,11 @@ void do_gettimeofday(struct timeval *tv)
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
);
/*
* This is revolting. We need to set "xtime" correctly. However, the
...
...
@@ -181,21 +184,22 @@ void do_settimeofday(struct timeval *tv)
* wall time. Discover what correction gettimeofday() would have
* done, and then undo it!
*/
tv
->
tv_
usec
-=
gettimeoffset
();
tv
->
tv_usec
-=
(
jiffies
-
wall_jiffies
)
*
USECS_PER_JIFFY
;
tv
->
tv_
nsec
-=
1000
*
(
gettimeoffset
()
+
(
jiffies
-
wall_jiffies
)
*
USECS_PER_JIFFY
)
;
while
(
tv
->
tv_
u
sec
<
0
)
{
tv
->
tv_
usec
+=
1000000
;
while
(
tv
->
tv_
n
sec
<
0
)
{
tv
->
tv_
nsec
+=
NSEC_PER_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_status
|=
STA_UNSYNC
;
time_maxerror
=
NTP_PHASE_LIMIT
;
time_esterror
=
NTP_PHASE_LIMIT
;
write_sequnlock_irq
(
&
xtime_lock
);
return
0
;
}
static
struct
irqaction
timer_irq
=
{
...
...
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