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
706a1898
Commit
706a1898
authored
Feb 17, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for ntpd and HZ=1024 from mike
parent
8a730248
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
arch/ppc64/kernel/time.c
arch/ppc64/kernel/time.c
+22
-5
No files found.
arch/ppc64/kernel/time.c
View file @
706a1898
...
@@ -79,6 +79,8 @@ static unsigned long first_settimeofday = 1;
...
@@ -79,6 +79,8 @@ static unsigned long first_settimeofday = 1;
unsigned
long
tb_ticks_per_jiffy
;
unsigned
long
tb_ticks_per_jiffy
;
unsigned
long
tb_ticks_per_usec
;
unsigned
long
tb_ticks_per_usec
;
unsigned
long
tb_ticks_per_sec
;
unsigned
long
tb_ticks_per_sec
;
unsigned
long
next_xtime_sync_tb
;
unsigned
long
xtime_sync_interval
;
unsigned
long
tb_to_xs
;
unsigned
long
tb_to_xs
;
unsigned
tb_to_us
;
unsigned
tb_to_us
;
spinlock_t
rtc_lock
=
SPIN_LOCK_UNLOCKED
;
spinlock_t
rtc_lock
=
SPIN_LOCK_UNLOCKED
;
...
@@ -154,6 +156,22 @@ static __inline__ void timer_check_rtc(void)
...
@@ -154,6 +156,22 @@ static __inline__ void timer_check_rtc(void)
}
}
}
}
/* Synchronize xtime with do_gettimeofday */
static
__inline__
void
timer_sync_xtime
(
unsigned
long
cur_tb
)
{
struct
timeval
my_tv
;
if
(
cur_tb
>
next_xtime_sync_tb
)
{
next_xtime_sync_tb
=
cur_tb
+
xtime_sync_interval
;
do_gettimeofday
(
&
my_tv
);
if
(
xtime
.
tv_sec
<=
my_tv
.
tv_sec
)
{
xtime
.
tv_sec
=
my_tv
.
tv_sec
;
xtime
.
tv_usec
=
my_tv
.
tv_usec
;
}
}
}
#ifdef CONFIG_PPC_ISERIES
#ifdef CONFIG_PPC_ISERIES
/*
/*
...
@@ -248,6 +266,7 @@ int timer_interrupt(struct pt_regs * regs)
...
@@ -248,6 +266,7 @@ int timer_interrupt(struct pt_regs * regs)
write_lock
(
&
xtime_lock
);
write_lock
(
&
xtime_lock
);
tb_last_stamp
=
paca
->
next_jiffy_update_tb
;
tb_last_stamp
=
paca
->
next_jiffy_update_tb
;
do_timer
(
regs
);
do_timer
(
regs
);
timer_sync_xtime
(
cur_tb
);
timer_check_rtc
();
timer_check_rtc
();
write_unlock
(
&
xtime_lock
);
write_unlock
(
&
xtime_lock
);
}
}
...
@@ -412,6 +431,9 @@ void __init time_init(void)
...
@@ -412,6 +431,9 @@ void __init time_init(void)
do_gtod
.
varp
->
tb_to_xs
=
tb_to_xs
;
do_gtod
.
varp
->
tb_to_xs
=
tb_to_xs
;
do_gtod
.
tb_to_us
=
tb_to_us
;
do_gtod
.
tb_to_us
=
tb_to_us
;
xtime_sync_interval
=
tb_ticks_per_sec
-
(
tb_ticks_per_sec
/
8
);
next_xtime_sync_tb
=
tb_last_stamp
+
xtime_sync_interval
;
xtime
.
tv_usec
=
0
;
xtime
.
tv_usec
=
0
;
last_rtc_update
=
xtime
.
tv_sec
;
last_rtc_update
=
xtime
.
tv_sec
;
write_unlock_irqrestore
(
&
xtime_lock
,
flags
);
write_unlock_irqrestore
(
&
xtime_lock
,
flags
);
...
@@ -440,7 +462,6 @@ void ppc_adjtimex(void)
...
@@ -440,7 +462,6 @@ void ppc_adjtimex(void)
unsigned
long
tb_ticks_per_sec_delta
;
unsigned
long
tb_ticks_per_sec_delta
;
long
delta_freq
,
ltemp
;
long
delta_freq
,
ltemp
;
struct
div_result
divres
;
struct
div_result
divres
;
struct
timeval
my_tv
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
gettimeofday_vars
*
temp_varp
;
struct
gettimeofday_vars
*
temp_varp
;
...
@@ -484,10 +505,6 @@ void ppc_adjtimex(void)
...
@@ -484,10 +505,6 @@ void ppc_adjtimex(void)
mb
();
mb
();
do_gtod
.
varp
=
temp_varp
;
do_gtod
.
varp
=
temp_varp
;
do_gettimeofday
(
&
my_tv
);
if
(
xtime
.
tv_sec
==
my_tv
.
tv_sec
)
xtime
.
tv_usec
=
my_tv
.
tv_usec
;
write_unlock_irqrestore
(
&
xtime_lock
,
flags
);
write_unlock_irqrestore
(
&
xtime_lock
,
flags
);
}
}
...
...
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