]> asedeno.scripts.mit.edu Git - linux.git/blob - arch/powerpc/include/asm/cputime.h
powerpc, sched/cputime: Remove unused cputime definitions
[linux.git] / arch / powerpc / include / asm / cputime.h
1 /*
2  * Definitions for measuring cputime on powerpc machines.
3  *
4  * Copyright (C) 2006 Paul Mackerras, IBM Corp.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version
9  * 2 of the License, or (at your option) any later version.
10  *
11  * If we have CONFIG_VIRT_CPU_ACCOUNTING_NATIVE, we measure cpu time in
12  * the same units as the timebase.  Otherwise we measure cpu time
13  * in jiffies using the generic definitions.
14  */
15
16 #ifndef __POWERPC_CPUTIME_H
17 #define __POWERPC_CPUTIME_H
18
19 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
20 #include <asm-generic/cputime.h>
21 #else
22
23 #include <linux/types.h>
24 #include <linux/time.h>
25 #include <asm/div64.h>
26 #include <asm/time.h>
27 #include <asm/param.h>
28 #include <asm/cpu_has_feature.h>
29
30 typedef u64 __nocast cputime_t;
31 typedef u64 __nocast cputime64_t;
32
33 #define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new)
34
35 #ifdef __KERNEL__
36 /*
37  * Convert cputime <-> microseconds
38  */
39 extern u64 __cputime_usec_factor;
40
41 static inline unsigned long cputime_to_usecs(const cputime_t ct)
42 {
43         return mulhdu((__force u64) ct, __cputime_usec_factor);
44 }
45
46 /*
47  * PPC64 uses PACA which is task independent for storing accounting data while
48  * PPC32 uses struct thread_info, therefore at task switch the accounting data
49  * has to be populated in the new task
50  */
51 #ifdef CONFIG_PPC64
52 static inline void arch_vtime_task_switch(struct task_struct *tsk) { }
53 #else
54 void arch_vtime_task_switch(struct task_struct *tsk);
55 #endif
56
57 #endif /* __KERNEL__ */
58 #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
59 #endif /* __POWERPC_CPUTIME_H */