Changeset 60433 in vbox for trunk/src/VBox/Devices/PC/BIOS/pciutil.c
- Timestamp:
- Apr 11, 2016 5:14:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/pciutil.c
r56292 r60433 45 45 46 46 47 #if VBOX_BIOS_CPU >= 80386 47 48 /* Warning: Destroys high bits of ECX. */ 48 49 uint16_t pci_find_class(uint16_t op, uint32_t dev_class, uint16_t start_bdf); 49 # pragma aux pci_find_class = \50 # pragma aux pci_find_class = \ 50 51 ".386" \ 51 52 "shl ecx, 16" \ … … 57 58 "found:" \ 58 59 parm [ax] [cx dx] [si] value [bx]; 60 #endif 59 61 60 62 uint16_t pci_find_dev(uint16_t op, uint16_t dev_id, uint16_t ven_id, uint16_t start_bdf); … … 77 79 parm [ax] [bx] [di] value [cx]; 78 80 81 #if VBOX_BIOS_CPU >= 80386 79 82 /* Warning: Destroys high bits of ECX. */ 80 83 uint32_t pci_read_cfgd(uint16_t op, uint16_t bus_dev_fn, uint16_t reg); 81 # pragma aux pci_read_cfgd = \84 # pragma aux pci_read_cfgd = \ 82 85 ".386" \ 83 86 "int 0x1a" \ … … 85 88 "shr ecx, 16" \ 86 89 parm [ax] [bx] [di] value [cx ax]; 90 #endif 87 91 88 92 uint8_t pci_write_cfgb(uint16_t op, uint16_t bus_dev_fn, uint16_t reg, uint8_t val); … … 96 100 parm [ax] [bx] [di] [cx]; 97 101 102 #if VBOX_BIOS_CPU >= 80386 98 103 /* Warning: Destroys high bits of ECX. */ 99 104 uint8_t pci_write_cfgd(uint16_t op, uint16_t bus_dev_fn, uint16_t reg, uint32_t val); 100 # pragma aux pci_write_cfgd = \105 # pragma aux pci_write_cfgd = \ 101 106 ".386" \ 102 107 "xchg cx, dx" \ … … 105 110 "int 0x1a" \ 106 111 parm [ax] [bx] [di] [dx cx]; 112 #endif 107 113 108 114 … … 119 125 uint16_t pci_find_classcode(uint32_t dev_class) 120 126 { 127 #if VBOX_BIOS_CPU >= 80386 121 128 return pci_find_class((PCIBIOS_ID << 8) | PCIBIOS_FIND_CLASS_CODE, dev_class, 0); 129 #else 130 return UINT16_C(0xffff); 131 #endif 122 132 } 123 133 … … 134 144 uint32_t pci_read_config_dword(uint8_t bus, uint8_t dev_fn, uint8_t reg) 135 145 { 146 #if VBOX_BIOS_CPU >= 80386 136 147 return pci_read_cfgd((PCIBIOS_ID << 8) | PCIBIOS_READ_CONFIG_DWORD, (bus << 8) | dev_fn, reg); 148 #else 149 return pci_read_cfgw((PCIBIOS_ID << 8) | PCIBIOS_READ_CONFIG_WORD, (bus << 8) | dev_fn, reg) 150 || ((uint32_t)pci_read_cfgw((PCIBIOS_ID << 8) | PCIBIOS_READ_CONFIG_WORD, (bus << 8) | dev_fn, reg + 2) << 16); 151 #endif 137 152 } 138 153
Note:
See TracChangeset
for help on using the changeset viewer.