Changeset 34876 in vbox
- Timestamp:
- Dec 9, 2010 11:16:00 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pci.h
r34301 r34876 986 986 #endif 987 987 988 #ifdef __cplusplus 989 struct PciBusAddress 990 { 991 int iBus; 992 int iDevice; 993 int iFn; 994 995 PciBusAddress() 996 { 997 clear(); 998 } 999 1000 PciBusAddress(int bus, int device, int fn) 1001 { 1002 init(bus, device, fn); 1003 } 1004 1005 PciBusAddress& clear() 1006 { 1007 iBus = iDevice = iFn = -1; 1008 return *this; 1009 } 1010 1011 void init(int bus, int device, int fn) 1012 { 1013 iBus = bus; 1014 iDevice = device; 1015 iFn = fn; 1016 } 1017 1018 void init(const PciBusAddress &a) 1019 { 1020 iBus = a.iBus; 1021 iDevice = a.iDevice; 1022 iFn = a.iFn; 1023 } 1024 1025 bool operator<(const PciBusAddress &a) const 1026 { 1027 if (iBus < a.iBus) 1028 return true; 1029 1030 if (iBus > a.iBus) 1031 return false; 1032 1033 if (iDevice < a.iDevice) 1034 return true; 1035 1036 if (iDevice > a.iDevice) 1037 return false; 1038 1039 if (iFn < a.iFn) 1040 return true; 1041 1042 if (iFn > a.iFn) 1043 return false; 1044 1045 return false; 1046 } 1047 1048 bool operator==(const PciBusAddress &a) const 1049 { 1050 return (iBus == a.iBus) 1051 && (iDevice == a.iDevice) 1052 && (iFn == a.iFn); 1053 } 1054 1055 bool operator!=(const PciBusAddress &a) const 1056 { 1057 return (iBus != a.iBus) 1058 || (iDevice != a.iDevice) 1059 || (iFn != a.iFn); 1060 } 1061 1062 bool valid() const 1063 { 1064 return (iBus != -1) && (iDevice != -1) && (iFn != -1); 1065 } 1066 1067 int32_t asLong() const 1068 { 1069 Assert(valid()); 1070 return (iBus << 8) | (iDevice << 3) | iFn; 1071 } 1072 1073 void fromLong(int32_t value) 1074 { 1075 iBus = (value >> 8) & 0xff; 1076 iDevice = (value & 0xff) >> 3; 1077 iFn = (value & 7); 1078 } 1079 }; 1080 #endif /* __cplusplus */ 1081 988 1082 /** @} */ 989 1083 -
trunk/src/VBox/Devices/Builtins.h
r32471 r34876 84 84 extern const PDMDEVREG g_DeviceEFI; 85 85 #endif 86 extern const PDMDEVREG g_DevicePciRaw; 86 87 87 88 extern const PDMDRVREG g_DrvMouseQueue; -
trunk/src/VBox/Devices/Makefile.kmk
r34768 r34876 272 272 Bus/MsiCommon.cpp \ 273 273 Bus/MsixCommon.cpp \ 274 Bus/DevPciRaw.cpp \ 274 275 Graphics/DevVGA.cpp \ 275 276 Storage/DevATA.cpp \ … … 533 534 Bus/MsiCommon.cpp \ 534 535 Bus/MsixCommon.cpp \ 536 Bus/DevPciRaw.cpp \ 535 537 Graphics/DevVGA.cpp \ 536 538 Input/DevPS2.cpp \ … … 636 638 Bus/MsiCommon.cpp \ 637 639 Bus/MsixCommon.cpp \ 640 Bus/DevPciRaw.cpp \ 638 641 Graphics/DevVGA.cpp \ 639 642 Input/DevPS2.cpp \ -
trunk/src/VBox/Main/include/BusAssignmentManager.h
r34331 r34876 21 21 22 22 #include "VBox/types.h" 23 #include "VBox/pci.h" 23 24 #include "VirtualBoxBase.h" 24 25 struct PciBusAddress26 {27 int iBus;28 int iDevice;29 int iFn;30 31 PciBusAddress()32 {33 clear();34 }35 36 PciBusAddress(int bus, int device, int fn)37 : iBus(bus), iDevice(device), iFn(fn)38 {39 }40 41 PciBusAddress& clear()42 {43 iBus = iDevice = iFn = -1;44 return *this;45 }46 47 bool operator<(const PciBusAddress &a) const48 {49 if (iBus < a.iBus)50 return true;51 52 if (iBus > a.iBus)53 return false;54 55 if (iDevice < a.iDevice)56 return true;57 58 if (iDevice > a.iDevice)59 return false;60 61 if (iFn < a.iFn)62 return true;63 64 if (iFn > a.iFn)65 return false;66 67 return false;68 }69 70 bool operator==(const PciBusAddress &a) const71 {72 return (iBus == a.iBus)73 && (iDevice == a.iDevice)74 && (iFn == a.iFn);75 }76 77 bool operator!=(const PciBusAddress &a) const78 {79 return (iBus != a.iBus)80 || (iDevice != a.iDevice)81 || (iFn != a.iFn);82 }83 84 bool valid() const85 {86 return (iBus != -1) && (iDevice != -1) && (iFn != -1);87 }88 89 LONG asLong() const90 {91 Assert(valid());92 return (iBus << 8) | (iDevice << 3) | iFn;93 }94 95 void fromLong(LONG value)96 {97 iBus = (value >> 8) & 0xff;98 iDevice = (value & 0xff) >> 3;99 iFn = (value & 7);100 }101 };102 25 103 26 class BusAssignmentManager
Note:
See TracChangeset
for help on using the changeset viewer.