qemu/include/hw/block/swim.h
Eduardo Habkost 8110fa1d94 Use DECLARE_*CHECKER* macros
Generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]')

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-12-ehabkost@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-13-ehabkost@redhat.com>
Message-Id: <20200831210740.126168-14-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-09 09:27:09 -04:00

82 lines
1.6 KiB
C

/*
* QEMU Macintosh floppy disk controller emulator (SWIM)
*
* Copyright (c) 2014-2018 Laurent Vivier <laurent@vivier.eu>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*
*/
#ifndef SWIM_H
#define SWIM_H
#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "qom/object.h"
#define SWIM_MAX_FD 2
typedef struct SWIMDrive SWIMDrive;
typedef struct SWIMBus SWIMBus;
typedef struct SWIMCtrl SWIMCtrl;
#define TYPE_SWIM_DRIVE "swim-drive"
DECLARE_INSTANCE_CHECKER(SWIMDrive, SWIM_DRIVE,
TYPE_SWIM_DRIVE)
struct SWIMDrive {
DeviceState qdev;
int32_t unit;
BlockConf conf;
};
#define TYPE_SWIM_BUS "swim-bus"
DECLARE_INSTANCE_CHECKER(SWIMBus, SWIM_BUS,
TYPE_SWIM_BUS)
struct SWIMBus {
BusState bus;
struct SWIMCtrl *ctrl;
};
typedef struct FDrive {
SWIMCtrl *swimctrl;
BlockBackend *blk;
BlockConf *conf;
} FDrive;
struct SWIMCtrl {
MemoryRegion iomem;
FDrive drives[SWIM_MAX_FD];
int mode;
/* IWM mode */
int iwm_switch;
uint16_t regs[8];
#define IWM_PH0 0
#define IWM_PH1 1
#define IWM_PH2 2
#define IWM_PH3 3
#define IWM_MTR 4
#define IWM_DRIVE 5
#define IWM_Q6 6
#define IWM_Q7 7
uint8_t iwm_data;
uint8_t iwm_mode;
/* SWIM mode */
uint8_t swim_phase;
uint8_t swim_mode;
SWIMBus bus;
};
#define TYPE_SWIM "swim"
typedef struct Swim Swim;
DECLARE_INSTANCE_CHECKER(Swim, SWIM,
TYPE_SWIM)
struct Swim {
SysBusDevice parent_obj;
SWIMCtrl ctrl;
};
#endif