Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157444
b: refs/heads/master
c: 05e7ff7
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Sep 11, 2009
1 parent b588184 commit 2414d32
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca99dab01dd63dcc413395bd3e75b0be152dfefc
refs/heads/master: 05e7ff7da78bad3edc1290ed86b4a37da72ced62
14 changes: 14 additions & 0 deletions trunk/arch/s390/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,18 @@ unsigned long long monotonic_clock(void);

extern u64 sched_clock_base_cc;

/**
* get_clock_monotonic - returns current time in clock rate units
*
* The caller must ensure that preemption is disabled.
* The clock and sched_clock_base get changed via stop_machine.
* Therefore preemption must be disabled when calling this
* function, otherwise the returned value is not guaranteed to
* be monotonic.
*/
static inline unsigned long long get_clock_monotonic(void)
{
return get_clock_xt() - sched_clock_base_cc;
}

#endif
3 changes: 2 additions & 1 deletion trunk/arch/s390/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#define TICK_SIZE tick

u64 sched_clock_base_cc = -1; /* Force to data section. */
EXPORT_SYMBOL_GPL(sched_clock_base_cc);

static DEFINE_PER_CPU(struct clock_event_device, comparators);

Expand All @@ -68,7 +69,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);
*/
unsigned long long notrace sched_clock(void)
{
return ((get_clock_xt() - sched_clock_base_cc) * 125) >> 9;
return (get_clock_monotonic() * 125) >> 9;
}

/*
Expand Down

0 comments on commit 2414d32

Please sign in to comment.