155 #ifndef __MULTIPROCESSING__
156 #define __MULTIPROCESSING__
175 #if PRAGMA_STRUCT_ALIGN
176 #pragma options align = power
177 #elif PRAGMA_STRUCT_PACKPUSH
178 #pragma pack(push, 2)
179 #elif PRAGMA_STRUCT_PACK
187 #define MPCopyrightNotice "Copyright © 1995-2001 Apple Computer, Inc.\n"
188 #define MPLibraryName "MPLibrary"
189 #define MPLibraryCName MPLibraryName
190 #define MPLibraryPName "\p" MPLibraryName
191 #define MP_API_Version "2.4"
195 MPLibrary_MajorVersion =
197 MPLibrary_MinorVersion =
199 MPLibrary_Release = 1,
200 MPLibrary_DevelopmentRevision = 1
203 typedef struct OpaqueMPProcessID *MPProcessID;
204 typedef struct OpaqueMPTaskID *MPTaskID;
205 typedef struct OpaqueMPQueueID *MPQueueID;
206 typedef struct OpaqueMPSemaphoreID *MPSemaphoreID;
207 typedef struct OpaqueMPCriticalRegionID *MPCriticalRegionID;
208 typedef struct OpaqueMPTimerID *MPTimerID;
209 typedef struct OpaqueMPEventID *MPEventID;
210 typedef struct OpaqueMPAddressSpaceID *MPAddressSpaceID;
211 typedef struct OpaqueMPNotificationID *MPNotificationID;
212 typedef struct OpaqueMPCoherenceID *MPCoherenceID;
213 typedef struct OpaqueMPCpuID *MPCpuID;
214 typedef struct OpaqueMPAreaID *MPAreaID;
215 typedef struct OpaqueMPConsoleID *MPConsoleID;
216 typedef struct OpaqueMPOpaqueID *MPOpaqueID;
222 kOpaqueProcessID = 1,
226 kOpaqueSemaphoreID = 5,
227 kOpaqueCriticalRegionID = 6,
229 kOpaqueAddressSpaceID = 8,
231 kOpaqueCoherenceID = 10,
233 kOpaqueNotificationID = 12,
234 kOpaqueConsoleID = 13
237 typedef UInt32 MPOpaqueIDClass;
247 typedef OptionBits MPTaskOptions;
248 typedef UInt32 TaskStorageIndex;
249 typedef UInt32 TaskStorageValue;
250 typedef ItemCount MPSemaphoreCount;
251 typedef UInt32 MPTaskWeight;
252 typedef UInt32 MPEventFlags;
253 typedef UInt32 MPExceptionKind;
254 typedef UInt32 MPTaskStateKind;
255 typedef UInt32 MPPageSizeClass;
259 kDurationImmediate = 0L,
260 kDurationForever = 0x7FFFFFFF,
261 kDurationMillisecond = 1,
262 kDurationMicrosecond = -1
303 kMPCreateTaskNotDebuggableMask = 1L << 2,
304 kMPCreateTaskValidOptionsMask =
308 typedef CALLBACK_API_C(OSStatus, TaskProc)(
void *parameter);
318 OSStatus
MPCreateTask(TaskProc entryPoint,
void *parameter, ByteCount stackSize,
319 MPQueueID notifyQueue,
void *terminationParameter1,
320 void *terminationParameter2, MPTaskOptions options,
473 OSStatus
MPNotifyQueue(MPQueueID queue,
void *param1,
void *param2,
void *param3);
507 MPSemaphoreID *semaphore);
539 #define MPCreateBinarySemaphore(semaphore) MPCreateSemaphore(1, 1, (semaphore))
657 void *notifyParam1,
void *notifyParam2,
669 MPOpaqueIDClass kind,
void *notifyParam1,
670 void *notifyParam2,
void *notifyParam3);
690 kMPPreserveTimerIDMask = 1L << 0,
691 kMPTimeIsDeltaMask = 1L << 1,
692 kMPTimeIsDurationMask = 1L << 2
705 #if CALL_NOT_IN_CARBON
748 void *notifyParam2,
void *notifyParam3);
777 kMPMaxAllocSize = 1024L * 1024 * 1024
783 kMPAllocateDefaultAligned = 0,
784 kMPAllocate8ByteAligned = 3,
785 kMPAllocate16ByteAligned = 4,
786 kMPAllocate32ByteAligned = 5,
787 kMPAllocate1024ByteAligned = 10,
788 kMPAllocate4096ByteAligned = 12,
789 kMPAllocateMaxAlignment = 16,
790 kMPAllocateAltiVecAligned = kMPAllocate16ByteAligned,
791 kMPAllocateVMXAligned =
792 kMPAllocateAltiVecAligned,
793 kMPAllocateVMPageAligned = 254,
794 kMPAllocateInterlockAligned = 255
800 kMPAllocateClearMask = 0x0001,
801 kMPAllocateGloballyMask =
803 kMPAllocateResidentMask = 0x0004,
804 kMPAllocateNoGrowthMask = 0x0010,
805 kMPAllocateNoCreateMask =
860 void MPBlockCopy(LogicalAddress source, LogicalAddress destination, ByteCount size);
893 kMPTaskStateRegisters = 0,
895 kMPTaskStateVectors = 2,
896 kMPTaskStateMachine = 3,
897 kMPTaskState32BitMemoryException =
899 kMPTaskStateTaskInfo = 5
905 kMPTaskPropagate = 0,
906 kMPTaskResumeStep = 1,
907 kMPTaskResumeBranch =
909 kMPTaskResumeMask = 0x0000,
910 kMPTaskPropagateMask =
911 1 << kMPTaskPropagate,
912 kMPTaskResumeStepMask =
914 << kMPTaskResumeStep,
915 kMPTaskResumeBranchMask =
916 1 << kMPTaskResumeBranch
932 kMPTaskInfoVersion = 3
954 MPProcessID processID;
960 ItemCount codePageFaults;
961 ItemCount dataPageFaults;
962 ItemCount preemptions;
965 MPOpaqueID blockedObject;
966 MPAddressSpaceID spaceID;
968 LogicalAddress stackBase;
969 LogicalAddress stackLimit;
970 LogicalAddress stackCurr;
1029 typedef UInt32 MPDebuggerLevel;
1032 kMPLowLevelDebugger = 0x00000000,
1033 kMPMidLevelDebugger = 0x10000000,
1034 kMPHighLevelDebugger = 0x20000000
1061 typedef CALLBACK_API_C(
void *, MPRemoteProcedure)(
void *parameter);
1063 typedef UInt8 MPRemoteContext;
1066 kMPAnyRemoteContext = 0,
1067 kMPOwningProcessRemoteContext = 1,
1068 kMPInterruptRemoteContext = 2,
1069 kMPAsyncInterruptRemoteContext = 3
1083 MPRemoteContext context);
1098 typedef CALLBACK_API_C(
Boolean, MPIsFullyInitializedProc)(void);
1099 #define kMPUnresolvedCFragSymbolAddress 0
1100 #define MPLibraryIsLoaded() \
1101 (((UInt32)_MPIsFullyInitialized != \
1102 (UInt32)kMPUnresolvedCFragSymbolAddress) && \
1103 (_MPIsFullyInitialized()))
1130 #if CALL_NOT_IN_CARBON
1131 #if CALL_NOT_IN_CARBON
1154 void *
_MPRPC(MPRemoteProcedure remoteProc,
void *parameter);
1179 UInt32 release, UInt32 revision);
1181 #define MPRPC _MPRPC
1182 #define MPTaskIsToolboxSafe _MPTaskIsToolboxSafe
1188 #if CALL_NOT_IN_CARBON
1189 #ifndef MPIncludeDefunctServices
1190 #define MPIncludeDefunctServices 1
1193 #if MPIncludeDefunctServices
1194 #if CALL_NOT_IN_CARBON
1228 typedef CALLBACK_API_C(
void, MPPrintfHandler)(MPTaskID taskID,
1229 const char *format, va_list args);
1230 #if CALL_NOT_IN_CARBON
1257 #if PRAGMA_STRUCT_ALIGN
1258 #pragma options align = reset
1259 #elif PRAGMA_STRUCT_PACKPUSH
1261 #elif PRAGMA_STRUCT_PACK
1265 #ifdef PRAGMA_IMPORT_OFF
1268 #pragma import reset
Basic Macintosh data types.
unsigned char * StringPtr
Definition: MacTypes.h:477
unsigned char Boolean
Definition: MacTypes.h:318
OSStatus MPNotifyQueue(MPQueueID queue, void *param1, void *param2, void *param3)
Boolean MPTaskIsPreemptive(MPTaskID taskID)
void _MPInitializePrintf(MPPrintfHandler pfn)
OSStatus MPExtractTaskState(MPTaskID task, MPTaskStateKind kind, void *info)
@ kMPNoID
Definition: Multiprocessing.h:244
ItemCount MPProcessorsScheduled(void)
OSStatus MPWaitForEvent(MPEventID event, MPEventFlags *flags, Duration timeout)
OSStatus MPModifyNotification(MPNotificationID notificationID, MPOpaqueID anID, void *notifyParam1, void *notifyParam2, void *notifyParam3)
const char * _MPStatusCString(OSStatus status)
Boolean _MPTaskIsToolboxSafe(MPTaskID task)
OSStatus MPModifyNotificationParameters(MPNotificationID notificationID, MPOpaqueIDClass kind, void *notifyParam1, void *notifyParam2, void *notifyParam3)
OSStatus MPDeleteSemaphore(MPSemaphoreID semaphore)
void MPBlockClear(LogicalAddress address, ByteCount size)
void MPDataToCode(LogicalAddress address, ByteCount size)
OSStatus MPDisposeTaskException(MPTaskID task, OptionBits action)
OSStatus MPCreateSemaphore(MPSemaphoreCount maximumValue, MPSemaphoreCount initialValue, MPSemaphoreID *semaphore)
OSStatus MPDelayUntil(AbsoluteTime *expirationTime)
OSStatus MPCancelTimer(MPTimerID timerID, AbsoluteTime *timeRemaining)
LogicalAddress MPAllocateAligned(ByteCount size, UInt8 alignment, OptionBits options)
Boolean _MPIsFullyInitialized(void)
OSStatus MPDeleteNotification(MPNotificationID notificationID)
void MPExit(OSStatus status)
OSStatus MPSetEvent(MPEventID event, MPEventFlags flags)
OSStatus MPSetTimerNotify(MPTimerID timerID, MPOpaqueID anID, void *notifyParam1, void *notifyParam2, void *notifyParam3)
void * MPRemoteCall(MPRemoteProcedure remoteProc, void *parameter, MPRemoteContext context)
OSStatus MPAllocateTaskStorageIndex(TaskStorageIndex *index)
OSStatus MPExitCriticalRegion(MPCriticalRegionID criticalRegion)
ItemCount MPProcessors(void)
OSStatus MPCreateNotification(MPNotificationID *notificationID)
OSStatus MPSetTaskState(MPTaskID task, MPTaskStateKind kind, void *info)
OSStatus MPDelayUntilSys(AbsoluteTime *expirationTime)
OSStatus MPCreateQueue(MPQueueID *queue)
Boolean _MPLibraryIsCompatible(const char *versionCString, UInt32 major, UInt32 minor, UInt32 release, UInt32 revision)
OSStatus MPSetTaskType(MPTaskID task, OSType taskType)
LogicalAddress MPAllocate(ByteCount size)
void _MPDebugStr(ConstStr255Param msg)
OSStatus MPDeleteCriticalRegion(MPCriticalRegionID criticalRegion)
OSStatus MPSetTaskWeight(MPTaskID task, MPTaskWeight weight)
OSStatus MPRegisterDebugger(MPQueueID queue, MPDebuggerLevel level)
OSStatus MPSetTaskStorageValue(TaskStorageIndex index, TaskStorageValue value)
OSStatus MPArmTimer(MPTimerID timerID, AbsoluteTime *expirationTime, OptionBits options)
ByteCount MPGetAllocatedBlockSize(LogicalAddress object)
OSStatus MPDeleteQueue(MPQueueID queue)
OSStatus MPSignalSemaphore(MPSemaphoreID semaphore)
OSStatus MPWaitOnQueue(MPQueueID queue, void **param1, void **param2, void **param3, Duration timeout)
OSStatus MPDeleteEvent(MPEventID event)
void MPFree(LogicalAddress object)
OSStatus MPUnregisterDebugger(MPQueueID queue)
OSStatus MPDeallocateTaskStorageIndex(TaskStorageIndex index)
OSStatus MPThrowException(MPTaskID task, MPExceptionKind kind)
OSStatus MPTerminateTask(MPTaskID task, OSStatus terminationStatus)
OSStatus MPCreateCriticalRegion(MPCriticalRegionID *criticalRegion)
OSStatus MPEnterCriticalRegion(MPCriticalRegionID criticalRegion, Duration timeout)
OSStatus MPCreateEvent(MPEventID *event)
TaskStorageValue MPGetTaskStorageValue(TaskStorageIndex index)
OSStatus MPCreateTimer(MPTimerID *timerID)
OSStatus MPWaitOnSemaphore(MPSemaphoreID semaphore, Duration timeout)
OSStatus MPCreateTask(TaskProc entryPoint, void *parameter, ByteCount stackSize, MPQueueID notifyQueue, void *terminationParameter1, void *terminationParameter2, MPTaskOptions options, MPTaskID *task)
OSStatus MPSetQueueReserve(MPQueueID queue, ItemCount count)
LogicalAddress _MPAllocateSys(ByteCount size)
StringPtr _MPStatusPString(OSStatus status)
void _MPLibraryVersion(const char **versionCString, UInt32 *major, UInt32 *minor, UInt32 *release, UInt32 *revision)
@ kMPCreateTaskTakesAllExceptionsMask
Definition: Multiprocessing.h:302
MPTaskID MPCurrentTaskID(void)
OSStatus MPSetExceptionHandler(MPTaskID task, MPQueueID exceptionQ)
OSStatus MPDeleteTimer(MPTimerID timerID)
void MPBlockCopy(LogicalAddress source, LogicalAddress destination, ByteCount size)
OSStatus MPCauseNotification(MPNotificationID notificationID)
void _MPPrintf(const char *format,...)
void * _MPRPC(MPRemoteProcedure remoteProc, void *parameter)
Definition: Multiprocessing.h:1312
Definition: Multiprocessing.h:944
Definition: Multiprocessing.h:1372
Definition: MacTypes.h:110