mirror of
https://github.com/mii443/qemu.git
synced 2025-12-09 14:08:32 +00:00
Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros.
This makes it difficult to automatically replace their
definitions with OBJECT_DECLARE_TYPE.
Patch generated using:
$ ./scripts/codeconverter/converter.py -i \
--pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')
which will split "typdef struct { ... } TypedefName"
declarations.
Followed by:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
$(git grep -l '' -- '*.[ch]')
which will:
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-9-ehabkost@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-10-ehabkost@redhat.com>
Message-Id: <20200831210740.126168-11-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "hw/sysbus.h"
|
||||
#include "qemu/timer.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TIM_CR1 0x00
|
||||
#define TIM_CR2 0x04
|
||||
@@ -61,10 +62,11 @@
|
||||
#define TIM_DIER_UIE 1
|
||||
|
||||
#define TYPE_STM32F2XX_TIMER "stm32f2xx-timer"
|
||||
typedef struct STM32F2XXTimerState STM32F2XXTimerState;
|
||||
#define STM32F2XXTIMER(obj) OBJECT_CHECK(STM32F2XXTimerState, \
|
||||
(obj), TYPE_STM32F2XX_TIMER)
|
||||
|
||||
typedef struct STM32F2XXTimerState {
|
||||
struct STM32F2XXTimerState {
|
||||
/* <private> */
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
@@ -95,6 +97,6 @@ typedef struct STM32F2XXTimerState {
|
||||
uint32_t tim_dcr;
|
||||
uint32_t tim_dmar;
|
||||
uint32_t tim_or;
|
||||
} STM32F2XXTimerState;
|
||||
};
|
||||
|
||||
#endif /* HW_STM32F2XX_TIMER_H */
|
||||
|
||||
Reference in New Issue
Block a user