src/emu/machine/pci.c
| r15466 | r15467 | |
| 70 | 70 | ***************************************************************************/ |
| 71 | 71 | |
| 72 | 72 | #include "emu.h" |
| 73 | | #include "devconv.h" |
| 74 | 73 | #include "machine/pci.h" |
| 75 | 74 | |
| 76 | 75 | #define LOG_PCI 0 |
| 77 | 76 | |
| 78 | | typedef struct _pci_bus_state pci_bus_state; |
| 79 | | struct _pci_bus_state |
| 80 | | { |
| 81 | | device_t * busdevice; |
| 82 | | const pci_bus_config * config; |
| 83 | | device_t * device[32]; |
| 84 | | pci_bus_state * siblings[8]; |
| 85 | | UINT8 siblings_busnum[8]; |
| 86 | | int siblings_count; |
| 87 | | offs_t address; |
| 88 | | INT8 devicenum; // device number we are addressing |
| 89 | | INT8 busnum; // pci bus number we are addressing |
| 90 | | pci_bus_state * busnumaddr; // pci bus we are addressing |
| 91 | | }; |
| 77 | //************************************************************************** |
| 78 | // GLOBAL VARIABLES |
| 79 | //************************************************************************** |
| 92 | 80 | |
| 81 | const device_type PCI_BUS = &device_creator<pci_bus_device>; |
| 93 | 82 | |
| 83 | //************************************************************************** |
| 84 | // LIVE DEVICE |
| 85 | //************************************************************************** |
| 94 | 86 | |
| 87 | //------------------------------------------------- |
| 88 | // pci_bus_device - constructor |
| 89 | //------------------------------------------------- |
| 90 | pci_bus_device::pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 91 | device_t(mconfig, PCI_BUS, "PCI Bus", tag, owner, clock), |
| 92 | m_father(NULL) |
| 93 | { |
| 94 | for (int i = 0; i < ARRAY_LENGTH(m_devtag); i++) { |
| 95 | m_devtag[i]= NULL; |
| 96 | m_read_callback[i] = NULL; |
| 97 | m_write_callback[i] = NULL; |
| 98 | } |
| 99 | m_siblings_count = 0; |
| 100 | } |
| 101 | |
| 95 | 102 | /*************************************************************************** |
| 96 | 103 | INLINE FUNCTIONS |
| 97 | 104 | ***************************************************************************/ |
| 98 | 105 | |
| 99 | | /*------------------------------------------------- |
| 100 | | get_safe_token - makes sure that the passed |
| 101 | | in device is, in fact, a PCI bus |
| 102 | | -------------------------------------------------*/ |
| 103 | | |
| 104 | | INLINE pci_bus_state *get_safe_token(device_t *device) |
| 106 | READ32_MEMBER( pci_bus_device::read ) |
| 105 | 107 | { |
| 106 | | assert(device != NULL); |
| 107 | | assert(device->type() == PCI_BUS); |
| 108 | | |
| 109 | | return (pci_bus_state *)downcast<legacy_device_base *>(device)->token(); |
| 110 | | } |
| 111 | | |
| 112 | | |
| 113 | | |
| 114 | | READ32_DEVICE_HANDLER( pci_32le_r ) |
| 115 | | { |
| 116 | | pci_bus_state *pcibus = get_safe_token(device); |
| 117 | 108 | UINT32 result = 0xffffffff; |
| 118 | 109 | int function, reg; |
| 119 | 110 | |
| r15466 | r15467 | |
| 122 | 113 | switch (offset) |
| 123 | 114 | { |
| 124 | 115 | case 0: |
| 125 | | result = pcibus->address; |
| 116 | result = m_address; |
| 126 | 117 | break; |
| 127 | 118 | |
| 128 | 119 | case 1: |
| 129 | | if (pcibus->devicenum != -1) |
| 120 | if (m_devicenum != -1) |
| 130 | 121 | { |
| 131 | | pci_read_func read = pcibus->busnumaddr->config->device[pcibus->devicenum].read_callback; |
| 122 | pci_read_func read = m_busnumaddr->m_read_callback[m_devicenum]; |
| 132 | 123 | if (read != NULL) |
| 133 | 124 | { |
| 134 | | function = (pcibus->address >> 8) & 0x07; |
| 135 | | reg = (pcibus->address >> 0) & 0xfc; |
| 136 | | result = (*read)(pcibus->busnumaddr->busdevice, pcibus->busnumaddr->device[pcibus->devicenum], function, reg, mem_mask); |
| 125 | function = (m_address >> 8) & 0x07; |
| 126 | reg = (m_address >> 0) & 0xfc; |
| 127 | result = (*read)(m_busnumaddr, m_busnumaddr->m_device[m_devicenum], function, reg, mem_mask); |
| 137 | 128 | } |
| 138 | 129 | } |
| 139 | 130 | break; |
| 140 | 131 | } |
| 141 | 132 | |
| 142 | 133 | if (LOG_PCI) |
| 143 | | logerror("pci_32le_r('%s'): offset=%d result=0x%08X\n", device->tag(), offset, result); |
| 134 | logerror("read('%s'): offset=%d result=0x%08X\n", tag(), offset, result); |
| 144 | 135 | |
| 145 | 136 | return result; |
| 146 | 137 | } |
| 147 | 138 | |
| 148 | 139 | |
| 149 | 140 | |
| 150 | | static pci_bus_state *pci_search_bustree(int busnum, int devicenum, pci_bus_state *pcibus) |
| 141 | pci_bus_device *pci_bus_device::pci_search_bustree(int busnum, int devicenum, pci_bus_device *pcibus) |
| 151 | 142 | { |
| 152 | | int a; |
| 153 | | pci_bus_state *ret; |
| 143 | int a; |
| 144 | pci_bus_device *ret; |
| 154 | 145 | |
| 155 | | if (pcibus->config->busnum == busnum) |
| 146 | if (pcibus->m_busnum == busnum) |
| 156 | 147 | { |
| 157 | 148 | return pcibus; |
| 158 | 149 | } |
| 159 | | for (a = 0; a < pcibus->siblings_count; a++) |
| 150 | for (a = 0; a < pcibus->m_siblings_count; a++) |
| 160 | 151 | { |
| 161 | | ret = pci_search_bustree(busnum, devicenum, pcibus->siblings[a]); |
| 152 | ret = pci_search_bustree(busnum, devicenum, pcibus->m_siblings[a]); |
| 162 | 153 | if (ret != NULL) |
| 163 | 154 | return ret; |
| 164 | 155 | } |
| r15466 | r15467 | |
| 167 | 158 | |
| 168 | 159 | |
| 169 | 160 | |
| 170 | | WRITE32_DEVICE_HANDLER( pci_32le_w ) |
| 161 | WRITE32_MEMBER( pci_bus_device::write ) |
| 171 | 162 | { |
| 172 | | pci_bus_state *pcibus = get_safe_token(device); |
| 173 | | |
| 174 | 163 | offset %= 2; |
| 175 | 164 | |
| 176 | 165 | if (LOG_PCI) |
| 177 | | logerror("pci_32le_w('%s'): offset=%d data=0x%08X\n", device->tag(), offset, data); |
| 166 | logerror("write('%s'): offset=%d data=0x%08X\n", tag(), offset, data); |
| 178 | 167 | |
| 179 | 168 | switch (offset) |
| 180 | 169 | { |
| 181 | 170 | case 0: |
| 182 | | pcibus->address = data; |
| 171 | m_address = data; |
| 183 | 172 | |
| 184 | 173 | /* lookup current device */ |
| 185 | | if (pcibus->address & 0x80000000) |
| 174 | if (m_address & 0x80000000) |
| 186 | 175 | { |
| 187 | | int busnum = (pcibus->address >> 16) & 0xff; |
| 188 | | int devicenum = (pcibus->address >> 11) & 0x1f; |
| 189 | | pcibus->busnumaddr = pci_search_bustree(busnum, devicenum, pcibus); |
| 190 | | if (pcibus->busnumaddr != NULL) |
| 176 | int busnum = (m_address >> 16) & 0xff; |
| 177 | int devicenum = (m_address >> 11) & 0x1f; |
| 178 | m_busnumaddr = pci_search_bustree(busnum, devicenum, this); |
| 179 | if (m_busnumaddr != NULL) |
| 191 | 180 | { |
| 192 | | pcibus->busnum = busnum; |
| 193 | | pcibus->devicenum = devicenum; |
| 181 | m_busnumber = busnum; |
| 182 | m_devicenum = devicenum; |
| 194 | 183 | } |
| 195 | 184 | else |
| 196 | | pcibus->devicenum = -1; |
| 185 | m_devicenum = -1; |
| 197 | 186 | if (LOG_PCI) |
| 198 | 187 | logerror(" bus:%d device:%d\n", busnum, devicenum); |
| 199 | 188 | } |
| 200 | 189 | break; |
| 201 | 190 | |
| 202 | 191 | case 1: |
| 203 | | if (pcibus->devicenum != -1) |
| 192 | if (m_devicenum != -1) |
| 204 | 193 | { |
| 205 | | pci_write_func write = pcibus->busnumaddr->config->device[pcibus->devicenum].write_callback; |
| 194 | pci_write_func write = m_busnumaddr->m_write_callback[m_devicenum]; |
| 206 | 195 | if (write != NULL) |
| 207 | 196 | { |
| 208 | | int function = (pcibus->address >> 8) & 0x07; |
| 209 | | int reg = (pcibus->address >> 0) & 0xfc; |
| 210 | | (*write)(pcibus->busnumaddr->busdevice, pcibus->busnumaddr->device[pcibus->devicenum], function, reg, data, mem_mask); |
| 197 | int function = (m_address >> 8) & 0x07; |
| 198 | int reg = (m_address >> 0) & 0xfc; |
| 199 | (*write)(m_busnumaddr, m_busnumaddr->m_device[m_devicenum], function, reg, data, mem_mask); |
| 211 | 200 | } |
| 212 | 201 | if (LOG_PCI) |
| 213 | | logerror(" function:%d register:%d\n", (pcibus->address >> 8) & 0x07, (pcibus->address >> 0) & 0xfc); |
| 202 | logerror(" function:%d register:%d\n", (m_address >> 8) & 0x07, (m_address >> 0) & 0xfc); |
| 214 | 203 | } |
| 215 | 204 | break; |
| 216 | 205 | } |
| r15466 | r15467 | |
| 218 | 207 | |
| 219 | 208 | |
| 220 | 209 | |
| 221 | | READ64_DEVICE_HANDLER(pci_64be_r) { return read64be_with_32le_device_handler(pci_32le_r, device, offset, mem_mask); } |
| 222 | | WRITE64_DEVICE_HANDLER(pci_64be_w) { write64be_with_32le_device_handler(pci_32le_w, device, offset, data, mem_mask); } |
| 210 | READ64_MEMBER(pci_bus_device::read_64be) |
| 211 | { |
| 212 | UINT64 result = 0; |
| 213 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 214 | if (ACCESSING_BITS_0_31) |
| 215 | result |= (UINT64)read(space, offset * 2 + 0, mem_mask >> 0) << 0; |
| 216 | if (ACCESSING_BITS_32_63) |
| 217 | result |= (UINT64)read(space, offset * 2 + 1, mem_mask >> 32) << 32; |
| 218 | return FLIPENDIAN_INT64(result); |
| 219 | } |
| 223 | 220 | |
| 221 | WRITE64_MEMBER(pci_bus_device::write_64be) |
| 222 | { |
| 223 | data = FLIPENDIAN_INT64(data); |
| 224 | mem_mask = FLIPENDIAN_INT64(mem_mask); |
| 225 | if (ACCESSING_BITS_0_31) |
| 226 | write(space, offset * 2 + 0, data >> 0, mem_mask >> 0); |
| 227 | if (ACCESSING_BITS_32_63) |
| 228 | write(space, offset * 2 + 1, data >> 32, mem_mask >> 32); |
| 229 | } |
| 224 | 230 | |
| 225 | | int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling ) |
| 226 | | { |
| 227 | | device_t *device1 = machine.device(pcitag); |
| 228 | | device_t *device2 = machine.device(sibling); |
| 229 | | pci_bus_state *pcibus1 = get_safe_token(device1); |
| 230 | | pci_bus_state *pcibus2 = get_safe_token(device2); |
| 231 | | pci_bus_config *config2; |
| 232 | 231 | |
| 233 | | if ((device1 == NULL) || (device2 == NULL) || (pcibus1 == NULL) || (pcibus2 == NULL)) |
| 234 | | return 0; |
| 235 | | if (pcibus1->siblings_count == 8) |
| 236 | | return 0; |
| 237 | | config2 = (pci_bus_config *)downcast<const legacy_device_base *>(device2)->inline_config(); |
| 238 | | pcibus1->siblings[pcibus1->siblings_count] = get_safe_token(device2); |
| 239 | | pcibus1->siblings_busnum[pcibus1->siblings_count] = config2->busnum; |
| 240 | | pcibus1->siblings_count++; |
| 241 | | return 1; |
| 232 | void pci_bus_device::add_sibling(pci_bus_device *sibling, int busnum) |
| 233 | { |
| 234 | m_siblings[m_siblings_count] = sibling; |
| 235 | m_siblings_busnum[m_siblings_count] = busnum; |
| 236 | m_siblings_count++; |
| 242 | 237 | } |
| 243 | 238 | |
| 244 | 239 | |
| 245 | | /*************************************************************************** |
| 246 | | DEVICE INTERFACE |
| 247 | | ***************************************************************************/ |
| 240 | //------------------------------------------------- |
| 241 | // device_post_load - handle updating after a |
| 242 | // restore |
| 243 | //------------------------------------------------- |
| 248 | 244 | |
| 249 | | |
| 250 | | static void pci_bus_postload(pci_bus_state *pcibus) |
| 245 | void pci_bus_device::device_post_load() |
| 251 | 246 | { |
| 252 | | if (pcibus->devicenum != -1) |
| 247 | if (m_devicenum != -1) |
| 253 | 248 | { |
| 254 | | pcibus->busnumaddr = pci_search_bustree(pcibus->busnum, pcibus->devicenum, pcibus); |
| 249 | m_busnumaddr = pci_search_bustree(m_busnumber, m_devicenum, this); |
| 255 | 250 | } |
| 256 | 251 | } |
| 257 | 252 | |
| 253 | //------------------------------------------------- |
| 254 | // device_start - device-specific startup |
| 255 | //------------------------------------------------- |
| 258 | 256 | |
| 259 | | /*------------------------------------------------- |
| 260 | | device start callback |
| 261 | | -------------------------------------------------*/ |
| 262 | | |
| 263 | | static DEVICE_START( pci_bus ) |
| 257 | void pci_bus_device::device_start() |
| 264 | 258 | { |
| 265 | | pci_bus_state *pcibus = get_safe_token(device); |
| 266 | | int devicenum; |
| 267 | | |
| 268 | | /* validate some basic stuff */ |
| 269 | | assert(device != NULL); |
| 270 | | assert(device->static_config() == NULL); |
| 271 | | assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL); |
| 272 | | |
| 273 | 259 | /* store a pointer back to the device */ |
| 274 | | pcibus->config = (const pci_bus_config *)downcast<const legacy_device_base *>(device)->inline_config(); |
| 275 | | pcibus->busdevice = device; |
| 276 | | pcibus->devicenum = -1; |
| 260 | m_devicenum = -1; |
| 277 | 261 | |
| 278 | 262 | /* find all our devices */ |
| 279 | | for (devicenum = 0; devicenum < ARRAY_LENGTH(pcibus->device); devicenum++) |
| 280 | | if (pcibus->config->device[devicenum].devtag != NULL) |
| 281 | | pcibus->device[devicenum] = device->machine().device(pcibus->config->device[devicenum].devtag); |
| 263 | for (int i = 0; i < ARRAY_LENGTH(m_devtag); i++) |
| 264 | if (m_devtag[i] != NULL) |
| 265 | m_device[i] = machine().device(m_devtag[i]); |
| 282 | 266 | |
| 283 | | if (pcibus->config->father != NULL) |
| 284 | | pci_add_sibling(device->machine(), (char *)pcibus->config->father, (char *)device->tag()); |
| 267 | if (m_father != NULL) { |
| 268 | pci_bus_device *father = machine().device<pci_bus_device>(m_father); |
| 269 | if (father) |
| 270 | father->add_sibling(this, m_busnum); |
| 271 | } |
| 285 | 272 | |
| 286 | 273 | /* register pci states */ |
| 287 | | device->save_item(NAME(pcibus->address)); |
| 288 | | device->save_item(NAME(pcibus->devicenum)); |
| 289 | | device->save_item(NAME(pcibus->busnum)); |
| 290 | | |
| 291 | | device->machine().save().register_postload(save_prepost_delegate(FUNC(pci_bus_postload), pcibus)); |
| 274 | save_item(NAME(m_address)); |
| 275 | save_item(NAME(m_devicenum)); |
| 276 | save_item(NAME(m_busnum)); |
| 292 | 277 | } |
| 293 | 278 | |
| 294 | 279 | |
| 295 | | /*------------------------------------------------- |
| 296 | | device reset callback |
| 297 | | -------------------------------------------------*/ |
| 280 | //------------------------------------------------- |
| 281 | // device_reset - device-specific reset |
| 282 | //------------------------------------------------- |
| 298 | 283 | |
| 299 | | static DEVICE_RESET( pci_bus ) |
| 284 | void pci_bus_device::device_reset() |
| 300 | 285 | { |
| 301 | | pci_bus_state *pcibus = get_safe_token(device); |
| 302 | | |
| 303 | 286 | /* reset the drive state */ |
| 304 | | pcibus->devicenum = -1; |
| 305 | | pcibus->address = 0; |
| 287 | m_devicenum = -1; |
| 288 | m_address = 0; |
| 306 | 289 | } |
| 307 | | |
| 308 | | |
| 309 | | /*------------------------------------------------- |
| 310 | | device get info callback |
| 311 | | -------------------------------------------------*/ |
| 312 | | |
| 313 | | DEVICE_GET_INFO( pci_bus ) |
| 314 | | { |
| 315 | | switch (state) |
| 316 | | { |
| 317 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 318 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(pci_bus_state); break; |
| 319 | | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(pci_bus_config); break; |
| 320 | | |
| 321 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 322 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(pci_bus); break; |
| 323 | | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(pci_bus);break; |
| 324 | | |
| 325 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 326 | | case DEVINFO_STR_NAME: strcpy(info->s, "PCI Bus"); break; |
| 327 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "Peripherial Bus"); break; |
| 328 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 329 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 330 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; |
| 331 | | } |
| 332 | | } |
| 333 | | |
| 334 | | |
| 335 | | DEFINE_LEGACY_DEVICE(PCI_BUS, pci_bus); |
src/emu/machine/pci.h
| r15466 | r15467 | |
| 9 | 9 | #ifndef PCI_H |
| 10 | 10 | #define PCI_H |
| 11 | 11 | |
| 12 | | #include "devlegcy.h" |
| 12 | //************************************************************************** |
| 13 | // TYPE DEFINITIONS |
| 14 | //************************************************************************** |
| 13 | 15 | |
| 14 | | |
| 15 | | /*************************************************************************** |
| 16 | | TYPE DEFINITIONS |
| 17 | | ***************************************************************************/ |
| 18 | | |
| 19 | 16 | typedef UINT32 (*pci_read_func)(device_t *pcibus, device_t *device, int function, int reg, UINT32 mem_mask); |
| 20 | 17 | typedef void (*pci_write_func)(device_t *pcibus, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask); |
| 21 | 18 | |
| 22 | | typedef struct _pci_device_entry pci_device_entry; |
| 23 | | struct _pci_device_entry |
| 19 | // ======================> ttl74145_device |
| 20 | |
| 21 | class pci_bus_device : public device_t |
| 24 | 22 | { |
| 25 | | const char * devtag; |
| 26 | | pci_read_func read_callback; |
| 27 | | pci_write_func write_callback; |
| 28 | | }; |
| 23 | public: |
| 24 | // construction/destruction |
| 25 | pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 29 | 26 | |
| 30 | | typedef struct _pci_bus_config pci_bus_config; |
| 31 | | struct _pci_bus_config |
| 32 | | { |
| 33 | | UINT8 busnum; |
| 34 | | pci_device_entry device[32]; |
| 35 | | const char * father; |
| 27 | DECLARE_READ32_MEMBER( read ); |
| 28 | DECLARE_WRITE32_MEMBER( write ); |
| 29 | |
| 30 | DECLARE_READ64_MEMBER( read_64be ); |
| 31 | DECLARE_WRITE64_MEMBER( write_64be ); |
| 32 | |
| 33 | void set_busnum(int busnum) { m_busnum = busnum; } |
| 34 | void set_device(int num, const char *tag, pci_read_func read_func, pci_write_func write_func) { |
| 35 | m_devtag[num] = tag; m_read_callback[num] = read_func; m_write_callback[num] = write_func; } |
| 36 | |
| 37 | pci_bus_device *pci_search_bustree(int busnum, int devicenum, pci_bus_device *pcibus); |
| 38 | void add_sibling(pci_bus_device *sibling, int busnum); |
| 39 | |
| 40 | protected: |
| 41 | // device-level overrides |
| 42 | virtual void device_start(); |
| 43 | virtual void device_reset(); |
| 44 | virtual void device_post_load(); |
| 45 | |
| 46 | private: |
| 47 | UINT8 m_busnum; |
| 48 | const char * m_devtag[32]; |
| 49 | pci_read_func m_read_callback[32]; |
| 50 | pci_write_func m_write_callback[32]; |
| 51 | const char * m_father; |
| 52 | device_t * m_device[32]; |
| 53 | pci_bus_device * m_siblings[8]; |
| 54 | UINT8 m_siblings_busnum[8]; |
| 55 | int m_siblings_count; |
| 56 | |
| 57 | offs_t m_address; |
| 58 | INT8 m_devicenum; // device number we are addressing |
| 59 | INT8 m_busnumber; // pci bus number we are addressing |
| 60 | pci_bus_device * m_busnumaddr; // pci bus we are addressing |
| 36 | 61 | }; |
| 37 | 62 | |
| 63 | // device type definition |
| 64 | extern const device_type PCI_BUS; |
| 38 | 65 | |
| 39 | 66 | |
| 40 | 67 | /*************************************************************************** |
| r15466 | r15467 | |
| 43 | 70 | |
| 44 | 71 | #define MCFG_PCI_BUS_ADD(_tag, _busnum) \ |
| 45 | 72 | MCFG_DEVICE_ADD(_tag, PCI_BUS, 0) \ |
| 46 | | MCFG_DEVICE_CONFIG_DATA32(pci_bus_config, busnum, _busnum) |
| 73 | downcast<pci_bus_device *>(device)->set_busnum(_busnum); \ |
| 47 | 74 | |
| 48 | 75 | #define MCFG_PCI_BUS_DEVICE(_devnum, _devtag, _configread, _configwrite) \ |
| 49 | | MCFG_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, devtag, _devtag) \ |
| 50 | | MCFG_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, read_callback, _configread) \ |
| 51 | | MCFG_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, write_callback, _configwrite) |
| 76 | downcast<pci_bus_device *>(device)->set_device(_devnum, _devtag,_configread,_configwrite); \ |
| 52 | 77 | |
| 53 | 78 | #define MCFG_PCI_BUS_SIBLING(_father_tag) \ |
| 54 | | MCFG_DEVICE_CONFIG_DATAPTR(pci_bus_config, father, _father_tag) |
| 79 | downcast<pci_bus_device *>(device)->set_father(_father_tag); \ |
| 55 | 80 | |
| 56 | 81 | |
| 57 | | /*************************************************************************** |
| 58 | | FUNCTION PROTOTYPES |
| 59 | | ***************************************************************************/ |
| 60 | | |
| 61 | | READ32_DEVICE_HANDLER( pci_32le_r ); |
| 62 | | WRITE32_DEVICE_HANDLER( pci_32le_w ); |
| 63 | | |
| 64 | | READ64_DEVICE_HANDLER( pci_64be_r ); |
| 65 | | WRITE64_DEVICE_HANDLER( pci_64be_w ); |
| 66 | | |
| 67 | | int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling ); |
| 68 | | |
| 69 | | /* ----- device interface ----- */ |
| 70 | | |
| 71 | | DECLARE_LEGACY_DEVICE(PCI_BUS, pci_bus); |
| 72 | | |
| 73 | 82 | #endif /* PCI_H */ |