mirror of
https://github.com/qemu/qemu.git
synced 2025-08-05 02:04:04 +00:00

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>
63 lines
1.4 KiB
C
63 lines
1.4 KiB
C
#ifndef HW_ESCC_H
|
|
#define HW_ESCC_H
|
|
|
|
#include "chardev/char-fe.h"
|
|
#include "chardev/char-serial.h"
|
|
#include "hw/sysbus.h"
|
|
#include "ui/input.h"
|
|
#include "qom/object.h"
|
|
|
|
/* escc.c */
|
|
#define TYPE_ESCC "escc"
|
|
#define ESCC_SIZE 4
|
|
|
|
typedef struct ESCCState ESCCState;
|
|
#define ESCC(obj) OBJECT_CHECK(ESCCState, (obj), TYPE_ESCC)
|
|
|
|
typedef enum {
|
|
escc_chn_a, escc_chn_b,
|
|
} ESCCChnID;
|
|
|
|
typedef enum {
|
|
escc_serial, escc_kbd, escc_mouse,
|
|
} ESCCChnType;
|
|
|
|
#define ESCC_SERIO_QUEUE_SIZE 256
|
|
|
|
typedef struct {
|
|
uint8_t data[ESCC_SERIO_QUEUE_SIZE];
|
|
int rptr, wptr, count;
|
|
} ESCCSERIOQueue;
|
|
|
|
#define ESCC_SERIAL_REGS 16
|
|
typedef struct ESCCChannelState {
|
|
qemu_irq irq;
|
|
uint32_t rxint, txint, rxint_under_svc, txint_under_svc;
|
|
struct ESCCChannelState *otherchn;
|
|
uint32_t reg;
|
|
uint8_t wregs[ESCC_SERIAL_REGS], rregs[ESCC_SERIAL_REGS];
|
|
ESCCSERIOQueue queue;
|
|
CharBackend chr;
|
|
int e0_mode, led_mode, caps_lock_mode, num_lock_mode;
|
|
int disabled;
|
|
int clock;
|
|
uint32_t vmstate_dummy;
|
|
ESCCChnID chn; /* this channel, A (base+4) or B (base+0) */
|
|
ESCCChnType type;
|
|
uint8_t rx, tx;
|
|
QemuInputHandlerState *hs;
|
|
} ESCCChannelState;
|
|
|
|
struct ESCCState {
|
|
SysBusDevice parent_obj;
|
|
|
|
struct ESCCChannelState chn[2];
|
|
uint32_t it_shift;
|
|
bool bit_swap;
|
|
MemoryRegion mmio;
|
|
uint32_t disabled;
|
|
uint32_t frequency;
|
|
};
|
|
|
|
#endif
|