Re: [Qemu-devel] [PATCH v2 04/16] register: Add support for decoding information
On Wed, Jan 27, 2016 at 7:09 AM, KONRAD Fredericwrote: > > > Le 19/01/2016 23:35, Alistair Francis a écrit : >> >> From: Peter Crosthwaite >> >> Allow defining of optional address decoding information in register >> definitions. This is useful for clients that want to associate >> registers with specific addresses. >> >> Signed-off-by: Peter Crosthwaite >> Signed-off-by: Alistair Francis >> --- >> changed since v4: >> Remove extraneous unused defintions. >> >> include/hw/register.h | 10 ++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/include/hw/register.h b/include/hw/register.h >> index a3c41db..90c0185 100644 >> --- a/include/hw/register.h >> +++ b/include/hw/register.h >> @@ -54,6 +54,11 @@ typedef struct RegisterAccessError { >>* allowing this function to modify the value before return to the >> client. >>*/ >> +#define REG_DECODE_READ (1 << 0) >> +#define REG_DECODE_WRITE (1 << 1) >> +#define REG_DECODE_EXECUTE (1 << 2) >> +#define REG_DECODE_RW (REG_DECODE_READ | REG_DECODE_WRITE) >> + >> struct RegisterAccessInfo { >> const char *name; >> uint64_t ro; >> @@ -71,6 +76,11 @@ struct RegisterAccessInfo { >> void (*post_write)(RegisterInfo *reg, uint64_t val); >> uint64_t (*post_read)(RegisterInfo *reg, uint64_t val); >> + >> +struct { >> +hwaddr addr; >> +uint8_t flags; >> +} decode; > > is that used somewhere? The addr variable is used in future patches, although flags isn't. I'm removing the flags variable. Thanks, Alistair > > Fred >> >> }; >> /** > > >
Re: [Qemu-devel] [PATCH v2 04/16] register: Add support for decoding information
Le 19/01/2016 23:35, Alistair Francis a écrit : From: Peter CrosthwaiteAllow defining of optional address decoding information in register definitions. This is useful for clients that want to associate registers with specific addresses. Signed-off-by: Peter Crosthwaite Signed-off-by: Alistair Francis --- changed since v4: Remove extraneous unused defintions. include/hw/register.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/hw/register.h b/include/hw/register.h index a3c41db..90c0185 100644 --- a/include/hw/register.h +++ b/include/hw/register.h @@ -54,6 +54,11 @@ typedef struct RegisterAccessError { * allowing this function to modify the value before return to the client. */ +#define REG_DECODE_READ (1 << 0) +#define REG_DECODE_WRITE (1 << 1) +#define REG_DECODE_EXECUTE (1 << 2) +#define REG_DECODE_RW (REG_DECODE_READ | REG_DECODE_WRITE) + struct RegisterAccessInfo { const char *name; uint64_t ro; @@ -71,6 +76,11 @@ struct RegisterAccessInfo { void (*post_write)(RegisterInfo *reg, uint64_t val); uint64_t (*post_read)(RegisterInfo *reg, uint64_t val); + +struct { +hwaddr addr; +uint8_t flags; +} decode; is that used somewhere? Fred }; /**
[Qemu-devel] [PATCH v2 04/16] register: Add support for decoding information
From: Peter CrosthwaiteAllow defining of optional address decoding information in register definitions. This is useful for clients that want to associate registers with specific addresses. Signed-off-by: Peter Crosthwaite Signed-off-by: Alistair Francis --- changed since v4: Remove extraneous unused defintions. include/hw/register.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/hw/register.h b/include/hw/register.h index a3c41db..90c0185 100644 --- a/include/hw/register.h +++ b/include/hw/register.h @@ -54,6 +54,11 @@ typedef struct RegisterAccessError { * allowing this function to modify the value before return to the client. */ +#define REG_DECODE_READ (1 << 0) +#define REG_DECODE_WRITE (1 << 1) +#define REG_DECODE_EXECUTE (1 << 2) +#define REG_DECODE_RW (REG_DECODE_READ | REG_DECODE_WRITE) + struct RegisterAccessInfo { const char *name; uint64_t ro; @@ -71,6 +76,11 @@ struct RegisterAccessInfo { void (*post_write)(RegisterInfo *reg, uint64_t val); uint64_t (*post_read)(RegisterInfo *reg, uint64_t val); + +struct { +hwaddr addr; +uint8_t flags; +} decode; }; /** -- 2.5.0