From: Andrew Jones <andrew.jones@linux.dev>
To: "Clément Léger" <cleger@rivosinc.com>
Cc: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
Andrew Jones <ajones@ventanamicro.com>,
Anup Patel <apatel@ventanamicro.com>,
Atish Patra <atishp@rivosinc.com>
Subject: Re: [kvm-unit-tests PATCH v4 1/5] kbuild: allow multiple asm-offsets file to be generated
Date: Tue, 7 Jan 2025 18:14:34 +0100 [thread overview]
Message-ID: <20250107-7e693ed9a487a4c6e714d071@orel> (raw)
In-Reply-To: <20241125162200.1630845-2-cleger@rivosinc.com>
On Mon, Nov 25, 2024 at 05:21:50PM +0100, Clément Léger wrote:
> In order to allow multiple asm-offsets files to generated the include
> guard need to be different between these file. Add a asm_offset_name
> makefile macro to obtain an uppercase name matching the original asm
> offsets file.
>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>
> ---
> scripts/asm-offsets.mak | 22 +++++++++++++++-------
> 1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/asm-offsets.mak b/scripts/asm-offsets.mak
> index 7b64162d..a5fdbf5d 100644
> --- a/scripts/asm-offsets.mak
> +++ b/scripts/asm-offsets.mak
> @@ -15,10 +15,14 @@ define sed-y
> s:->::; p;}'
> endef
>
> +define asm_offset_name
> + $(shell echo $(notdir $(1)) | tr [:lower:]- [:upper:]_)
> +endef
> +
> define make_asm_offsets
> (set -e; \
> - echo "#ifndef __ASM_OFFSETS_H__"; \
> - echo "#define __ASM_OFFSETS_H__"; \
> + echo "#ifndef __$(strip $(asm_offset_name))_H__"; \
> + echo "#define __$(strip $(asm_offset_name))_H__"; \
> echo "/*"; \
> echo " * Generated file. DO NOT MODIFY."; \
> echo " *"; \
> @@ -29,12 +33,16 @@ define make_asm_offsets
> echo "#endif" ) > $@
> endef
>
> -$(asm-offsets:.h=.s): $(asm-offsets:.h=.c)
> - $(CC) $(CFLAGS) -fverbose-asm -S -o $@ $<
> +define gen_asm_offsets_rules
> +$(1).s: $(1).c
> + $(CC) $(CFLAGS) -fverbose-asm -S -o $$@ $$<
> +
> +$(1).h: $(1).s
> + $$(call make_asm_offsets,$(1))
> + cp -f $$@ lib/generated/
> +endef
>
> -$(asm-offsets): $(asm-offsets:.h=.s)
> - $(call make_asm_offsets)
> - cp -f $(asm-offsets) lib/generated/
> +$(foreach o,$(asm-offsets),$(eval $(call gen_asm_offsets_rules, $(o:.h=))))
>
> OBJDIRS += lib/generated
>
> --
> 2.45.2
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
next prev parent reply other threads:[~2025-01-07 17:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 16:21 [kvm-unit-tests PATCH v4 0/5] riscv: add SBI SSE extension tests Clément Léger
2024-11-25 16:21 ` [kvm-unit-tests PATCH v4 1/5] kbuild: allow multiple asm-offsets file to be generated Clément Léger
2025-01-07 17:14 ` Andrew Jones [this message]
2024-11-25 16:21 ` [kvm-unit-tests PATCH v4 2/5] riscv: use asm-offsets to generate SBI_EXT_HSM values Clément Léger
2025-01-07 17:27 ` Andrew Jones
2025-01-07 17:33 ` Clément Léger
2024-11-25 16:21 ` [kvm-unit-tests PATCH v4 3/5] riscv: Add "-deps" handling for tests Clément Léger
2024-11-25 16:21 ` [kvm-unit-tests PATCH v4 4/5] riscv: lib: Add SBI SSE extension definitions Clément Léger
2025-01-08 13:03 ` Andrew Jones
2025-01-08 18:34 ` Atish Kumar Patra
2024-11-25 16:21 ` [kvm-unit-tests PATCH v4 5/5] riscv: sbi: Add SSE extension tests Clément Léger
2025-01-13 17:19 ` Andrew Jones
2025-01-13 17:22 ` Andrew Jones
2025-01-14 11:59 ` Andrew Jones
2025-02-13 9:27 ` Clément Léger
2025-01-06 10:11 ` [kvm-unit-tests PATCH v4 0/5] riscv: add SBI " Clément Léger
2025-01-06 13:55 ` Andrew Jones
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=20250107-7e693ed9a487a4c6e714d071@orel \
--to=andrew.jones@linux.dev \
--cc=ajones@ventanamicro.com \
--cc=apatel@ventanamicro.com \
--cc=atishp@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.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