aboutsummaryrefslogtreecommitdiff
path: root/hw/input
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-09-11 19:26:51 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-09-11 19:26:51 +0100
commitf4ef8c9cc10b3bee829b9775879d4ff9f77c2442 (patch)
tree8245341c3ebfe98b9673bf7a8cb818b6d494c76f /hw/input
parent2499453eb1cbb68a45d7562a180afd7659007fd4 (diff)
parentb84bf23c88699098973de3bdec316c796f1b3794 (diff)
downloadqemu-f4ef8c9cc10b3bee829b9775879d4ff9f77c2442.zip
qemu-f4ef8c9cc10b3bee829b9775879d4ff9f77c2442.tar.gz
qemu-f4ef8c9cc10b3bee829b9775879d4ff9f77c2442.tar.bz2
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
QOM boilerplate cleanup Documentation build fix: * memory: Remove kernel-doc comment marker (Eduardo Habkost) QOM cleanups: * Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost) QOM new macros: * OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé) * DECLARE_*_CHECKER macros (Eduardo Habkost) Automated QOM boilerplate changes: * Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost * Automated changes to use OBJECT_DECLARE* (Eduardo Habkost) # gpg: Signature made Thu 10 Sep 2020 19:17:49 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: (33 commits) virtio-vga: Use typedef name for instance_size vhost-user-vga: Use typedef name for instance_size xilinx_axienet: Use typedef name for instance_size lpc_ich9: Use typedef name for instance_size omap_intc: Use typedef name for instance_size xilinx_axidma: Use typedef name for instance_size tusb6010: Rename TUSB to TUSB6010 pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312 vfio: Rename PCI_VFIO to VFIO_PCI usb: Rename USB_SERIAL_DEV to USB_SERIAL sabre: Rename SABRE_DEVICE to SABRE rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER esp: Rename ESP_STATE to ESP ahci: Rename ICH_AHCI to ICH9_AHCI vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE gpex: Fix type checking function name ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/input')
-rw-r--r--hw/input/adb-kbd.c18
-rw-r--r--hw/input/adb-mouse.c18
-rw-r--r--hw/input/lm832x.c9
-rw-r--r--hw/input/milkymist-softusb.c7
-rw-r--r--hw/input/pl050.c9
5 files changed, 34 insertions, 27 deletions
diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c
index 3cfb6a7..fe0c363 100644
--- a/hw/input/adb-kbd.c
+++ b/hw/input/adb-kbd.c
@@ -30,30 +30,30 @@
#include "hw/input/adb-keys.h"
#include "adb-internal.h"
#include "trace.h"
+#include "qom/object.h"
-#define ADB_KEYBOARD(obj) OBJECT_CHECK(KBDState, (obj), TYPE_ADB_KEYBOARD)
+typedef struct ADBKeyboardClass ADBKeyboardClass;
+typedef struct KBDState KBDState;
+DECLARE_OBJ_CHECKERS(KBDState, ADBKeyboardClass,
+ ADB_KEYBOARD, TYPE_ADB_KEYBOARD)
-typedef struct KBDState {
+struct KBDState {
/*< private >*/
ADBDevice parent_obj;
/*< public >*/
uint8_t data[128];
int rptr, wptr, count;
-} KBDState;
+};
-#define ADB_KEYBOARD_CLASS(class) \
- OBJECT_CLASS_CHECK(ADBKeyboardClass, (class), TYPE_ADB_KEYBOARD)
-#define ADB_KEYBOARD_GET_CLASS(obj) \
- OBJECT_GET_CLASS(ADBKeyboardClass, (obj), TYPE_ADB_KEYBOARD)
-typedef struct ADBKeyboardClass {
+struct ADBKeyboardClass {
/*< private >*/
ADBDeviceClass parent_class;
/*< public >*/
DeviceRealize parent_realize;
-} ADBKeyboardClass;
+};
/* The adb keyboard doesn't have every key imaginable */
#define NO_KEY 0xff
diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c
index 577a38f..f575090 100644
--- a/hw/input/adb-mouse.c
+++ b/hw/input/adb-mouse.c
@@ -29,30 +29,30 @@
#include "qemu/module.h"
#include "adb-internal.h"
#include "trace.h"
+#include "qom/object.h"
-#define ADB_MOUSE(obj) OBJECT_CHECK(MouseState, (obj), TYPE_ADB_MOUSE)
+typedef struct ADBMouseClass ADBMouseClass;
+typedef struct MouseState MouseState;
+DECLARE_OBJ_CHECKERS(MouseState, ADBMouseClass,
+ ADB_MOUSE, TYPE_ADB_MOUSE)
-typedef struct MouseState {
+struct MouseState {
/*< public >*/
ADBDevice parent_obj;
/*< private >*/
int buttons_state, last_buttons_state;
int dx, dy, dz;
-} MouseState;
+};
-#define ADB_MOUSE_CLASS(class) \
- OBJECT_CLASS_CHECK(ADBMouseClass, (class), TYPE_ADB_MOUSE)
-#define ADB_MOUSE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(ADBMouseClass, (obj), TYPE_ADB_MOUSE)
-typedef struct ADBMouseClass {
+struct ADBMouseClass {
/*< public >*/
ADBDeviceClass parent_class;
/*< private >*/
DeviceRealize parent_realize;
-} ADBMouseClass;
+};
static void adb_mouse_event(void *opaque,
int dx1, int dy1, int dz1, int buttons_state)
diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c
index aa629dd..70245fd 100644
--- a/hw/input/lm832x.c
+++ b/hw/input/lm832x.c
@@ -25,11 +25,14 @@
#include "qemu/module.h"
#include "qemu/timer.h"
#include "ui/console.h"
+#include "qom/object.h"
#define TYPE_LM8323 "lm8323"
-#define LM8323(obj) OBJECT_CHECK(LM823KbdState, (obj), TYPE_LM8323)
+typedef struct LM823KbdState LM823KbdState;
+DECLARE_INSTANCE_CHECKER(LM823KbdState, LM8323,
+ TYPE_LM8323)
-typedef struct {
+struct LM823KbdState {
I2CSlave parent_obj;
uint8_t i2c_dir;
@@ -72,7 +75,7 @@ typedef struct {
uint8_t addr[3];
QEMUTimer *tm[3];
} pwm;
-} LM823KbdState;
+};
#define INT_KEYPAD (1 << 0)
#define INT_ERROR (1 << 3)
diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c
index 3e0a7eb..eaaf8ad 100644
--- a/hw/input/milkymist-softusb.c
+++ b/hw/input/milkymist-softusb.c
@@ -32,6 +32,7 @@
#include "hw/qdev-properties.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "qom/object.h"
enum {
R_CTRL = 0,
@@ -50,8 +51,9 @@ enum {
#define COMLOC_KEVT_BASE 0x1143
#define TYPE_MILKYMIST_SOFTUSB "milkymist-softusb"
-#define MILKYMIST_SOFTUSB(obj) \
- OBJECT_CHECK(MilkymistSoftUsbState, (obj), TYPE_MILKYMIST_SOFTUSB)
+typedef struct MilkymistSoftUsbState MilkymistSoftUsbState;
+DECLARE_INSTANCE_CHECKER(MilkymistSoftUsbState, MILKYMIST_SOFTUSB,
+ TYPE_MILKYMIST_SOFTUSB)
struct MilkymistSoftUsbState {
SysBusDevice parent_obj;
@@ -80,7 +82,6 @@ struct MilkymistSoftUsbState {
/* keyboard state */
uint8_t kbd_hid_buffer[8];
};
-typedef struct MilkymistSoftUsbState MilkymistSoftUsbState;
static uint64_t softusb_read(void *opaque, hwaddr addr,
unsigned size)
diff --git a/hw/input/pl050.c b/hw/input/pl050.c
index 1123037..7c53ae9 100644
--- a/hw/input/pl050.c
+++ b/hw/input/pl050.c
@@ -14,11 +14,14 @@
#include "hw/irq.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define TYPE_PL050 "pl050"
-#define PL050(obj) OBJECT_CHECK(PL050State, (obj), TYPE_PL050)
+typedef struct PL050State PL050State;
+DECLARE_INSTANCE_CHECKER(PL050State, PL050,
+ TYPE_PL050)
-typedef struct PL050State {
+struct PL050State {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -29,7 +32,7 @@ typedef struct PL050State {
int pending;
qemu_irq irq;
bool is_mouse;
-} PL050State;
+};
static const VMStateDescription vmstate_pl050 = {
.name = "pl050",