Statistics
| Branch: | Revision:

root / hw / shpc.h @ bc927e48

History | View | Annotate | Download (1.2 kB)

1 1dc324d2 Michael S. Tsirkin
#ifndef SHPC_H
2 1dc324d2 Michael S. Tsirkin
#define SHPC_H
3 1dc324d2 Michael S. Tsirkin
4 1dc324d2 Michael S. Tsirkin
#include "qemu-common.h"
5 1dc324d2 Michael S. Tsirkin
#include "memory.h"
6 1dc324d2 Michael S. Tsirkin
#include "vmstate.h"
7 1dc324d2 Michael S. Tsirkin
8 1dc324d2 Michael S. Tsirkin
struct SHPCDevice {
9 1dc324d2 Michael S. Tsirkin
    /* Capability offset in device's config space */
10 1dc324d2 Michael S. Tsirkin
    int cap;
11 1dc324d2 Michael S. Tsirkin
12 1dc324d2 Michael S. Tsirkin
    /* # of hot-pluggable slots */
13 1dc324d2 Michael S. Tsirkin
    int nslots;
14 1dc324d2 Michael S. Tsirkin
15 1dc324d2 Michael S. Tsirkin
    /* SHPC WRS: working register set */
16 1dc324d2 Michael S. Tsirkin
    uint8_t *config;
17 1dc324d2 Michael S. Tsirkin
18 1dc324d2 Michael S. Tsirkin
    /* Used to enable checks on load. Note that writable bits are
19 1dc324d2 Michael S. Tsirkin
     * never checked even if set in cmask. */
20 1dc324d2 Michael S. Tsirkin
    uint8_t *cmask;
21 1dc324d2 Michael S. Tsirkin
22 1dc324d2 Michael S. Tsirkin
    /* Used to implement R/W bytes */
23 1dc324d2 Michael S. Tsirkin
    uint8_t *wmask;
24 1dc324d2 Michael S. Tsirkin
25 1dc324d2 Michael S. Tsirkin
    /* Used to implement RW1C(Write 1 to Clear) bytes */
26 1dc324d2 Michael S. Tsirkin
    uint8_t *w1cmask;
27 1dc324d2 Michael S. Tsirkin
28 1dc324d2 Michael S. Tsirkin
    /* MMIO for the SHPC BAR */
29 1dc324d2 Michael S. Tsirkin
    MemoryRegion mmio;
30 1dc324d2 Michael S. Tsirkin
31 1dc324d2 Michael S. Tsirkin
    /* Bus controlled by this SHPC */
32 1dc324d2 Michael S. Tsirkin
    PCIBus *sec_bus;
33 1dc324d2 Michael S. Tsirkin
34 1dc324d2 Michael S. Tsirkin
    /* MSI already requested for this event */
35 1dc324d2 Michael S. Tsirkin
    int msi_requested;
36 1dc324d2 Michael S. Tsirkin
};
37 1dc324d2 Michael S. Tsirkin
38 1dc324d2 Michael S. Tsirkin
void shpc_reset(PCIDevice *d);
39 1dc324d2 Michael S. Tsirkin
int shpc_bar_size(PCIDevice *dev);
40 1dc324d2 Michael S. Tsirkin
int shpc_init(PCIDevice *dev, PCIBus *sec_bus, MemoryRegion *bar, unsigned off);
41 1dc324d2 Michael S. Tsirkin
void shpc_cleanup(PCIDevice *dev, MemoryRegion *bar);
42 1dc324d2 Michael S. Tsirkin
void shpc_cap_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int len);
43 1dc324d2 Michael S. Tsirkin
44 1dc324d2 Michael S. Tsirkin
extern VMStateInfo shpc_vmstate_info;
45 1dc324d2 Michael S. Tsirkin
#define SHPC_VMSTATE(_field, _type) \
46 1dc324d2 Michael S. Tsirkin
    VMSTATE_BUFFER_UNSAFE_INFO(_field, _type, 0, shpc_vmstate_info, 0)
47 1dc324d2 Michael S. Tsirkin
48 1dc324d2 Michael S. Tsirkin
#endif