mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] riscv: use generic bitsperlong.h
@ 2019-08-07 16:30 Masahiro Yamada
  2019-08-07 16:30 ` [PATCH 2/2] mips: " Masahiro Yamada
  2019-08-12  7:02 ` [PATCH 1/2] riscv: " Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-08-07 16:30 UTC (permalink / raw)
  To: barebox

Linux highly depends on the fact that the 'long' and the pointer
have the same width, and so does barebox.

So, we can always use include/asm-generic/bitsperlong.h, which
determines BITS_PER_LONG depending on CONFIG_64BIT.

This is what Linux does (at least in the kernel-space), and barebox
can follow it.

Currently, barebox only supports 32-bit riscv, but this should work
when it supports 64-bit by adding CONFIG_64BIT to arch/riscv/Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 arch/riscv/include/asm/bitsperlong.h | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/riscv/include/asm/bitsperlong.h b/arch/riscv/include/asm/bitsperlong.h
index 4641e7e485..6dc0bb0c13 100644
--- a/arch/riscv/include/asm/bitsperlong.h
+++ b/arch/riscv/include/asm/bitsperlong.h
@@ -1,10 +1 @@
-#ifndef __ASM_BITSPERLONG_H
-#define __ASM_BITSPERLONG_H
-
-#ifdef __riscv64
-#define BITS_PER_LONG 64
-#else
-#define BITS_PER_LONG 32
-#endif
-
-#endif /* __ASM_BITSPERLONG_H */
+#include <asm-generic/bitsperlong.h>
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] mips: use generic bitsperlong.h
  2019-08-07 16:30 [PATCH 1/2] riscv: use generic bitsperlong.h Masahiro Yamada
@ 2019-08-07 16:30 ` Masahiro Yamada
  2019-08-12  7:02 ` [PATCH 1/2] riscv: " Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-08-07 16:30 UTC (permalink / raw)
  To: barebox

Linux highly depends on the fact that the 'long' and the pointer
have the same width, and so does barebox.

So, we can always use include/asm-generic/bitsperlong.h, which
determines BITS_PER_LONG depending on CONFIG_64BIT.

This is what Linux does (at least in the kernel-space), and barebox
can follow it.

It is true that MIPS Linux references _MIPS_SZLONG
(arch/mips/include/uaspi/asm/bitsperlong.h), but this is bacause
the user-space cannot reference CONFIG options. For the kernel-space,
it uses the generic definition from include/asm-generic/bitsperlong.h.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 arch/mips/include/asm/bitsperlong.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/mips/include/asm/bitsperlong.h b/arch/mips/include/asm/bitsperlong.h
index 41712161bc..6dc0bb0c13 100644
--- a/arch/mips/include/asm/bitsperlong.h
+++ b/arch/mips/include/asm/bitsperlong.h
@@ -1,6 +1 @@
-#ifndef __ASM_MIPS_BITSPERLONG_H
-#define __ASM_MIPS_BITSPERLONG_H
-
-#define BITS_PER_LONG _MIPS_SZLONG
-
-#endif /* __ASM_MIPS_BITSPERLONG_H */
+#include <asm-generic/bitsperlong.h>
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] riscv: use generic bitsperlong.h
  2019-08-07 16:30 [PATCH 1/2] riscv: use generic bitsperlong.h Masahiro Yamada
  2019-08-07 16:30 ` [PATCH 2/2] mips: " Masahiro Yamada
@ 2019-08-12  7:02 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2019-08-12  7:02 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: barebox

On Thu, Aug 08, 2019 at 01:30:45AM +0900, Masahiro Yamada wrote:
> Linux highly depends on the fact that the 'long' and the pointer
> have the same width, and so does barebox.
> 
> So, we can always use include/asm-generic/bitsperlong.h, which
> determines BITS_PER_LONG depending on CONFIG_64BIT.
> 
> This is what Linux does (at least in the kernel-space), and barebox
> can follow it.
> 
> Currently, barebox only supports 32-bit riscv, but this should work
> when it supports 64-bit by adding CONFIG_64BIT to arch/riscv/Kconfig.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>  arch/riscv/include/asm/bitsperlong.h | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-12  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 16:30 [PATCH 1/2] riscv: use generic bitsperlong.h Masahiro Yamada
2019-08-07 16:30 ` [PATCH 2/2] mips: " Masahiro Yamada
2019-08-12  7:02 ` [PATCH 1/2] riscv: " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox