From: Himanshu Chauhan <hchauhan@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v2 1/7] include: sbi: Introduce common endianess conversion macro
Date: Mon, 8 Jan 2024 12:25:19 +0530 [thread overview]
Message-ID: <20240108065525.208172-2-hchauhan@ventanamicro.com> (raw)
In-Reply-To: <20240108065525.208172-1-hchauhan@ventanamicro.com>
Introduce cpu_to_lle and lle_to_cpu macros which invoke
correct word length cpu_to_le<64/32> conversion based on
__riscv_xlen.
Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
---
include/sbi/sbi_byteorder.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/sbi/sbi_byteorder.h b/include/sbi/sbi_byteorder.h
index 15107e1..db6eb2b 100644
--- a/include/sbi/sbi_byteorder.h
+++ b/include/sbi/sbi_byteorder.h
@@ -58,4 +58,14 @@
#define le64_to_cpu(x) ((uint64_t)BSWAP64(x))
#endif
+#if __riscv_xlen == 64
+#define cpu_to_lle cpu_to_le64
+#define lle_to_cpu le64_to_cpu
+#elif __riscv_xlen == 32
+#define cpu_to_lle cpu_to_le32
+#define lle_to_cpu le32_to_cpu
+#else
+#error "Unknown __riscv_xlen"
+#endif
+
#endif /* __SBI_BYTEORDER_H__ */
--
2.34.1
next prev parent reply other threads:[~2024-01-08 6:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-08 6:55 [PATCH v2 0/7] Introduce support for SBI Debug Trigger Extension Himanshu Chauhan
2024-01-08 6:55 ` Himanshu Chauhan [this message]
2024-01-09 10:22 ` [PATCH v2 1/7] include: sbi: Introduce common endianess conversion macro Anup Patel
2024-01-08 6:55 ` [PATCH v2 2/7] include: sbi: Add TINFO debug trigger CSR Himanshu Chauhan
2024-01-09 10:23 ` Anup Patel
2024-01-08 6:55 ` [PATCH v2 3/7] include: sbi: Introduce debug trigger register encodings Himanshu Chauhan
2024-01-09 10:23 ` Anup Patel
2024-01-08 6:55 ` [PATCH v2 4/7] lib: sbi: Introduce the SBI debug triggers extension support Himanshu Chauhan
2024-01-09 10:32 ` Anup Patel
2024-01-09 15:31 ` Himanshu Chauhan
2024-01-09 15:44 ` Anup Patel
2024-01-08 6:55 ` [PATCH v2 5/7] include: sbi: Add SBI debug trigger extension related defines Himanshu Chauhan
2024-01-09 10:33 ` Anup Patel
2024-01-08 6:55 ` [PATCH v2 6/7] lib: sbi: Implement SBI debug trigger extension Himanshu Chauhan
2024-01-09 10:33 ` Anup Patel
2024-01-08 6:55 ` [PATCH v2 7/7] lib: sbi: Print number of debug triggers found Himanshu Chauhan
2024-01-09 10:33 ` Anup Patel
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=20240108065525.208172-2-hchauhan@ventanamicro.com \
--to=hchauhan@ventanamicro.com \
--cc=opensbi@lists.infradead.org \
/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