Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / ide / ahci.h
blobba31e75ff9b2ebc8ec33fa33d9c2aeba1f1c38f6
1 /*
2 * QEMU AHCI Emulation
4 * Copyright (c) 2010 qiaochong@loongson.cn
5 * Copyright (c) 2010 Roland Elek <elek.roland@gmail.com>
6 * Copyright (c) 2010 Sebastian Herbszt <herbszt@gmx.de>
7 * Copyright (c) 2010 Alexander Graf <agraf@suse.de>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
24 #ifndef HW_IDE_AHCI_H
25 #define HW_IDE_AHCI_H
27 #include "exec/memory.h"
29 typedef struct AHCIDevice AHCIDevice;
31 typedef struct AHCIControlRegs {
32 uint32_t cap;
33 uint32_t ghc;
34 uint32_t irqstatus;
35 uint32_t impl;
36 uint32_t version;
37 } AHCIControlRegs;
39 typedef struct AHCIState {
40 DeviceState *container;
42 AHCIDevice *dev;
43 AHCIControlRegs control_regs;
44 MemoryRegion mem;
45 MemoryRegion idp; /* Index-Data Pair I/O port space */
46 unsigned idp_offset; /* Offset of index in I/O port space */
47 uint32_t idp_index; /* Current IDP index */
48 uint32_t ports;
49 qemu_irq irq;
50 AddressSpace *as;
51 } AHCIState;
54 void ahci_ide_create_devs(AHCIState *ahci, DriveInfo **hd);
56 #endif /* HW_IDE_AHCI_H */