diff options
83 files changed, 1105 insertions, 507 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 14db93e4c8a8..dbc1760f418b 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
| @@ -1139,6 +1139,7 @@ struct rusage32 { | |||
| 1139 | SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) | 1139 | SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) |
| 1140 | { | 1140 | { |
| 1141 | struct rusage32 r; | 1141 | struct rusage32 r; |
| 1142 | cputime_t utime, stime; | ||
| 1142 | 1143 | ||
| 1143 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN) | 1144 | if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN) |
| 1144 | return -EINVAL; | 1145 | return -EINVAL; |
| @@ -1146,8 +1147,9 @@ SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) | |||
| 1146 | memset(&r, 0, sizeof(r)); | 1147 | memset(&r, 0, sizeof(r)); |
| 1147 | switch (who) { | 1148 | switch (who) { |
| 1148 | case RUSAGE_SELF: | 1149 | case RUSAGE_SELF: |
| 1149 | jiffies_to_timeval32(current->utime, &r.ru_utime); | 1150 | task_cputime(current, &utime, &stime); |
| 1150 | jiffies_to_timeval32(current->stime, &r.ru_stime); | 1151 | jiffies_to_timeval32(utime, &r.ru_utime); |
| 1152 | jiffies_to_timeval32(stime, &r.ru_stime); | ||
| 1151 | r.ru_minflt = current->min_flt; | 1153 | r.ru_minflt = current->min_flt; |
| 1152 | r.ru_majflt = current->maj_flt; | 1154 | r.ru_majflt = current->maj_flt; |
| 1153 | break; | 1155 | break; |
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h index 7fcf7f08ab06..e2d3f5baf265 100644 --- a/arch/ia64/include/asm/cputime.h +++ b/arch/ia64/include/asm/cputime.h | |||
| @@ -11,99 +11,19 @@ | |||
| 11 | * as published by the Free Software Foundation; either version | 11 | * as published by the Free Software Foundation; either version |
| 12 | * 2 of the License, or (at your option) any later version. | 12 | * 2 of the License, or (at your option) any later version. |
| 13 | * | 13 | * |
| 14 | * If we have CONFIG_VIRT_CPU_ACCOUNTING, we measure cpu time in nsec. | 14 | * If we have CONFIG_VIRT_CPU_ACCOUNTING_NATIVE, we measure cpu time in nsec. |
| 15 | * Otherwise we measure cpu time in jiffies using the generic definitions. | 15 | * Otherwise we measure cpu time in jiffies using the generic definitions. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #ifndef __IA64_CPUTIME_H | 18 | #ifndef __IA64_CPUTIME_H |
| 19 | #define __IA64_CPUTIME_H | 19 | #define __IA64_CPUTIME_H |
| 20 | 20 | ||
| 21 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 21 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
| 22 | #include <asm-generic/cputime.h> | 22 | # include <asm-generic/cputime.h> |
| 23 | #else | 23 | #else |
| 24 | 24 | # include <asm/processor.h> | |
| 25 | #include <linux/time.h> | 25 | # include <asm-generic/cputime_nsecs.h> |
| 26 | #include <linux/jiffies.h> | ||
| 27 | #include <asm/processor.h> | ||
| 28 | |||
| 29 | typedef u64 __nocast cputime_t; | ||
| 30 | typedef u64 __nocast cputime64_t; | ||
| 31 | |||
| 32 | #define cputime_one_jiffy jiffies_to_cputime(1) | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Convert cputime <-> jiffies (HZ) | ||
| 36 | */ | ||
| 37 | #define cputime_to_jiffies(__ct) \ | ||
| 38 | ((__force u64)(__ct) / (NSEC_PER_SEC / HZ)) | ||
| 39 | #define jiffies_to_cputime(__jif) \ | ||
| 40 | (__force cputime_t)((__jif) * (NSEC_PER_SEC / HZ)) | ||
| 41 | #define cputime64_to_jiffies64(__ct) \ | ||
| 42 | ((__force u64)(__ct) / (NSEC_PER_SEC / HZ)) | ||
| 43 | #define jiffies64_to_cputime64(__jif) \ | ||
