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
5aa563a9
Commit
5aa563a9
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] sparc64: fix do_settimeofday() for new API
parent
b1537c10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
arch/sparc64/kernel/time.c
arch/sparc64/kernel/time.c
+12
-9
No files found.
arch/sparc64/kernel/time.c
View file @
5aa563a9
...
...
@@ -1088,10 +1088,13 @@ static __inline__ unsigned long do_gettimeoffset(void)
return
(
ticks
*
timer_ticks_per_usec_quotient
)
>>
30UL
;
}
void
do_settimeofday
(
struct
timeval
*
tv
)
int
do_settimeofday
(
struct
timespec
*
tv
)
{
if
((
unsigned
long
)
tv
->
tv_nsec
>=
NSEC_PER_SEC
)
return
-
EINVAL
;
if
(
this_is_starfire
)
return
;
return
0
;
write_seqlock_irq
(
&
xtime_lock
);
/*
...
...
@@ -1100,17 +1103,16 @@ void do_settimeofday(struct timeval *tv)
* wall time. Discover what correction gettimeofday() would have
* made, and then undo it!
*/
tv
->
tv_
usec
-=
do_gettimeoffset
()
;
tv
->
tv_
usec
-=
(
jiffies
-
wall_jiffies
)
*
(
U
SEC_PER_SEC
/
HZ
);
tv
->
tv_
nsec
-=
do_gettimeoffset
()
*
1000
;
tv
->
tv_
nsec
-=
(
jiffies
-
wall_jiffies
)
*
(
N
SEC_PER_SEC
/
HZ
);
while
(
tv
->
tv_
u
sec
<
0
)
{
tv
->
tv_
usec
+=
U
SEC_PER_SEC
;
while
(
tv
->
tv_
n
sec
<
0
)
{
tv
->
tv_
nsec
+=
N
SEC_PER_SEC
;
tv
->
tv_sec
--
;
}
tv
->
tv_usec
*=
NSEC_PER_USEC
;
wall_to_monotonic
.
tv_sec
+=
xtime
.
tv_sec
-
tv
->
tv_sec
;
wall_to_monotonic
.
tv_nsec
+=
xtime
.
tv_nsec
-
tv
->
tv_
u
sec
;
wall_to_monotonic
.
tv_nsec
+=
xtime
.
tv_nsec
-
tv
->
tv_
n
sec
;
if
(
wall_to_monotonic
.
tv_nsec
>
NSEC_PER_SEC
)
{
wall_to_monotonic
.
tv_nsec
-=
NSEC_PER_SEC
;
...
...
@@ -1122,12 +1124,13 @@ void do_settimeofday(struct timeval *tv)
}
xtime
.
tv_sec
=
tv
->
tv_sec
;
xtime
.
tv_nsec
=
tv
->
tv_
u
sec
;
xtime
.
tv_nsec
=
tv
->
tv_
n
sec
;
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
;
}
/* Ok, my cute asm atomicity trick doesn't work anymore.
...
...
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