On 07/07/2017 12:26 PM, Thomas Huth wrote: > The upcoming netboot code will use the libc from SLOF. To be able > to still use s390-ccw.h there, the libc related functions in this > header have to be moved to a different location. > And while we're at it, remove the duplicate memcpy() function from > sclp.c. > > Signed-off-by: Thomas Huth <th...@redhat.com>
one suggestion below, but Reviewed-by: Christian Borntraeger <borntrae...@de.ibm.com> for change and no change [...] > +static inline void *memcpy(void *s1, const void *s2, size_t n) > +{ > + uint8_t *p1 = s1; > + const uint8_t *p2 = s2; > + > + while (n--) { > + p1[n] = p2[n]; > + } > + return s1; > +} Not that it matters, and no idea if moving forward like in the for loop below might allow gcc to generate better code, but a for loop like below will be the same direction as the MVC instruction. Can you double check if this generates better code? > -static void _memcpy(char *dest, const char *src, int len) > -{ > - int i; > - for (i = 0; i < len; i++) > - dest[i] = src[i]; > -} > -