Re: [RFC PATCH 05/23] hw: add register access utility functions

2024-08-13 Thread Philippe Mathieu-Daudé
On 12/8/24 23:14, Octavian Purdila wrote: On Mon, Aug 12, 2024 at 8:33 AM Peter Maydell wrote: On Mon, 5 Aug 2024 at 21:17, Octavian Purdila wrote: Add register access utility functions for device models, like checking aligned access and reading and writing to a register backstore. Sign

Re: [RFC PATCH 05/23] hw: add register access utility functions

2024-08-12 Thread Richard Henderson
On 8/13/24 07:14, Octavian Purdila wrote: +#define BITS(hi, lo) (BIT(hi + 1) - BIT(lo)) +#define BIT_IS_SET(v, b) (((v) & BIT(b)) != 0) To the extent we need these we should be putting them in bits.h with the other bit-related operations. (But prefer the existing MAKE_64BIT_MASK over ad

Re: [RFC PATCH 05/23] hw: add register access utility functions

2024-08-12 Thread Octavian Purdila
On Mon, Aug 12, 2024 at 8:33 AM Peter Maydell wrote: > > On Mon, 5 Aug 2024 at 21:17, Octavian Purdila wrote: > > > > Add register access utility functions for device models, like checking > > aligned access and reading and writing to a register backstore. > > > > Signed-off-by: Octavian Purdila

Re: [RFC PATCH 05/23] hw: add register access utility functions

2024-08-12 Thread Peter Maydell
On Mon, 5 Aug 2024 at 21:17, Octavian Purdila wrote: > > Add register access utility functions for device models, like checking > aligned access and reading and writing to a register backstore. > Signed-off-by: Octavian Purdila > --- > include/hw/regs.h | 89 +++

[RFC PATCH 05/23] hw: add register access utility functions

2024-08-05 Thread Octavian Purdila
Add register access utility functions for device models, like checking aligned access and reading and writing to a register backstore. Signed-off-by: Octavian Purdila --- include/hw/regs.h | 89 +++ 1 file changed, 89 insertions(+) create mode 100644