aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/interrupts_and_traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/lguest/interrupts_and_traps.c')
-rw-r--r--drivers/lguest/interrupts_and_traps.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index 5a10754b4790..0e9067b0d507 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -213,6 +213,20 @@ void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
213 if (!more) 213 if (!more)
214 put_user(0, &cpu->lg->lguest_data->irq_pending); 214 put_user(0, &cpu->lg->lguest_data->irq_pending);
215} 215}
216
217/* And this is the routine when we want to set an interrupt for the Guest. */
218void set_interrupt(struct lg_cpu *cpu, unsigned int irq)
219{
220 /* Next time the Guest runs, the core code will see if it can deliver
221 * this interrupt. */
222 set_bit(irq, cpu->irqs_pending);
223
224 /* Make sure it sees it; it might be asleep (eg. halted), or
225 * running the Guest right now, in which case kick_process()
226 * will knock it out. */
227 if (!wake_up_process(cpu->tsk))
228 kick_process(cpu->tsk);
229}
216/*:*/ 230/*:*/
217 231
218/* Linux uses trap 128 for system calls. Plan9 uses 64, and Ron Minnich sent 232/* Linux uses trap 128 for system calls. Plan9 uses 64, and Ron Minnich sent
@@ -528,10 +542,7 @@ static enum hrtimer_restart clockdev_fn(struct hrtimer *timer)
528 struct lg_cpu *cpu = container_of(timer, struct lg_cpu, hrt); 542 struct lg_cpu *cpu = container_of(timer, struct lg_cpu, hrt);
529 543
530 /* Remember the first interrupt is the timer interrupt. */ 544 /* Remember the first interrupt is the timer interrupt. */
531 set_bit(0, cpu->irqs_pending); 545 set_interrupt(cpu, 0);
532 /* Guest may be stopped or running on another CPU. */
533 if (!wake_up_process(cpu->tsk))
534 kick_process(cpu->tsk);
535 return HRTIMER_NORESTART; 546 return HRTIMER_NORESTART;
536} 547}
537 548