OSDN Git Service

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