[PATCH v3 02/30] ARM: provide runtime hook for ioremap/iounmap

Nicolas Pitre nico at fluxnic.net
Mon Mar 5 16:11:56 EST 2012


On Mon, 5 Mar 2012, Arnd Bergmann wrote:

> On Monday 05 March 2012, Nicolas Pitre wrote:
> > Given that the majority of existing platforms don't need the 
> > indirection, should we make this indirection conditional on 
> > CONFIG_NEED_IOREMAP_HOOK and let those who need it select it?  Or maybe 
> > this isn't performance critical and we just don't care?  In any case I'd 
> > like to see such reasoning captured in the commit log.
> 
> It's certainly not performance critical, but there may be some space overhead
> in the .text section of the kernel that we could avoid by adding another
> indirection.

Of course the size issue can be mitigated significantly by replacing:

extern void __iomem * (*arch_ioremap)(unsigned long, size_t, unsigned int);
extern void (*arch_iounmap)(volatile void __iomem *);

#define __arch_ioremap                 arch_ioremap
#define __arch_iounmap                 arch_iounmap

by:

extern void __iomem * (*arch_ioremap)(unsigned long, size_t, unsigned int);
extern void (*arch_iounmap)(volatile void __iomem *);

extern void __iomem * __arch_ioremap(unsigned long, size_t, unsigned int);
extern void __arch_iounmap(volatile void __iomem *);

and out of line:

void __iomem *__arch_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
{
	return arch_ioremap(phys_addr, size, mtype);
}

void __arch_iounmap(volatile void __iomem *io_addr)
{
	arch_iounmap(io_addr);
}


Nicolas



More information about the linux-arm-kernel mailing list