- Timestamp:
- Jul 16, 2007 3:46:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r2981 r3650 52 52 /* Hack to get PCIDEVICEINT declare at the right point - include "PCIInternal.h". */ 53 53 #define PCI_INCLUDE_PRIVATE 54 #include "vl_vbox.h"55 54 #include <VBox/pci.h> 56 55 #include <VBox/pdm.h> … … 59 58 #include <VBox/log.h> 60 59 #include <iprt/assert.h> 60 #include <iprt/string.h> 61 61 62 62 #include "Builtins.h" … … 226 226 uint32_t last_addr, new_addr, config_ofs; 227 227 228 cmd = le16_to_cpu(*(uint16_t *)(d->config + PCI_COMMAND));228 cmd = RT_LE2H_U16(*(uint16_t *)(d->config + PCI_COMMAND)); 229 229 for(i = 0; i < PCI_NUM_REGIONS; i++) { 230 230 r = &d->Int.s.aIORegions[i]; … … 237 237 if (r->type & PCI_ADDRESS_SPACE_IO) { 238 238 if (cmd & PCI_COMMAND_IO) { 239 new_addr = le32_to_cpu(*(uint32_t *)(d->config +239 new_addr = RT_LE2H_U32(*(uint32_t *)(d->config + 240 240 config_ofs)); 241 241 new_addr = new_addr & ~(r->size - 1); … … 251 251 } else { 252 252 if (cmd & PCI_COMMAND_MEMORY) { 253 new_addr = le32_to_cpu(*(uint32_t *)(d->config +253 new_addr = RT_LE2H_U32(*(uint32_t *)(d->config + 254 254 config_ofs)); 255 255 /* the ROM slot has a specific enable bit */ … … 318 318 break; 319 319 case 2: 320 val = le16_to_cpu(*(uint16_t *)(d->config + address));320 val = RT_LE2H_U16(*(uint16_t *)(d->config + address)); 321 321 break; 322 322 default: 323 323 case 4: 324 val = le32_to_cpu(*(uint32_t *)(d->config + address));324 val = RT_LE2H_U32(*(uint32_t *)(d->config + address)); 325 325 break; 326 326 } … … 355 355 val |= r->type; 356 356 } 357 *(uint32_t *)(d->config + address) = cpu_to_le32(val);357 *(uint32_t *)(d->config + address) = RT_H2LE_U32(val); 358 358 pci_update_mappings(d); 359 359 return; … … 411 411 break; 412 412 } 413 #ifdef VBOX 414 /* status register: only clear bits by writing a '1' at the corresponding bit */ 415 if (addr == 0x06) 416 { 417 d->config[addr] &= ~val; 418 d->config[addr] |= 0x08; /* interrupt status */ 419 } 420 else if (addr == 0x07) 421 { 422 d->config[addr] &= ~val; 423 } 424 else 425 #endif 413 426 if (can_write) { 414 427 d->config[addr] = val;
Note:
See TracChangeset
for help on using the changeset viewer.