diff options
| author | Tony Luck <tony.luck@intel.com> | 2005-05-17 18:53:14 -0400 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2005-05-17 18:53:14 -0400 |
| commit | 325a479c4c110db278ef3361460a48c4093252cc (patch) | |
| tree | bcfbf4d0647d9442045639a5c19da59d55190e81 /arch/s390/kernel/vtime.c | |
| parent | ebcc80c1b6629a445f7471cc1ddb48faf8a84e70 (diff) | |
| parent | 7f9eaedf894dbaa08c157832e9a6c9c03ffed1ed (diff) | |
Merge with temp tree to get David's gdb inferior calls patch
Diffstat (limited to 'arch/s390/kernel/vtime.c')
| -rw-r--r-- | arch/s390/kernel/vtime.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index bb6cf02418a2..fa0726507b3d 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
| @@ -122,12 +122,17 @@ static void start_cpu_timer(void) | |||
| 122 | struct vtimer_queue *vt_list; | 122 | struct vtimer_queue *vt_list; |
| 123 | 123 | ||
| 124 | vt_list = &per_cpu(virt_cpu_timer, smp_processor_id()); | 124 | vt_list = &per_cpu(virt_cpu_timer, smp_processor_id()); |
| 125 | set_vtimer(vt_list->idle); | 125 | |
| 126 | /* CPU timer interrupt is pending, don't reprogramm it */ | ||
| 127 | if (vt_list->idle & 1LL<<63) | ||
| 128 | return; | ||
| 129 | |||
| 130 | if (!list_empty(&vt_list->list)) | ||
| 131 | set_vtimer(vt_list->idle); | ||
| 126 | } | 132 | } |
| 127 | 133 | ||
| 128 | static void stop_cpu_timer(void) | 134 | static void stop_cpu_timer(void) |
| 129 | { | 135 | { |
| 130 | __u64 done; | ||
| 131 | struct vtimer_queue *vt_list; | 136 | struct vtimer_queue *vt_list; |
| 132 | 137 | ||
| 133 | vt_list = &per_cpu(virt_cpu_timer, smp_processor_id()); | 138 | vt_list = &per_cpu(virt_cpu_timer, smp_processor_id()); |
| @@ -138,21 +143,17 @@ static void stop_cpu_timer(void) | |||
| 138 | goto fire; | 143 | goto fire; |
| 139 | } | 144 | } |
| 140 | 145 | ||
| 141 | /* store progress */ | 146 | /* store the actual expire value */ |
| 142 | asm volatile ("STPT %0" : "=m" (done)); | 147 | asm volatile ("STPT %0" : "=m" (vt_list->idle)); |
| 143 | 148 | ||
| 144 | /* | 149 | /* |
| 145 | * If done is negative we do not stop the CPU timer | 150 | * If the CPU timer is negative we don't reprogramm |
| 146 | * because we will get instantly an interrupt that | 151 | * it because we will get instantly an interrupt. |
| 147 | * will start the CPU timer again. | ||
| 148 | */ | 152 | */ |
| 149 | if (done & 1LL<<63) | 153 | if (vt_list->idle & 1LL<<63) |
| 150 | return; | 154 | return; |
| 151 | else | ||
| 152 | vt_list->offset += vt_list->to_expire - done; | ||
| 153 | 155 | ||
| 154 | /* save the actual expire value */ | 156 | vt_list->offset += vt_list->to_expire - vt_list->idle; |
| 155 | vt_list->idle = done; | ||
| 156 | 157 | ||
| 157 | /* | 158 | /* |
| 158 | * We cannot halt the CPU timer, we just write a value that | 159 | * We cannot halt the CPU timer, we just write a value that |
