Re: [PATCH 09/10] lib/string.c: export non optimized memmove as __default_memmove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25.09.24 15:55, Sascha Hauer wrote:
> When an architecture defines __HAVE_ARCH_MEMMOVE then the generic
> non optimized memmove is not compiled in. It is needed on ARM64
> as a fallback in certain cases though, so make it available as
> __default_memmove just like done with __default_memcpy already.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Reviewed-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

> ---
>  lib/string.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/string.c b/lib/string.c
> index 374f326143..98dd3cffdd 100644
> --- a/lib/string.c
> +++ b/lib/string.c
> @@ -666,7 +666,6 @@ void *mempcpy(void *dest, const void *src, size_t count)
>  }
>  EXPORT_SYMBOL(mempcpy);
>  
> -#ifndef __HAVE_ARCH_MEMMOVE
>  /**
>   * memmove - Copy one area of memory to another
>   * @dest: Where to copy to
> @@ -675,7 +674,7 @@ EXPORT_SYMBOL(mempcpy);
>   *
>   * Unlike memcpy(), memmove() copes with overlapping areas.
>   */
> -void * memmove(void * dest,const void *src,size_t count)
> +void *__default_memmove(void * dest,const void *src,size_t count)
>  {
>  	char *tmp, *s;
>  
> @@ -694,6 +693,13 @@ void * memmove(void * dest,const void *src,size_t count)
>  
>  	return dest;
>  }
> +EXPORT_SYMBOL(__default_memmove);
> +
> +#ifndef __HAVE_ARCH_MEMMOVE
> +void *memmove(void * dest, const void *src, size_t count)
> +	__alias(__default_memmove);
> +void *__memmove(void * dest, const void *src, size_t count)
> +	__alias(__default_memmove);
>  #endif
>  EXPORT_SYMBOL(memmove);
>  
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux