1 .\" Copyright (c) International Business Machines Corp., 2006
3 .\" %%%LICENSE_START(GPLv2+_SW_3_PARA)
4 .\" This program is free software; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" This program is distributed in the hope that it will be useful,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12 .\" the GNU General Public License for more details.
14 .\" You should have received a copy of the GNU General Public
15 .\" License along with this manual; if not, see
16 .\" <http://www.gnu.org/licenses/>.
20 .\" 2005-09-28, created by Arnd Bergmann <arndb@de.ibm.com>
21 .\" 2006-06-16, revised by Eduardo M. Fleury <efleury@br.ibm.com>
22 .\" 2007-07-10, some polishing by mtk
23 .\" 2007-09-28, updates for newer kernels by Jeremy Kerr <jk@ozlabs.org>
25 .TH SPU_CREATE 2 2021-03-22 Linux "Linux Programmer's Manual"
27 spu_create \- create a new spu context
30 .BR "#include <sys/spu.h>" " /* Definition of " SPU_* " constants */"
31 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
32 .B #include <unistd.h>
34 .BI "int syscall(SYS_spu_create, const char *" pathname \
35 ", unsigned int " flags ,
36 .BI " mode_t " mode ", int " neighbor_fd );
40 glibc provides no wrapper for
42 necessitating the use of
47 system call is used on PowerPC machines that implement the
48 Cell Broadband Engine Architecture in order to access Synergistic
49 Processor Units (SPUs).
50 It creates a new logical context for an SPU in
52 and returns a file descriptor associated with it.
54 must refer to a nonexistent directory in the mount point of
59 is successful, a directory is created at
61 and it is populated with the files described in
64 When a context is created,
65 the returned file descriptor can only be passed to
71 family of system calls (e.g.,
74 other operations are not defined.
76 context is destroyed (along with all files created within the context's
78 directory) once the last reference to the context has gone;
79 this usually occurs when the file descriptor returned by
85 argument (minus any bits set in the process's
87 specifies the permissions used for creating the new directory in
91 for a full list of the possible
98 .B SPU_CREATE_AFFINITY_SPU
99 flag is specified; see below.
103 argument can be zero or any bitwise OR-ed
104 combination of the following constants:
106 .B SPU_CREATE_EVENTS_ENABLED
107 Rather than using signals for reporting DMA errors, use the
113 Create an SPU gang instead of a context.
114 (A gang is a group of SPU contexts that are
115 functionally related to each other and which share common scheduling
116 parameters\(empriority and policy.
117 In the future, gang scheduling may be implemented causing
118 the group to be switched in and out as a single unit.)
120 A new directory will be created at the location specified by the
123 This gang may be used to hold other SPU contexts, by providing
124 a pathname that is within the gang directory to further calls to
127 .B SPU_CREATE_NOSCHED
128 Create a context that is not affected by the SPU scheduler.
129 Once the context is run,
130 it will not be scheduled out until it is destroyed by
131 the creating process.
133 Because the context cannot be removed from the SPU, some functionality
135 .BR SPU_CREATE_NOSCHED
137 Only a subset of the files will be
138 available in this context directory in
141 .BR SPU_CREATE_NOSCHED
142 contexts cannot dump a core file when crashing.
145 .BR SPU_CREATE_NOSCHED
146 contexts requires the
150 .B SPU_CREATE_ISOLATE
151 Create an isolated SPU context.
152 Isolated contexts are protected from some
153 PPE (PowerPC Processing Element)
155 such as access to the SPU local store and the NPC register.
158 .B SPU_CREATE_ISOLATE
159 contexts also requires the
160 .B SPU_CREATE_NOSCHED
163 .BR SPU_CREATE_AFFINITY_SPU " (since Linux 2.6.23)"
164 .\" commit 8e68e2f248332a9c3fd4f08258f488c209bd3e0c
165 Create a context with affinity to another SPU context.
166 This affinity information is used within the SPU scheduling algorithm.
167 Using this flag requires that a file descriptor referring to
168 the other SPU context be passed in the
172 .BR SPU_CREATE_AFFINITY_MEM " (since Linux 2.6.23)"
173 .\" commit 8e68e2f248332a9c3fd4f08258f488c209bd3e0c
174 Create a context with affinity to system memory.
175 This affinity information
176 is used within the SPU scheduling algorithm.
180 returns a new file descriptor.
181 On failure, \-1 is returned, and
183 is set to indicate the error.
187 The current user does not have write access to the
192 An SPU context already exists at the given pathname.
196 is not a valid string pointer in the
197 calling process's address space.
201 is not a directory in the
203 mount point, or invalid flags have been provided.
206 Too many symbolic links were found while resolving
210 The per-process limit on the number of open file descriptors has been reached.
217 The system-wide limit on the total number of open files has been reached.
220 An isolated context was requested, but the hardware does not support
226 could not be resolved.
229 The kernel could not allocate all resources required.
232 There are not enough SPU resources available to create
233 a new context or the user-specific limit for the number
234 of SPU contexts has been reached.
237 The functionality is not provided by the current system, because
238 either the hardware does not provide SPUs or the spufs module is not
248 .B SPU_CREATE_NOSCHED
249 flag has been given, but the user does not have the
254 must point to a location beneath the mount point of
256 By convention, it gets mounted in
261 system call was added to Linux in kernel 2.6.16.
263 This call is Linux-specific and implemented only on the PowerPC
265 Programs using this system call are not portable.
268 is meant to be used from libraries that implement a more abstract
269 interface to SPUs, not to be used from regular applications.
271 .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/
273 for the recommended libraries.
275 Prior to the addition of the
276 .B SPU_CREATE_AFFINITY_SPU
277 flag in Linux 2.6.23, the
279 system call took only three arguments (i.e., there was no
285 for an example of the use of
290 .BR capabilities (7),