提交 dfc65f1f 编写于 作者: M Markus Armbruster 提交者: Kevin Wolf

Un-inline fdctrl_init_isa()

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 8aab031f
...@@ -1888,6 +1888,26 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl) ...@@ -1888,6 +1888,26 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl)
return 0; return 0;
} }
ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
{
ISADevice *dev;
dev = isa_try_create(bus, "isa-fdc");
if (!dev) {
return NULL;
}
if (fds[0]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv);
}
if (fds[1]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv);
}
qdev_init_nofail(&dev->qdev);
return dev;
}
void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base, DriveInfo **fds) target_phys_addr_t mmio_base, DriveInfo **fds)
{ {
......
#ifndef HW_FDC_H #ifndef HW_FDC_H
#define HW_FDC_H #define HW_FDC_H
#include "isa.h" #include "qemu-common.h"
#include "blockdev.h"
/* fdc.c */ /* fdc.c */
#define MAX_FD 2 #define MAX_FD 2
static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds) ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds);
{
ISADevice *dev;
dev = isa_try_create(bus, "isa-fdc");
if (!dev) {
return NULL;
}
if (fds[0]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv);
}
if (fds[1]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv);
}
qdev_init_nofail(&dev->qdev);
return dev;
}
void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base, DriveInfo **fds); target_phys_addr_t mmio_base, DriveInfo **fds);
void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base, void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
......
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <hw/hw.h> #include <hw/hw.h>
#include <hw/pc.h> #include <hw/pc.h>
#include <hw/pci.h> #include <hw/pci.h>
#include <hw/isa.h> #include <hw/isa.h>
#include "block.h" #include "blockdev.h"
#include "sysemu.h" #include "sysemu.h"
#include "dma.h" #include "dma.h"
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#define ISA_NUM_IRQS 16 #define ISA_NUM_IRQS 16
typedef struct ISADevice ISADevice;
#define TYPE_ISA_DEVICE "isa-device" #define TYPE_ISA_DEVICE "isa-device"
#define ISA_DEVICE(obj) \ #define ISA_DEVICE(obj) \
OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE) OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "blockdev.h"
#include "sysbus.h" #include "sysbus.h"
#include "hw.h" #include "hw.h"
#include "pc.h" #include "pc.h"
......
...@@ -239,6 +239,7 @@ typedef struct VLANState VLANState; ...@@ -239,6 +239,7 @@ typedef struct VLANState VLANState;
typedef struct VLANClientState VLANClientState; typedef struct VLANClientState VLANClientState;
typedef struct i2c_bus i2c_bus; typedef struct i2c_bus i2c_bus;
typedef struct ISABus ISABus; typedef struct ISABus ISABus;
typedef struct ISADevice ISADevice;
typedef struct SMBusDevice SMBusDevice; typedef struct SMBusDevice SMBusDevice;
typedef struct PCIHostState PCIHostState; typedef struct PCIHostState PCIHostState;
typedef struct PCIExpressHost PCIExpressHost; typedef struct PCIExpressHost PCIExpressHost;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册