[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 1/8] pc-bios/s390-ccw: Move libc function
From: |
Christian Borntraeger |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 1/8] pc-bios/s390-ccw: Move libc functions to separate header |
Date: |
Fri, 7 Jul 2017 15:46:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
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 <address@hidden>
one suggestion below, but
Reviewed-by: Christian Borntraeger <address@hidden>
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];
> -}
> -