[PATCH/RFC] Hookable IO operations

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Nov 4 09:56:29 EST 2006


]
> Actually I meant all of the I/O pointers, not just these three. When
> you were describing your idea to me, I was thinking of something like
> 
> struct ppc_io {
> 	void (*writeb)(u8 val);
> 	void (*writew)(u16 val);
> 	void (*writel)(u32 val);
> 	void (*writeq)(u64 val);
> 	...
> 	void (*memset_io)(volatile void __iomem *addr, int c,
> 				 unsigned long n);
> 	void (*__memcpy_fromio)(void *dest,
> 			const volatile void __iomem *src, unsigned long n);
> 	void (*__memcpy_toio)(volatile void __iomem *dest,
> 			const void *src, unsigned long n);
> } *ppc_io;
> 
> Did you never consider this, or did you make your mind up in the
> process?

I considered this and decided against it while doing the macro since I
could get the hooks auto-generated easier as globals, but I can still
change it, it's not that much bloat and might indeed look nicer.

> Is your current code more efficient?

I don't think there is a difference is ppc_io is a global struct rather
than a pointer, like ppc_md.

Ben.





More information about the Linuxppc-dev mailing list