]> git.proxmox.com Git - mirror_qemu.git/commit
hw/arm/mps2-tz.c: Add extra data parameter to MakeDevFn
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Sep 2021 15:07:25 +0000 (16:07 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Sep 2021 20:01:08 +0000 (21:01 +0100)
commite6f79acd86ed06f5da63122d59ae69cf1fb490f5
treebcb2486ce13d68c944a1cc5f3741bbcc02279646
parent1518562b49af772ca2c1a5c2e8dda20c2b58992f
hw/arm/mps2-tz.c: Add extra data parameter to MakeDevFn

The mps2-tz boards use a data-driven structure to create the devices
that sit behind peripheral protection controllers.  Currently the
functions which create these devices are passed an 'opaque' pointer
which is always the address within the machine struct of the device
to create, and some "all devices need this" information like irqs and
addresses.

If a specific device needs more information than this, it is
currently not possible to pass that through from the PPCInfo
data structure. Add support for passing an extra data parameter,
so that we can more flexibly handle the needs of specific
device types. To provide some type-safety we make this extra
parameter a pointer to a union (which initially has no members).

In particular, we would like to be able to indicate which of the
i2c controllers are for on-board devices only and which are
connected to the external 'shield' expansion port; a subsequent
patch will use this mechanism for that purpose.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210903151435.22379-3-peter.maydell@linaro.org
hw/arm/mps2-tz.c