Cafe Core OS (COS) API Functions

Address Conversion Alarms Atomic Data Access Cache
Compression Copy (Processor) Cores Coroutines
Debug Dynamic Loading Error Exception
FastCast Information Initialization Logging
Memory Management Memory and Mapping Overlay Arena Paired Singles
Performance Monitoring Process Switching Stack Start and Stop
Synchronization Thread Thread Synchronization Time

Address Conversion

OSIsAddressRangeDCValid Check if an address range is valid in the data cache.
OSIsAddressValid Check if an address is valid in the current process address space.
OSRoundUp32B Round an address up to the nearest 32-byte boundary.
OSRoundDown32B Round an address down to the nearest 32-byte boundary.

Alarms

OSCancelAlarm Cancels the specified alarm.
OSCancelAlarms Cancels the alarm groups with the same tag value.
OSCreateAlarm Initializes the structure for the specified alarm.
OSCreateAlarmEx Initializes the structure for the specified alarm.
OSGetAlarmUserData Gets user data from an alarm.
OSSetAlarm Sets an alarm.
OSSetAlarmTag Sets a tag to an alarm.
OSSetAlarmUserData Sets user data in an alarm.
OSSetPeriodicAlarm Sets a periodic alarm.
OSWaitAlarm Waits for the specified alarm to expire.

Atomic Data Access

OSAddAtomic Atomically ADD two 32-bit values and store to memory.
OSAndAtomic Atomically AND two 32-bit values together and store to memory
OSCompareAndSwapAtomic Atomically compares two 32-bit values and swaps with value in memory based specific conditions.
OSCompareAndSwapAtomicEx Atomically compares two 32-bit values and swaps with value in memory based specific conditions. Returns original atomic value.
OSDecAtomic Atomically decrement a 32-bit value in memory.
OSIncAtomic Atomically increment a 32-bit value in memory.
OSOrAtomic Atomically OR 2 32-bit numbers together and store to memory.
OSSwapAtomic Atomically swap an 32-bit input value with the 32-bit value in memory.
OSTestAndClearAtomic Atomically test and clear bits (32-bit) in memory.
OSTestAndSetAtomic Atomically test and set bits (32-bit) in memory.
OSXorAtomic Atomically XOR 2 32-bit values together and store to memory.
OSAddAtomic64 Atomically ADD 2 64-bit values together and store to memory.
OSAndAtomic64 Atomically AND 2 64-bit values together and store to memory
OSCompareAndSwapAtomic64 Atomically compare and swap 2 64-bit values from memory.
OSCompareAndSwapAtomicEx64 Atomically compare and swap 2 64-bit values from memory. Returns original atomic value.
OSDecAtomic64 Atomically decrement a 64-bit value in memory.
OSGetAtomic64 Atomically get a 64-bit value in memory.
OSIncAtomic64 Atomically increment a 64-bit value in memory.
OSOrAtomic64 Atomically OR 2 64-bit numbers together and store to memory.
OSSetAtomic64 Atomically set a 64-bit value in memory.
OSSwapAtomic64 Atomically swap an 64-bit input value with the 64-bit value in memory.
OSTestAndClearAtomic64 Atomically test and clear bits (64-bit) in memory.
OSTestAndSetAtomic64 Atomically test and set bits (64-bit) in memory.
OSXorAtomic64 Atomically XOR 2 64-bit values together and store to memory.

Cache

DCFlushRange Execute dcbf on given range.
DCFlushRangeNoSync Execute dcbf on given range without using a sync.
DCInvalidateRange Execute dcbi on given range.
DCStoreRange Execute dcbst on given range.
DCStoreRangeNoSync Execute dcbst on given range without using a sync.
DCTouchRange Execute dcbt on given range.
DCZeroRange Execute dcbz on given range.
LCAlloc Allocate locked cache memory from the current CPU core.
LCDealloc Free the locked cache for the current CPU core.
LCDisableDMA Disable the calling thread from performing locked cache DMA.
LCEnableDMA Allow the calling thread to perform locked cache DMA.
LCGetAllocatableSize Return the size of largest allocatable contiguous space in the locked cache in bytes for the current CPU core.
LCGetDMAQueueLength Get the queued number of DMA transactions for the current CPU core.
LCGetMaxSize Return the maximum size of the locked cache in bytes for the current CPU core.
LCIsDMAEnabled Return whether the locked cached is enabled for the current CPU core.
LCGetUnallocated Return the available space in the locked cache in bytes for the current CPU core.
LCHardwareIsAvailable Return TRUE if the process has access to the LC/DMA hardware on a given CPU core. Otherwise, return FALSE.
LCLoadDMABlocks Load data from main memory into a locked cached region.
LCStoreDMABlocks Store data from the locked cache to a main memory region.
LCWaitDMAQueue Wait until the queued DMA transaction number is equal or less than a given length for the current CPU core.

Compression

LzmaCompress Compress data using the LZMA algorithm.
LzmaUncompress Uncompress data using the LZMA algorithm.
SZFILE helper library and demo 7-Zip file parsing assistance library
SZFILE_CreateArc Create simple manifest of parsed 7Zip file
SZFILE_FindInArc Find a file by name or path in a SZFILE_DIR from a SZFILE manifest
SZFILE_Get Easy-to-use helper function to find and extract by path or file name.
SZFILE_GetUnpackedFile Unpack any stream associated with a SZFILE_ENTRY and return a pointer to the data and its size.
SZFILE_PurgeArc Purge all memory use for an archive manifest created with SZFILE_CreateArc
SZFILE_UnpackStream Unpack a specific 7-Zip file folder stream by index.
ZIPFILE helper library and demo ZIP file parsing assistance library.
ZIPFILE_CalcCRC Calculate CRC used with ZIP files
ZIPFILE_CreateDir Create simple manifest of parsed ZIP file
ZIPFILE_Find Find a file by name or path in a ZIPPED_DIR from a ZIPFILE manifest
zlib Overview Publicly available generic compression library.

Copy

OSBlockMove Optimized memmove function.
OSBlockSet Optimized memset function.

(Processor) Cores

OSGetCoreCount Returns the total core count in the system.
OSGetCoreId Returns the current processor core ID.
OSIsMainCore Returns whether the current core is the primary operating system core.

Coroutines

OSInitCoroutine Initializes a coroutine.
OSLoadCoroutine Loads a previously saved coroutine, switching to it.
OSSaveCoroutine Saves the current coroutine's state.
OSSwitchCoroutine Switches from the current coroutine to a new one, saving the current coroutine's state.

Debug

DisassemblePPCOpcode Disassembles one PowerPC instruction.
DisassemblePPCRange Disassembles PowerPC instructions from an effective address range.
OSDebug Stop in debugger.
OSDebugStr Stop in debugger and displays message.
OSDebugMessage Displays message in debugger. Does not stop the debugger.
OSDebugMessageBytes Displays message of a specified size in debugger. Does not stop the debugger.
OSIsDebuggerPresent Return TRUE if the debugger is connected.
OSIsDebuggerInitialized Return TRUE if the debugger is initialized.
OSIsSchedulerLocked Checks to discover if the scheduler is locked.

Dynamic Loading

OSDynLoad_Acquire The primary RPL loader. The function loads the base module, and returns the handle to the loaded module.
OSDynLoad_AcquireContainingModule Loads an RPL module that contains an object and returns its handle.
OSDynLoad_AddNotifyCallback Used to add a generic callback that is invoked when a module is loaded or unloaded.
OSDynLoad_DelNotifyCallback Removes a previously registered callback.
OSDynLoad_FindExport Finds code or data that was exported by a loaded RPL.
OSDynLoad_FindTag Finds a tag that was attached to an RPL at the MakeRPL stage.
OSDynLoad_GetAllocator Atomically gets the allocator that is used by the loader to allocate read/write areas for the loaded RPL files.
OSDynLoad_GetLoaderHeapStatistics Returns statistics for heaps that are used by the loader at the time the function is called.
OSDynLoad_GetModuleName Gets the name of the loaded RPL module.
OSDynLoad_GetNumberOfRPLs Gets the number of modules that are loaded.
OSDynLoad_GetRPLInfo Fill the array that is referenced by infobuffer with a maximum of count elements, beginning with the module (RPX or RPL) with index index.
OSDynLoad_IsModuleLoaded Takes the base module name to load, and returns a handle to the loaded module.
OSDynLoad_Release Releases an RPL that was previously loaded into memory or supplementally acquired.
OSDynLoad_SetAllocator Atomically sets the allocator that is used by the loader to allocate read/write areas for the RPL files that are loaded.

Error

ASSERT During development, fail if a runtime code assertion fails.
ASSERTMSG During development, fail with a specified message if a runtime code assertion fails.
OSFatal Stop program execution and display a specified message on the TV and GamePad.
OSGetSymbolName Get the module and function name for the given function address.
OSHalt Display the specified message and then panic the system.
OSPanic Display the specified file name, line, and message text, and then panic the system.
OSReport Display a formatted message on the output port.
OSReportInfo Display a formatted message on the output port if the NOTICES level of caferun -v n is set.
OSReportVerbose Display a formatted message on the output port if the VERBOSE level of caferun -v n is set.
OSReportWarn Display a formatted message on the output port if the WARNING level of caferun -v n is set.
OSVReport Display a formatted message on the output port.

Exception

OSDisableAllThreadFPUException Turn off floating-point unit (FPU) exceptions for all non-running threads.
OSDisableContextFPUException Turn off FPU exceptions in a program exception callback.
OSDisableThreadFPUException Turn off FPU exceptions for a given thread.
OSEnableAllThreadFPUException Turn on FPU exception for all non-running threads.
OSEnableThreadFPUException Turn on the FPU exception for a given thread.
OSSetDABR Set Data Address Breakpoint Register.
OSSetExceptionCallback Set per-thread DSI handler.
OSSetExceptionCallbackEx Set per-thread DSI handler with additional options.

FastCast

OSf32tos16 Fast-convert single-precision floating-point to signed 16-bit integer.
OSf32tos8 Fast-convert single-precision floating-point to signed 8-bit integer.
OSf32tou16 Fast-convert single-precision floating-point to unsigned 16-bit integer.
OSf32tou8 Fast-convert single-precision floating-point to unsigned 8-bit integer.
OSInitFastCast Initialize the fast floating-point to/from integer casting feature for the main program and all threads.
OSs16tof32 Fast-convert signed 16-bit integer to 32-bit floating-point.
OSs8tof32 Fast-convert signed 8-bit integer to 32-bit floating-point.
OSSetGQRn Set GQR register n in the Broadway CPU.
OSu16tof32 Fast-convert unsigned 16-bit integer to 32-bit floating-point.
OSu8tof32 Fast-convert unsigned 8-bit integer to 32-bit floating-point.

Information

OSGetConsoleType Checks the console type.
OSGetInfo Get OS selector-based information.
OSSetInfo Set OS selector-based information.

Initialization

OSGetArgcArgv Get the initial program parameters after startup.
OSInit Initialized the operating system.

Logging

System Logging Overview Introduction to system logging on Cafe.
APP_TRACE_* Macros Description of use of APP_TRACE_* macros.
Parse OS Event Log (pcel.exe) pcel is an x86 executable tool that is used to parse an OS Event Log image.
OSLogBuffer Send a buffer of data to the system log.
OSLogArgs Send a set of arguments with an entry to the system log.
OSLogFunc Log a function execution in the system log.
OSLogPrintf Use a printf-style formatting string to send information to the system log.
OSLogReport Retrieve information about the system log.
OSLogRetrieve Get information from the system log.
OSLogSaveCrashDump Synchronously commit any log entries to storage.
OSLogSetFilterPolicy Set the minimum level for noise events to restrict what is entered into the system log.

Memory Management

Memory Allocator
MEMAllocFromAllocator Allocates a memory block from the allocator.
MEMFreeToAllocator Frees the memory block and returns the memory block to the allocator.
MEMInitAllocatorForBlockHeap Initializes the allocator and enables the allocator to allocate and free memory for the block heap.
MEMInitAllocatorForDefaultHeap Initializes the allocator and enables the allocator to allocate and free memory for the default heap.
MEMInitAllocatorForExpHeap Initializes the allocator and enables the allocator to allocate and free memory for the expanded heap.
MEMInitAllocatorForFrmHeap Initializes the allocator and enables the allocator to allocate and free memory for the frame heap.
MEMInitAllocatorForUnitHeap Initializes the allocator and enables the allocator to allocate and free memory for the unit heap.
Default Heap
MEMAllocFromDefaultHeap Allocates memory from the default heap.
MEMAllocFromDefaultHeapEx Allocates memory from the default heap, allowing alignment to be specified.
MEMFreeToDefaultHeap Frees memory that was previously allocated from the default heap.
MEMCreateUserHeapHandle Create a handle for a user-defined heap.
Base Heap
MEMGetBaseHeapHandle Retrieves the handle for a memory arena (physical region).
MEMSetBaseHeapHandle Specifies the base heap to use for a memory arena (physical region).
MEMGetArena Retrieve the memory arena (physical region) that a heap is using.
Functionality Common to Expanded, Frame, and Unit Heap
MEMGetHeapStartAddress Gets the starting address of the memory region used by the heap.
MEMGetHeapStartAddressUsable Gets the first usable memory address region that is managed by the heap.
MEMGetHeapEndAddress Gets the ending address + 1 of the memory region that is used by the heap.
MEMGetHeapTotalSize Gets the memory size that is allocated for the heap. This is the overall memory size, including the header.
MEMGetHeapTotalUsableSize Gets the memory size that is allocated for the heap. This memory size does not include the header size.
MEMFindContainHeap Finds the heap that includes the specified memory block.
MEMFindParentHeap Gets the parent heap handle.
MEMDumpHeap Displays the heap content for debugging.
MEMSetFillValForHeap Sets the fill value in memory during heap creation and during memory block allocation and deallocation for debugging.
MEMGetFillValForHeap Gets the fill value from memory during heap creation and during memory block allocation and deallocation for debugging.
MEMGetHeapType Gets the heap type from the heap handle.
Expanded Heap
MEMCreateExpHeap Creates the expanded heap.
MEMCreateExpHeapEx Creates the expanded heap, using the specified options.
MEMDestroyExpHeap Destroys the expanded heap.
MEMAllocFromExpHeap Allocates a memory block from the expanded heap.
MEMAllocFromExpHeapEx Allocates a memory block from the expanded heap with specified alignment.
MEMFreeToExpHeap Deallocates a memory block.
MEMResizeForMBlockExpHeap Changes the memory block size.
MEMGetTotalFreeSizeForExpHeap Gets the total size of the available region in the expanded heap.
MEMGetAllocatableSizeForExpHeap Gets the maximum size of the allocatable memory block.
MEMGetAllocatableSizeForExpHeapEx Gets the maximum size of the allocatable memory block. (alignment specified)
MEMSetAllocModeForExpHeap Sets the allocation mode of the memory block of the expanded heap.
MEMGetAllocModeForExpHeap Gets the allocation mode of the memory block of the expanded heap.
MEMUseMarginOfAlignmentForExpHeap Sets whether the small memory fragments produced by alignment may be reused as allocatable memory.
MEMSetGroupIDForExpHeap Sets the group ID of the expanded heap.
MEMGetGroupIDForExpHeap Gets the group ID of the expanded heap.
MEMGetSizeForMBlockExpHeap Gets the size of the memory block.
MEMGetGroupIDForMBlockExpHeap Gets the group ID of the memory block.
MEMGetAllocDirForMBlockExpHeap Gets the allocation direction of the memory block.
MEMVisitAllocatedForExpHeap Makes a specified function process all memory blocks.
MEMAdjustExpHeap Reduces the memory used by the expanded heap by freeing the available memory in it.
MEMCheckExpHeap Determines whether the expanded heap is corrupted. (for debugging)
MEMCheckForMBlockExpHeap Checks for corruption in the memory blocks of the expanded heap. (for debugging)
MEMIsExpHeap Determines whether the heap handle is for an expanded heap.
Frame Heap
MEMCreateFrmHeap Creates the frame heap.
MEMCreateFrmHeapEx Creates the frame heap. (options specified)
MEMDestroyFrmHeap Destroys the frame heap.
MEMAllocFromFrmHeap Allocates a memory block from frame heap.
MEMAllocFromFrmHeapEx Allocates a memory block from frame heap. (alignment specified)
MEMFreeToFrmHeap Deallocates a memory block.
MEMResizeForMBlockFrmHeap Changes the size of a memory block.
MEMGetAllocatableSizeForFrmHeap Gets the maximum size of the allocatable memory block.
MEMGetAllocatableSizeForFrmHeapEx Gets the maximum size of the allocatable memory block. (alignment specified)
MEMRecordStateForFrmHeap Records the allocation state of the memory block of the frame heap.
MEMFreeByStateToFrmHeap Returns to the memory block allocation state immediately before recording, using the recorded information about the allocation state of the memory block of the frame heap.
MEMAdjustFrmHeap Deallocates the empty space of the frame heap and reduces the memory region used by the frame heap.
MEMIsFrmHeap Determines whether the heap handle is for a frame heap.
Unit Heap
MEMCreateUnitHeap Creates the unit heap.
MEMCreateUnitHeapEx Creates the unit heap. (alignment and options can be specified)
MEMDestroyUnitHeap Destroys the unit heap.
MEMAllocFromUnitHeap Allocates a memory block from the unit heap.
MEMFreeToUnitHeap Deallocates a memory block.
MEMCountFreeBlockForUnitHeap Gets the number of memory blocks allocatable from the unit heap.
MEMCalcHeapSizeForUnitHeap Gets the size of the required unit heap from the size and number of the memory blocks.
MEMGetMemBlockSizeForUnitHeap Gets the size of the unit heap memory blocks.
MEMIsUnitHeap Determines whether the heap handle is for a unit heap.

Memory and Mapping

OSAllocVirtAddr Allocates a range of size bytes of virtual addresses for memory-mapping later.
OSFreeVirtAddr Frees a range of virtual addresses that were previously allocated using OSAllocVirtAddr.
OSGetAvailPhysAddrRange Returns the range of available physical addresses that may be memory-mapped.
OSGetDataPhysAddrRange Returns the range of data physical addresses that may be memory-mapped.
OSGetMapVirtAddrRange Returns the range of virtual addresses that are available for memory-mapping.
OSGetMemBound Retrieves the maximum bounds of a memory arena, regardless of any heaps that may be in use in that arena.
OSGetPageSize Returns the system memory page size.
OSMapMemory Maps a range of physical memory addresses to a range of virtual addresses, either read-only or read-write.
OSUnmapMemory Unmaps a range of physical memory addresses that were previously mapped using OSMapMemory.

Overlay Arena

OSEnableOverlayArenaWithTimeoutDev Uses a timeout to enable the master process to use the overlay arena.
OSEnableOverlayArenaDev Enables the master process to use the overlay arena.
OSDisableOverlayArenaWithTimeoutDev Uses a timeout to disable the master process to use the overlay arena.
OSDisableOverlayArenaDev Disables the master process to use the overlay arena.
OSIsEnabledOverlayArenaDev Checks if the overlay arena is enabled.

Paired Singles

f32x2: Paired Singles Type Paired Singles Type f32x2 Overview
__PS_ABS / __PS_NABS Paired Singles absolute value and negative absolute value.
__PS_ADD / __PS_SUB Paired Singles add and subtract operations that return Paired Singles values.
__PS_ADDS / __PS_SUBS Floating-point add and subtract operations that return Paired Singles values.
__PS_FDUP Copy floating-point value to Paired Singles value.
__PS_MADD / __PS_MADDS0 /
__PS_MADDS1 / __PS_MSUB /
__PS_NMADD / __PS_NMSUB
Paired Singles add or subtract operations that return Paired Singles positive or negative values.
_PS_MADDS / __PS_MSUBS /
__PS_NMADDS / __PS_NMSUBS
Floating-point add or subtract operations that return positive or negative Paired Singles values.
__PS_MERGE00 / __PS_MERGE01 /
__PS_MERGE10 / __PS_MERGE11
Merge Paired Singles values.
__PS_MUL / __PS_MULS0 /
__PS_MULS1 / __PS_DIV
Paired Singles multiply or divide operations that return Paired Singles values.
__PS_MULS / __PS_DIVS Floating-point multiply or divide operations that return Paired Singles values.
__PS_NEG Returns the negative Paired Singles value of the Paired Singles input value.
__PS_NEGS Returns a negative Paired Singles value of the floating-point input value.
__PS_RES / __PS_RSQRTE Returns the estimate of the Paired Singles reciprocal value of the Paired Singles input or Paired Singles reciprocal square root value of the Paired Singles input.
__PS_RESS Returns an estimate of the Paired Singles reciprocal value of the floating-point input value.
__PS_SEL If the ps1 value is greater than or equal to 0.0, the selected Paired Singles value is returned.
__PS_SUM0 / __PS_SUM1 Returns the Paired Singles result of adding the ps0 or ps1 fields of the first and last input arguments.
__PSQ_L / __PSQ_LX /
__PS_ST / __PSQ_STX
Reads or writes Paired Singles registers, with optional quantization.

Performance Monitoring

OSSetPerformanceMonitor Set the supervisor level performance monitor registers.
PMGetCycleCount Get CPU cycles count.
PMGetInstructionCount Get CPU instructions count.
PMResetCycleAndInstructionCount Zeros the cycle and instruction count.
PMStartCycleAndInstructionCount Start counting cycles and instructions.
PMStopCycleAndInstructionCount Stop counting cycles and instructions.
PMCPUSetGroup Set performance counter group to monitor events.
PMCPUStartGroup Start performance counters indicated by group.
PMCPUReadGroup Read the group performance counter values.
PMCPUStopGroup Stop the group performance counters.
PMCPUResetGroup Reset the group performance counters to zero.
PMCPUResetStartGroup Reset and start the group performance counters.

Process Switching

System Messages
APP_IN_FOREGROUND Macro that calls OSGetForegroundBucket with benign arguments and returns nonzero if the calling process has access to foreground resources.
OSBlockThreadsOnExit The system stops scheduling user threads when the application calls the exit or _Exit functions are called or when the application returns from main.
OSEnableForegroundExit Enables the game to exit while in the foreground.
OSEnableHomeButtonMenu If a process needs to leave the HOME Button disabled after it starts listening to the system message queue, call OSEnableHomeButtonMenu(FALSE) before calling OSGetSystemMessageQueue.
OSGetCallArgs When a switch is made and the process receives the foreground, it may call this function to retrieve the arguments that were passed to it by the "calling" process.
OSGetForegroundBucket Get the location and size of the foreground bucket memory area.
OSGetForegroundBucketFreeArea Get the location and size of the foreground bucket free memory area.
OSGetScreenCapturePermission Returns TRUE if the "last frame" may be used for a screen capture.
OSGetScreenCapturePermissionEx Returns TRUE if the "last frame" may be used for a screen capture.
OSGetSystemMessageQueue Retrieve a pointer to the queue that receives system messages.
OSIsBlockThreadsOnExit Verifies that OSBlockThreadsOnExit is turned on.
OSIsHomeButtonMenuEnabled Used to determine if the HOME Menu is enabled or disabled for the process.
OSReleaseForeground When a process is releasing the foreground, this function must be called by all three processor cores to coordinate the release of foreground resources on all cores.
OSRestartGame Restart the currently running game.
OSRunThreadsOnExit The system runs all user threads that are being scheduled when the application calls the exit or _Exit functions are called or when the application returns from main.
OSSavesDone_ReadyToRelease Notifies the operating system that an application completed its fast saves before releasing the foreground.
OSSendAppSwitchRequest Sends a message to the system to release the foreground to another process.
OSSendPolicyRequest Send a message to the system to request processing with regard to a policy.
OSSetScreenCapturePermission Indicates whether the last rendered frame that is in memory after foreground release may be used by another application.
OSSetScreenCapturePermissionEx Indicates whether the last rendered frame that is in memory after foreground release may be used by another application.

Stack

OSClearStack Clears the stack to the specified value of the current thread.
OSGetStackPointer Gets the current stack pointer address (r1).
OSGetUserStackPointer Gets the user stack pointer for the specified thread.
OSSwitchFiber Executes a function that uses the new stack.
OSSwitchFiberEx Executes a function that uses the new stack. The function can pass an argument.
OSSwitchStack Switches the current stack pointer.

Starting and Stopping

OSGetShutdownFlags Get shutdown flags.
OSGetShutdownReason Get shutdown reason.

Synchronization

OSAcquireSpinLock Acquire an OSSpinLock.
OSCoherencyBarrier Executes a PowerPC SYNC instruction, forcing stores on the existing processor core to become coherent prior to resuming execution on the current processor core.
OSDisableInterrupts Disables interrupts on the current processor core in the current process. Other cores are not affected.
OSEnableInterrupts Enables interrupts on the current processor core in the current process.
OSInitRendezvous Initialize an OSRendezvous to a waitable state.
OSInitSpinLock Initialize a spinlock to non-acquired state.
OSIsInterruptEnabled Returns TRUE if interrupts are enabled, or FALSE if interrupts are disabled.
OSMemoryBarrier Wait for a PowerPC SYNC instruction and all stores to complete.
OSReleaseSpinLock Release an OSSpinLock.
OSRestoreInterrupts Restores the current processor core interrupt setting for the current process.
OSTryAcquireSpinLock Try to acquire an OSSpinLock.
OSTryAcquireSpinLockWithTimeout Try to acquire an OSSpinLock or wait until the timeout expires.
OSUninterruptibleSpinLock_Acquire Busy-waits to acquire an OSUninterruptibleSpinLock if the spinlock has never been acquired.
OSUninterruptibleSpinLock_Release Releases the per-thread OSUninterruptibleSpinLock.
OSUninterruptibleSpinLock_TryAcquire Attempts to acquire an OSUninterruptibleSpinLock.
OSUninterruptibleSpinLock_TryAcquireWithTimeout Attempts to acquire an OSUninterruptibleSpinLock until the timeout time is reached.
OSWaitRendezvous The thread or task to busy-waits until the specified set of processor cores reach the OSRendezvous.
OSWaitRendezvousWithTimeout The thread or task to busy-waits until the specified set of processor cores reach the OSRendezvous or until the timeout elapses.

Thread

OSCancelThread Cancels the specified thread when the thread reaches specific points in its execution.
OSCheckActiveThreads Executes as many checks as possible by tracing an active thread queue.
OSCheckThreadStackUsage Gets maximum thread stack usage of the specified thread.
OSClearThreadStackUsage Turns off tracking thread stack usage.
OSContinueThread Sets the suspend counter to zero for the specified thread, and then resumes the specified thread.
OSCreateThread Creates a new thread.
OSCreateThreadType Creates and schedules a new thread of the specified type and priority.
OSDetachThread Sets the detached attribute for the specified thread. When a thread ends, that thread is automatically removed from the active thread list.
OSExitThread Ends the current (called) thread and switches to the next runnable thread.
OSGetActiveThreadLink Returns a snapshot of the next and previous thread in the active global thread list.
OSGetCurrentThread Gets the pointer to the current thread.
OSGetDefaultThread Gets the pointer to the thread which initially run on a processor core.
OSGetThreadAffinity Gets the thread core affinity.
OSGetThreadName Gets the name of the specified thread.
OSGetThreadPriority Returns the priority order that will become the scheduling base for the specified thread.
OSInitThreadQueue Initializes the thread queue that other thread functions use.
OSIsThreadSuspended Determines whether the specified thread is suspended.
OSIsThreadTerminated Determines whether the specified thread is stopped.
OSJoinThread Waits for the specified thread to terminate and reproduces information for that thread.
OSPrintCurrentThreadState Prints the currently running thread state context information.
OSResumeThread Resumes the specified thread (incremental).
OSRunThread Runs the specified function on the specified thread.
OSSetThreadAffinity A thread may have an affinity for more than one core. OSSetThreadAffinity migrates a thread from one core to another core.
OSSetThreadCancelState Determines whether a thread may be canceled or suspended.
OSSetThreadCleanupCallback Registers the callback to run immediately before the thread terminates.
OSSetThreadDeallocator Registers a deallocator that runs after the thread terminates.
OSSetThreadName Sets the name of the specified thread.
OSSetThreadPriority Sets the priority level that is used as the scheduling base.
OSSetThreadRunQuantum Sets the amount of time in microseconds that a thread runs before the OS attempts to reschedule.
OSSetThreadSpecific Gets data specific to the thread that called this function.
OSSetThreadStackUsage Turns on thread stack usage tracking.
OSSleepMicroseconds Sleep current thread for given number of microseconds.
OSSleepMilliseconds Sleep current thread for given number of milliseconds.
OSSleepNanoseconds Sleep current thread for given number of nanoseconds.
OSSleepSeconds Sleep current thread for given number of seconds.
OSSleepThread Suspends the current thread and inserts it into the thread queue thatqueue specifies.
OSSleepTicks Sleep current thread for given number of ticks.
OSSuspendThread Increments the suspend count and suspends the thread if the counter is greater than zero.
OSTestThreadCancel To allow a thread to be suspended or canceled, this function creates a cancellation point in the calling thread.
OSWakeupThread Wakes up all the threads in the specified thread queue.
OSYieldThread Performs thread rescheduling.
PPCSetFpIEEEMode Sets the FPU mode for the thread to IEEE.
PPCSetFpNonIEEEMode Sets the FPU mode for the thread to non-IEEE.

Thread Synchronization

Mutexes and Condition Variables
OSFastCond_Init Initialized the fast condition variable.
OSFastCond_Signal Signals the fast condition variable.
OSFastCond_Wait Waits on the fast condition variable.
OSFastMutex_Init Initializes the fast mutex.
OSFastMutex_Lock The calling thread locks the fast mutex.
OSFastMutex_TryLock The calling thread trys to lock the fast mutex.
OSFastMutex_Unlock The calling thread unlocks the fast mutex.
OSInitCond Initializes the condition variable. 
OSInitCondEx Initializes the condition variable. 
OSInitMutex Initializes the mutex.
OSInitMutexEx Initializes the mutex.
OSLockMutex Attempts to lock the mutex that mutex specifies.
OSSignalCond Unblocks all the threads waiting on the specified condition variable.
OSTryLockMutex The calling thread tries to lock the mutex.
OSUnlockMutex The calling thread unlocks the mutex.
OSWaitCond Blocks the calling thread on the condition variable and releases the mutex.
Message Queues
OSInitMessageQueue Initializes the message queue structure mq.
OSInitMessageQueueEx Initializes the message queue structure mq.
OSJamMessage Inserts a message at the start of the specified message queue.
OSReceiveMessage Extracts messages from the message queue.
OSSendMessage Inserts a message at the end of the specified message queue.
Semaphores
OSGetSemaphoreCount Returns the current semaphore count.
OSInitSemaphore Initializes semaphores.
OSInitSemaphoreEx Initializes semaphores.
OSSignalSemaphore Increments the specified semaphore count.
OSTryWaitSemaphore If the semaphore count is greater than zero, the count is decremented.
OSWaitSemaphore Decrements the specified semaphore count.
Shared System Resources
OSGetSharedData Retrieves the address of a system-wide shared resource in memory.
Events
OSInitEvent Initialize an OSEvent to a non-signaled state.
OSInitEventEx Initialize an OSEvent to a non-signaled state.
OSSignalEvent Signal an OSEvent to wake up the waiting thread.
OSSignalEventAll Signal an OSEvent to wake up all waiting threads.
OSWaitEvent Wait until the OSEvent is signaled.
OSWaitEventWithTimeout Wait until the OSEvent is signaled or the timeout expires.
OSResetEvent Reset an OSEvent if it is in the signaling state.

Time

OSDiffTick Returns the difference between two tick values.
OSGetTime Gets the value of the time base register (64-bit width) in units of OS_TIMER_CLOCK Hz.
OSGetTick Gets a tick. (Gets the 32 low order bits of Broadway's time base register.)
OSGetSystemTime Gets the value of the time base register, which indicate how long it past after system reset.
OSTicksToCycles Converts time from ticks to CPU core cycles units (OS_CORE_CLOCK Hz).
OSTicksToSeconds Converts value from ticks to seconds.
OSTicksToMilliseconds Converts value from ticks to milliseconds.
OSTicksToMicroseconds Converts value from ticks to microseconds.
OSTicksToNanoseconds Converts value from ticks to nanoseconds.
OSSecondsToTicks Converts value from seconds to ticks.
OSMillisecondsToTicks Converts value from milliseconds to ticks.
OSMicrosecondsToTicks Converts value from microseconds to ticks.
OSNanosecondsToTicks Converts value from nanoseconds to ticks.
OSCalendarTimeToTicks Converts value from calendar time to ticks (OS_TIMER_CLOCK Hz).
OSTicksToCalendarTime Converts value from ticks (OS_TIMER_CLOCK Hz) to calendar time.

Revision History

2014/08/29 Remove OSIs<Mode>Boot and OSGetSecurityLevel.
2014/04/18 Added links to OSIsAddressValid and OSSetExceptionCallbackEx.
2014/04/14 Added link to OSIs<Mode>Boot.
2014/04/07 Added links to OSGetSecurityLevel.
2014/02/24 Added links to OSUninterruptibleSpinLock.
2014/02/04 Added link to OSIsDebuggerInitialized.
2014/01/21 Terminology change to HOME Menu.
2014/01/16 Fixed incorrect spelling.
2013/11/15 Fixed 'Time' anchor.
2013/11/15 Added links to missing functions.
2013/08/02 Add coroutine overview.
2013/05/08 Automated cleanup pass.


CONFIDENTIAL