Revision 4677d8ed
b/hw/pci_host.c | ||
---|---|---|
71 | 71 |
uint32_t config_addr = pci_addr_to_config(addr); |
72 | 72 |
uint32_t val; |
73 | 73 |
|
74 |
assert(len == 1 || len == 2 || len == 4); |
|
74 | 75 |
if (!pci_dev) { |
75 |
switch(len) { |
|
76 |
case 1: |
|
77 |
val = 0xff; |
|
78 |
break; |
|
79 |
case 2: |
|
80 |
val = 0xffff; |
|
81 |
break; |
|
82 |
default: |
|
83 |
case 4: |
|
84 |
val = 0xffffffff; |
|
85 |
break; |
|
86 |
} |
|
87 |
} else { |
|
88 |
val = pci_dev->config_read(pci_dev, config_addr, len); |
|
89 |
PCI_DPRINTF("%s: %s: addr=%02"PRIx32" val=%08"PRIx32" len=%d\n", |
|
90 |
__func__, pci_dev->name, config_addr, val, len); |
|
76 |
return ~0x0; |
|
91 | 77 |
} |
92 | 78 |
|
79 |
val = pci_dev->config_read(pci_dev, config_addr, len); |
|
80 |
PCI_DPRINTF("%s: %s: addr=%02"PRIx32" val=%08"PRIx32" len=%d\n", |
|
81 |
__func__, pci_dev->name, config_addr, val, len); |
|
82 |
|
|
93 | 83 |
return val; |
94 | 84 |
} |
95 | 85 |
|
b/hw/pcie_host.c | ||
---|---|---|
65 | 65 |
PCIE_MMCFG_CONFOFFSET(mmcfg_addr), val, len); |
66 | 66 |
} |
67 | 67 |
|
68 |
static uint32_t pcie_mmcfg_data_read(PCIBus *s, |
|
69 |
uint32_t mmcfg_addr, int len) |
|
68 |
static uint32_t pcie_mmcfg_data_read(PCIBus *s, uint32_t addr, int len) |
|
70 | 69 |
{ |
71 |
PCIDevice *pci_dev = pcie_mmcfg_addr_to_dev(s, mmcfg_addr); |
|
72 |
uint32_t val; |
|
70 |
PCIDevice *pci_dev = pcie_mmcfg_addr_to_dev(s, addr); |
|
73 | 71 |
|
72 |
assert(len == 1 || len == 2 || len == 4); |
|
74 | 73 |
if (!pci_dev) { |
75 |
switch(len) { |
|
76 |
case 1: |
|
77 |
val = 0xff; |
|
78 |
break; |
|
79 |
case 2: |
|
80 |
val = 0xffff; |
|
81 |
break; |
|
82 |
default: |
|
83 |
case 4: |
|
84 |
val = 0xffffffff; |
|
85 |
break; |
|
86 |
} |
|
87 |
} else { |
|
88 |
val = pci_dev->config_read(pci_dev, |
|
89 |
PCIE_MMCFG_CONFOFFSET(mmcfg_addr), len); |
|
74 |
return ~0x0; |
|
90 | 75 |
} |
91 |
|
|
92 |
return val; |
|
76 |
return pci_dev->config_read(pci_dev, PCIE_MMCFG_CONFOFFSET(addr), len); |
|
93 | 77 |
} |
94 | 78 |
|
95 | 79 |
static void pcie_mmcfg_data_writeb(void *opaque, |
Also available in: Unified diff