summaryrefslogtreecommitdiffstats
path: root/hw/core
diff options
context:
space:
mode:
authorPeter Crosthwaite2016-07-04 14:06:36 +0200
committerPeter Maydell2016-07-04 14:15:22 +0200
commit684204593d9b81ba4cd4c441b5ee395a29cff606 (patch)
tree619707acc63ada3691db1c3bdfaca5904a1ae7e0 /hw/core
parentregister: Add Memory API glue (diff)
downloadqemu-684204593d9b81ba4cd4c441b5ee395a29cff606.tar.gz
qemu-684204593d9b81ba4cd4c441b5ee395a29cff606.tar.xz
qemu-684204593d9b81ba4cd4c441b5ee395a29cff606.zip
register: Define REG and FIELD macros
Define some macros that can be used for defining registers and fields. The REG32 macro will define A_FOO, for the byte address of a register as well as R_FOO for the uint32_t[] register number (A_FOO / 4). The FIELD macro will define FOO_BAR_MASK, FOO_BAR_SHIFT and FOO_BAR_LENGTH constants for field BAR in register FOO. Finally, there are some shorthand helpers for extracting/depositing fields from registers based on these naming schemes. Usage can greatly reduce the verbosity of device code. The deposit and extract macros (eg FIELD_EX32, FIELD_DP32 etc.) can be used to generate extract and deposits without any repetition of the name stems. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-id: bbd87a3c03b1f173b1ed73a6d502c0196c18a72f.1467053537.git.alistair.francis@xilinx.com [ EI Changes: * Add Deposit macros ] Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core')
0 files changed, 0 insertions, 0 deletions