Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

582 lines
15 KiB

  1. /*
  2. File: MultiprocessingInfo.h
  3. Contains: Multiprocessing Information interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1996-2001 by Apple Computer, Inc. and (c) 1995-1997 DayStar Digital, Inc.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. /*
  11. ==========================================================================================================================
  12. *** WARNING: You must properly check the availability of MP services before calling them!
  13. See the section titled "Checking API Availability".
  14. ==========================================================================================================================
  15. */
  16. #ifndef __MULTIPROCESSINGINFO__
  17. #define __MULTIPROCESSINGINFO__
  18. #ifndef __MACTYPES__
  19. #include <MacTypes.h>
  20. #endif
  21. #ifndef __MULTIPROCESSING__
  22. #include <Multiprocessing.h>
  23. #endif
  24. #if PRAGMA_ONCE
  25. #pragma once
  26. #endif
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #if PRAGMA_IMPORT
  31. #pragma import on
  32. #endif
  33. #if PRAGMA_STRUCT_ALIGN
  34. #pragma options align=power
  35. #elif PRAGMA_STRUCT_PACKPUSH
  36. #pragma pack(push, 2)
  37. #elif PRAGMA_STRUCT_PACK
  38. #pragma pack(2)
  39. #endif
  40. /*
  41. ==========================================================================================================================
  42. This is the header file for version 2.3 of the Mac OS multiprocessing information support.
  43. ==========================================================================================================================
  44. */
  45. /*
  46. ==========================================================================================================================
  47. The following services are new in version 2.1:
  48. MPGetNextTaskID
  49. MPGetNextCpuID
  50. ==========================================================================================================================
  51. */
  52. /*
  53. ==========================================================================================================================
  54. The following services are new in version 2.2:
  55. MPGetPageSizeClasses
  56. MPGetPageSize
  57. MPGetNextAreaID
  58. ==========================================================================================================================
  59. */
  60. /*
  61. ==========================================================================================================================
  62. The following services are new in version 2.3:
  63. MPGetNextCoherenceID
  64. MPGetNextProcessID
  65. MPGetNextAddressSpaceID
  66. MPGetNextQueueID
  67. MPGetNextSemaphoreID
  68. MPGetNextCriticalRegionID
  69. MPGetNextTimerID
  70. MPGetNextEventID
  71. MPGetNextNotificationID
  72. MPGetNextConsoleID
  73. ==========================================================================================================================
  74. */
  75. /*
  76. .
  77. ==========================================================================================================================
  78. Page size Services
  79. ==================
  80. */
  81. #if CALL_NOT_IN_CARBON
  82. /*
  83. * MPGetPageSizeClasses()
  84. *
  85. * Availability:
  86. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  87. * CarbonLib: not available
  88. * Mac OS X: not available
  89. */
  90. EXTERN_API_C( MPPageSizeClass )
  91. MPGetPageSizeClasses(void);
  92. /* The number of page size classes, 1 to n.*/
  93. #endif /* CALL_NOT_IN_CARBON */
  94. /* -------------------------------------------------------------------------------------------*/
  95. #if CALL_NOT_IN_CARBON
  96. /*
  97. * MPGetPageSize()
  98. *
  99. * Availability:
  100. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  101. * CarbonLib: not available
  102. * Mac OS X: not available
  103. */
  104. EXTERN_API_C( ByteCount )
  105. MPGetPageSize(MPPageSizeClass pageClass);
  106. /* The page size in bytes.*/
  107. #endif /* CALL_NOT_IN_CARBON */
  108. /*
  109. .
  110. ==========================================================================================================================
  111. ID Iterator Services
  112. ==========================
  113. */
  114. #if CALL_NOT_IN_CARBON
  115. /*
  116. * MPGetNextCoherenceID()
  117. *
  118. * Availability:
  119. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  120. * CarbonLib: not available
  121. * Mac OS X: not available
  122. */
  123. EXTERN_API_C( OSStatus )
  124. MPGetNextCoherenceID(MPCoherenceID * coherenceID);
  125. /*
  126. * MPGetNextCpuID()
  127. *
  128. * Availability:
  129. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  130. * CarbonLib: not available
  131. * Mac OS X: not available
  132. */
  133. EXTERN_API_C( OSStatus )
  134. MPGetNextCpuID(
  135. MPCoherenceID owningCoherenceID,
  136. MPCpuID * cpuID);
  137. /*
  138. * MPGetNextProcessID()
  139. *
  140. * Availability:
  141. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  142. * CarbonLib: not available
  143. * Mac OS X: not available
  144. */
  145. EXTERN_API_C( OSStatus )
  146. MPGetNextProcessID(MPProcessID * processID);
  147. /*
  148. * MPGetNextAddressSpaceID()
  149. *
  150. * Availability:
  151. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  152. * CarbonLib: not available
  153. * Mac OS X: not available
  154. */
  155. EXTERN_API_C( OSStatus )
  156. MPGetNextAddressSpaceID(
  157. MPProcessID owningProcessID,
  158. MPAddressSpaceID * addressSpaceID);
  159. /*
  160. * MPGetNextTaskID()
  161. *
  162. * Availability:
  163. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  164. * CarbonLib: not available
  165. * Mac OS X: not available
  166. */
  167. EXTERN_API_C( OSStatus )
  168. MPGetNextTaskID(
  169. MPProcessID owningProcessID,
  170. MPTaskID * taskID);
  171. /*
  172. * MPGetNextQueueID()
  173. *
  174. * Availability:
  175. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  176. * CarbonLib: not available
  177. * Mac OS X: not available
  178. */
  179. EXTERN_API_C( OSStatus )
  180. MPGetNextQueueID(
  181. MPProcessID owningProcessID,
  182. MPQueueID * queueID);
  183. /*
  184. * MPGetNextSemaphoreID()
  185. *
  186. * Availability:
  187. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  188. * CarbonLib: not available
  189. * Mac OS X: not available
  190. */
  191. EXTERN_API_C( OSStatus )
  192. MPGetNextSemaphoreID(
  193. MPProcessID owningProcessID,
  194. MPSemaphoreID * semaphoreID);
  195. /*
  196. * MPGetNextCriticalRegionID()
  197. *
  198. * Availability:
  199. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  200. * CarbonLib: not available
  201. * Mac OS X: not available
  202. */
  203. EXTERN_API_C( OSStatus )
  204. MPGetNextCriticalRegionID(
  205. MPProcessID owningProcessID,
  206. MPCriticalRegionID * criticalRegionID);
  207. /*
  208. * MPGetNextTimerID()
  209. *
  210. * Availability:
  211. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  212. * CarbonLib: not available
  213. * Mac OS X: not available
  214. */
  215. EXTERN_API_C( OSStatus )
  216. MPGetNextTimerID(
  217. MPProcessID owningProcessID,
  218. MPTimerID * timerID);
  219. /*
  220. * MPGetNextEventID()
  221. *
  222. * Availability:
  223. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  224. * CarbonLib: not available
  225. * Mac OS X: not available
  226. */
  227. EXTERN_API_C( OSStatus )
  228. MPGetNextEventID(
  229. MPProcessID owningProcessID,
  230. MPEventID * eventID);
  231. /*
  232. * MPGetNextNotificationID()
  233. *
  234. * Availability:
  235. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  236. * CarbonLib: not available
  237. * Mac OS X: not available
  238. */
  239. EXTERN_API_C( OSStatus )
  240. MPGetNextNotificationID(
  241. MPProcessID owningProcessID,
  242. MPNotificationID * notificationID);
  243. #endif /* CALL_NOT_IN_CARBON */
  244. #if CALL_NOT_IN_CARBON
  245. /*
  246. * MPGetNextAreaID()
  247. *
  248. * Availability:
  249. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  250. * CarbonLib: not available
  251. * Mac OS X: not available
  252. */
  253. EXTERN_API( OSStatus )
  254. MPGetNextAreaID(
  255. MPAddressSpaceID owningSpaceID,
  256. MPAreaID * areaID);
  257. #endif /* CALL_NOT_IN_CARBON */
  258. #if CALL_NOT_IN_CARBON
  259. /*
  260. * MPGetNextConsoleID()
  261. *
  262. * Availability:
  263. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  264. * CarbonLib: not available
  265. * Mac OS X: not available
  266. */
  267. EXTERN_API_C( OSStatus )
  268. MPGetNextConsoleID(MPConsoleID * consoleID);
  269. /* -------------------------------------------------------------------------------------------*/
  270. /*
  271. * MPGetNextID()
  272. *
  273. * Availability:
  274. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  275. * CarbonLib: not available
  276. * Mac OS X: not available
  277. */
  278. EXTERN_API_C( OSStatus )
  279. MPGetNextID(
  280. MPOpaqueIDClass kind,
  281. MPOpaqueID * id);
  282. /*
  283. .
  284. ==========================================================================================================================
  285. Object Information Services
  286. ===========================
  287. */
  288. /*
  289. ----------------------------------------------------------------------------------------------
  290. ! The implementation of MPGetObjectInfo assumes that all info records are in 4 byte multiples.
  291. */
  292. #endif /* CALL_NOT_IN_CARBON */
  293. enum {
  294. /* The version of the MPAreaInfo structure requested.*/
  295. kMPQueueInfoVersion = 1L | (kOpaqueQueueID << 16),
  296. kMPSemaphoreInfoVersion = 1L | (kOpaqueSemaphoreID << 16),
  297. kMPEventInfoVersion = 1L | (kOpaqueEventID << 16),
  298. kMPCriticalRegionInfoVersion = 1L | (kOpaqueCriticalRegionID << 16),
  299. kMPNotificationInfoVersion = 1L | (kOpaqueNotificationID << 16),
  300. kMPAddressSpaceInfoVersion = 1L | (kOpaqueAddressSpaceID << 16)
  301. };
  302. struct MPQueueInfo {
  303. PBVersion version; /* Version of the data structure requested*/
  304. MPProcessID processID; /* Owning process ID*/
  305. OSType queueName; /* Queue name*/
  306. ItemCount nWaiting;
  307. MPTaskID waitingTaskID; /* First waiting task.*/
  308. ItemCount nMessages;
  309. ItemCount nReserved;
  310. void * p1; /* First message parameters...*/
  311. void * p2;
  312. void * p3;
  313. };
  314. typedef struct MPQueueInfo MPQueueInfo;
  315. struct MPSemaphoreInfo {
  316. PBVersion version; /* Version of the data structure requested*/
  317. MPProcessID processID; /* Owning process ID*/
  318. OSType semaphoreName; /* Semaphore name*/
  319. ItemCount nWaiting;
  320. MPTaskID waitingTaskID; /* First waiting task.*/
  321. ItemCount maximum;
  322. ItemCount count;
  323. };
  324. typedef struct MPSemaphoreInfo MPSemaphoreInfo;
  325. struct MPEventInfo {
  326. PBVersion version; /* Version of the data structure requested*/
  327. MPProcessID processID; /* Owning process ID*/
  328. OSType eventName; /* Event name*/
  329. ItemCount nWaiting;
  330. MPTaskID waitingTaskID; /* First waiting task.*/
  331. MPEventFlags events;
  332. };
  333. typedef struct MPEventInfo MPEventInfo;
  334. struct MPCriticalRegionInfo {
  335. PBVersion version; /* Version of the data structure requested*/
  336. MPProcessID processID; /* Owning process ID*/
  337. OSType regionName; /* Critical region name*/
  338. ItemCount nWaiting;
  339. MPTaskID waitingTaskID; /* First waiting task.*/
  340. MPTaskID owningTask;
  341. ItemCount count;
  342. };
  343. typedef struct MPCriticalRegionInfo MPCriticalRegionInfo;
  344. struct MPNotificationInfo {
  345. PBVersion version; /* Version of the data structure requested*/
  346. MPProcessID processID; /* Owning process ID*/
  347. OSType notificationName; /* Notification name*/
  348. MPQueueID queueID; /* Queue to notify.*/
  349. void * p1;
  350. void * p2;
  351. void * p3;
  352. MPEventID eventID; /* Event to set.*/
  353. MPEventFlags events;
  354. MPSemaphoreID semaphoreID; /* Sempahore to signal. */
  355. };
  356. typedef struct MPNotificationInfo MPNotificationInfo;
  357. struct MPAddressSpaceInfo {
  358. PBVersion version; /* Version of the data structure requested*/
  359. MPProcessID processID; /* Owning process ID*/
  360. MPCoherenceID groupID; /* Related coherence group.*/
  361. ItemCount nTasks; /* Number of tasks in this space.*/
  362. UInt32 vsid[16]; /* Segment register VSIDs.*/
  363. };
  364. typedef struct MPAddressSpaceInfo MPAddressSpaceInfo;
  365. /* *** We should put the task info call here instead of in MPExtractTaskState.*/
  366. #if CALL_NOT_IN_CARBON
  367. /*
  368. * MPGetQueueInfo()
  369. *
  370. * Availability:
  371. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  372. * CarbonLib: not available
  373. * Mac OS X: not available
  374. */
  375. EXTERN_API_C( OSStatus )
  376. MPGetQueueInfo(
  377. MPQueueID id,
  378. PBVersion version,
  379. MPQueueInfo * info_o);
  380. /*
  381. * MPGetSemaphoreInfo()
  382. *
  383. * Availability:
  384. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  385. * CarbonLib: not available
  386. * Mac OS X: not available
  387. */
  388. EXTERN_API_C( OSStatus )
  389. MPGetSemaphoreInfo(
  390. MPSemaphoreID id,
  391. PBVersion version,
  392. MPSemaphoreInfo * info_o);
  393. /*
  394. * MPGetEventInfo()
  395. *
  396. * Availability:
  397. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  398. * CarbonLib: not available
  399. * Mac OS X: not available
  400. */
  401. EXTERN_API_C( OSStatus )
  402. MPGetEventInfo(
  403. MPEventID id,
  404. PBVersion version,
  405. MPEventInfo * info_o);
  406. /*
  407. * MPGetCriticalRegionInfo()
  408. *
  409. * Availability:
  410. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  411. * CarbonLib: not available
  412. * Mac OS X: not available
  413. */
  414. EXTERN_API_C( OSStatus )
  415. MPGetCriticalRegionInfo(
  416. MPCriticalRegionID id,
  417. PBVersion version,
  418. MPCriticalRegionInfo * info_o);
  419. /*
  420. * MPGetNotificationInfo()
  421. *
  422. * Availability:
  423. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  424. * CarbonLib: not available
  425. * Mac OS X: not available
  426. */
  427. EXTERN_API_C( OSStatus )
  428. MPGetNotificationInfo(
  429. MPNotificationID id,
  430. PBVersion version,
  431. MPNotificationInfo * info_o);
  432. /*
  433. * MPGetAddressSpaceInfo()
  434. *
  435. * Availability:
  436. * Non-Carbon CFM: in MPDiagnostics 2.3 and later
  437. * CarbonLib: not available
  438. * Mac OS X: not available
  439. */
  440. EXTERN_API_C( OSStatus )
  441. MPGetAddressSpaceInfo(
  442. MPAddressSpaceID id,
  443. PBVersion version,
  444. MPAddressSpaceInfo * info_o);
  445. /* ==========================================================================================================================*/
  446. #endif /* CALL_NOT_IN_CARBON */
  447. #if PRAGMA_STRUCT_ALIGN
  448. #pragma options align=reset
  449. #elif PRAGMA_STRUCT_PACKPUSH
  450. #pragma pack(pop)
  451. #elif PRAGMA_STRUCT_PACK
  452. #pragma pack()
  453. #endif
  454. #ifdef PRAGMA_IMPORT_OFF
  455. #pragma import off
  456. #elif PRAGMA_IMPORT
  457. #pragma import reset
  458. #endif
  459. #ifdef __cplusplus
  460. }
  461. #endif
  462. #endif /* __MULTIPROCESSINGINFO__ */