aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-timer.c
diff options
context:
space:
mode:
authorJoe Komlodi <komlodi@google.com>2022-06-13 14:05:48 +0200
committerCédric Le Goater <clg@kaod.org>2022-06-22 09:49:34 +0200
commit4a71d6d32e59ecf02c246037198882e59894db3d (patch)
tree088227f509142b907230cfb7aa2bbf8e83704e74 /util/qemu-timer.c
parent3302184f7f2450a50ce03b825d87434a621f949f (diff)
downloadqemu-4a71d6d32e59ecf02c246037198882e59894db3d.zip
qemu-4a71d6d32e59ecf02c246037198882e59894db3d.tar.gz
qemu-4a71d6d32e59ecf02c246037198882e59894db3d.tar.bz2
hw/registerfields: Add shared fields macros
Occasionally a peripheral will have different operating modes, where the MMIO layout changes, but some of the register fields have the same offsets and behaviors. To help support this, we add SHARED_FIELD_XX macros that create SHIFT, LENGTH, and MASK macros for the fields that are shared across registers, and accessors for these fields. An example use may look as follows: There is a peripheral with registers REG_MODE1 and REG_MODE2 at different addreses, and both have a field FIELD1 initialized by SHARED_FIELD(). Depending on what mode the peripheral is operating in, the user could extract FIELD1 via SHARED_ARRAY_FIELD_EX32(s->regs, R_REG_MODE1, FIELD1) or SHARED_ARRAY_FIELD_EX32(s->regs, R_REG_MODE2, FIELD1) Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: Id3dc53e7d2f8741c95697cbae69a81bb699fa3cb Message-Id: <20220331043248.2237838-2-komlodi@google.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'util/qemu-timer.c')
0 files changed, 0 insertions, 0 deletions