[POWERPC] convert string i/o operations to C

Michael Ellerman michael at ellerman.id.au
Wed Sep 20 14:38:27 EST 2006


On Wed, 2006-09-20 at 13:35 +1000, Stephen Rothwell wrote:
> This produces essentially the same code and will make the iSeries i/o
> consolidation easier.

A bit more white space would be nice :D, eg:

> +void _insb(volatile u8 __iomem *port, void *buf, long count)
> +{
> +	u8 *tbuf = buf;
> +	u8 tmp;
> +
> +	if (unlikely(count <= 0))
> +		return;

> +	asm volatile("sync");

> +	do {
> +		tmp = *port;
> +		asm volatile("eieio");
> +		*tbuf++ = tmp;
> +	} while (--count != 0);

> +	asm volatile("twi 0,%0,0; isync" : : "r" (tmp));
> +}
> +EXPORT_SYMBOL(_insb);

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060920/3ac9d943/attachment.pgp>


More information about the Linuxppc-dev mailing list