diff options
author | Jessica Clarke <jrtc27@jrtc27.com> | 2025-07-10 00:29:28 +0100 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2025-07-22 15:54:27 +0530 |
commit | ffd3ed976d88fa5cda56d9d2c139557c69eec5d8 (patch) | |
tree | ce45dd7822f7a4928787584fc4232c5ce3fe15b4 /lib/utils/cppc | |
parent | 0b7c2e0d6091e6f48b4b3b2a345fd588eb95ddfc (diff) | |
download | opensbi-ffd3ed976d88fa5cda56d9d2c139557c69eec5d8.zip opensbi-ffd3ed976d88fa5cda56d9d2c139557c69eec5d8.tar.gz opensbi-ffd3ed976d88fa5cda56d9d2c139557c69eec5d8.tar.bz2 |
include: sbi: Use array for struct sbi_trap_regs and GET/SET macros
Rather than hand-rolling scaled pointer arithmetic with casts and
shifts, let the compiler do so by indexing an array of GPRs, taking
advantage of the language's type system to scale based on whatever type
the register happens to be. This makes it easier to support CHERI where
the registers are capabilities, not plain integers, and so this pointer
arithmetic would need to change (and currently REGBYTES is both the size
of a register and the size of an integer word upstream).
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250709232932.37622-1-jrtc27@jrtc27.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/cppc')
0 files changed, 0 insertions, 0 deletions