WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 1/3] minios: add ioremap/iounmap

To: Rolf Neugebauer <rolf.neugebauer@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 1/3] minios: add ioremap/iounmap
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Date: Tue, 24 Feb 2009 01:44:30 +0100
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 23 Feb 2009 16:44:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <499D9F39.1030505@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, Rolf Neugebauer <rolf.neugebauer@xxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
References: <499D9F39.1030505@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Rolf Neugebauer, le Thu 19 Feb 2009 18:04:41 +0000, a écrit :
> + *
> + * Permission is hereby granted, free of charge, to any person 
> obtaining a copy

The lines of the patch got wrapped.

> +    /* create a list of MFNs to map */
> +    mfns = xmalloc_array(unsigned long, num_pages);
> +    for ( i = 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] = mfn;
> +    }
> +    va = (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>/arch_mm.h?

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>