1 | /** @file
|
---|
2 | *
|
---|
3 | * PCI Internal header - Only for hiding bits of PCIDEVICE.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __PCIInternal_h__
|
---|
23 | #define __PCIInternal_h__
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * PCI I/O region.
|
---|
27 | */
|
---|
28 | typedef struct PCIIOREGION
|
---|
29 | {
|
---|
30 | /** Current PCI mapping address.
|
---|
31 | * -1 means not mapped. Memory addresses are relative to pci_mem_base. */
|
---|
32 | uint32_t addr;
|
---|
33 | uint32_t size;
|
---|
34 | uint8_t type; /* PCIADDRESSSPACE */
|
---|
35 | uint8_t padding[HC_ARCH_BITS == 32 ? 3 : 7];
|
---|
36 | /** Callback called when the region is mapped. */
|
---|
37 | HCPTRTYPE(PFNPCIIOREGIONMAP) map_func;
|
---|
38 | } PCIIOREGION, PCIIORegion;
|
---|
39 | /** Pointer to PCI I/O region. */
|
---|
40 | typedef PCIIOREGION *PPCIIOREGION;
|
---|
41 |
|
---|
42 | /** Pointer to pci_default_read_config. */
|
---|
43 | typedef uint32_t (*PFNPCICONFIGREAD)(PPCIDEVICE pPciDev, uint32_t u32CfgAddress, int cb);
|
---|
44 | /** Pointer to pci_default_write_config. */
|
---|
45 | typedef void (*PFNPCICONFIGWRITE)(PPCIDEVICE pPciDev, uint32_t u32CfgAddress, uint32_t u32Data, int cb);
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * PCI Device - Internal data.
|
---|
49 | */
|
---|
50 | typedef struct PCIDEVICEINT
|
---|
51 | {
|
---|
52 | /** I/O regions. */
|
---|
53 | PCIIOREGION aIORegions[PCI_NUM_REGIONS];
|
---|
54 | /** Pointer to the PCI bus of the device. */
|
---|
55 | R3PTRTYPE(struct PCIBus *) pBus;
|
---|
56 | /** Read config callback. */
|
---|
57 | R3PTRTYPE(PFNPCICONFIGREAD) pfnConfigRead;
|
---|
58 | /** Write config callback. */
|
---|
59 | R3PTRTYPE(PFNPCICONFIGWRITE) pfnConfigWrite;
|
---|
60 | /** The irq assigned to the device. */
|
---|
61 | int32_t iIrq;
|
---|
62 | /** Set if the specific device fun was requested by PDM.
|
---|
63 | * If clear the device and it's functions can be relocated to satisfy the slot request of another device. */
|
---|
64 | bool fRequestedDevFn;
|
---|
65 | } PCIDEVICEINT;
|
---|
66 |
|
---|
67 | /* Indicate that PCIDEVICE::Int.s can be declared. */
|
---|
68 | #define __PCIDEVICEINT_DECLARED__
|
---|
69 |
|
---|
70 | #endif
|
---|