diff options
| author | Jessica Clarke <[email protected]> | 2025-07-10 00:29:28 +0100 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-07-22 15:54:27 +0530 |
| commit | ffd3ed976d88fa5cda56d9d2c139557c69eec5d8 (patch) | |
| tree | ce45dd7822f7a4928787584fc4232c5ce3fe15b4 /firmware | |
| parent | 0b7c2e0d6091e6f48b4b3b2a345fd588eb95ddfc (diff) | |
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 <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions
