1SPU_CREATE(2) Linux Programmer's Manual SPU_CREATE(2)
2
3
4
6 spu_create - create a new spu context
7
8
10 #include <sys/types.h>
11 #include <sys/spu.h>
12
13 int spu_create(const char *pathname, int flags, mode_t mode);
14
16 The spu_create system call is used on PowerPC machines that implement
17 the Cell Broadband Engine Architecture in order to access Synergistic
18 Processor Units (SPUs). It creates a new logical context for an SPU in
19 pathname and returns a handle to associated with it. pathname must
20 point to a non-existing directory in the mount point of the SPU file
21 system (spufs). When spu_create is successful, a directory gets cre‐
22 ated on pathname and it is populated with files.
23
24 The returned file handle can only be passed to spu_run(2) or closed,
25 other operations are not defined on it. When it is closed, all associ‐
26 ated directory entries in spufs are removed. When the last file handle
27 pointing either inside of the context directory or to this file
28 descriptor is closed, the logical SPU context is destroyed.
29
30 The parameter flags can be zero or any bitwise or'd combination of the
31 following constants:
32
33 SPU_RAWIO
34 Allow mapping of some of the hardware registers of the SPU into
35 user space. This flag requires the CAP_SYS_RAWIO capability, see
36 capabilities(7).
37
38 The mode parameter specifies the permissions used for creating the new
39 directory in spufs. mode is modified with the user's umask(2) value
40 and then used for both the directory and the files contained in it. The
41 file permissions mask out some more bits of mode because they typically
42 support only read or write access. See stat[4m(2) for a full list of the
43 possible mode values.
44
45
47 spu_create returns a new file descriptor. It may return -1 to indicate
48 an error condition and set errno to one of the error codes listed
49 below.
50
51
53 EACCESS
54 The current user does not have write access on the spufs mount
55 point.
56
57 EEXIST An SPU context already exists at the given path name.
58
59 EFAULT pathname is not a valid string pointer in the current address
60 space.
61
62 EINVAL pathname is not a directory in the spufs mount point.
63
64 ELOOP Too many symlinks were found while resolving pathname.
65
66 EMFILE The process has reached its maximum open file limit.
67
68 ENAMETOOLONG
69 pathname was too long.
70
71 ENFILE The system has reached the global open file limit.
72
73 ENOENT Part of pathname could not be resolved.
74
75 ENOMEM The kernel could not allocate all resources required.
76
77 ENOSPC There are not enough SPU resources available to create a new
78 context or the user specific limit for the number of SPU con‐
79 texts has been reached.
80
81 ENOSYS the functionality is not provided by the current system, because
82 either the hardware does not provide SPUs or the spufs module is
83 not loaded.
84
85 ENOTDIR
86 A part of pathname is not a directory.
87
89 spu_create is meant to be used from libraries that implement a more
90 abstract interface to SPUs, not to be used from regular applications.
91 See http://www.bsc.es/projects/deepcomputing/linuxoncell/ for the rec‐
92 ommended libraries.
93
94
96 pathname must point to a location beneath the mount point of spufs. By
97 convention, it gets mounted in /spu.
98
99
101 This call is Linux specific and only implemented by the ppc64 architec‐
102 ture. Programs using this system call are not portable.
103
104
106 The code does not yet fully implement all features lined out here.
107
108
110 Arnd Bergmann <arndb@de.ibm.com>
111
113 capabilities(7), close(2), spu_run(2), spufs(7)
114
115
116
117Linux 2005-09-28 SPU_CREATE(2)