Messages in this thread | | | Date | Tue, 30 May 2006 18:36:47 -0700 | From | "H. Peter Anvin" <> | Subject | Re: [patch 2.6.17-rc5 1/2] i386 memcpy: use as few moves as possible for I/O |
| |
One concern: this is not the standard return value for memcpy(). It either needs a comment to that effect (stating it returns a pointer to the end of the area), or just make it return void.
Also, the formatting looks nonstandard.
> > /* > + * Do memcpy with as few moves as possible (for transfers to/from IO space.) > + */ > +static inline void * __minimal_memcpy(void * to, const void * from, size_t n) > +{ > +int d0, d1, d2; > +__asm__ __volatile__( > + "rep ; movsl\n\t" > + "testb $2,%b4\n\t" > + "jz 1f\n\t" > + "movsw\n" > + "1:\n\t" > + "testb $1,%b4\n\t" > + "jz 2f\n\t" > + "movsb\n" > + "2:" > + : "=&c" (d0), "=&D" (d1), "=&S" (d2) > + :"0" (n/4), "q" (n), "1" ((long) to), "2" ((long) from) > + : "memory"); > +return to; > +}
-hpa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |