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 2017-09-15 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 ", int " flags ", mode_t " mode ");"
34 .BI "int spu_create(const char *" pathname ", int " flags ", mode_t " mode ","
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 can be zero or any bitwise OR-ed
82 combination of the following constants:
84 .B SPU_CREATE_EVENTS_ENABLED
85 Rather than using signals for reporting DMA errors, use the
91 Create an SPU gang instead of a context.
92 (A gang is a group of SPU contexts that are
93 functionally related to each other and which share common scheduling
94 parameters\(empriority and policy.
95 In the future, gang scheduling may be implemented causing
96 the group to be switched in and out as a single unit.)
98 A new directory will be created at the location specified by the
101 This gang may be used to hold other SPU contexts, by providing
102 a pathname that is within the gang directory to further calls to
105 .B SPU_CREATE_NOSCHED
106 Create a context that is not affected by the SPU scheduler.
107 Once the context is run,
108 it will not be scheduled out until it is destroyed by
109 the creating process.
111 Because the context cannot be removed from the SPU, some functionality
113 .BR SPU_CREATE_NOSCHED
115 Only a subset of the files will be
116 available in this context directory in
119 .BR SPU_CREATE_NOSCHED
120 contexts cannot dump a core file when crashing.
123 .BR SPU_CREATE_NOSCHED
124 contexts requires the
128 .B SPU_CREATE_ISOLATE
129 Create an isolated SPU context.
130 Isolated contexts are protected from some
131 PPE (PowerPC Processing Element)
133 such as access to the SPU local store and the NPC register.
136 .B SPU_CREATE_ISOLATE
137 contexts also requires the
138 .B SPU_CREATE_NOSCHED
141 .B SPU_CREATE_AFFINITY_SPU
142 Create a context with affinity to another SPU context.
143 This affinity information is used within the SPU scheduling algorithm.
144 Using this flag requires that a file descriptor referring to
145 the other SPU context be passed in the
149 .B SPU_CREATE_AFFINITY_MEM
150 Create a context with affinity to system memory.
151 This affinity information
152 is used within the SPU scheduling algorithm.
156 argument (minus any bits set in the process's
158 specifies the permissions used for creating the new directory in
162 for a full list of the possible
168 returns a new file descriptor.
169 On error, \-1 is returned, and
171 is set to one of the error codes listed below.
175 The current user does not have write access to the
180 An SPU context already exists at the given pathname.
184 is not a valid string pointer in the
185 calling process's address space.
189 is not a directory in the
191 mount point, or invalid flags have been provided.
194 Too many symbolic links were found while resolving
198 The per-process limit on the number of open file descriptors has been reached.
205 The system-wide limit on the total number of open files has been reached.
208 An isolated context was requested, but the hardware does not support
214 could not be resolved.
217 The kernel could not allocate all resources required.
220 There are not enough SPU resources available to create
221 a new context or the user-specific limit for the number
222 of SPU contexts has been reached.
225 The functionality is not provided by the current system, because
226 either the hardware does not provide SPUs or the spufs module is not
236 .I SPU_CREATE_NOSCHED
237 flag has been given, but the user does not have the
242 must point to a location beneath the mount point of
244 By convention, it gets mounted in
249 system call was added to Linux in kernel 2.6.16.
251 This call is Linux-specific and implemented only on the PowerPC
253 Programs using this system call are not portable.
255 Glibc does not provide a wrapper for this system call; call it using
259 is meant to be used from libraries that implement a more abstract
260 interface to SPUs, not to be used from regular applications.
262 .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/
264 for the recommended libraries.
268 for an example of the use of
273 .BR capabilities (7),