spe_context_create - Create a new SPE context.
#include <libspe2.h>
spe_context_ptr_t spe_context_create(unsigned int flags, spe_gang_context_ptr_t gang)
Parameters | |
flags | A bit-wise OR of modifiers that are applied when the SPE context is created. See Usage. |
gang | Associate the new SPE context with this gang context. If NULL is specified, the new SPE context is not associated with any gang. |
On success, a pointer to the newly created SPE context is returned.
On error, NULL is returned and errno is set to indicate the error.
Possible errors include:
ENOMEM | The SPE context could not be allocated due to lack of system resources. |
EINVAL | The value passed for flags was invalid. |
EPERM | The process does not have permission to add threads to the designated SPE gang context, or to use the SPU_MAP_PS setting. |
ESRCH | The gang context could not be found. |
EFAULT | A runtime error of the underlying operating system service occurred. |
ENODEV | An isolated SPE context has been requested but the system is not isolation-enabled. |
The following values are accepted for the flags parameter:
SPE_EVENTS_ENABLE | Enable event handling on this SPE context |
SPE_CFG_SIGNOTIFY1_OR | Configure the SPU Signal Notification 1 Register to be in "logical OR" mode instead of the default "Overwrite" mode. See Cell Broadband Engine Architecture, SPU Signal Notification Facility. |
SPE_CFG_SIGNOTIFY2_OR | Configure the SPU Signal Notification 2 Register to be in "logical OR" mode instead of the default "Overwrite" mode. See Cell Broadband Engine Architecture, SPU Signal Notification Facility. |
SPE_MAP_PS | Request permission for memory-mapped access to the SPE's problem state area(s). See Cell Broadband Engine Architecture, Problem State Memory-Mapped Registers. |
SPE_ISOLATED | This context executes on an SPU in the isolation mode. Programs loaded into contexts flagged with SPE_ISOLATED must be be correctly formatted for isolated execution. |
SPE_ISOLATED_EMULATE | Run this context on an SPU in an emulated isolation
mode. This mode provides emulation of an isolated SPU without truly being
isolated as is intended for use by developers who need access to debug tools
during the development of their isolated applications. Programs loaded into
contexts flagged with SPE_ISOLATED_EMULATE must be correctly formatted for
isolated emulation execution. Note: (Linux) Proper operation of a PPE assisted
function call assumes the use of the ISOLATED version of the SPE library functions.
|
spe_context_destroy(3); spe_gang_context_create(3)
Cell Broadband Engine Architecture, SPU Signal Notification Facility
Cell Broadband Engine Architecture, Problem State Memory-Mapped Registers