RtfwSetProcessorConfiguration

RtfwSetProcessorConfiguration configures the processor configuration of the wRTOS Subsystem.

Syntax

Copy
bool RtfwSetProcessorConfiguration(
    [in]    DWORD requestedWindowsProcessorCount,
    [in]    DWORD requestedRTSSProcessorCount,
    [out]   DWORD* pWarning
);

Parameters

[in] requestedWindowsProcessorCount

Specifies the number of Windows processors, which must be at least one and not exceed one less than the total number of processors in the system.

[in] requestedRTSSProcessorCount

Specifies the requested number of RTSS processors, which must be at least one and not exceed one less than the total number of processors in the system.

[out] pWarning

A pointer to a value that is set to a non-zero warning code if a warning results from a successful call to this API. If this API fails, this value is undefined. See preprocessor macros RT_WARNING_... in header file RtErrorCodes.h for possible warning codes.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.

Possible error codes:

Error code Meaning

ERROR_ACCESS_DENIED

The caller did not have Administrator privileges.

ERROR_INVALID_PARAMETER

The sum of requestedWindowsProcesssorCount and requestedRTSSProcessorCount exceeds the total number of processors in the system. This is not supported.

RT_ERROR_RESTART_SUBSYSTEM

(Success) Occurs when errors RT_ERROR_INCONSISTENT_PROCESSOR_CONFIGURATION and RT_ERROR_RESTART_WINDOWS were not set, the number of Windows processors has not changed, the number of RTSS processors has changed, and the Subsystem is running. RtfwRestartRequired will report that the wRTOS Subsystem must be restarted.

The wRTOS Subsystem must be restarted for the changes to take effect.

RT_ERROR_RESTART_WINDOWS

(Success) Occurs when error RT_ERROR_INCONSISTENT_PROCESSOR_CONFIGURATION was not set, and the number of Windows processors has changed. RtfwRestartRequired will report that Windows must be restarted.

RT_ERROR_SUBSYSTEM_START_STOP_IN_PROGRESS

The wRTOS Subsystem was in the process of starting or stopping when this API was called.

RT_WARNING_INCONSISTENT_PROCESSOR_CONFIGURATION

The new processor configuration has no RTSS processor corresponding to any processor numbers configured elsewhere (e.g., the ideal processor of the RT_TCP/IP Stack or the processor numbers configured for a network interface). As a result, all processor numbers are set to a value of 0, which means the first RTSS processor.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtfwApi.h

RtfwApi.lib

See Also: