qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] hw/sd: Declare CPU QOM types using DEFINE_TYPES() macro
@ 2023-10-31  8:06 Philippe Mathieu-Daudé
  2023-10-31  8:06 ` [PATCH 1/1] " Philippe Mathieu-Daudé
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-31  8:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Igor Mammedov, qemu-arm, Peter Maydell, Eduardo Habkost,
	Markus Armbruster, Philippe Mathieu-Daudé, Mark Cave-Ayland

Hi,

This is an intent to automatically convert to DEFINE_TYPES().

I used a Comby script, see https://comby.dev/.

Example in Comby playground:
https://comby.live/#%7B%22source%22%3A%22static%20const%20TypeInfo%20pl181_info%20%3D%20%7B%5Cn%20%20%20%20.name%20%20%20%20%20%20%20%20%20%20%3D%20TYPE_PL181%2C%5Cn%20%20%20%20.parent%20%20%20%20%20%20%20%20%3D%20TYPE_SYS_BUS_DEVICE%2C%5Cn%20%20%20%20.instance_size%20%3D%20sizeof(PL181State)%2C%5Cn%20%20%20%20.instance_init%20%3D%20pl181_init%2C%5Cn%20%20%20%20.class_init%20%20%20%20%3D%20pl181_class_init%2C%5Cn%7D%3B%5Cn%5Cnstatic%20void%20pl181_bus_class_init(ObjectClass%20*klass%2C%20void%20*data)%5Cn%7B%5Cn%20%20%20%20SDBusClass%20*sbc%20%3D%20SD_BUS_CLASS(klass)%3B%5Cn%5Cn%20%20%20%20sbc-%3Eset_inserted%20%3D%20pl181_set_inserted%3B%5Cn%20%20%20%20sbc-%3Eset_readonly%20%3D%20pl181_set_readonly%3B%5Cn%7D%5Cn%5Cnstatic%20const%20TypeInfo%20pl181_bus_info%20%3D%20%7B%5Cn%20%20%20%20.name%20%3D%20TYPE_PL181_BUS%2C%5Cn%20%20%20%20.parent%20%3D%20TYPE_SD_BUS%2C%5Cn%20%20%20%20.instance_size%20%3D%20sizeof(SDBus)%2C%5Cn%20%20%20%20.class_init%20%3D%20pl181_bus_class_init%2C%5Cn%7D%3B%5Cn%5Cnstatic%20void%20pl181_register_types(void)%5Cn%7B%5Cn%20%20%20%20type_register_static(%26pl181_info)%3B%5Cn%20%20%20%20type_register_static(%26pl181_bus_info)%3B%5Cn%7D%5Cn%5Cntype_init(pl181_register_types)%5Cn%22%2C%22match%22%3A%22static%20const%20TypeInfo%20%3A%5Bi1a~.*_info%5D%20%3D%20%7B%5Cn%20%20%20%20%3A%5Bbody1%5D%5Cn%7D%3B%5Cn...%5Cnstatic%20const%20TypeInfo%20%3A%5Bi2a~.*_info%5D%20%3D%20%7B%5Cn%20%20%20%20%3A%5Bbody2%5D%5Cn%7D%3B%5Cnstatic%20void%20%3A%5Brt1~.*_register_type.%5D(void)%5Cn%7B%5Cn%20%20%20%20type_register_static(%26%3A%5Bi1b~.*_info%5D)%3B%5Cn%20%20%20%20type_register_static(%26%3A%5Bi2b~.*_info%5D)%3B%5Cn%7D%5Cntype_init(%3A%5Brt2~.*_register_type.%5D)%22%2C%22rule%22%3A%22where%20true%22%2C%22rewrite%22%3A%22static%20const%20TypeInfo%20%3A%5Bi1a%5D%5B%5D%20%3D%20%7B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%3A%5Bbody1%5D%5Cn%20%20%20%20%7D%2C%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%3A%5Bbody2%5D%5Cn%20%20%20%20%7D%2C%5Cn%7D%3B%5Cn%5CnDEFINE_TYPES(%3A%5Bi1a%5D)%5Cn%22%2C%22language%22%3A%22.generic%22%2C%22substitution_kind%22%3A%22in_place%22%2C%22id%22%3A0%7D

Regards,

Phil.

Philippe Mathieu-Daudé (1):
  hw/sd: Declare CPU QOM types using DEFINE_TYPES() macro

 hw/sd/aspeed_sdhci.c   | 19 ++++++++-----------
 hw/sd/bcm2835_sdhost.c | 33 ++++++++++++++-------------------
 hw/sd/cadence_sdhci.c  | 21 +++++++++------------
 hw/sd/core.c           | 19 ++++++++-----------
 hw/sd/npcm7xx_sdhci.c  | 21 +++++++++------------
 hw/sd/pl181.c          | 35 +++++++++++++++--------------------
 hw/sd/pxa2xx_mmci.c    | 35 +++++++++++++++--------------------
 hw/sd/sd.c             | 37 ++++++++++++++++---------------------
 hw/sd/sdhci-pci.c      | 25 +++++++++++--------------
 hw/sd/ssi-sd.c         | 19 ++++++++-----------
 10 files changed, 113 insertions(+), 151 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-08 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-31  8:06 [PATCH 0/1] hw/sd: Declare CPU QOM types using DEFINE_TYPES() macro Philippe Mathieu-Daudé
2023-10-31  8:06 ` [PATCH 1/1] " Philippe Mathieu-Daudé
2023-10-31  8:31   ` Cédric Le Goater
2023-11-08 10:39     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).