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 .B #include <sys/types.h>
31 .B #include <sys/spu.h>
33 .BI "int spu_create(const char *" pathname ", unsigned int " flags \
35 .BI " int " neighbor_fd ");"
39 There is no glibc wrapper for this system call; see NOTES.
43 system call is used on PowerPC machines that implement the
44 Cell Broadband Engine Architecture in order to access Synergistic
45 Processor Units (SPUs).
46 It creates a new logical context for an SPU in
48 and returns a file descriptor associated with it.
50 must refer to a nonexistent directory in the mount point of
55 is successful, a directory is created at
57 and it is populated with the files described in
60 When a context is created,
61 the returned file descriptor can only be passed to
67 family of system calls (e.g.,
70 other operations are not defined.
72 context is destroyed (along with all files created within the context's
74 directory) once the last reference to the context has gone;
75 this usually occurs when the file descriptor returned by
81 argument (minus any bits set in the process's
83 specifies the permissions used for creating the new directory in
87 for a full list of the possible
94 .B SPU_CREATE_AFFINITY_SPU
95 flag is specified; see below.
99 argument can be zero or any bitwise OR-ed
100 combination of the following constants:
102 .B SPU_CREATE_EVENTS_ENABLED
103 Rather than using signals for reporting DMA errors, use the
109 Create an SPU gang instead of a context.
110 (A gang is a group of SPU contexts that are
111 functionally related to each other and which share common scheduling
112 parameters\(empriority and policy.
113 In the future, gang scheduling may be implemented causing
114 the group to be switched in and out as a single unit.)
116 A new directory will be created at the location specified by the
119 This gang may be used to hold other SPU contexts, by providing
120 a pathname that is within the gang directory to further calls to
123 .B SPU_CREATE_NOSCHED
124 Create a context that is not affected by the SPU scheduler.
125 Once the context is run,
126 it will not be scheduled out until it is destroyed by
127 the creating process.
129 Because the context cannot be removed from the SPU, some functionality
131 .BR SPU_CREATE_NOSCHED
133 Only a subset of the files will be
134 available in this context directory in
137 .BR SPU_CREATE_NOSCHED
138 contexts cannot dump a core file when crashing.
141 .BR SPU_CREATE_NOSCHED
142 contexts requires the
146 .B SPU_CREATE_ISOLATE
147 Create an isolated SPU context.
148 Isolated contexts are protected from some
149 PPE (PowerPC Processing Element)
151 such as access to the SPU local store and the NPC register.
154 .B SPU_CREATE_ISOLATE
155 contexts also requires the
156 .B SPU_CREATE_NOSCHED
159 .BR SPU_CREATE_AFFINITY_SPU " (since Linux 2.6.23)"
160 .\" commit 8e68e2f248332a9c3fd4f08258f488c209bd3e0c
161 Create a context with affinity to another SPU context.
162 This affinity information is used within the SPU scheduling algorithm.
163 Using this flag requires that a file descriptor referring to
164 the other SPU context be passed in the
168 .BR SPU_CREATE_AFFINITY_MEM " (since Linux 2.6.23)"
169 .\" commit 8e68e2f248332a9c3fd4f08258f488c209bd3e0c
170 Create a context with affinity to system memory.
171 This affinity information
172 is used within the SPU scheduling algorithm.
176 returns a new file descriptor.
177 On failure, \-1 is returned, and
179 is set to indicate the error.
183 The current user does not have write access to the
188 An SPU context already exists at the given pathname.
192 is not a valid string pointer in the
193 calling process's address space.
197 is not a directory in the
199 mount point, or invalid flags have been provided.
202 Too many symbolic links were found while resolving
206 The per-process limit on the number of open file descriptors has been reached.
213 The system-wide limit on the total number of open files has been reached.
216 An isolated context was requested, but the hardware does not support
222 could not be resolved.
225 The kernel could not allocate all resources required.
228 There are not enough SPU resources available to create
229 a new context or the user-specific limit for the number
230 of SPU contexts has been reached.
233 The functionality is not provided by the current system, because
234 either the hardware does not provide SPUs or the spufs module is not
244 .B SPU_CREATE_NOSCHED
245 flag has been given, but the user does not have the
250 must point to a location beneath the mount point of
252 By convention, it gets mounted in
257 system call was added to Linux in kernel 2.6.16.
259 This call is Linux-specific and implemented only on the PowerPC
261 Programs using this system call are not portable.
263 Glibc does not provide a wrapper for this system call; call it using
267 is meant to be used from libraries that implement a more abstract
268 interface to SPUs, not to be used from regular applications.
270 .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/
272 for the recommended libraries.
274 Prior to the addition of the
275 .B SPU_CREATE_AFFINITY_SPU
276 flag in Linux 2.6.23, the
278 system call took only three arguments (i.e., there was no
284 for an example of the use of
289 .BR capabilities (7),