mirror of
https://github.com/qemu/qemu.git
synced 2024-12-14 23:13:29 +08:00
8110fa1d94
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>
95 lines
2.6 KiB
C
95 lines
2.6 KiB
C
/*
|
|
* QEMU AHCI Emulation
|
|
*
|
|
* Copyright (c) 2010 qiaochong@loongson.cn
|
|
* Copyright (c) 2010 Roland Elek <elek.roland@gmail.com>
|
|
* Copyright (c) 2010 Sebastian Herbszt <herbszt@gmx.de>
|
|
* Copyright (c) 2010 Alexander Graf <agraf@suse.de>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
#ifndef HW_IDE_AHCI_H
|
|
#define HW_IDE_AHCI_H
|
|
|
|
#include "hw/sysbus.h"
|
|
#include "qom/object.h"
|
|
|
|
typedef struct AHCIDevice AHCIDevice;
|
|
|
|
typedef struct AHCIControlRegs {
|
|
uint32_t cap;
|
|
uint32_t ghc;
|
|
uint32_t irqstatus;
|
|
uint32_t impl;
|
|
uint32_t version;
|
|
} AHCIControlRegs;
|
|
|
|
typedef struct AHCIState {
|
|
DeviceState *container;
|
|
|
|
AHCIDevice *dev;
|
|
AHCIControlRegs control_regs;
|
|
MemoryRegion mem;
|
|
MemoryRegion idp; /* Index-Data Pair I/O port space */
|
|
unsigned idp_offset; /* Offset of index in I/O port space */
|
|
uint32_t idp_index; /* Current IDP index */
|
|
int32_t ports;
|
|
qemu_irq irq;
|
|
AddressSpace *as;
|
|
} AHCIState;
|
|
|
|
typedef struct AHCIPCIState AHCIPCIState;
|
|
|
|
#define TYPE_ICH9_AHCI "ich9-ahci"
|
|
DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH_AHCI,
|
|
TYPE_ICH9_AHCI)
|
|
|
|
int32_t ahci_get_num_ports(PCIDevice *dev);
|
|
void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd);
|
|
|
|
#define TYPE_SYSBUS_AHCI "sysbus-ahci"
|
|
typedef struct SysbusAHCIState SysbusAHCIState;
|
|
DECLARE_INSTANCE_CHECKER(SysbusAHCIState, SYSBUS_AHCI,
|
|
TYPE_SYSBUS_AHCI)
|
|
|
|
struct SysbusAHCIState {
|
|
/*< private >*/
|
|
SysBusDevice parent_obj;
|
|
/*< public >*/
|
|
|
|
AHCIState ahci;
|
|
uint32_t num_ports;
|
|
};
|
|
|
|
#define TYPE_ALLWINNER_AHCI "allwinner-ahci"
|
|
typedef struct AllwinnerAHCIState AllwinnerAHCIState;
|
|
DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState, ALLWINNER_AHCI,
|
|
TYPE_ALLWINNER_AHCI)
|
|
|
|
#define ALLWINNER_AHCI_MMIO_OFF 0x80
|
|
#define ALLWINNER_AHCI_MMIO_SIZE 0x80
|
|
|
|
struct AllwinnerAHCIState {
|
|
/*< private >*/
|
|
SysbusAHCIState parent_obj;
|
|
/*< public >*/
|
|
|
|
MemoryRegion mmio;
|
|
uint32_t regs[ALLWINNER_AHCI_MMIO_SIZE/4];
|
|
};
|
|
|
|
#endif /* HW_IDE_AHCI_H */
|