This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / kernel / vserver / cvirt.c
1 /*
2  *  linux/kernel/vserver/cvirt.c
3  *
4  *  Virtual Server: Context Virtualization
5  *
6  *  Copyright (C) 2004  Herbert Pƶtzl
7  *
8  *  V0.01  broken out from limit.c
9  *
10  */
11
12 #include <linux/config.h>
13 #include <linux/vserver/cvirt.h>
14 #include <linux/vserver/context.h>
15 #include <linux/vserver/switch.h>
16 #include <linux/vinline.h>
17
18 #include <asm/errno.h>
19 #include <asm/uaccess.h>
20
21
22 void vx_vsi_uptime(struct timespec *uptime, struct timespec *idle)
23 {
24         struct vx_info *vxi = current->vx_info;
25
26         set_normalized_timespec(uptime,
27                 uptime->tv_sec - vxi->cvirt.bias_tp.tv_sec,
28                 uptime->tv_nsec - vxi->cvirt.bias_tp.tv_nsec);
29         if (!idle)
30                 return;
31         set_normalized_timespec(idle,
32                 idle->tv_sec - vxi->cvirt.bias_idle.tv_sec,
33                 idle->tv_nsec - vxi->cvirt.bias_idle.tv_nsec);
34         return;
35 }
36
37 uint64_t vx_idle_jiffies()
38 {
39         return init_task.utime + init_task.stime;
40 }
41