On Wed, 21 Oct 2009, Samuel Thibault wrote:
> Xen patchbot-unstable, le Wed 21 Oct 2009 08:10:15 -0700, a écrit :
> > + unsigned long mfns[n];
> > + for (i = 0; i < n; i++)
> > + mfns[i] = ((unsigned long) offset + (i * PAGE_SIZE)) >>
> > PAGE_SHIFT;
> Mmm, is there a reason for adding (i*PAGE_SIZE) before right-shifting?
> > + return map_frames_ex(mfns, n, 1, 0, 1, DOMID_IO, 0,
> > _PAGE_PRESENT|_PAGE_RW);
> Actually I think the whole could just be
> unsigned long first_mfn = offset >> PAGE_SHIFT;
> return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, 0,
> which avoids the need to prepare a table.
Yeah, you are right.
Both versions are fine for me.
Xen-devel mailing list