This source file includes following definitions.
- cputime_to_usecs
- arch_vtime_task_switch
- arch_vtime_task_switch
1
2
3
4
5
6
7
8
9
10
11
12 #ifndef __POWERPC_CPUTIME_H
13 #define __POWERPC_CPUTIME_H
14
15 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
16
17 #include <linux/types.h>
18 #include <linux/time.h>
19 #include <asm/div64.h>
20 #include <asm/time.h>
21 #include <asm/param.h>
22
23 typedef u64 __nocast cputime_t;
24 typedef u64 __nocast cputime64_t;
25
26 #define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new)
27
28 #ifdef __KERNEL__
29
30
31
32 extern u64 __cputime_usec_factor;
33
34 static inline unsigned long cputime_to_usecs(const cputime_t ct)
35 {
36 return mulhdu((__force u64) ct, __cputime_usec_factor);
37 }
38
39
40
41
42
43
44 #ifdef CONFIG_PPC64
45 #define get_accounting(tsk) (&get_paca()->accounting)
46 static inline void arch_vtime_task_switch(struct task_struct *tsk) { }
47 #else
48 #define get_accounting(tsk) (&task_thread_info(tsk)->accounting)
49
50
51
52
53
54 static inline void arch_vtime_task_switch(struct task_struct *prev)
55 {
56 struct cpu_accounting_data *acct = get_accounting(current);
57 struct cpu_accounting_data *acct0 = get_accounting(prev);
58
59 acct->starttime = acct0->starttime;
60 }
61 #endif
62
63 #endif
64 #endif
65 #endif