Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
92117778
Commit
92117778
authored
Jul 03, 2009
by
Ingo Molnar
Committed by
Thomas Gleixner
Jul 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subject: rt: mutex x86 64
Signed-off-by:
Ingo Molnar
<
mingo@elte.hu
>
parent
5a950072
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
arch/x86/include/asm/vgtod.h
arch/x86/include/asm/vgtod.h
+1
-1
arch/x86/kernel/vsyscall_64.c
arch/x86/kernel/vsyscall_64.c
+7
-7
arch/x86/vdso/vclock_gettime.c
arch/x86/vdso/vclock_gettime.c
+4
-4
No files found.
arch/x86/include/asm/vgtod.h
View file @
92117778
...
...
@@ -5,7 +5,7 @@
#include <linux/clocksource.h>
struct
vsyscall_gtod_data
{
seqlock_t
lock
;
atomic_seqlock_t
lock
;
/* open coded 'struct timespec' */
time_t
wall_time_sec
;
...
...
arch/x86/kernel/vsyscall_64.c
View file @
92117778
...
...
@@ -59,7 +59,7 @@ int __vgetcpu_mode __section_vgetcpu_mode;
struct
vsyscall_gtod_data
__vsyscall_gtod_data
__section_vsyscall_gtod_data
=
{
.
lock
=
SEQLOCK_UNLOCKED
,
.
lock
=
__ATOMIC_SEQLOCK_UNLOCKED
(
__vsyscall_gtod_data
.
lock
)
,
.
sysctl_enabled
=
1
,
};
...
...
@@ -67,17 +67,17 @@ void update_vsyscall_tz(void)
{
unsigned
long
flags
;
write_seqlock_irqsave
(
&
vsyscall_gtod_data
.
lock
,
flags
);
write_
atomic_
seqlock_irqsave
(
&
vsyscall_gtod_data
.
lock
,
flags
);
/* sys_tz has changed */
vsyscall_gtod_data
.
sys_tz
=
sys_tz
;
write_sequnlock_irqrestore
(
&
vsyscall_gtod_data
.
lock
,
flags
);
write_
atomic_
sequnlock_irqrestore
(
&
vsyscall_gtod_data
.
lock
,
flags
);
}
void
update_vsyscall
(
struct
timespec
*
wall_time
,
struct
clocksource
*
clock
)
{
unsigned
long
flags
;
write_seqlock_irqsave
(
&
vsyscall_gtod_data
.
lock
,
flags
);
write_
atomic_
seqlock_irqsave
(
&
vsyscall_gtod_data
.
lock
,
flags
);
/* copy vsyscall data */
vsyscall_gtod_data
.
clock
.
vread
=
clock
->
vread
;
vsyscall_gtod_data
.
clock
.
cycle_last
=
clock
->
cycle_last
;
...
...
@@ -87,7 +87,7 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
vsyscall_gtod_data
.
wall_time_sec
=
wall_time
->
tv_sec
;
vsyscall_gtod_data
.
wall_time_nsec
=
wall_time
->
tv_nsec
;
vsyscall_gtod_data
.
wall_to_monotonic
=
wall_to_monotonic
;
write_sequnlock_irqrestore
(
&
vsyscall_gtod_data
.
lock
,
flags
);
write_
atomic_
sequnlock_irqrestore
(
&
vsyscall_gtod_data
.
lock
,
flags
);
}
/* RED-PEN may want to readd seq locking, but then the variable should be
...
...
@@ -124,7 +124,7 @@ static __always_inline void do_vgettimeofday(struct timeval * tv)
unsigned
long
mult
,
shift
,
nsec
;
cycle_t
(
*
vread
)(
void
);
do
{
seq
=
read_seqbegin
(
&
__vsyscall_gtod_data
.
lock
);
seq
=
read_
atomic_
seqbegin
(
&
__vsyscall_gtod_data
.
lock
);
vread
=
__vsyscall_gtod_data
.
clock
.
vread
;
if
(
unlikely
(
!
__vsyscall_gtod_data
.
sysctl_enabled
||
!
vread
))
{
...
...
@@ -140,7 +140,7 @@ static __always_inline void do_vgettimeofday(struct timeval * tv)
tv
->
tv_sec
=
__vsyscall_gtod_data
.
wall_time_sec
;
nsec
=
__vsyscall_gtod_data
.
wall_time_nsec
;
}
while
(
read_seqretry
(
&
__vsyscall_gtod_data
.
lock
,
seq
));
}
while
(
read_
atomic_
seqretry
(
&
__vsyscall_gtod_data
.
lock
,
seq
));
/* calculate interval: */
cycle_delta
=
(
now
-
base
)
&
mask
;
...
...
arch/x86/vdso/vclock_gettime.c
View file @
92117778
...
...
@@ -47,11 +47,11 @@ notrace static noinline int do_realtime(struct timespec *ts)
{
unsigned
long
seq
,
ns
;
do
{
seq
=
read_seqbegin
(
&
gtod
->
lock
);
seq
=
read_
atomic_
seqbegin
(
&
gtod
->
lock
);
ts
->
tv_sec
=
gtod
->
wall_time_sec
;
ts
->
tv_nsec
=
gtod
->
wall_time_nsec
;
ns
=
vgetns
();
}
while
(
unlikely
(
read_seqretry
(
&
gtod
->
lock
,
seq
)));
}
while
(
unlikely
(
read_
atomic_
seqretry
(
&
gtod
->
lock
,
seq
)));
timespec_add_ns
(
ts
,
ns
);
return
0
;
}
...
...
@@ -76,12 +76,12 @@ notrace static noinline int do_monotonic(struct timespec *ts)
{
unsigned
long
seq
,
ns
,
secs
;
do
{
seq
=
read_seqbegin
(
&
gtod
->
lock
);
seq
=
read_
atomic_
seqbegin
(
&
gtod
->
lock
);
secs
=
gtod
->
wall_time_sec
;
ns
=
gtod
->
wall_time_nsec
+
vgetns
();
secs
+=
gtod
->
wall_to_monotonic
.
tv_sec
;
ns
+=
gtod
->
wall_to_monotonic
.
tv_nsec
;
}
while
(
unlikely
(
read_seqretry
(
&
gtod
->
lock
,
seq
)));
}
while
(
unlikely
(
read_
atomic_
seqretry
(
&
gtod
->
lock
,
seq
)));
vset_normalized_timespec
(
ts
,
secs
,
ns
);
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