- Timestamp:
- Nov 18, 2008 11:38:52 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r14035 r14338 1079 1079 darwin/RTErrConvertFromDarwinKern.cpp \ 1080 1080 generic/RTAssertShouldPanic-generic.cpp \ 1081 generic/RTMpCpuId-generic.cpp \1082 generic/RTMpCpuIdFromSetIndex-generic.cpp \1083 generic/RTMpCpuIdToSetIndex-generic.cpp \1084 generic/RTMpIsCpuPossible-generic.cpp \1085 generic/RTMpGetCount-generic.cpp \1086 generic/RTMpGetMaxCpuId-generic.cpp \1087 generic/RTMpGetOnlineCount-generic.cpp \1088 generic/RTMpGetOnlineSet-generic.cpp \1089 generic/RTMpGetSet-generic.cpp \1090 generic/RTMpIsCpuOnline-generic.cpp \1091 1081 generic/RTTimerCreate-generic.cpp \ 1092 1082 generic/mppresent-generic.cpp \ 1093 1083 generic/timer-generic.cpp \ 1094 r0drv/generic/RTMpOn-r0drv-generic.cpp \1095 1084 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 1096 1085 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ … … 1101 1090 r0drv/darwin/initterm-r0drv-darwin.cpp \ 1102 1091 r0drv/darwin/memobj-r0drv-darwin.cpp \ 1092 r0drv/darwin/mp-r0drv-darwin.cpp \ 1103 1093 r0drv/darwin/process-r0drv-darwin.cpp \ 1104 1094 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \ -
trunk/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp
r8245 r14338 40 40 #include "r0drv/mp-r0drv.h" 41 41 42 #define MY_DARWIN_MAX_CPUS (0xf + 1) /* see MAX_CPUS */ 43 44 45 DECLINLINE(int) rtMpDarwinMaxCpus(void) 46 { 47 return ml_get_max_cpus(); 48 } 49 42 50 43 51 RTDECL(RTCPUID) RTMpCpuId(void) … … 47 55 48 56 49 /** 50 * Wrapper between the native darwin per-cpu callback and PFNRTWORKER 57 RTDECL(int) RTMpCpuIdToSetIndex(RTCPUID idCpu) 58 { 59 return idCpu < MY_DARWIN_MAX_CPUS ? (int)idCpu : -1; 60 } 61 62 63 RTDECL(RTCPUID) RTMpCpuIdFromSetIndex(int iCpu) 64 { 65 return (unsigned)iCpu < MY_DARWIN_MAX_CPUS ? (RTCPUID)iCpu : NIL_RTCPUID; 66 } 67 68 69 RTDECL(RTCPUID) RTMpGetMaxCpuId(void) 70 { 71 return rtMpDarwinMaxCpus() - 1; 72 } 73 74 75 RTDECL(bool) RTMpIsCpuPossible(RTCPUID idCpu) 76 { 77 return idCpu < MY_DARWIN_MAX_CPUS 78 && idCpu < (RTCPUID)rtMpDarwinMaxCpus(); 79 } 80 81 82 RTDECL(PRTCPUSET) RTMpGetSet(PRTCPUSET pSet) 83 { 84 85 } 86 87 88 RTDECL(RTCPUID) RTMpGetCount(void) 89 { 90 return rtMpDarwinMaxCpus(); 91 } 92 93 94 RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet) 95 { 96 /** @todo darwin R0 MP */ 97 return RTMpGetSet(pSet); 98 } 99 100 101 RTDECL(RTCPUID) RTMpGetOnlineCount(void) 102 { 103 /** @todo darwin R0 MP */ 104 return RTMpGetCount(); 105 } 106 107 108 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 109 { 110 /** @todo darwin R0 MP */ 111 return RTMpIsCpuPossible(idCpu); 112 } 113 114 115 RTDECL(PRTCPUSET) RTMpGetPresentSet(PRTCPUSET pSet) 116 { 117 return RTMpGetSet(pSet); 118 } 119 120 121 RTDECL(RTCPUID) RTMpGetPresentCount(void) 122 { 123 return RTMpGetCount(); 124 } 125 126 127 RTDECL(bool) RTMpIsCpuPresent(RTCPUID idCpu) 128 { 129 return RTMpIsCpuPossible(idCpu); 130 } 131 132 133 RTDECL(uint32_t) RTMpGetCurFrequency(RTCPUID idCpu) 134 { 135 /** @todo darwin R0 MP (rainy day) */ 136 return 0; 137 } 138 139 140 RTDECL(uint32_t) RTMpGetMaxFrequency(RTCPUID idCpu) 141 { 142 /** @todo darwin R0 MP (rainy day) */ 143 return 0; 144 } 145 146 147 /** 148 * Wrapper between the native darwin per-cpu callback and PFNRTWORKER 51 149 * for the RTMpOnAll API. 52 * 150 * 53 151 * @param pvArg Pointer to the RTMPARGS package. 54 152 */ … … 68 166 Args.idCpu = NIL_RTCPUID; 69 167 Args.cHits = 0; 70 mp_rendezvous (NULL, rtmpOnAllDarwinWrapper, NULL, &Args);168 mp_rendezvous_no_intrs(rtmpOnAllDarwinWrapper, &Args); 71 169 return VINF_SUCCESS; 72 170 } 73 171 74 172 75 /** 76 * Wrapper between the native darwin per-cpu callback and PFNRTWORKER 173 /** 174 * Wrapper between the native darwin per-cpu callback and PFNRTWORKER 77 175 * for the RTMpOnOthers API. 78 * 176 * 79 177 * @param pvArg Pointer to the RTMPARGS package. 80 178 */ … … 97 195 Args.idCpu = NIL_RTCPUID; 98 196 Args.cHits = 0; 99 mp_rendezvous (NULL, rtmpOnOthersDarwinWrapper, NULL, &Args);197 mp_rendezvous_no_intrs(rtmpOnOthersDarwinWrapper, &Args); 100 198 return VINF_SUCCESS; 101 199 } 102 200 103 201 104 /** 105 * Wrapper between the native darwin per-cpu callback and PFNRTWORKER 202 /** 203 * Wrapper between the native darwin per-cpu callback and PFNRTWORKER 106 204 * for the RTMpOnSpecific API. 107 * 205 * 108 206 * @param pvArg Pointer to the RTMPARGS package. 109 207 */ … … 129 227 Args.idCpu = idCpu; 130 228 Args.cHits = 0; 131 mp_rendezvous (NULL, rtmpOnSpecificDarwinWrapper, NULL, &Args);132 return Args.cHits == 1 133 ? VINF_SUCCESS 229 mp_rendezvous_no_intrs(rtmpOnSpecificDarwinWrapper, &Args); 230 return Args.cHits == 1 231 ? VINF_SUCCESS 134 232 : VERR_CPU_NOT_FOUND; 135 233 } -
trunk/src/VBox/Runtime/r0drv/darwin/the-darwin-kernel.h
r8245 r14338 59 59 #include <kern/sched_prim.h> 60 60 #include <kern/locks.h> 61 #include <i386/mp_events.h> 61 62 #include <libkern/libkern.h> 62 63 #include <mach/thread_act.h> … … 96 97 /* mach/i386/thread_act.h */ 97 98 extern kern_return_t thread_terminate(thread_t); 99 100 /* osfmk/i386/mp.h */ 101 extern void mp_rendezvous(void (*)(void *), void (*)(void *), void (*)(void *), void *); 102 extern void mp_rendezvous_no_intrs(void (*)(void *), void *); 103 104 /* osfmk/i386/cpu_number.h */ 105 extern int cpu_number(void); 106 107 /* i386/machine_routines.h */ 108 extern int ml_get_max_cpus(void); 109 98 110 __END_DECLS 99 111
Note:
See TracChangeset
for help on using the changeset viewer.