Statistics
| Branch: | Revision:

root / hw / msi.h @ 6059631c

History | View | Annotate | Download (1.4 kB)

1 e4c7d2ae Isaku Yamahata
/*
2 e4c7d2ae Isaku Yamahata
 * msi.h
3 e4c7d2ae Isaku Yamahata
 *
4 e4c7d2ae Isaku Yamahata
 * Copyright (c) 2010 Isaku Yamahata <yamahata at valinux co jp>
5 e4c7d2ae Isaku Yamahata
 *                    VA Linux Systems Japan K.K.
6 e4c7d2ae Isaku Yamahata
 *
7 e4c7d2ae Isaku Yamahata
 * This program is free software; you can redistribute it and/or modify
8 e4c7d2ae Isaku Yamahata
 * it under the terms of the GNU General Public License as published by
9 e4c7d2ae Isaku Yamahata
 * the Free Software Foundation; either version 2 of the License, or
10 e4c7d2ae Isaku Yamahata
 * (at your option) any later version.
11 e4c7d2ae Isaku Yamahata

12 e4c7d2ae Isaku Yamahata
 * This program is distributed in the hope that it will be useful,
13 e4c7d2ae Isaku Yamahata
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 e4c7d2ae Isaku Yamahata
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 e4c7d2ae Isaku Yamahata
 * GNU General Public License for more details.
16 e4c7d2ae Isaku Yamahata

17 e4c7d2ae Isaku Yamahata
 * You should have received a copy of the GNU General Public License along
18 e4c7d2ae Isaku Yamahata
 * with this program; if not, see <http://www.gnu.org/licenses/>.
19 e4c7d2ae Isaku Yamahata
 */
20 e4c7d2ae Isaku Yamahata
21 e4c7d2ae Isaku Yamahata
#ifndef QEMU_MSI_H
22 e4c7d2ae Isaku Yamahata
#define QEMU_MSI_H
23 e4c7d2ae Isaku Yamahata
24 e4c7d2ae Isaku Yamahata
#include "qemu-common.h"
25 e4c7d2ae Isaku Yamahata
#include "pci.h"
26 e4c7d2ae Isaku Yamahata
27 e4c7d2ae Isaku Yamahata
bool msi_enabled(const PCIDevice *dev);
28 e4c7d2ae Isaku Yamahata
int msi_init(struct PCIDevice *dev, uint8_t offset,
29 e4c7d2ae Isaku Yamahata
             unsigned int nr_vectors, bool msi64bit, bool msi_per_vector_mask);
30 e4c7d2ae Isaku Yamahata
void msi_uninit(struct PCIDevice *dev);
31 e4c7d2ae Isaku Yamahata
void msi_reset(PCIDevice *dev);
32 e4c7d2ae Isaku Yamahata
void msi_notify(PCIDevice *dev, unsigned int vector);
33 e4c7d2ae Isaku Yamahata
void msi_write_config(PCIDevice *dev, uint32_t addr, uint32_t val, int len);
34 e4c7d2ae Isaku Yamahata
unsigned int msi_nr_vectors_allocated(const PCIDevice *dev);
35 e4c7d2ae Isaku Yamahata
36 e4c7d2ae Isaku Yamahata
static inline bool msi_present(const PCIDevice *dev)
37 e4c7d2ae Isaku Yamahata
{
38 e4c7d2ae Isaku Yamahata
    return dev->cap_present & QEMU_PCI_CAP_MSI;
39 e4c7d2ae Isaku Yamahata
}
40 e4c7d2ae Isaku Yamahata
41 e4c7d2ae Isaku Yamahata
#endif /* QEMU_MSI_H */