OSDN Git Service

455fe0859ba3cc34b3f77c0adc79fdb35a493e9d
[linuxjm/LDP_man-pages.git] / release / man2 / spu_create.2
1 .\" Copyright (c) International Business Machines Corp., 2006
2 .\"
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.
8 .\"
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.
13 .\"
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/>.
17 .\" %%%LICENSE_END
18 .\"
19 .\" HISTORY:
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>
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH SPU_CREATE 2 2012\-08\-05 Linux "Linux Programmer's Manual"
31 .SH 名前
32 spu_create \- 新しい SPU コンテキストを生成する
33 .SH 書式
34 .nf
35 \fB#include <sys/types.h>\fP
36 \fB#include <sys/spu.h>\fP
37
38 \fBint spu_create(const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB);\fP
39 \fBint spu_create(const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB,\fP
40 \fB               int \fP\fIneighbor_fd\fP\fB);\fP
41 .fi
42
43 \fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。
44 .SH 説明
45 \fBspu_create\fP() システムコールは、Cell Broadband Engine アーキテクチャ
46 を実装した PowerPC マシンにおいて、Synergistic Processor Unit (SPU) に
47 アクセスする ために使用される。 このシステムコールは、SPU に対する新し
48 い論理コンテキストを \fIpathname\fP に生成し、そのコンテキストに関連付けら
49 れたファイルディスクリプタを返す。 \fIpathname\fP は SPU ファイルシステム
50 (\fBspufs\fP) のマウントポイント内の 存在しないディレクトリを指していなけ
51 ればならない。 \fBspu_create\fP() が成功すると、 \fIpathname\fP にディレクト
52 リが生成され、そのディレクトリに \fBspufs\fP(7) で説明されているファイル群
53 が配置される。
54
55 When a context is created, the returned file descriptor can only be passed
56 to \fBspu_run\fP(2), used as the \fIdirfd\fP argument to the \fB*at\fP family of
57 system calls (e.g., \fBopenat\fP(2)), or closed; other operations are not
58 defined.  A logical SPU context is destroyed (along with all files created
59 within the context's \fIpathname\fP directory) once the last reference to the
60 context has gone; this usually occurs when the file descriptor returned by
61 \fBspu_create\fP()  is closed.
62
63 \fIflags\fP 引き数には 0 か以下の定数の組み合わせ (ビット単位の論理和)
64 を指定できる。
65 .TP 
66 \fBSPU_CREATE_EVENTS_ENABLED\fP
67 Rather than using signals for reporting DMA errors, use the \fIevent\fP
68 argument to \fBspu_run\fP(2).
69 .TP 
70 \fBSPU_CREATE_GANG\fP
71 Create an SPU gang instead of a context.  (A gang is a group of SPU contexts
72 that are functionally related to each other and which share common
73 scheduling parameters\(empriority and policy.  In the future, gang
74 scheduling may be implemented causing the group to be switched in and out as
75 a single unit.)
76
77 A new directory will be created at the location specified by the \fIpathname\fP
78 argument.  This gang may be used to hold other SPU contexts, by providing a
79 pathname that is within the gang directory to further calls to
80 \fBspu_create\fP().
81 .TP 
82 \fBSPU_CREATE_NOSCHED\fP
83 Create a context that is not affected by the SPU scheduler.  Once the
84 context is run, it will not be scheduled out until it is destroyed by the
85 creating process.
86
87 Because the context cannot be removed from the SPU, some functionality is
88 disabled for \fBSPU_CREATE_NOSCHED\fP contexts.  Only a subset of the files
89 will be available in this context directory in \fBspufs\fP.  Additionally,
90 \fBSPU_CREATE_NOSCHED\fP contexts cannot dump a core file when crashing.
91
92 Creating \fBSPU_CREATE_NOSCHED\fP contexts requires the \fBCAP_SYS_NICE\fP
93 capability.
94 .TP 
95 \fBSPU_CREATE_ISOLATE\fP
96 Create an isolated SPU context.  Isolated contexts are protected from some
97 PPE (PowerPC Processing Element)  operations, such as access to the SPU
98 local store and the NPC register.
99
100 Creating \fBSPU_CREATE_ISOLATE\fP contexts also requires the
101 \fBSPU_CREATE_NOSCHED\fP flag.
102 .TP 
103 \fBSPU_CREATE_AFFINITY_SPU\fP
104 Create a context with affinity to another SPU context.  This affinity
105 information is used within the SPU scheduling algorithm.  Using this flag
106 requires that a file descriptor referring to the other SPU context be passed
107 in the \fIneighbor_fd\fP argument.
108 .TP 
109 \fBSPU_CREATE_AFFINITY_MEM\fP
110 Create a context with affinity to system memory.  This affinity information
111 is used within the SPU scheduling algorithm.
112 .PP
113 The \fImode\fP argument (minus any bits set in the process's \fBumask\fP(2))
114 specifies the permissions used for creating the new directory in \fBspufs\fP.
115 See \fBstat\fP(2)  for a full list of the possible \fImode\fP values.
116 .SH 返り値
117 成功すると、 \fBspu_create\fP() は新しいファイルディスクリプタを返す。
118 エラーの場合、\-1 を返し、 \fIerrno\fP に以下のリストに記載のエラーコードの
119 いずれかを設定する。
120 .SH エラー
121 .TP 
122 \fBEACCES\fP
123 現在のユーザが \fBspufs\fP(7) のマウントポイントへの書き込み許可を持って
124 いない。
125 .TP 
126 \fBEEXIST\fP
127 指定されたパス名で SPU コンテキストがすでに生成されている。
128 .TP 
129 \fBEFAULT\fP
130 \fIpathname\fP が呼び出し元のプロセスのアドレス空間で有効な文字列ポインタ
131 ではない。
132 .TP 
133 \fBEINVAL\fP
134 \fIpathname\fP が SPUFS マウントポインタ内のディレクトリではない。
135 または、無効なフラグが指定された。
136 .TP 
137 \fBELOOP\fP
138 \fIpathname\fP を解決するまでに辿ったシンボリックリンクが多過ぎた。
139 .TP 
140 \fBEMFILE\fP
141 そのプロセスがオープンできるファイル数の上限に達していた。
142 .TP 
143 \fBENAMETOOLONG\fP
144 \fIpathname\fP が長過ぎる。
145 .TP 
146 \fBENFILE\fP
147 システム全体でオープンできるファイル数の上限に達していた。
148 .TP 
149 \fBENODEV\fP
150 An isolated context was requested, but the hardware does not support SPU
151 isolation.
152 .TP 
153 \fBENOENT\fP
154 \fIpathname\fP の一部が解決できなかった。
155 .TP 
156 \fBENOMEM\fP
157 カーネルが必要なリソースの全てを割り当てることができなかった。
158 .TP 
159 \fBENOSPC\fP
160 新しいコンテキストを生成するのに十分な SPU リソースがなかった、
161 または SPU コンテキスト数がそのユーザの特定の上限に達していた。
162 .TP 
163 \fBENOSYS\fP
164 機能が動作中のシステムで提供されていない。理由は、 ハードウェアで SPU が提供されていないか、 spufs
165 モジュールがロードされていないか、のどちらかである。
166 .TP 
167 \fBENOTDIR\fP
168 \fIpathname\fP の一部がディレクトリではない。
169 .TP 
170 \fBEPERM\fP
171 The \fISPU_CREATE_NOSCHED\fP flag has been given, but the user does not have
172 the \fBCAP_SYS_NICE\fP capability.
173 .SH ファイル
174 \fIpathname\fP は \fBspufs\fP のマウントポイントの配下の場所を指して
175 いなければならない。 慣例では \fI/spu\fP にマウントされる。
176 .SH バージョン
177 \fBspu_create\fP() システムコールはカーネル 2.6.16 で Linux に追加された。
178 .SH 準拠
179 このシステムコールは Linux 固有であり、 PowerPC アーキテクチャでのみ
180 実装されている。 このシステムコールを使ったプログラムは移植性がない。
181 .SH 注意
182 glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2)  を使うこと。ただし、
183 \fBspu_create\fP()  は より抽象度の高い SPU へのインタフェースを実装するライブラリから
184 利用されることを意図したものであり、通常のアプリケーションから 使用は意図されていない。推奨のライブラリについては
185 .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/
186 .UE
187 を参照のこと。
188 .SH 例
189 See \fBspu_run\fP(2)  for an example of the use of \fBspu_create\fP()
190 .SH 関連項目
191 \fBclose\fP(2), \fBspu_run\fP(2), \fBcapabilities\fP(7), \fBspufs\fP(7)
192 .SH この文書について
193 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
194 である。プロジェクトの説明とバグ報告に関する情報は
195 http://www.kernel.org/doc/man\-pages/ に書かれている。