On Fri, 07 Feb 2025 11:02:47 +0000, Cornelia Huck <coh...@redhat.com> wrote: > > From: Eric Auger <eric.au...@redhat.com> > > Introduce scripts that automate the generation of system register > definitions from a given linux source tree arch/arm64/tools/sysreg. > > Invocation of > ./update-aarch64-sysreg-code.sh $PATH_TO_LINUX_SOURCE_TREE > in scripts directory do generate 2 qemu files: > - target/arm/cpu-sysreg-properties.c > - target/arm/cpu-sysregs.h.inc > > cpu-sysregs.h.inc creates defines for all system registers. > However cpu-sysreg-properties.c only cares about feature ID registers. > > update-aarch64-sysreg-code.sh calls two awk scripts. > gen-cpu-sysreg-properties.awk is inherited from kernel > arch/arm64/tools/gen-sysreg.awk. All credits to Mark Rutland > the original author of this script. > > [CH: update to handle current kernel sysregs structure, and to emit > the re-worked register structures] > Signed-off-by: Eric Auger <eric.au...@redhat.com> > Signed-off-by: Cornelia Huck <coh...@redhat.com> > --- > scripts/gen-cpu-sysreg-properties.awk | 325 ++++++++++++++++++++++++++ > scripts/gen-cpu-sysregs-header.awk | 70 ++++++ > scripts/update-aarch64-sysreg-code.sh | 30 +++ > 3 files changed, 425 insertions(+) > create mode 100755 scripts/gen-cpu-sysreg-properties.awk > create mode 100755 scripts/gen-cpu-sysregs-header.awk > create mode 100755 scripts/update-aarch64-sysreg-code.sh
Shameless plug: https://lore.kernel.org/r/20250102144339.1564778-1-...@kernel.org You could use (something like) this to generate the sysreg file itself from the architecture data, or another representation as required. M. -- Without deviation from the norm, progress is not possible.