From: Samuel Thibault Subject: Re: [PATCH 1/3] minios: add ioremap/iounmap Date: Tue, 24 Feb 2009 01:44:30 +0100 Message-ID: <20090224004430.GV5059@const.famille.thibault.fr> References: <499D9F39.1030505@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <499D9F39.1030505@netronome.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Rolf Neugebauer Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org Rolf Neugebauer, le Thu 19 Feb 2009 18:04:41 +0000, a =E9crit : > + * > + * Permission is hereby granted, free of charge, to any person=20 > obtaining a copy The lines of the patch got wrapped. > + /* create a list of MFNs to map */ > + mfns =3D xmalloc_array(unsigned long, num_pages); > + for ( i =3D 0; i < num_pages; i++, mfn++ ) > + { > + if ( mfn_is_ram(mfn) ) > + { > + printk("ioremap: mfn 0x%ulx is RAM\n", mfn); > + goto mfn_invalid; > + } > + > + mfns[i] =3D mfn; > + } > + va =3D (unsigned long)map_frames_ex(mfns, num_pages, 1, 0, 1, > + DOMID_IO, 0, prot); Instead of allocating an array, why not using the incr parameter of map_frames_ex? > +/* Maybe these should be defined in the respective arch_mm.h */ > +#if defined(__i386__) || defined(__x86_64__) > +#define IO_PROT (L1_PROT) > +#define IO_PROT_NOCACHE (L1_PROT | _PAGE_PCD) > +#elif defined(__ia64__) > +/* XXX IA64 needs to define these as appropriate. */ > +#define IO_PROT 0 > +#define IO_PROT_NOCACHE 0 > +#else > +#error "Unsupported architecture" > +#endif Shouldn't these go to include//arch_mm.h? Samuel