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
040e6a4c
Commit
040e6a4c
authored
Jul 28, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rt/cherry-picks' into rt/base
parents
58c81852
c1554e11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
59 deletions
+127
-59
arch/x86/kernel/mfgpt_32.c
arch/x86/kernel/mfgpt_32.c
+1
-1
kernel/hrtimer.c
kernel/hrtimer.c
+0
-56
kernel/time/timekeeping.c
kernel/time/timekeeping.c
+126
-2
No files found.
arch/x86/kernel/mfgpt_32.c
View file @
040e6a4c
...
...
@@ -347,7 +347,7 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
static
struct
irqaction
mfgptirq
=
{
.
handler
=
mfgpt_tick
,
.
flags
=
IRQF_DISABLED
|
IRQF_NOBALANCING
,
.
flags
=
IRQF_DISABLED
|
IRQF_NOBALANCING
|
IRQF_TIMER
,
.
name
=
"mfgpt-timer"
};
...
...
kernel/hrtimer.c
View file @
040e6a4c
...
...
@@ -48,37 +48,6 @@
#include <asm/uaccess.h>
/**
* ktime_get - get the monotonic time in ktime_t format
*
* returns the time in ktime_t format
*/
ktime_t
ktime_get
(
void
)
{
struct
timespec
now
;
ktime_get_ts
(
&
now
);
return
timespec_to_ktime
(
now
);
}
EXPORT_SYMBOL_GPL
(
ktime_get
);
/**
* ktime_get_real - get the real (wall-) time in ktime_t format
*
* returns the time in ktime_t format
*/
ktime_t
ktime_get_real
(
void
)
{
struct
timespec
now
;
getnstimeofday
(
&
now
);
return
timespec_to_ktime
(
now
);
}
EXPORT_SYMBOL_GPL
(
ktime_get_real
);
/*
* The timer bases:
*
...
...
@@ -106,31 +75,6 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
}
};
/**
* ktime_get_ts - get the monotonic clock in timespec format
* @ts: pointer to timespec variable
*
* The function calculates the monotonic clock from the realtime
* clock and the wall_to_monotonic offset and stores the result
* in normalized timespec format in the variable pointed to by @ts.
*/
void
ktime_get_ts
(
struct
timespec
*
ts
)
{
struct
timespec
tomono
;
unsigned
long
seq
;
do
{
seq
=
read_seqbegin
(
&
xtime_lock
);
getnstimeofday
(
ts
);
tomono
=
wall_to_monotonic
;
}
while
(
read_seqretry
(
&
xtime_lock
,
seq
));
set_normalized_timespec
(
ts
,
ts
->
tv_sec
+
tomono
.
tv_sec
,
ts
->
tv_nsec
+
tomono
.
tv_nsec
);
}
EXPORT_SYMBOL_GPL
(
ktime_get_ts
);
/*
* Get the coarse grained time at the softirq based on xtime and
* wall_to_monotonic.
...
...
kernel/time/timekeeping.c
View file @
040e6a4c
...
...
@@ -125,6 +125,75 @@ void getnstimeofday(struct timespec *ts)
EXPORT_SYMBOL
(
getnstimeofday
);
ktime_t
ktime_get
(
void
)
{
cycle_t
cycle_now
,
cycle_delta
;
unsigned
int
seq
;
s64
secs
,
nsecs
;
WARN_ON
(
timekeeping_suspended
);
do
{
seq
=
read_seqbegin
(
&
xtime_lock
);
secs
=
xtime
.
tv_sec
+
wall_to_monotonic
.
tv_sec
;
nsecs
=
xtime
.
tv_nsec
+
wall_to_monotonic
.
tv_nsec
;
/* read clocksource: */
cycle_now
=
clocksource_read
(
clock
);
/* calculate the delta since the last update_wall_time: */
cycle_delta
=
(
cycle_now
-
clock
->
cycle_last
)
&
clock
->
mask
;
/* convert to nanoseconds: */
nsecs
+=
cyc2ns
(
clock
,
cycle_delta
);
}
while
(
read_seqretry
(
&
xtime_lock
,
seq
));
/*
* Use ktime_set/ktime_add_ns to create a proper ktime on
* 32-bit architectures without CONFIG_KTIME_SCALAR.
*/
return
ktime_add_ns
(
ktime_set
(
secs
,
0
),
nsecs
);
}
EXPORT_SYMBOL_GPL
(
ktime_get
);
/**
* ktime_get_ts - get the monotonic clock in timespec format
* @ts: pointer to timespec variable
*
* The function calculates the monotonic clock from the realtime
* clock and the wall_to_monotonic offset and stores the result
* in normalized timespec format in the variable pointed to by @ts.
*/
void
ktime_get_ts
(
struct
timespec
*
ts
)
{
cycle_t
cycle_now
,
cycle_delta
;
struct
timespec
tomono
;
unsigned
int
seq
;
s64
nsecs
;
WARN_ON
(
timekeeping_suspended
);
do
{
seq
=
read_seqbegin
(
&
xtime_lock
);
*
ts
=
xtime
;
tomono
=
wall_to_monotonic
;
/* read clocksource: */
cycle_now
=
clocksource_read
(
clock
);
/* calculate the delta since the last update_wall_time: */
cycle_delta
=
(
cycle_now
-
clock
->
cycle_last
)
&
clock
->
mask
;
/* convert to nanoseconds: */
nsecs
=
cyc2ns
(
clock
,
cycle_delta
);
}
while
(
read_seqretry
(
&
xtime_lock
,
seq
));
set_normalized_timespec
(
ts
,
ts
->
tv_sec
+
tomono
.
tv_sec
,
ts
->
tv_nsec
+
tomono
.
tv_nsec
+
nsecs
);
}
EXPORT_SYMBOL_GPL
(
ktime_get_ts
);
/**
* do_gettimeofday - Returns the time of day in a timeval
* @tv: pointer to the timeval to be set
...
...
@@ -221,10 +290,65 @@ static void change_clocksource(void)
clock->name);
*/
}
#else
#else
/* GENERIC_TIME */
static
inline
void
clocksource_forward_now
(
void
)
{
}
static
inline
void
change_clocksource
(
void
)
{
}
#endif
/**
* ktime_get - get the monotonic time in ktime_t format
*
* returns the time in ktime_t format
*/
ktime_t
ktime_get
(
void
)
{
struct
timespec
now
;
ktime_get_ts
(
&
now
);
return
timespec_to_ktime
(
now
);
}
EXPORT_SYMBOL_GPL
(
ktime_get
);
/**
* ktime_get_ts - get the monotonic clock in timespec format
* @ts: pointer to timespec variable
*
* The function calculates the monotonic clock from the realtime
* clock and the wall_to_monotonic offset and stores the result
* in normalized timespec format in the variable pointed to by @ts.
*/
void
ktime_get_ts
(
struct
timespec
*
ts
)
{
struct
timespec
tomono
;
unsigned
long
seq
;
do
{
seq
=
read_seqbegin
(
&
xtime_lock
);
getnstimeofday
(
ts
);
tomono
=
wall_to_monotonic
;
}
while
(
read_seqretry
(
&
xtime_lock
,
seq
));
set_normalized_timespec
(
ts
,
ts
->
tv_sec
+
tomono
.
tv_sec
,
ts
->
tv_nsec
+
tomono
.
tv_nsec
);
}
EXPORT_SYMBOL_GPL
(
ktime_get_ts
);
#endif
/* !GENERIC_TIME */
/**
* ktime_get_real - get the real (wall-) time in ktime_t format
*
* returns the time in ktime_t format
*/
ktime_t
ktime_get_real
(
void
)
{
struct
timespec
now
;
getnstimeofday
(
&
now
);
return
timespec_to_ktime
(
now
);
}
EXPORT_SYMBOL_GPL
(
ktime_get_real
);
/**
* getrawmonotonic - Returns the raw monotonic time in a timespec
...
...
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