Changeset 9429 in vbox for trunk/src/VBox
- Timestamp:
- Jun 5, 2008 3:22:37 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 31680
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h
r8890 r9429 182 182 * The upper 16-bit is the major version, the the lower the minor version. 183 183 * When incompatible changes are made, the upper major number has to be changed. */ 184 #define SUPDRVIOC_VERSION 0x0007000 2184 #define SUPDRVIOC_VERSION 0x00070003 185 185 186 186 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r9212 r9429 202 202 { "RTMpCpuIdFromSetIndex", (void *)RTMpCpuIdFromSetIndex }, 203 203 { "RTMpCpuIdToSetIndex", (void *)RTMpCpuIdToSetIndex }, 204 { "RTMp DoesCpuExist", (void *)RTMpDoesCpuExist},204 { "RTMpIsCpuPossible", (void *)RTMpIsCpuPossible }, 205 205 { "RTMpGetCount", (void *)RTMpGetCount }, 206 206 { "RTMpGetMaxCpuId", (void *)RTMpGetMaxCpuId }, -
trunk/src/VBox/Runtime/Makefile.kmk
r9366 r9429 978 978 generic/RTMpCpuIdFromSetIndex-generic.cpp \ 979 979 generic/RTMpCpuIdToSetIndex-generic.cpp \ 980 generic/RTMp DoesCpuExist-generic.cpp \980 generic/RTMpIsCpuPossible-generic.cpp \ 981 981 generic/RTMpGetCount-generic.cpp \ 982 982 generic/RTMpGetMaxCpuId-generic.cpp \ … … 1022 1022 generic/RTMpCpuIdFromSetIndex-generic.cpp \ 1023 1023 generic/RTMpCpuIdToSetIndex-generic.cpp \ 1024 generic/RTMp DoesCpuExist-generic.cpp \1024 generic/RTMpIsCpuPossible-generic.cpp \ 1025 1025 generic/RTMpGetCount-generic.cpp \ 1026 1026 generic/RTMpGetMaxCpuId-generic.cpp \ … … 1069 1069 generic/RTMpCpuIdFromSetIndex-generic.cpp \ 1070 1070 generic/RTMpCpuIdToSetIndex-generic.cpp \ 1071 generic/RTMp DoesCpuExist-generic.cpp \1071 generic/RTMpIsCpuPossible-generic.cpp \ 1072 1072 generic/RTMpGetCount-generic.cpp \ 1073 1073 generic/RTMpGetMaxCpuId-generic.cpp \ … … 1126 1126 generic/RTMpCpuIdFromSetIndex-generic.cpp \ 1127 1127 generic/RTMpCpuIdToSetIndex-generic.cpp \ 1128 generic/RTMp DoesCpuExist-generic.cpp \1128 generic/RTMpIsCpuPossible-generic.cpp \ 1129 1129 generic/RTMpGetCount-generic.cpp \ 1130 1130 generic/RTMpGetMaxCpuId-generic.cpp \ … … 1195 1195 generic/RTMpCpuIdFromSetIndex-generic.cpp \ 1196 1196 generic/RTMpCpuIdToSetIndex-generic.cpp \ 1197 generic/RTMp DoesCpuExist-generic.cpp \1197 generic/RTMpIsCpuPossible-generic.cpp \ 1198 1198 generic/RTMpGetCount-generic.cpp \ 1199 1199 generic/RTMpGetMaxCpuId-generic.cpp \ -
trunk/src/VBox/Runtime/generic/RTMpGetSet-generic.cpp
r8245 r9429 45 45 do 46 46 { 47 if (RTMp DoesCpuExist(idCpu))47 if (RTMpIsCpuPossible(idCpu)) 48 48 RTCpuSetAdd(pSet, idCpu); 49 49 } while (idCpu-- > 0); -
trunk/src/VBox/Runtime/generic/RTMpIsCpuPossible-generic.cpp
r9407 r9429 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Multiprocessor, Generic RTMp DoesCpuExist.3 * IPRT - Multiprocessor, Generic RTMpIsCpuPossible. 4 4 */ 5 5 … … 36 36 37 37 38 RTDECL(bool) RTMp DoesCpuExist(RTCPUID idCpu)38 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 39 39 { 40 40 return RTMpCpuId() == idCpu; -
trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
r8245 r9429 66 66 67 67 68 RTDECL(bool) RTMpIsCpu Online(RTCPUID idCpu)69 { 70 #if def CONFIG_SMP68 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 69 { 70 #if defined(CONFIG_SMP) 71 71 if (RT_UNLIKELY(idCpu >= NR_CPUS)) 72 72 return false; 73 # ifdef cpu_online 74 return cpu_online(idCpu); 75 # else /* 2.4: */ 76 return cpu_online_map & RT_BIT_64(idCpu); 77 # endif 78 #else 79 return idCpu == RTMpCpuId(); 80 #endif 81 } 82 83 84 RTDECL(bool) RTMpDoesCpuExist(RTCPUID idCpu) 85 { 86 #ifdef CONFIG_SMP 87 if (RT_UNLIKELY(idCpu >= NR_CPUS)) 88 return false; 89 # ifdef CONFIG_HOTPLUG_CPU /* introduced & uses cpu_present */ 90 return cpu_present(idCpu); 91 # elif defined(cpu_possible) 73 74 # if defined(cpu_possible) 92 75 return cpu_possible(idCpu); 93 # else /* 2.4:*/76 # else /* < 2.5.29 */ 94 77 return idCpu < (RTCPUID)smp_num_cpus; 95 78 # endif … … 108 91 do 109 92 { 110 if (RTMp DoesCpuExist(idCpu))93 if (RTMpIsCpuPossible(idCpu)) 111 94 RTCpuSetAdd(pSet, idCpu); 112 95 } while (idCpu-- > 0); … … 135 118 136 119 120 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 121 { 122 #ifdef CONFIG_SMP 123 if (RT_UNLIKELY(idCpu >= NR_CPUS)) 124 return false; 125 # ifdef cpu_online 126 return cpu_online(idCpu); 127 # else /* 2.4: */ 128 return cpu_online_map & RT_BIT_64(idCpu); 129 # endif 130 #else 131 return idCpu == RTMpCpuId(); 132 #endif 133 } 134 135 137 136 RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet) 138 137 { … … 272 271 Args.cHits = 0; 273 272 274 if (!RTMp DoesCpuExist(idCpu))273 if (!RTMpIsCpuPossible(idCpu)) 275 274 return VERR_CPU_NOT_FOUND; 276 275 -
trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
r8840 r9429 95 95 return false; 96 96 97 /** @todo this must be done at init time as it's not safe under all circumstances (braindead OS design). */ 97 98 KAFFINITY Mask = KeQueryActiveProcessors(); 98 99 return !!(Mask & RT_BIT_64(idCpu)); … … 100 101 101 102 102 RTDECL(bool) RTMp DoesCpuExist(RTCPUID idCpu)103 RTDECL(bool) RTMpIsCpuPresent(RTCPUID idCpu) 103 104 { 104 105 /* Cannot easily distinguish between online and offline cpus. */ 106 /** @todo online/present cpu stuff must be corrected for proper W2K8 support. */ 105 107 return RTMpIsCpuOnline(idCpu); 106 108 } … … 109 111 RTDECL(PRTCPUSET) RTMpGetSet(PRTCPUSET pSet) 110 112 { 113 /** @todo online/present cpu stuff must be corrected for proper W2K8 support. */ 111 114 return RTMpGetOnlineSet(pSet); 112 115 } … … 115 118 RTDECL(RTCPUID) RTMpGetCount(void) 116 119 { 120 /** @todo online/present cpu stuff must be corrected for proper W2K8 support. */ 117 121 return RTMpGetOnlineCount(); 118 122 } … … 167 171 #if 0 168 172 /* KeFlushQueuedDpcs must be run at IRQL PASSIVE_LEVEL according to MSDN, but the 169 * driver verifier doesn't complain... 173 * driver verifier doesn't complain... 170 174 */ 171 175 AssertMsg(KeGetCurrentIrql() == PASSIVE_LEVEL, ("%d != %d (PASSIVE_LEVEL)\n", KeGetCurrentIrql(), PASSIVE_LEVEL)); … … 173 177 174 178 KAFFINITY Mask = KeQueryActiveProcessors(); 175 176 if ( enmCpuid == RT_NT_CPUID_SPECIFIC177 && ( idCpu >= 64178 || !(Mask & RT_BIT_64(idCpu))))179 return VERR_CPU_NOT_FOUND; /* can't distinguish between cpu not present or offline */180 179 181 180 /* KeFlushQueuedDpcs is not present in Windows 2000; import it dynamically so we can just fail this call. */ … … 244 243 } 245 244 if (enmCpuid != RT_NT_CPUID_OTHERS) 246 {247 245 pfnWorker(iSelf, pvUser1, pvUser2); 248 }249 246 } 250 247 … … 270 267 RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 271 268 { 269 if (RTMpIsCpuOnline(idCpu); 270 return !RTMpIsCpuPossible(idCpu) ? VERR_CPU_NOT_FOUND : VERR_CPU_OFFLINE; 271 272 272 return rtMpCall(pfnWorker, pvUser1, pvUser2, RT_NT_CPUID_SPECIFIC, idCpu); 273 273 } -
trunk/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c
r8245 r9429 66 66 67 67 68 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 69 { 70 cpu_t *pCpu = idCpu < NCPU ? cpu_get(idCpu) : NULL; 71 return pCpu 72 && cpu_is_online(pCpu); 73 } 74 75 76 RTDECL(bool) RTMpDoesCpuExist(RTCPUID idCpu) 68 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 77 69 { 78 70 cpu_t *pCpu = idCpu < NCPU ? cpu_get(idCpu) : NULL; … … 89 81 do 90 82 { 91 if (RTMp DoesCpuExist(idCpu))83 if (RTMpIsCpuPossible(idCpu)) 92 84 RTCpuSetAdd(pSet, idCpu); 93 85 } while (idCpu-- > 0); … … 100 92 { 101 93 return ncpus; 94 } 95 96 97 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 98 { 99 cpu_t *pCpu = idCpu < NCPU ? cpu_get(idCpu) : NULL; 100 return pCpu 101 && cpu_is_online(pCpu); 102 102 } 103 103 -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/mp-r0drv-solaris.c
r9149 r9429 72 72 73 73 74 RTDECL(bool) RTMp DoesCpuExist(RTCPUID idCpu)74 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 75 75 { 76 76 return idCpu < vbi_cpu_count(); … … 86 86 do 87 87 { 88 if (RTMp DoesCpuExist(idCpu))88 if (RTMpIsCpuPossible(idCpu)) 89 89 RTCpuSetAdd(pSet, idCpu); 90 90 } while (idCpu-- > 0); -
trunk/src/VBox/Runtime/r3/os2/mp-os2.cpp
r8245 r9429 62 62 63 63 64 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 65 { 66 RTCPUSET Set; 67 return RTCpuSetIsMember(RTMpGetOnlineSet(&Set), idCpu); 68 } 69 70 71 RTDECL(bool) RTMpDoesCpuExist(RTCPUID idCpu) 64 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 72 65 { 73 66 RTCPUSET Set; … … 96 89 97 90 91 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 92 { 93 RTCPUSET Set; 94 return RTCpuSetIsMember(RTMpGetOnlineSet(&Set), idCpu); 95 } 96 97 98 98 RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet) 99 99 { -
trunk/src/VBox/Runtime/r3/win/mp-win.cpp
r8245 r9429 67 67 68 68 69 RTDECL(bool) RTMp DoesCpuExist(RTCPUID idCpu)69 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 70 70 { 71 71 RTCPUSET Set;
Note:
See TracChangeset
for help on using the changeset viewer.