[Lguest] [patch] lguest_dma.c
Steven Rostedt
rostedt at goodmis.org
Fri Aug 10 01:19:19 EST 2007
On Thu, 2007-08-09 at 16:54 +0200, Jes Sorensen wrote:
> Hi,
>
> On top of Steven's initial patches, I'd like to suggest this one which
> introduces lguest_dma.c which are the DMA related functions pulled in
> from lguest.c - it should be the non architecture specific stuff which
> I'd like to share.
>
> The only bit I had to mingle was LGUEST_IRQ_SHIFT since ia64 has more
> than 256 irq sources.
>
> Any objections to this approach? I think it should be very easy to fit
> this for x86_64 as well?
>
Sounds good to me. I have one minor thing (below).
> Cheers,
> Jes
>
>
> plain text document attachment (lguest-dma.diff)
> +int lguest_bind_dma(unsigned long key, struct lguest_dma *dmas,
> + unsigned int num, u8 irq)
> +{
> + /* This is the only hypercall which actually wants 5 arguments, and we
> + * only support 4. Fortunately the interrupt number is always less
> + * than 256, so we can pack it with the number of dmas in the final
> + * argument. */
> + if (!hcall(LHCALL_BIND_DMA, key, __pa(dmas),
> + (num << LGUEST_IRQ_SHIFT) | irq))
> + return -ENOMEM;
> + return 0;
> +}
> +
I guess we should have num as an unsigned long.
-- Steve
More information about the Lguest
mailing list