]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: qom: move device_id to PL011 class side
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Nov 2024 10:38:59 +0000 (11:38 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jan 2025 22:34:43 +0000 (23:34 +0100)
commitd9434f29ca83e114fe02ed24c8ad2ccfa7ac3fe9
treeb3ca51166c946371d4b6a9c7973239bfab0df9ae
parent33aa660575f7174752a7308229e5fc108921c2a6
rust: qom: move device_id to PL011 class side

There is no need to monkeypatch DeviceId::Luminary into the already-initialized
PL011State.  Instead, now that we can define a class hierarchy, we can define
PL011Class and make device_id a field in there.

There is also no need anymore to have "Arm" as zero, so change DeviceId into a
wrapper for the array; all it does is provide an Index<hwaddr> implementation
because arrays can only be indexed by usize.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/hw/char/pl011/src/device.rs