Linux Kernel helper functions - ioremap family

ioremap - map bus memory into CPU space @address: bus address of the memory @size: size of the resource to map

ioremap performs a platform specific sequence of operations to make bus memory CPU accessible via the readb/readw/readl/writeb/writew/writel functions and the other mmio helpers. The returned address is not guaranteed to be usable directly as a virtual address.

PS3 Note: The PS3 Linux Kernel does in fact use the returned address directly as a virtual address, so there appears no need to limit oneself to the read*/write* functions as suggested here.

There are a few variations of it:

function declaration description
ioremap
void __iomem *ioremap(phys_addr_t address, 
                      unsigned long size); 
is the standard one and provides non-cacheable guarded mappings and can be hooked by the platform via ppc_md
ioremap_flags
void __iomem *ioremap_flags(phys_addr_t address, 
                            unsigned long size,
		            unsigned long flags); 
allows to specify the page flags as an argument and can also be hooked by the platform via ppc_md
ioremap_nocache
 #define ioremap_nocache(addr, size)	ioremap((addr), (size)) 
is identical to ioremap
iounmap
 void iounmap(volatile void __iomem *addr); 
undoes such a mapping and can be hooked

It would be very useful to work out how these functions work, as they must call some operation in the hypervisor to map the memory, and if so that may give a way to map arbitrary memory on the otherside of the hypervisor (unlikely but possible).

 
ps3/kernel_call/ioremap.txt · Last modified: 2008/05/15 00:07
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki