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
b162fa01
Commit
b162fa01
authored
Nov 19, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: Port over cset 1.1459 x86 gettimeofday fix.
parent
44cb023a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
21 deletions
+36
-21
arch/sparc/kernel/pcic.c
arch/sparc/kernel/pcic.c
+12
-7
arch/sparc/kernel/time.c
arch/sparc/kernel/time.c
+12
-7
arch/sparc64/kernel/time.c
arch/sparc64/kernel/time.c
+12
-7
No files found.
arch/sparc/kernel/pcic.c
View file @
b162fa01
...
...
@@ -776,23 +776,28 @@ static void pci_do_gettimeofday(struct timeval *tv)
unsigned
long
flags
;
unsigned
long
seq
;
unsigned
long
usec
,
sec
;
unsigned
long
max_ntp_tick
=
tick_usec
-
tickadj
;
do
{
unsigned
long
lost
;
seq
=
read_seqbegin_irqsave
(
&
xtime_lock
,
flags
);
usec
=
do_gettimeoffset
();
{
unsigned
long
lost
=
jiffies
-
wall_jiffies
;
if
(
lost
)
usec
+=
lost
*
(
1000000
/
HZ
);
}
lost
=
jiffies
-
wall_jiffies
;
/*
* If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards..
*/
if
(
unlikely
(
time_adjust
<
0
)
&&
usec
>
tickadj
)
usec
=
tickadj
;
if
(
unlikely
(
time_adjust
<
0
))
{
usec
=
min
(
usec
,
max_ntp_tick
);
if
(
lost
)
usec
+=
lost
*
max_ntp_tick
;
}
else
if
(
unlikely
(
lost
))
usec
+=
lost
*
tick_usec
;
sec
=
xtime
.
tv_sec
;
usec
+=
(
xtime
.
tv_nsec
/
1000
);
...
...
arch/sparc/kernel/time.c
View file @
b162fa01
...
...
@@ -481,23 +481,28 @@ void do_gettimeofday(struct timeval *tv)
unsigned
long
flags
;
unsigned
long
seq
;
unsigned
long
usec
,
sec
;
unsigned
long
max_ntp_tick
=
tick_usec
-
tickadj
;
do
{
unsigned
long
lost
;
seq
=
read_seqbegin_irqsave
(
&
xtime_lock
,
flags
);
usec
=
do_gettimeoffset
();
{
unsigned
long
lost
=
jiffies
-
wall_jiffies
;
if
(
lost
)
usec
+=
lost
*
(
1000000
/
HZ
);
}
lost
=
jiffies
-
wall_jiffies
;
/*
* If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards..
*/
if
(
unlikely
(
time_adjust
<
0
)
&&
usec
>
tickadj
)
usec
=
tickadj
;
if
(
unlikely
(
time_adjust
<
0
))
{
usec
=
min
(
usec
,
max_ntp_tick
);
if
(
lost
)
usec
+=
lost
*
max_ntp_tick
;
}
else
if
(
unlikely
(
lost
))
usec
+=
lost
*
tick_usec
;
sec
=
xtime
.
tv_sec
;
usec
+=
(
xtime
.
tv_nsec
/
1000
);
...
...
arch/sparc64/kernel/time.c
View file @
b162fa01
...
...
@@ -1140,23 +1140,28 @@ void do_gettimeofday(struct timeval *tv)
unsigned
long
flags
;
unsigned
long
seq
;
unsigned
long
usec
,
sec
;
unsigned
long
max_ntp_tick
=
tick_usec
-
tickadj
;
do
{
unsigned
long
lost
;
seq
=
read_seqbegin_irqsave
(
&
xtime_lock
,
flags
);
usec
=
do_gettimeoffset
();
{
unsigned
long
lost
=
jiffies
-
wall_jiffies
;
if
(
lost
)
usec
+=
lost
*
(
1000000
/
HZ
);
}
lost
=
jiffies
-
wall_jiffies
;
/*
* If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards..
*/
if
(
unlikely
(
time_adjust
<
0
)
&&
usec
>
tickadj
)
usec
=
tickadj
;
if
(
unlikely
(
time_adjust
<
0
))
{
usec
=
min
(
usec
,
max_ntp_tick
);
if
(
lost
)
usec
+=
lost
*
max_ntp_tick
;
}
else
if
(
unlikely
(
lost
))
usec
+=
lost
*
tick_usec
;
sec
=
xtime
.
tv_sec
;
usec
+=
(
xtime
.
tv_nsec
/
1000
);
...
...
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