hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h'

"hw/ide.h" is a mixed bag of lost IDE declarations.

Extract mmio_ide_init_drives() and the TYPE_MMIO_IDE QOM
declarations to a new "hw/ide/mmio.h" header.

Document the SysBus interface.

Message-Id: <20230215112712.23110-4-philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2023-02-09 23:24:42 +01:00
parent c79f63ff39
commit 01c43405d6
4 changed files with 28 additions and 8 deletions

View File

@ -29,9 +29,9 @@
#include "qemu/module.h"
#include "sysemu/dma.h"
#include "hw/ide/mmio.h"
#include "hw/ide/internal.h"
#include "hw/qdev-properties.h"
#include "qom/object.h"
/***********************************************************/
/* MMIO based ide port
@ -39,9 +39,6 @@
* dedicated ide controller, which is often seen on embedded boards.
*/
#define TYPE_MMIO_IDE "mmio-ide"
OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE)
struct MMIOIDEState {
/*< private >*/
SysBusDevice parent_obj;

View File

@ -38,7 +38,7 @@
#include "hw/qdev-properties.h"
#include "net/net.h"
#include "sh7750_regs.h"
#include "hw/ide.h"
#include "hw/ide/mmio.h"
#include "hw/irq.h"
#include "hw/loader.h"
#include "hw/usb.h"

View File

@ -8,9 +8,6 @@
ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
DriveInfo *hd0, DriveInfo *hd1);
/* ide-mmio.c */
void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1);
int ide_get_geometry(BusState *bus, int unit,
int16_t *cyls, int8_t *heads, int8_t *secs);
int ide_get_bios_chs_trans(BusState *bus, int unit);

26
include/hw/ide/mmio.h Normal file
View File

@ -0,0 +1,26 @@
/*
* QEMU IDE Emulation: mmio support (for embedded).
*
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2006 Openedhand Ltd.
*
* SPDX-License-Identifier: MIT
*/
#ifndef HW_IDE_MMIO_H
#define HW_IDE_MMIO_H
#include "qom/object.h"
/*
* QEMU interface:
* + sysbus IRQ 0: asserted by the IDE channel
* + sysbus MMIO region 0: data registers
* + sysbus MMIO region 1: status & control registers
*/
#define TYPE_MMIO_IDE "mmio-ide"
OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE)
void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1);
#endif