diff options
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 566257d1dc10..13dd64fe143d 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1018,21 +1018,6 @@ unsigned long get_next_timer_interrupt(unsigned long now) | |||
1018 | } | 1018 | } |
1019 | #endif | 1019 | #endif |
1020 | 1020 | ||
1021 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
1022 | void account_process_tick(struct task_struct *p, int user_tick) | ||
1023 | { | ||
1024 | cputime_t one_jiffy = jiffies_to_cputime(1); | ||
1025 | |||
1026 | if (user_tick) { | ||
1027 | account_user_time(p, one_jiffy); | ||
1028 | account_user_time_scaled(p, cputime_to_scaled(one_jiffy)); | ||
1029 | } else { | ||
1030 | account_system_time(p, HARDIRQ_OFFSET, one_jiffy); | ||
1031 | account_system_time_scaled(p, cputime_to_scaled(one_jiffy)); | ||
1032 | } | ||
1033 | } | ||
1034 | #endif | ||
1035 | |||
1036 | /* | 1021 | /* |
1037 | * Called from the timer interrupt handler to charge one tick to the current | 1022 | * Called from the timer interrupt handler to charge one tick to the current |
1038 | * process. user_tick is 1 if the tick is user time, 0 for system. | 1023 | * process. user_tick is 1 if the tick is user time, 0 for system. |
@@ -1144,7 +1129,7 @@ void do_timer(unsigned long ticks) | |||
1144 | * For backwards compatibility? This can be done in libc so Alpha | 1129 | * For backwards compatibility? This can be done in libc so Alpha |
1145 | * and all newer ports shouldn't need it. | 1130 | * and all newer ports shouldn't need it. |
1146 | */ | 1131 | */ |
1147 | asmlinkage unsigned long sys_alarm(unsigned int seconds) | 1132 | SYSCALL_DEFINE1(alarm, unsigned int, seconds) |
1148 | { | 1133 | { |
1149 | return alarm_setitimer(seconds); | 1134 | return alarm_setitimer(seconds); |
1150 | } | 1135 | } |
@@ -1167,7 +1152,7 @@ asmlinkage unsigned long sys_alarm(unsigned int seconds) | |||
1167 | * | 1152 | * |
1168 | * This is SMP safe as current->tgid does not change. | 1153 | * This is SMP safe as current->tgid does not change. |
1169 | */ | 1154 | */ |
1170 | asmlinkage long sys_getpid(void) | 1155 | SYSCALL_DEFINE0(getpid) |
1171 | { | 1156 | { |
1172 | return task_tgid_vnr(current); | 1157 | return task_tgid_vnr(current); |
1173 | } | 1158 | } |
@@ -1178,7 +1163,7 @@ asmlinkage long sys_getpid(void) | |||
1178 | * value of ->real_parent under rcu_read_lock(), see | 1163 | * value of ->real_parent under rcu_read_lock(), see |
1179 | * release_task()->call_rcu(delayed_put_task_struct). | 1164 | * release_task()->call_rcu(delayed_put_task_struct). |
1180 | */ | 1165 | */ |
1181 | asmlinkage long sys_getppid(void) | 1166 | SYSCALL_DEFINE0(getppid) |
1182 | { | 1167 | { |
1183 | int pid; | 1168 | int pid; |
1184 | 1169 | ||
@@ -1189,25 +1174,25 @@ asmlinkage long sys_getppid(void) | |||
1189 | return pid; | 1174 | return pid; |
1190 | } | 1175 | } |
1191 | 1176 | ||
1192 | asmlinkage long sys_getuid(void) | 1177 | SYSCALL_DEFINE0(getuid) |
1193 | { | 1178 | { |
1194 | /* Only we change this so SMP safe */ | 1179 | /* Only we change this so SMP safe */ |
1195 | return current_uid(); | 1180 | return current_uid(); |
1196 | } | 1181 | } |
1197 | 1182 | ||
1198 | asmlinkage long sys_geteuid(void) | 1183 | SYSCALL_DEFINE0(geteuid) |
1199 | { | 1184 | { |
1200 | /* Only we change this so SMP safe */ | 1185 | /* Only we change this so SMP safe */ |
1201 | return current_euid(); | 1186 | return current_euid(); |
1202 | } | 1187 | } |
1203 | 1188 | ||
1204 | asmlinkage long sys_getgid(void) | 1189 | SYSCALL_DEFINE0(getgid) |
1205 | { | 1190 | { |
1206 | /* Only we change this so SMP safe */ | 1191 | /* Only we change this so SMP safe */ |
1207 | return current_gid(); | 1192 | return current_gid(); |
1208 | } | 1193 | } |
1209 | 1194 | ||
1210 | asmlinkage long sys_getegid(void) | 1195 | SYSCALL_DEFINE0(getegid) |
1211 | { | 1196 | { |
1212 | /* Only we change this so SMP safe */ | 1197 | /* Only we change this so SMP safe */ |
1213 | return current_egid(); | 1198 | return current_egid(); |
@@ -1323,7 +1308,7 @@ signed long __sched schedule_timeout_uninterruptible(signed long timeout) | |||
1323 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); | 1308 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); |
1324 | 1309 | ||
1325 | /* Thread ID - the internal kernel "pid" */ | 1310 | /* Thread ID - the internal kernel "pid" */ |
1326 | asmlinkage long sys_gettid(void) | 1311 | SYSCALL_DEFINE0(gettid) |
1327 | { | 1312 | { |
1328 | return task_pid_vnr(current); | 1313 | return task_pid_vnr(current); |
1329 | } | 1314 | } |
@@ -1415,7 +1400,7 @@ out: | |||
1415 | return 0; | 1400 | return 0; |
1416 | } | 1401 | } |
1417 | 1402 | ||
1418 | asmlinkage long sys_sysinfo(struct sysinfo __user *info) | 1403 | SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info) |
1419 | { | 1404 | { |
1420 | struct sysinfo val; | 1405 | struct sysinfo val; |
1421 | 1406 | ||