- 28 2月, 2023 40 次提交
-
-
由 Philippe Mathieu-Daudé 提交于
Since commit 262a69f4 ("osdep.h: Prohibit disabling assert() in supported builds") we can not build QEMU with NDEBUG (or G_DISABLE_ASSERT) defined, thus 'assert(0)' always aborts QEMU. However some static analyzers / compilers doesn't notice NDEBUG can't be defined and emit warnings if code is used after an 'assert(0)' call. Apparently such compiler isn't as clever with G_DISABLE_ASSERT, so we can silent these warnings by using g_assert_not_reached() which is easier to read anyway. In order to avoid these annoying warnings, add a checkpatch rule to prohibit 'assert(0)'. Suggest using g_assert_not_reached() instead. For example when reverting the previous patch we get: ERROR: use g_assert_not_reached() instead of assert(0) #21: FILE: target/ppc/dfp_helper.c:124: + assert(0); /* cannot get here */ ERROR: use g_assert_not_reached() instead of assert(0) #30: FILE: target/ppc/dfp_helper.c:141: + assert(0); /* cannot get here */ total: 2 errors, 0 warnings, 16 lines checked Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230221232520.14480-3-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Since commit 262a69f4 ("osdep.h: Prohibit disabling assert() in supported builds") 'NDEBUG' can not be defined, so '#ifndef NDEBUG' is dead code. Remove it. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230221232520.14480-5-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
MAL properties are declared as uint8_t: static Property ppc4xx_mal_properties[] = { DEFINE_PROP_UINT8("txc-num", Ppc4xxMalState, txcnum, 0), DEFINE_PROP_UINT8("rxc-num", Ppc4xxMalState, rxcnum, 0), DEFINE_PROP_END_OF_LIST(), }; Correct the API use by setting the property using qdev_prop_set_uint8(). No behavioral change. Fixes: da116a8a ("ppc/ppc405: QOM'ify MAL") Reviewed-by: NBALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230203145536.17585-7-philmd@linaro.org>
-
由 BALATON Zoltan 提交于
Pixman may return false if it does not have a suitable implementation. Add fallbacks to handle such cases. Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reported-by: NRene Engel <ReneEngel80@emailn.de> Tested-by: NRene Engel <ReneEngel80@emailn.de> Message-Id: <20ed9442a0146238254ccc340c0d1efa226c6356.1677445307.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 BALATON Zoltan 提交于
Add simple implementation for two raster operations that are used by AmigaOS which fixes graphics problems in some programs using these. Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reported-by: NRene Engel <ReneEngel80@emailn.de> Tested-by: NRene Engel <ReneEngel80@emailn.de> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <17ef3c59dc7868f75034e9ebe21e2999c8f718d4.1677445307.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
No need to use an intermediate 'dma-offset' property in the chipset object. Alias the property, so when the machine (here r2d-plus) sets the value on the chipset, it is propagated to the OHCI object. Note we can rename the chipset 'base' property as 'dma-offset' since the object is a non-user-creatable sysbus type. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NBALATON Zoltan <balaton@eik.bme.hu> Message-Id: <20230203145536.17585-12-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Note this device doesn't implement unrealize(). Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NBALATON Zoltan <balaton@eik.bme.hu> Message-Id: <20230203145536.17585-11-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-8-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
NEC_XHCI is a QOM object type. Declare its macros / typedefs using OBJECT_DECLARE_SIMPLE_TYPE(). Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-7-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
By using the QOM UHCI_GET_CLASS() cast macro we don't to use the intermediate PCIDeviceClass variable. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-6-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
The automatic conversion done during commit a489d195 ("Use OBJECT_DECLARE_TYPE when possible") missed this model because the typedefs are in a different file unit (hcd-uhci.c) than where the DECLARE_INSTANCE_CHECKER() is (hcd-uhci.h). Manually convert to OBJECT_DECLARE_TYPE(). Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-5-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <03599fd4db313ac4f651cceb43340109ad6a14b8.1676916640.git.balaton@eik.bme.hu>
-
由 BALATON Zoltan 提交于
To help debugging add trace points that print values read from or written to the device's registers. Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Message-Id: <1bb4985e5dfc1df5a290e77f76fd827ae3592ab7.1676916640.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 BALATON Zoltan 提交于
The ohci_port_set_if_connected() function is only used by ohci_port_set_status(), move next to it to have them at the same place. Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Message-Id: <46411d4980ab0fba61ab0d2209a939fdc41eb573.1676916640.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 BALATON Zoltan 提交于
Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Message-Id: <aaa3ddee99c7677d6cc137f637982e94267b99b6.1676916640.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 BALATON Zoltan 提交于
Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Message-Id: <c9b99b3555dcd03194a8950b810f5e1b4b4bd5d3.1676916640.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 BALATON Zoltan 提交于
Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Message-Id: <9b0aadedc7c4780fefdc27f14f72ac9003032fbf.1676916639.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Forward-define the type first, then use it for the ohci_die() handler. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-3-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Avoid when including "hw/usb/hcd-ohci.h": hw/usb/hcd-ohci.h:100:5: error: unknown type name 'SysBusDevice' SysBusDevice parent_obj; ^ Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20230203113650.78146-6-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
hw/usb/u2f.h was added by commit 80e267f1 ("hw/usb: Add U2F key base class"), almost the same time of the automatic conversion done by commit c821774a ("Use OBJECT_DECLARE_TYPE where posible"). Manually convert to OBJECT_DECLARE_TYPE(). Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-9-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
To avoid forward-declaring CCIDBus, declare CCID_BUS QOM definitions before its use in the USBCCIDState structure. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220150515.32549-2-philmd@linaro.org>
-
由 BALATON Zoltan 提交于
These can be shared with other AC97 implementations. Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <6f0980fdc3753624be6f3935a6ab0a2dc1df4b30.1677445307.git.balaton@eik.bme.hu> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220131837.26292-5-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220131837.26292-4-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
To avoid forward-declaring ES1370State, declare ES1370 QOM definitions before its use in the chan_bits structure. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220131837.26292-3-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
To avoid forward-declaring HDAAudioState, declare HDA_AUDIO QOM definitions before its use in the HDAAudioStream structure. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230220131837.26292-2-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Avoid when refactoring unrelated headers: hw/timer/hpet.c:776:39: error: array has incomplete element type 'Property' (aka 'struct Property') static Property hpet_device_properties[] = { ^ hw/timer/hpet.c:777:5: error: implicit declaration of function 'DEFINE_PROP_UINT8' is invalid in C99 [-Werror,-Wimplicit-function-declaration] DEFINE_PROP_UINT8("timers", HPETState, num_timers, HPET_MIN_TIMERS), ^ Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Acked-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230215174353.37097-2-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
rtc_get_memory() and rtc_set_memory() helpers only work with TYPE_MC146818_RTC devices. 'memory' in their name refer to the CMOS region. Rename them as mc146818rtc_get_cmos_data() and mc146818rtc_set_cmos_data() to be explicit about what they are doing. Mechanical change doing: $ sed -i -e 's/rtc_set_memory/mc146818rtc_set_cmos_data/g' \ $(git grep -wl rtc_set_memory) $ sed -i -e 's/rtc_get_memory/mc146818rtc_get_cmos_data/g' \ $(git grep -wl rtc_get_memory) Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210233116.80311-4-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
rtc_get_memory() and rtc_set_memory() methods can not take any TYPE_ISA_DEVICE object. They expect a TYPE_MC146818_RTC one. Simplify the API by passing a MC146818RtcState. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210233116.80311-3-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
RTCState only represents a Motorola MC146818 model, not any RTC chipset. Rename the structure as MC146818RtcState using: $ sed -i -e s/RTCState/MC146818RtcState/g $(git grep -wl RTCState) Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210233116.80311-2-philmd@linaro.org> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NThomas Huth <thuth@redhat.com> Message-Id: <20230215161641.32663-4-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
isa_get_irq() was added in commit 3a38d437 ("Add isa_reserve_irq()" Fri Aug 14 11:36:15 2009) as: a temporary interface to be used to allocate ISA IRQs for devices which have not yet been converted to qdev, and for special cases which are not suited for qdev conversions, such as the 'ferr'. We still use it 14 years later, using the global 'isabus' singleton. In order to get rid of such *temporary* interface, extract isa_bus_get_irq() which can take any ISABus* object. Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NThomas Huth <thuth@redhat.com> Message-Id: <20230215161641.32663-3-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
isa_get_dma() returns a DMA channel handler from an ISABus. To emphasize this, rename it as isa_bus_get_dma(). Mechanical change using: $ sed -i -e 's/isa_get_dma/isa_bus_get_dma/g' \ $(git grep -l isa_get_dma) Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NThomas Huth <thuth@redhat.com> Message-Id: <20230215161641.32663-2-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230210163744.32182-11-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
isa_bus_irqs() register an array of input IRQs on the ISA bus. Rename it as isa_bus_register_input_irqs(). Mechanical change using: $ sed -i -e 's/isa_bus_irqs/isa_bus_register_input_irqs/g' \ $(git grep -wl isa_bus_irqs) Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210163744.32182-10-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
No point in inlining isa_bus_from_device() which is only used at device realization time. Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230210163744.32182-9-philmd@linaro.org> Reviewed-by: NBernhard Beschow <shentey@gmail.com>
-
由 Philippe Mathieu-Daudé 提交于
Separate functions taking an ISABus* argument versus functions taking a ISADevice* one. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210163744.32182-8-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
ISADeviceClass is an empty class and just increase code complexity. Remove it, directly embedding DeviceClass in classes expanding TYPE_ISA_DEVICE. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NBernhard Beschow <shentey@gmail.com> Message-Id: <20230215161641.32663-19-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Keep reference to ISA input IRQs in EbusState. To emphasize input/output distinction, rename arrays as isa_irqs_in / isa_irqs_out. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210163744.32182-7-philmd@linaro.org>
-
由 Philippe Mathieu-Daudé 提交于
Directly dispatch ISA IRQs to 'cpu_intr' output IRQ by removing the intermediate via_isa_request_i8259_irq() handler. Rename ISA IRQs array as 'isa_irqs_in' to emphasize these are input IRQs. Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20230210163744.32182-5-philmd@linaro.org> Signed-off-by: NPhilippe Mathieu-Daudé <philmd@linaro.org>
-