Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132124
b: refs/heads/master
c: 6db6a5f
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Mar 8, 2009
1 parent 9fc9a11 commit b1b752f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbd88c8e6f5cdb8d4b9af01df825305200240382
refs/heads/master: 6db6a5f3ae2ca6b874b0fd97ae16fdc9b5cdd6cc
16 changes: 9 additions & 7 deletions trunk/arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,19 +594,21 @@ static void __init lguest_init_IRQ(void)
/* Some systems map "vectors" to interrupts weirdly. Lguest has
* a straightforward 1 to 1 mapping, so force that here. */
__get_cpu_var(vector_irq)[vector] = i;
if (vector != SYSCALL_VECTOR) {
set_intr_gate(vector,
interrupt[vector-FIRST_EXTERNAL_VECTOR]);
set_irq_chip_and_handler_name(i, &lguest_irq_controller,
handle_level_irq,
"level");
}
if (vector != SYSCALL_VECTOR)
set_intr_gate(vector, interrupt[i]);
}
/* This call is required to set up for 4k stacks, where we have
* separate stacks for hard and soft interrupts. */
irq_ctx_init(smp_processor_id());
}

void lguest_setup_irq(unsigned int irq)
{
irq_to_desc_alloc_cpu(irq, 0);
set_irq_chip_and_handler_name(irq, &lguest_irq_controller,
handle_level_irq, "level");
}

/*
* Time.
*
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/lguest/lguest_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ static void lg_notify(struct virtqueue *vq)
hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0);
}

/* An extern declaration inside a C file is bad form. Don't do it. */
extern void lguest_setup_irq(unsigned int irq);

/* This routine finds the first virtqueue described in the configuration of
* this device and sets it up.
*
Expand Down Expand Up @@ -266,6 +269,9 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
goto unmap;
}

/* Make sure the interrupt is allocated. */
lguest_setup_irq(lvq->config.irq);

/* Tell the interrupt for this virtqueue to go to the virtio_ring
* interrupt handler. */
/* FIXME: We used to have a flag for the Host to tell us we could use
Expand Down

0 comments on commit b1b752f

Please sign in to comment.