Real-Time API Functions

This section contains a list of supported RTAPI functions.

RTAPI Function Name

Description

RtAcquireFastSemaphore

Places the thread into a busy wait state until the fast semaphore is released.

RtAllocateContiguousMemory

Allocates physically contiguous memory.

RtAllocateContiguousMemorySpecifyCache

Allocates a range of physically contiguous, cache-aligned memory.

RtAllocateLocalMemory

Allocates memory from the local pool or pool cache of the external allocation space of the current process.

RtAllocateLocalMemoryEx

Allocates memory from a pre-allocated Process local memory pool to avoid SRI activity if allocating memory from the Windows memory pool.

RtAllocateLockedMemory

Commits and locks the specified amount of memory to avoid page faults as the memory is used.

RtAtoi

Converts a given string value to an integer.

RtCancelTimer

Cancels the expiration of the indicated timer.

RtCloseHandle

Closes an open object handle.

RtCreateEvent

Creates a named or unnamed event object.

RtCreateMutex

Creates an Process mutex. A handle is returned to the newly created mutex object.

RtCreateProcess

Creates and starts a new process. The new process runs the specified Process executable file.

RtCreateSemaphore

Creates a named or unnamed semaphore object.

RtCreateSharedMemory

Creates a named region of physical memory that can be mapped by any process.

RtCreateTimer

Creates a timer associated with the specified clock and returns a handle to the timer.

RtCreateTimerEx

Creates a timer associated with the specified clock and returns a handle to the timer.

RtDeleteProcThreadAttributeList

Deletes the specified list of attributes for process and thread creation.

RtDeleteTimer

Deletes the timer specified by the given handle.

RtDisableInterrupts

In the Windows environment, RtDisableInterrupts disables all user-level interrupt handling for all interrupts to which the Windows process is attached.

In an Process environment, RtDisableInterrupts disables all interrupts at the processor level including timer interrupts.

RtDisablePortIo

Disables direct I/O port access from user context.

RtEnableInterrupts

Enables user-level interrupt handling for all interrupts to which the process is attached.

RtEnablePortIo

Enables direct I/O port access from user context.

RtEnumProcesses

Retrieves the process identifier for each process object.

RtEnumProcessesEx Retrieves the process identifier for each process object.

RtEnumProcessModules

Retrieves a handle for each module in a specified process.

RtExpandMSpace Expands the local pool of the specified MSpace by the size specified.

RtFreeContiguousMemory

Frees a previously allocated physically contiguous memory region.

RtFreeLockedMemory

Frees memory previously committed and locked by a call to RtAllocateLockedMemory.

RtGetBusDataByOffset

Obtains details, starting at the given offset, about a given slot on an I/O bus.

RtGetClockResolution

Obtains the resolution of the specified clock.

RtGetClockTime

Obtains the current value of the specified clock.

RtGetClockTimerPeriod

Obtains the minimum timer period of the specified clock. The RtGetClockTimecall delivers the clock time as 64-bit quantity of 100ns.

RtGetCountFastSemaphore

Returns the number of threads waiting on this fast semaphore. This information is useful when preparing for a manual release of the fast semaphore.

RtGetCurrentProcessorNumber

Returns the system-assigned number of the current processor on which the caller is running.

RtGetEnabledXStateFeature

Returns the highest feature for a specified XState feature set supported on the running processor and enabled by eRTOS.

RtGetExitCodeProcess

Retrieves the termination status of the specified process.

RtGetFlushTLBTickMod

Allows a process to query the current flush TLB tick mod set by RtSetFlushTLBTickMod.

RtGetHalTimerPeriodCounts Retrieves the APIC counts per eRTOS HAL timer period.

RtGetModuleBaseName

Retrieves the base name of a specified module.

RtGetModuleFileName

Retrieves the fully qualified path for the file that contains the specified module.

RtGetModuleFileNameEx

Retrieves the fully qualified path for the file that contains the specified module.

RtGetPhysicalAddress

Returns the physical address for the virtual address of a contiguous physical memory buffer previously allocated by RtAllocateContiguousMemory.

In the Process environment, this function applies to all memory allocation.

RtGetProcessAffinityMask

Retrieves the process affinity mask for the specified process and the system affinity mask for Process.

RtGetProcessIdealProcessor

Retrieves the ideal processor for a given process handle.

RtGetProcessMSpace Retrieves an MSpace descriptor of the external and internal allocation space for the specified process or system process.

RtGetProcessorInfo

Retrieves the system-wide processor numbers for the lowest and highest processors.

RtGetRDTCapability Returns the system Resource Director Technology (RDT) allocation capability.
RtGetSystemTimes Retrieves an array of system timing information. On a multiprocessor system, values in each of the FILETIME structures will contain system timing information about the Process core.
RtGetThreadCLOS Retrieves the Class of Services (CLOS) value of a specified thread.

RtGetThreadPriority

Returns the priority value for the specified thread.

RtGetThreadStack Retrieves the thread stack parameters for an existing thread object.

RtGetThreadTimes

Retrieves timing information for the specified Process thread.

RtGetTimeQuantum Retrieves the time quantum, in milliseconds, of a specified thread.

RtGetTimer

Returns the remaining relative time until the next expiration of the specified timer.

RtInitializeFastSemaphore

Initializes a fast semaphore object.

RtInitializeProcThreadAttributeList

Initializes a specified list of attributes for process and thread creation.

RtIsDebuggerPresent

Determines whether a local real-time process is attached to the MaxRT eRTOS Debugger.

RtIsPerformanceCore

Queries whether the specified core is a performance core.

RtMapMemory

Maps a range of physical memory addresses into the user's virtual address space.

RtOpenEvent

Returns a handle of an existing named event object.

RtOpenMutex

Returns a handle to the named mutex.

RtOpenProcess

Returns a handle to an existing process object.

RtOpenSemaphore

Returns a handle of an existing named semaphore object.

RtOpenSharedMemory

Opens a named physical-mapping object.

RtOpenThread Opens an existing thread object and returns a handle to that thread object.

RtPrintf

Prints formatted output to the standard output stream or console window.

RtPulseEvent

Provides a single operation that sets (to signaled) the state of the specified event object and then resets it (to non-signaled) after releasing the appropriate number of waiting threads.

RtQueryPciMsiCapability

Allows a user to query a PCI device and determine if the device has MSI or MSI-X capability.

RtQueryPerformanceCounter

Retrieves the current value of the high-resolution performance counter (based on processor’s time-stamp counter, TSC).

RtQueryPerformanceFrequency

Retrieves the frequency of the high-resolution performance counter (based on processor’s time-stamp counter, TSC).

RtQueryProcessMSpace Queries memory allocation space information in the specified process MSpace, including various summary statistics of its local pool and pool cache.
RtQuerySharedMemory Retrieves shared memory information.

RtQuerySystemPerfCaps

Queries the performance capability of each logical processor for the specified ClassID.

RtQueryThreadPerfIdealProcessor

Queries the thread’s current Class ID, the performance ideal processor, the current performance capability of affinity logical processor, and the performance capability of each logical processor based on hardware feedback.

RtReadPortBuffer Calls copy data from an I/O port to a buffer until the buffer has been filled using the bytes that you specify for each read operation.

RtReleaseAllFastSemaphore

Releases all threads waiting on the fast semaphore. Ensures that all waiting threads enter the ready-to-run state. Ensures that no new threads enter the busy wait state until all current waiters have become runnable.

RtReleaseFastSemaphore

Releases the specified count of threads waiting on the fast semaphore. If the number of waiting threads is less than the specified count, RtReleaseFastSemaphore will store the remaining count value and continue to release new threads that call RtAcquireFastSemaphore on this fast semaphore.

RtReleaseMutex

Relinquishes ownership of a mutex.

RtReleaseSemaphore

Increases the count of the specified semaphore object by a specified amount.

RtResetEvent

Sets the state of the specified event object to non-signaled.

RtResetWatchdog

Resets the watchdog timer counter on the specified Process core(s).

RtSetBusDataByOffset

Sets bus-configuration data for a device on a dynamically configurable I/O bus with a published, standard interface.

RtSetClockTime

Sets the current value of the specified clock.

RtSetEvent

Sets the state of the specified event object to signaled.

RtSetFlushTLBTickMod

Allows a process to set the flush TLB tick mod.

RtSetHalTimerPeriodCounts Sets the APIC counts per eRTOS HAL timer period.

RtSetProcessAffinityMask

Sets a processor affinity mask for the threads of the specified process.

RtSetThreadCLOS Overwrites a thread’s implicit or default Class of Services (CLOS), which is based on its priority.

RtSetThreadPriority

Sets the priority value for the specified thread.

RtSetTimeQuantum Sets the time quantum, in milliseconds, of a specified thread.

RtSetTimer

Sets the expiration time and repeat interval on the specified timer.

RtSetTimerRelative

Sets the expiration time and repeat interval on the specified timer.

RtShrinkMSpace Shrinks the local pool of the specified MSpace up to the size specified.

RtSleepFt

Suspends the current thread for the specified time.

RtSleepFtEx

Suspends execution of the current thread for a specified time.

RtSleepEx

Suspends the current thread until the specified condition is met.

RtTerminateProcess

Terminates the specified process and all its threads.

RtTranslateBusAddress

Translates a bus-specific address into the corresponding system logical address.

RtUnmapMemory

Releases a mapping made by a previous call to RtMapMemory.

RtUpdateProcThreadAttribute

Updates the specified attribute in a list of attributes for process and thread creation.

RtWaitForMultipleObjectsEx

Allows a thread to wait on one of multiple objects to be signaled with high granularity of time-out interval.

RtWaitForSingleObject

Allows a thread to wait on an object to be signaled.

RtWaitForSingleObjectEx

Allows a thread to wait on an object to be signaled with high granularity of time-out interval.

RtWPrintf

Prints formatted output to the standard output stream or console window.

RtWritePortBuffer Calls copy data from a buffer to an I/O port until the buffer has been emptied using the bytes that you specify for each write operation.

RtWtoi

Converts a given string value to an integer.

Note: The functions listed under #pragma deprecated in the real-time API, Rtapi.h, are unsupported, not deprecated. Listing them this way ensures that a warning appears in Visual Studio when a developer attempts to use an unsupported function in Visual Studio.

Note: Implicit TLS initializers/finalizers must not take too long to execute. While they are executing, any real-time APIs that create or destroy internal eRTOS kernel objects (e.g., threads, processes, mutexes, semaphores, open files, etc.) will block.