1 .\" Copyright (c) International Business Machines Corp., 2006
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" 2005-09-28, created by Arnd Bergmann <arndb@de.ibm.com>
7 .\" 2006-06-16, revised by Eduardo M. Fleury <efleury@br.ibm.com>
8 .\" 2007-07-10, some polishing by mtk
9 .\" 2007-09-28, updates for newer kernels by Jeremy Kerr <jk@ozlabs.org>
11 .TH SPU_CREATE 2 2021-03-22 Linux "Linux Programmer's Manual"
13 spu_create \- create a new spu context
16 .RI ( libc ", " \-lc )
19 .BR "#include <sys/spu.h>" " /* Definition of " SPU_* " constants */"
20 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
21 .B #include <unistd.h>
23 .BI "int syscall(SYS_spu_create, const char *" pathname \
24 ", unsigned int " flags ,
25 .BI " mode_t " mode ", int " neighbor_fd );
29 glibc provides no wrapper for
31 necessitating the use of
36 system call is used on PowerPC machines that implement the
37 Cell Broadband Engine Architecture in order to access Synergistic
38 Processor Units (SPUs).
39 It creates a new logical context for an SPU in
41 and returns a file descriptor associated with it.
43 must refer to a nonexistent directory in the mount point of
48 is successful, a directory is created at
50 and it is populated with the files described in
53 When a context is created,
54 the returned file descriptor can only be passed to
60 family of system calls (e.g.,
63 other operations are not defined.
65 context is destroyed (along with all files created within the context's
67 directory) once the last reference to the context has gone;
68 this usually occurs when the file descriptor returned by
74 argument (minus any bits set in the process's
76 specifies the permissions used for creating the new directory in
80 for a full list of the possible
87 .B SPU_CREATE_AFFINITY_SPU
88 flag is specified; see below.
92 argument can be zero or any bitwise OR-ed
93 combination of the following constants:
95 .B SPU_CREATE_EVENTS_ENABLED
96 Rather than using signals for reporting DMA errors, use the
102 Create an SPU gang instead of a context.
103 (A gang is a group of SPU contexts that are
104 functionally related to each other and which share common scheduling
105 parameters\(empriority and policy.
106 In the future, gang scheduling may be implemented causing
107 the group to be switched in and out as a single unit.)
109 A new directory will be created at the location specified by the
112 This gang may be used to hold other SPU contexts, by providing
113 a pathname that is within the gang directory to further calls to
116 .B SPU_CREATE_NOSCHED
117 Create a context that is not affected by the SPU scheduler.
118 Once the context is run,
119 it will not be scheduled out until it is destroyed by
120 the creating process.
122 Because the context cannot be removed from the SPU, some functionality
124 .B SPU_CREATE_NOSCHED
126 Only a subset of the files will be
127 available in this context directory in
130 .B SPU_CREATE_NOSCHED
131 contexts cannot dump a core file when crashing.
134 .B SPU_CREATE_NOSCHED
135 contexts requires the
139 .B SPU_CREATE_ISOLATE
140 Create an isolated SPU context.
141 Isolated contexts are protected from some
142 PPE (PowerPC Processing Element)
144 such as access to the SPU local store and the NPC register.
147 .B SPU_CREATE_ISOLATE
148 contexts also requires the
149 .B SPU_CREATE_NOSCHED
152 .BR SPU_CREATE_AFFINITY_SPU " (since Linux 2.6.23)"
153 .\" commit 8e68e2f248332a9c3fd4f08258f488c209bd3e0c
154 Create a context with affinity to another SPU context.
155 This affinity information is used within the SPU scheduling algorithm.
156 Using this flag requires that a file descriptor referring to
157 the other SPU context be passed in the
161 .BR SPU_CREATE_AFFINITY_MEM " (since Linux 2.6.23)"
162 .\" commit 8e68e2f248332a9c3fd4f08258f488c209bd3e0c
163 Create a context with affinity to system memory.
164 This affinity information
165 is used within the SPU scheduling algorithm.
169 returns a new file descriptor.
170 On failure, \-1 is returned, and
172 is set to indicate the error.
176 The current user does not have write access to the
181 An SPU context already exists at the given pathname.
185 is not a valid string pointer in the
186 calling process's address space.
190 is not a directory in the
192 mount point, or invalid flags have been provided.
195 Too many symbolic links were found while resolving
199 The per-process limit on the number of open file descriptors has been reached.
206 The system-wide limit on the total number of open files has been reached.
209 An isolated context was requested, but the hardware does not support
215 could not be resolved.
218 The kernel could not allocate all resources required.
221 There are not enough SPU resources available to create
222 a new context or the user-specific limit for the number
223 of SPU contexts has been reached.
226 The functionality is not provided by the current system, because
227 either the hardware does not provide SPUs or the spufs module is not
237 .B SPU_CREATE_NOSCHED
238 flag has been given, but the user does not have the
243 must point to a location beneath the mount point of
245 By convention, it gets mounted in
250 system call was added to Linux in kernel 2.6.16.
252 This call is Linux-specific and implemented only on the PowerPC
254 Programs using this system call are not portable.
257 is meant to be used from libraries that implement a more abstract
258 interface to SPUs, not to be used from regular applications.
260 .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/
262 for the recommended libraries.
264 Prior to the addition of the
265 .B SPU_CREATE_AFFINITY_SPU
266 flag in Linux 2.6.23, the
268 system call took only three arguments (i.e., there was no
274 for an example of the use of
279 .BR capabilities (7),