Skip to content

Commit fbad1ea

Browse files
torbenh33KAGA-KOKO
authored andcommitted
time: Move get_jiffies_64 to kernel/time/jiffies.c
Move the jiffies access functions to the jiffies clocksource code. [ tglx: Add missing include ] Signed-off-by: Torben Hohn <torbenh@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: johnstul@us.ibm.com Cc: yong.zhang0@gmail.com Cc: hch@infradead.org LKML-Reference: <20110127145900.23248.73352.stgit@localhost> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 871cf1e commit fbad1ea

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎kernel/time.c‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -674,23 +674,6 @@ unsigned long nsecs_to_jiffies(u64 n)
674674
#endif
675675
}
676676

677-
#if (BITS_PER_LONG < 64)
678-
u64 get_jiffies_64(void)
679-
{
680-
unsigned long seq;
681-
u64 ret;
682-
683-
do {
684-
seq = read_seqbegin(&xtime_lock);
685-
ret = jiffies_64;
686-
} while (read_seqretry(&xtime_lock, seq));
687-
return ret;
688-
}
689-
EXPORT_SYMBOL(get_jiffies_64);
690-
#endif
691-
692-
EXPORT_SYMBOL(jiffies);
693-
694677
/*
695678
* Add two timespec values and do a safety check for overflow.
696679
* It's assumed that both values are valid (>= 0)

‎kernel/time/jiffies.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
************************************************************************/
2323
#include <linux/clocksource.h>
2424
#include <linux/jiffies.h>
25+
#include <linux/module.h>
2526
#include <linux/init.h>
2627

2728
/* The Jiffies based clocksource is the lowest common
@@ -64,6 +65,23 @@ struct clocksource clocksource_jiffies = {
6465
.shift = JIFFIES_SHIFT,
6566
};
6667

68+
#if (BITS_PER_LONG < 64)
69+
u64 get_jiffies_64(void)
70+
{
71+
unsigned long seq;
72+
u64 ret;
73+
74+
do {
75+
seq = read_seqbegin(&xtime_lock);
76+
ret = jiffies_64;
77+
} while (read_seqretry(&xtime_lock, seq));
78+
return ret;
79+
}
80+
EXPORT_SYMBOL(get_jiffies_64);
81+
#endif
82+
83+
EXPORT_SYMBOL(jiffies);
84+
6785
static int __init init_jiffies_clocksource(void)
6886
{
6987
return clocksource_register(&clocksource_jiffies);

0 commit comments

Comments
 (0)