mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	"open list:BAREBOX" <barebox@lists.infradead.org>
Subject: Re: [PATCH 01/10] ARM: Use optimized reads[bwl] and writes[bwl] functions
Date: Wed, 25 Sep 2024 17:45:05 +0200	[thread overview]
Message-ID: <8cd79f34-f13d-4ea0-9cb6-1a71ba622e4a@pengutronix.de> (raw)
In-Reply-To: <20240925-arm-assembly-memmove-v1-1-0d92103658a0@pengutronix.de>

On 25.09.24 15:55, Sascha Hauer wrote:
> The optimized versions are there for ARM32, but since 0d53f3c584a2
> ("arm: use asm-generic/io.h") they were no longer used. Activate
> them again.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

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

> ---
>  arch/arm/include/asm/io.h        | 24 ++++++++++++++++++++++++
>  arch/arm/lib32/io-readsb.S       |  6 +++---
>  arch/arm/lib32/io-readsl.S       |  6 +++---
>  arch/arm/lib32/io-readsw-armv4.S |  6 +++---
>  arch/arm/lib32/io-writesb.S      |  6 +++---
>  arch/arm/lib32/io-writesl.S      |  6 +++---
>  6 files changed, 39 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index 486b142950..9e9b13ad18 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -3,6 +3,30 @@
>  #ifndef __ASM_ARM_IO_H
>  #define __ASM_ARM_IO_H
>  
> +#include <linux/compiler.h>
> +
> +#ifndef CONFIG_CPU_64
> +/*
> + * Generic IO read/write.  These perform native-endian accesses.  Note
> + * that some architectures will want to re-define __raw_{read,write}w.
> + */
> +void __raw_writesb(volatile void __iomem *addr, const void *data, int bytelen);
> +void __raw_writesw(volatile void __iomem *addr, const void *data, int wordlen);
> +void __raw_writesl(volatile void __iomem *addr, const void *data, int longlen);
> +
> +void __raw_readsb(const volatile void __iomem *addr, void *data, int bytelen);
> +void __raw_readsw(const volatile void __iomem *addr, void *data, int wordlen);
> +void __raw_readsl(const volatile void __iomem *addr, void *data, int longlen);
> +
> +#define readsb(p,d,l)		__raw_readsb(p,d,l)
> +#define readsw(p,d,l)		__raw_readsw(p,d,l)
> +#define readsl(p,d,l)		__raw_readsl(p,d,l)
> +
> +#define writesb(p,d,l)		__raw_writesb(p,d,l)
> +#define writesw(p,d,l)		__raw_writesw(p,d,l)
> +#define writesl(p,d,l)		__raw_writesl(p,d,l)
> +#endif
> +
>  #define	IO_SPACE_LIMIT	0
>  
>  #define memcpy_fromio memcpy_fromio
> diff --git a/arch/arm/lib32/io-readsb.S b/arch/arm/lib32/io-readsb.S
> index f853c48021..41f68092c5 100644
> --- a/arch/arm/lib32/io-readsb.S
> +++ b/arch/arm/lib32/io-readsb.S
> @@ -7,7 +7,7 @@
>  #include <linux/linkage.h>
>  #include <asm/assembler.h>
>  
> -.section .text.readsb
> +.section .text.__raw_readsb
>  
>  .Linsb_align:	rsb	ip, ip, #4
>  		cmp	ip, r2
> @@ -22,7 +22,7 @@
>  		subs	r2, r2, ip
>  		bne	.Linsb_aligned
>  
> -ENTRY(readsb)
> +ENTRY(__raw_readsb)
>  		teq	r2, #0		@ do we have to check for the zero len?
>  		moveq	pc, lr
>  		ands	ip, r1, #3
> @@ -119,4 +119,4 @@ ENTRY(readsb)
>  		strgtb	r3, [r1]
>  
>  		ldmfd	sp!, {r4 - r6, pc}
> -ENDPROC(readsb)
> +ENDPROC(__raw_readsb)
> diff --git a/arch/arm/lib32/io-readsl.S b/arch/arm/lib32/io-readsl.S
> index bb8b96ded0..e1855fd636 100644
> --- a/arch/arm/lib32/io-readsl.S
> +++ b/arch/arm/lib32/io-readsl.S
> @@ -7,9 +7,9 @@
>  #include <linux/linkage.h>
>  #include <asm/assembler.h>
>  
> -.section .text.readsl
> +.section .text.__raw_readsl
>  
> -ENTRY(readsl)
> +ENTRY(__raw_readsl)
>  		teq	r2, #0		@ do we have to check for the zero len?
>  		moveq	pc, lr
>  		ands	ip, r1, #3
> @@ -75,4 +75,4 @@ ENTRY(readsl)
>  8:		mov	r3, ip, get_byte_0
>  		strb	r3, [r1, #0]
>  		mov	pc, lr
> -ENDPROC(readsl)
> +ENDPROC(__raw_readsl)
> diff --git a/arch/arm/lib32/io-readsw-armv4.S b/arch/arm/lib32/io-readsw-armv4.S
> index 25f2778860..9fb7fd7576 100644
> --- a/arch/arm/lib32/io-readsw-armv4.S
> +++ b/arch/arm/lib32/io-readsw-armv4.S
> @@ -15,7 +15,7 @@
>  #endif
>  		.endm
>  
> -.section .text.readsw
> +.section .text.__raw_readsw
>  
>  .Linsw_align:	movs	ip, r1, lsl #31
>  		bne	.Linsw_noalign
> @@ -23,7 +23,7 @@
>  		sub	r2, r2, #1
>  		strh	ip, [r1], #2
>  
> -ENTRY(readsw)
> +ENTRY(__raw_readsw)
>  		teq	r2, #0
>  		moveq	pc, lr
>  		tst	r1, #3
> @@ -127,4 +127,4 @@ ENTRY(readsw)
>     _BE_ONLY_(	movne	ip, ip, lsr #24		)
>  		strneb	ip, [r1]
>  		ldmfd	sp!, {r4, pc}
> -ENDPROC(readsw)
> +ENDPROC(__raw_readsw)
> diff --git a/arch/arm/lib32/io-writesb.S b/arch/arm/lib32/io-writesb.S
> index 313839bff6..b6ce85f0d4 100644
> --- a/arch/arm/lib32/io-writesb.S
> +++ b/arch/arm/lib32/io-writesb.S
> @@ -27,7 +27,7 @@
>  #endif
>  		.endm
>  
> -.section .text.writesb
> +.section .text.__raw_writesb
>  
>  .Loutsb_align:	rsb	ip, ip, #4
>  		cmp	ip, r2
> @@ -42,7 +42,7 @@
>  		subs	r2, r2, ip
>  		bne	.Loutsb_aligned
>  
> -ENTRY(writesb)
> +ENTRY(__raw_writesb)
>  		teq	r2, #0		@ do we have to check for the zero len?
>  		moveq	pc, lr
>  		ands	ip, r1, #3
> @@ -90,4 +90,4 @@ ENTRY(writesb)
>  		strgtb	r3, [r0]
>  
>  		ldmfd	sp!, {r4, r5, pc}
> -ENDPROC(writesb)
> +ENDPROC(__raw_writesb)
> diff --git a/arch/arm/lib32/io-writesl.S b/arch/arm/lib32/io-writesl.S
> index d9a29d9153..ed91ae19b7 100644
> --- a/arch/arm/lib32/io-writesl.S
> +++ b/arch/arm/lib32/io-writesl.S
> @@ -7,9 +7,9 @@
>  #include <linux/linkage.h>
>  #include <asm/assembler.h>
>  
> -.section .text.writesl
> +.section .text.__raw_writesl
>  
> -ENTRY(writesl)
> +ENTRY(__raw_writesl)
>  		teq	r2, #0		@ do we have to check for the zero len?
>  		moveq	pc, lr
>  		ands	ip, r1, #3
> @@ -63,4 +63,4 @@ ENTRY(writesl)
>  		str	ip, [r0]
>  		bne	6b
>  		mov	pc, lr
> -ENDPROC(writesl)
> +ENDPROC(__raw_writesl)
> 


-- 
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 |



  reply	other threads:[~2024-09-25 15:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 13:55 [PATCH 00/10] ARM: add assembler optimized memmove Sascha Hauer
2024-09-25 13:55 ` [PATCH 01/10] ARM: Use optimized reads[bwl] and writes[bwl] functions Sascha Hauer
2024-09-25 15:45   ` Ahmad Fatoum [this message]
2024-09-25 13:55 ` [PATCH 02/10] ARM: rename logical shift macros push pull into lspush lspull Sascha Hauer
2024-09-25 15:52   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 03/10] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ Sascha Hauer
2024-09-25 15:56   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 04/10] ARM: update lib1funcs.S from Linux Sascha Hauer
2024-09-25 16:02   ` Ahmad Fatoum
2024-09-26  8:22     ` Sascha Hauer
2024-09-26 11:09       ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 05/10] ARM: update findbit.S " Sascha Hauer
2024-09-25 16:03   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 06/10] ARM: update io-* " Sascha Hauer
2024-09-25 16:04   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 07/10] ARM: always assume the unified syntax for assembly code Sascha Hauer
2024-09-25 16:09   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 08/10] ARM: update memcpy.S and memset.S from Linux Sascha Hauer
2024-09-26  5:51   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 09/10] lib/string.c: export non optimized memmove as __default_memmove Sascha Hauer
2024-09-25 16:10   ` Ahmad Fatoum
2024-09-25 13:55 ` [PATCH 10/10] ARM: add optimized memmove Sascha Hauer
2024-09-26  5:48   ` Ahmad Fatoum
2024-09-26 11:12     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8cd79f34-f13d-4ea0-9cb6-1a71ba622e4a@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox