OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man7 / spufs.7
1 .\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :)
2 .\"
3 .\" Copyright (c) International Business Machines Corp., 2006
4 .\"
5 .\" This program is free software; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" This program is distributed in the hope that it will be useful,
11 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 .\" the GNU General Public License for more details.
14 .\"
15 .\" You should have received a copy of the GNU General Public License
16 .\" along with this program; if not, write to the Free Software
17 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 .\" MA 02111-1307 USA
19 .\"
20 .\" HISTORY:
21 .\" 2005-09-28, created by Arnd Bergmann <arndb@de.ibm.com>,
22 .\"   Mark Nutter <mnutter@us.ibm.com> and
23 .\"   Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
24 .\" 2006-06-16, revised by Eduardo M. Fleury <efleury@br.ibm.com>
25 .\" 2007-07-10, quite a lot of polishing by mtk
26 .\"
27 .\" Japanese Version Copyright (c) 2007  Akihiro MOTOKI
28 .\"         all rights reserved.
29 .\" Translated 2007-10-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
30 .\"
31 .TH SPUFS 7 2007-07-10 "Linux" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH 名前
34 .\"O spufs \- the SPU file system
35 spufs \- SPU ファイルシステム
36 .\"O .SH DESCRIPTION
37 .SH 説明
38 .\"O The SPU file system is used on PowerPC machines that implement the
39 .\"O Cell Broadband Engine Architecture in order to access Synergistic
40 .\"O Processor Units (SPUs).
41 SPU ファイルシステムは、Cell Broadband Engine アーキテクチャを実装した
42 PowerPC マシンにおいて、Synergistic Processor Unit (SPU) にアクセスする
43 ために使用される。
44
45 .\"O The file system provides a name space similar to POSIX shared
46 .\"O memory or message queues.
47 .\"O Users that have write permissions
48 .\"O on the file system can use
49 .\"O .BR spu_create (2)
50 .\"O to establish SPU contexts under the spufs root directory.
51 このファイルシステムでは、POSIX 共有メモリやメッセージキューに
52 似た名前空間が提供される。
53 ファイルシステムに書き込み許可を持つユーザは
54 .BR spu_create (2)
55 を使って spufs のルートディレクトリに SPU コンテキストを作成できる。
56
57 .\"O Every SPU context is represented by a directory containing
58 .\"O a predefined set of files.
59 .\"O These files can be
60 .\"O used for manipulating the state of the logical SPU.
61 .\"O Users can change permissions on those files, but can't
62 .\"O add or remove files.
63 各 SPU コンテキストは、あらかじめ定義されたファイル群を含む
64 ディレクトリとして表現される。
65 これらのファイルを使って、論理 SPU の状態を操作できる。
66 ユーザはこれらのファイルのアクセス許可を変更することはできるが、
67 ファイルの追加・削除を行うことはできない。
68 .\"O .SS Mount Options
69 .SS マウントオプション
70 .TP
71 .B uid=<uid>
72 .\"O set the user owning the mount point; the default is 0 (root).
73 マウントポイントを所有するユーザを設定する。
74 デフォルトは 0 (root) である。
75 .TP
76 .B gid=<gid>
77 .\"O set the group owning the mount point; the default is 0 (root).
78 マウントポイントを所有するグループを設定する。
79 デフォルトは 0 (root) である。
80 .\"O .SS Files
81 .SS ファイル
82 .\"O The files in
83 .\"O .I spufs
84 .\"O mostly follow the standard behavior for regular system calls like
85 .\"O .BR read (2)
86 .\"O or
87 .\"O .BR write (2),
88 .\"O but often support only a subset of the operations
89 .\"O supported on regular file systems.
90 .\"O This list details the supported
91 .\"O operations and the deviations from the standard behavior described
92 .\"O in the respective man pages.
93 .I spufs
94 のファイルは、ほとんどの場合
95 .BR read (2)
96
97 .BR write (2)
98 といった通常のシステムコールに対する標準的な振る舞いを示すが、
99 多くの場合通常のファイルシステムでサポートされている操作の一部分だけが
100 サポートされている。以下のリストでは、サポートされている操作と
101 それぞれのマニュアルページに書かれている標準的な振る舞いとの違いに
102 ついて説明する。
103
104 .\"O All files that support the
105 .\"O .BR read (2)
106 .\"O operation also support
107 .\"O .BR readv (2)
108 .\"O and all files that support the
109 .\"O .BR write (2)
110 .\"O operation also support
111 .\"O .BR writev (2).
112 .BR read (2)
113 操作に対応している全てのファイルは
114 .BR readv (2)
115 にも対応している。また、
116 .BR write (2)
117 操作に対応している全てのファイルは
118 .BR writev (2)
119 にも対応している。
120
121 .\"O All files support the
122 .\"O .BR access (2)
123 .\"O and
124 .\"O .BR stat (2)
125 .\"O family of operations, but for the latter call,
126 .\"O the only fields of the returned
127 .\"O .I stat
128 .\"O structure that contain reliable information are
129 .\"O .IR st_mode ,
130 .\"O .IR st_nlink ,
131 .\"O .IR st_uid ,
132 .\"O and
133 .\"O .IR st_gid .
134 全てのファイルは、
135 .BR access (2)
136
137 .BR stat (2)
138 系の操作に対応しているが、
139 .BR stat (2)
140 では、呼び出した際に返される
141 .I stat
142 構造体のフィールドのうち信頼できる情報が入っているのは
143 .IR st_mode ,
144 .IR st_nlink ,
145 .IR st_uid ,
146 .I st_gid
147 だけである。
148
149 .\"O All files support the
150 .\"O .BR chmod (2)/ fchmod (2)
151 .\"O and
152 .\"O .BR chown (2)/ fchown (2)
153 .\"O operations, but will not be able to grant permissions that contradict
154 .\"O the possible operations (e.g., read access on the
155 .\"O .I wbox
156 .\"O file).
157 全てのファイルは
158 .BR chmod (2)/ fchmod (2)
159
160 .BR chown (2)/ fchown (2)
161 の操作に対応しているが、
162 そのファイルが対応している操作と矛盾するアクセス許可を
163 付与することはできない (例えば、
164 .I wbox
165 ファイルに対する読み出しアクセスなど)。
166
167 .\"O The current set of files is:
168 現時点でのファイルは以下の通りである。
169 .TP
170 .B /mem
171 .\"O the contents of the local storage memory of the SPU.
172 .\"O This can be accessed like a regular shared memory
173 .\"O file and contains both code and data in the address
174 .\"O space of the SPU.
175 .\"O The possible operations on an open
176 .\"O .I mem
177 .\"O file are:
178 SPU のローカルストレージの内容。
179 このファイルは通常の共有メモリファイルと同様にアクセスでき、
180 SPU のアドレス空間にはコードとデータの両方を格納できる。
181 オープンされた
182 .I mem
183 ファイルに可能な操作は以下である。
184 .RS
185 .TP
186 .BR read "(2), " pread "(2), " write "(2), " pwrite "(2), " lseek (2)
187 .\"O These operate as usual, with the exception that
188 .\"O .BR lseek "(2), " write (2)
189 .\"O and
190 .\"O .BR pwrite (2)
191 .\"O are not supported beyond the end of the file.
192 .\"O The file size
193 .\"O is the size of the local storage of the SPU,
194 .\"O which is normally 256 kilobytes.
195 これらは通常通り動作するが、
196 ファイル末尾を越えての
197 .BR lseek (2),
198 .BR write (2),
199 .BR pwrite (2)
200 に対応していない点だけが異なる。
201 ファイルサイズは SPU のローカルストレージのサイズであり、
202 通常は 256 キロバイトである。
203 .TP
204 .BR mmap (2)
205 .\"O Mapping
206 .\"O .I mem
207 .\"O into the process address space provides access to the SPU local
208 .\"O storage within the process address space.
209 .\"O Only
210 .\"O .B MAP_SHARED
211 .\"O mappings are allowed.
212 .I mem
213 をプロセスのアドレス空間にマッピングすると、
214 プロセスのアドレス空間の一部として
215 SPU のローカル・ストレージにアクセスできるようになる。
216 .RE
217 .TP
218 .B /mbox
219 .\"O The first SPU-to-CPU communication mailbox.
220 .\"O This file
221 .\"O is read-only and can be read in units of 32 bits.
222 .\"O The file can only be used in non-blocking mode and not
223 .\"O even
224 .\"O .BR poll (2)
225 .\"O will block on it.
226 .\"O The only possible operation on an open
227 .\"O .I mbox
228 .\"O file is:
229 SPU から CPU への通信用の一つ目のメールボックス。
230 このファイルは読み出し専用で、読み出しは 32ビット単位で行う。
231 このファイルは非停止 (non-blocking) モードでのみ使用でき、
232 .BR poll (2)
233 であってもこのファイルで停止 (block) することはない。
234 オープンされた
235 .I mbox
236 ファイルに可能な操作は以下である。
237 .RS
238 .TP
239 .BR read (2)
240 .\"O If
241 .\"O .I count
242 .\"O is smaller than four,
243 .\"O .BR read (2)
244 .\"O returns \-1 and sets
245 .\"O .I errno
246 .\"O to
247 .\"O .BR EINVAL .
248 .\"O If there is no data available in the mailbox, the return
249 .\"O value is set to \-1 and
250 .\"O .I errno
251 .\"O is set to
252 .\"O .BR EAGAIN .
253 .\"O When data
254 .\"O has been read successfully, four bytes are placed in
255 .\"O the data buffer and the value four is returned.
256 .I count
257 が 4 より小さい場合、
258 .BR read (2)
259 は \-1 を返し、
260 .I errno
261
262 .B EINVAL
263 に設定する。
264 メールボックスにデータがない場合、\-1 が返り、
265 .I errno
266
267 .B EAGAIN
268 に設定される。データの読み出しに成功した場合、
269 4 バイトがデータバッファに格納され、返り値として 4 が返される。
270 .RE
271 .TP
272 .B /ibox
273 .\"O The second SPU-to-CPU communication mailbox.
274 .\"O This file is similar to the first mailbox file, but can be read
275 .\"O in blocking I/O mode, thus
276 .\"O .BR poll (2)
277 .\"O and similar system calls can be used to monitor this file.
278 .\"O The possible operations on an open
279 .\"O .I ibox
280 .\"O file are:
281 SPU から CPU への通信用の二つ目のメールボックスである。
282 このファイルは一つ目のメールボックスファイルと似ているが、
283 停止 (blocking) I/O モードでの読み出しが可能である。したがって、
284 .BR poll (2)
285 や同様のシステムコールを使って、このファイルを監視することができる。
286 オープンされた
287 .I ibox
288 ファイルに可能な操作は以下である。
289 .RS
290 .TP
291 .BR read (2)
292 .\"O If
293 .\"O .I count
294 .\"O is smaller than four,
295 .\"O .BR read (2)
296 .\"O returns \-1 and sets
297 .\"O .I errno
298 .\"O to
299 .\"O .BR EINVAL .
300 .\"O If there is no data available in the mailbox and the file
301 .\"O descriptor has been opened with
302 .\"O .BR O_NONBLOCK ,
303 .\"O the return value is set to \-1 and
304 .\"O .I errno
305 .\"O is set to
306 .\"O .BR EAGAIN .
307 .I count
308 が 4 より小さい場合、
309 .BR read (2)
310 は \-1 を返し、
311 .I errno
312
313 .B EINVAL
314 に設定する。
315 メールボックスにデータがない場合、ファイルディスクリプタが
316 .B O_NONBLOCK
317 でオープンされていれば、返り値は \-1 となり、
318 .I errno
319
320 .B EAGAIN
321 に設定される。
322
323 .\"O If there is no data available in the mailbox and the file
324 .\"O descriptor has been opened without
325 .\"O .BR O_NONBLOCK ,
326 .\"O the call will
327 .\"O block until the SPU writes to its interrupt mailbox channel.
328 .\"O When data has been read successfully, four bytes are placed in
329 .\"O the data buffer and the value four is returned.
330 メールボックスにデータがない場合で、ファイルディスクリプタが
331 .B O_NONBLOCK
332 なしでオープンされていれば、
333 SPU が自分の割り込みメールボックスチャネル (interrupt mailbox channel)
334 に書き込みを行うまで
335 .BR read (2)
336 は停止 (block) する。
337 データの読み出しに成功した場合、
338 4 バイトがデータバッファに格納され、返り値として 4 が返される。
339 .TP
340 .BR poll (2)
341 .\"O Poll on the
342 .\"O .I ibox
343 .\"O file returns
344 .\"O .I "(POLLIN | POLLRDNORM)"
345 .\"O whenever data is available for reading.
346 .I ibox
347 ファイルに対する
348 .BR poll (2)
349 は、読み出しデータが利用可能になる度に
350 .I "(POLLIN | POLLRDNORM)"
351 を返す。
352 .RE
353 .TP
354 .B /wbox
355 .\"O The CPU-to-SPU communication mailbox.
356 .\"O It is write-only and can be written in units of 32 bits.
357 .\"O If the mailbox is full,
358 .\"O .BR write (2)
359 .\"O will block and
360 .\"O .BR poll (2)
361 .\"O can be used to wait for it to become empty again.
362 .\"O The possible operations on an open
363 .\"O .I wbox
364 .\"O file are:
365 CPU から SPU への通信用のメールボックス。
366 このファイルは書き込み専用で、書き込みは 32ビット単位で行う。
367 メールボックスが一杯の場合、
368 .BR write (2)
369 は停止 (block) し、
370 .BR poll (2)
371 を使ってメールボックスに再度空きができるまで待つことができる。
372 オープンされた
373 .I wbox
374 ファイルに可能な操作は以下である。
375 .RS
376 .TP
377 .BR write (2)
378 .\"O If
379 .\"O .I count
380 .\"O is smaller than four,
381 .\"O .BR write (2)
382 .\"O returns \-1 and sets
383 .\"O .I errno
384 .\"O to
385 .\"O .BR EINVAL .
386 .\"O If there is no space available in the mailbox and the file
387 .\"O descriptor has been opened with
388 .\"O .BR O_NONBLOCK ,
389 .\"O the return
390 .\"O value is set to \-1 and
391 .\"O .I errno
392 .\"O is set to
393 .\"O .BR EAGAIN .
394 .I count
395 が 4 より小さい場合、
396 .BR write (2)
397 は \-1 を返し、
398 .I errno
399
400 .B EINVAL
401 に設定する。
402 メールボックスに空き領域がない場合、ファイルディスクリプタが
403 .B O_NONBLOCK
404 でオープンされていれば、返り値は \-1 となり、
405 .I errno
406
407 .B EAGAIN
408 に設定される。
409
410 .\"O If there is no space available in the mailbox and the file
411 .\"O descriptor has been opened without
412 .\"O .BR O_NONBLOCK ,
413 .\"O the call will
414 .\"O block until the SPU reads from its PPE mailbox channel.
415 .\"O When data has been written successfully,
416 .\"O the system call returns four as its function result.
417 メールボックスに空き領域がない場合で、ファイルディスクリプタが
418 .B O_NONBLOCK
419 なしでオープンされていれば、
420 SPU が自分の PPE メールボックスチャネルから読み出しを行うまで
421 .BR write (2)
422 は停止 (block) する。
423 データの書き込みに成功した場合、返り値として 4 が返される。
424 .TP
425 .BR poll (2)
426 .\"O A poll on the
427 .\"O .I wbox
428 .\"O file returns
429 .\"O .I "(POLLOUT | POLLWRNORM)"
430 .\"O whenever space is available for writing.
431 .I wbox
432 ファイルに対する
433 .BR poll (2)
434 は、書き込み用の空間が利用可能になる度に
435 .I "(POLLOUT | POLLWRNORM)"
436 を返す。
437 .RE
438 .TP
439 .BR /mbox_stat ", " /ibox_stat ", " /wbox_stat
440 .\"O These are read-only files that contain the length of the current
441 .\"O queue of each mailbox, i.e., how many words can be read from
442 .\"O .IR mbox " or " ibox
443 .\"O or how many words can be written to
444 .\"O .I wbox
445 .\"O without blocking.
446 .\"O The files can be read only in four-byte units and return
447 .\"O a big-endian binary integer number.
448 .\"O The possible operations on an open
449 .\"O .I *box_stat
450 .\"O file are:
451 これらのファイルは読み出し専用で、
452 各メールボックスの現在のキュー長を保持する。
453 具体的には、停止 (blocking) せずに、
454 .IR mbox " や " ibox
455 から何ワードを読み出すことができ、
456 .I wbox
457 に何ワードを書き込むことができるか、ということである。
458 これらのファイルは 4 バイト単位でのみ読み出しが可能で、
459 ビッグ・エンディアンの整数値を返す。
460 オープンされた
461 .I *box_stat
462 ファイルに可能な操作は以下である。
463 .RS
464 .TP
465 .BR read (2)
466 .\"O If
467 .\"O .I count
468 .\"O is smaller than four,
469 .\"O .BR read (2)
470 .\"O returns \-1 and sets
471 .\"O .I errno
472 .\"O to
473 .\"O .BR EINVAL .
474 .\"O Otherwise, a four-byte value is placed in the data buffer.
475 .\"O This value is the number of elements that can be read from (for
476 .\"O .I mbox_stat
477 .\"O and
478 .\"O .IR ibox_stat )
479 .\"O or written to (for
480 .\"O .IR wbox_stat )
481 .\"O the respective mailbox without blocking or getting an
482 .\"O .B EAGAIN
483 .\"O error.
484 .I count
485 が 4 より小さい場合、
486 .BR read (2)
487 は \-1 を返し、
488 .I errno
489
490 .B EINVAL
491 に設定する。
492 それ以外の場合、データバッファに 4 バイトの値が書き込まれる。
493 この値は、各メールボックスにおいて停止せずに、または
494 .B EAGAIN
495 エラーなしで、読み出し可能なエレメント数
496 .RI ( mbox_stat
497
498 .I ibox_stat
499 の場合)、書き込み可能なエレメント数
500 .RI ( wbox_stat
501 の場合) である。
502 .RE
503 .TP
504 .BR /npc ", " /decr ", " /decr_status ", " /spu_tag_mask ", " \
505 /event_mask ", " /srr0
506 .\"O These files expose internal registers of the SPU.
507 .\"O The values are represented
508 .\"O as ASCII strings containing the numeric value of each register.
509 .\"O These can be used in read/write mode for debugging, but normal
510 .\"O operation of programs should not rely on these files because
511 .\"O accesses to any of them except
512 .\"O .I npc
513 .\"O require an SPU context save, which is very inefficient.
514 これらのファイルは SPU の内部レジスタを公開するものである。
515 値は、各レジスタの数値を含むアスキー文字列で表現される。
516 これらのファイルはデバッグ用として読み出し/書き込みの両モードで利用できるが、
517 プログラムの通常の操作はこれらのファイルに依存すべきではない。
518 なぜなら、これらのファイルのうち
519 .I npc
520 以外へのアクセスでは SPU コンテキストの保存が必須であり、
521 SPU コンテキストの保存は非常に効率が悪いからである。
522 .IP
523 .\"O The contents of these files are:
524 これらのファイルの内容は以下の通り。
525 .RS
526 .TP 16
527 .I npc
528 .\"O Next Program Counter
529 次のプログラムカウンタ
530 .TP
531 .I decr
532 .\"O SPU Decrementer
533 SPU Decrementer
534 .TP
535 .I decr_status
536 .\"O Decrementer Status
537 Decrementer の状態
538 .TP
539 .I spu_tag_mask
540 .\"O MFC tag mask for SPU DMA
541 SPU の DMA 用の MFA タグマスク
542 .TP
543 .I event_mask
544 .\"O Event mask for SPU interrupts
545 SPU の割り込みのイベントマスク
546 .TP
547 .I srr0
548 .\"O Interrupt Return address register
549 割り込みリターンアドレスレジスタ
550 .RE
551 .IP
552 .\"O The possible operations on one of these files are:
553 これらのファイルに対して可能な操作は以下である。
554 .RS
555 .TP
556 .BR read (2)
557 .\"O When the
558 .\"O .I count
559 .\"O supplied to the
560 .\"O .BR read (2)
561 .\"O call is shorter than the required length for the register
562 .\"O value plus a newline character, subsequent reads from the same
563 .\"O file descriptor will complete the string, regardless
564 .\"O of changes to the register by a running SPU task.
565 .\"O When a complete string has been read, all subsequent read operations
566 .\"O will return zero bytes and a new file descriptor needs to be opened
567 .\"O to read a new value.
568 .BR read (2)
569 に渡された
570 .I count
571 がレジスタ値と改行 (newline) 文字 1 個を格納するのに必要な長さより短い場合、
572 同じファイルディスクリプタを続けて read することで、文字列全体を読み出すこと
573 ができる。この際、実行中の SPU タスクによりレジスタ値の変更の影響は受けない。
574 文字列全体が読み出されると、それ以降の read 操作では 0 バイトが返され、
575 新しい値を読み出すには新しいファイルディスクリプタをオープンする必要がある。
576 .TP
577 .BR write (2)
578 .\"O A
579 .\"O .BR write (2)
580 .\"O operation on the file sets the register to the
581 .\"O value given in the string.
582 .\"O The string is parsed from the beginning
583 .\"O until the first non-numeric character or the end of the buffer.
584 .\"O Subsequent writes to the same file descriptor overwrite the
585 .\"O previous setting.
586 このファイルへの
587 .BR write (2)
588 操作はレジスタ値を文字列で指定された値に設定する。
589 文字列の解釈は先頭から開始され、数字以外の文字が初めて登場するか、
590 バッファの末尾に達するまで行われる。
591 同じファイルディスクリプタへ続けて write を行うと、
592 後の write により前の設定が上書きされる。
593 .RE
594 .TP
595 .B /fpcr
596 .\"O This file provides access to the Floating Point Status and
597 .\"O Control Register as a four-byte file.
598 .\"O The operations on the
599 .\"O .I fpcr
600 .\"O file are:
601 このファイルにより Floating Point Status and Control Register に
602 アクセスできる。このファイルは大きさ 4 バイトである。
603 .I fpcr
604 ファイルに可能な操作は以下である。
605 .RS
606 .TP
607 .BR read (2)
608 .\"O If
609 .\"O .I count
610 .\"O is smaller than four,
611 .\"O .BR read (2)
612 .\"O returns \-1 and sets
613 .\"O .I errno
614 .\"O to
615 .\"O .BR EINVAL .
616 .\"O Otherwise, a four-byte value is placed in the data buffer;
617 .\"O this is the current value of the
618 .\"O .I fpcr
619 .\"O register.
620 .I count
621 が 4 より小さい場合、
622 .BR read (2)
623 は \-1 を返し、
624 .I errno
625
626 .B EINVAL
627 に設定する。
628 それ以外の場合、データバッファに 4 バイトの値が書き込まれる。
629 書き込まれる値は
630 .I fpcr
631 レジスタの現在の値である。
632 .TP
633 .BR write (2)
634 .\"O If
635 .\"O .I count
636 .\"O is smaller than four,
637 .\"O .BR write (2)
638 .\"O returns \-1 and sets
639 .\"O .I errno
640 .\"O to
641 .\"O .BR EINVAL .
642 .\"O Otherwise, a four-byte value is copied from the data buffer,
643 .\"O updating the value of the
644 .\"O .I fpcr
645 .\"O register.
646 .I count
647 が 4 より小さい場合、
648 .BR write (2)
649 は \-1 を返し、
650 .I errno
651
652 .B EINVAL
653 に設定する。
654 それ以外の場合、 4 バイトの値がデータバッファからコピーされ、
655 .I fpcr
656 レジスタの値が更新される。
657 .RE
658 .TP
659 .BR /signal1 ", " /signal2
660 .\"O The files provide access to the two signal notification channels
661 .\"O of an SPU.
662 .\"O These are read-write files that operate on 32-bit words.
663 .\"O Writing to one of these files triggers an interrupt on the SPU.
664 .\"O The value written to the signal files can
665 .\"O be read from the SPU through a channel read or from
666 .\"O host user space through the file.
667 .\"O After the value has been read by the SPU, it is reset to zero.
668 .\"O The possible operations on an open
669 .\"O .I signal1
670 .\"O or
671 .\"O .I signal2
672 .\"O file are:
673 これらのファイルにより
674 SPU の二つのシグナル通知チャネル (signal notification channel) に
675 アクセスできる。
676 これらは 32 ビット単位の読み書きができる。
677 これらのファイルの一つに書き込みを行うと、その SPU の割り込みが
678 発生するトリガーとなる。
679 シグナルファイルへ書き込まれた値は、チャネル経由で SPU で読み出したり、
680 このファイル経由でホストのユーザ空間で読み出したりできる。
681 SPU が値を読み出した後では、値は 0 にリセットされる。
682 オープンされた
683 .I signal1
684
685 .I signal2
686 ファイルに可能な操作は以下である。
687 .RS
688 .TP
689 .BR read (2)
690 .\"O If
691 .\"O .I count
692 .\"O is smaller than four,
693 .\"O .BR read (2)
694 .\"O returns \-1 and sets
695 .\"O .I errno
696 .\"O to
697 .\"O .BR EINVAL .
698 .\"O Otherwise, a four-byte value is placed in the data buffer;
699 .\"O this is the current value of the specified signal notification
700 .\"O register.
701 .I count
702 が 4 より小さい場合、
703 .BR read (2)
704 は \-1 を返し、
705 .I errno
706
707 .B EINVAL
708 に設定する。
709 それ以外の場合、データバッファに 4 バイトの値が書き込まれる。
710 書き込まれる値は、指定されたシグナル通知レジスタの現在の値である。
711 .TP
712 .BR write (2)
713 .\"O If
714 .\"O .I count
715 .\"O is smaller than four,
716 .\"O .BR write (2)
717 .\"O returns \-1 and sets
718 .\"O .I errno
719 .\"O to
720 .\"O .BR EINVAL .
721 .\"O Otherwise, a four-byte value is copied from the data buffer,
722 .\"O updating the value of the specified signal notification
723 .\"O register.
724 .I count
725 が 4 より小さい場合、
726 .BR write (2)
727 は \-1 を返し、
728 .I errno
729
730 .B EINVAL
731 に設定する。
732 それ以外の場合、 4 バイトの値がデータバッファからコピーされ、
733 指定されたシグナル通知レジスタの値が更新される。
734 .\"O The signal notification register will either be replaced with
735 .\"O the input data or will be updated to the bitwise OR operation
736 .\"O of the old value and the input data, depending on the contents
737 .\"O of the
738 .\"O .I signal1_type
739 .\"O or
740 .\"O .I signal2_type
741 .\"O files respectively.
742 シグナル通知レジスタの更新には、レジスタ値を入力データで置き換えるモードと
743 以前の値と入力データのビット単位の OR をとった値に更新するモードがある。
744 どちらのモードになるかは、それぞれ
745 .IR signal1_type ,
746 .I signal2_type
747 ファイルの内容によって決まる。
748 .RE
749 .TP
750 .BR /signal1_type ", " /signal2_type
751 .\"O These two files change the behavior of the
752 .\"O .I signal1
753 .\"O and
754 .\"O .I signal2
755 .\"O notification files.
756 これらのファイルは、シグナル通知ファイル
757 .I signal1
758
759 .I signal2
760 の動作を変更する。
761 .\"O They contain a numerical
762 .\"O ASCII string which is read as either "1" or "0".
763 .\"O In mode 0 (overwrite), the hardware replaces the contents
764 .\"O of the signal channel with the data that is written to it.
765 .\"O In mode 1 (logical OR), the hardware accumulates the bits
766 .\"O that are subsequently written to it.
767 これらのファイルは数値を表すアスキー文字列を保持し、
768 読み出すと "1" か "0" のどちらかが得られる。
769 モード 0 (上書きモード) では、ハードウェアはシグナルチャネルの内容を
770 シグナルチャネルに書き込まれたデータで置き換える。
771 モード 1 (論理 OR モード) では、ハードウェアはシグナルチャネルに
772 書き込まれたビットを積算していく。
773 .\"O The possible operations on an open
774 .\"O .I signal1_type
775 .\"O or
776 .\"O .I signal2_type
777 .\"O file are:
778 オープンされた
779 .I signal1_type
780
781 .I signal2_type
782 ファイルに可能な操作は以下である。
783 .RS
784 .TP
785 .BR read (2)
786 .\"O When the count supplied to the
787 .\"O .BR read (2)
788 .\"O call is shorter than the required length for the digit
789 .\"O plus a newline character, subsequent reads from the same
790 .\"O file descriptor will complete the string.
791 .\"O When a complete string has been read, all subsequent read operations
792 .\"O will return zero bytes and a new file descriptor needs to be opened
793 .\"O to read the value again.
794 .BR read (2)
795 に渡された
796 .I count
797 がレジスタの数値と改行 (newline) 文字 1 個を格納するのに必要な長さより
798 短い場合、同じファイルディスクリプタを続けて read することで、
799 文字列全体を読み出すことができる。
800 文字列全体が読み出されると、それ以降の read 操作では 0 バイトが返され、
801 新しい値を読み出すには新しいファイルディスクリプタをオープンする必要がある。
802 .TP
803 .BR write (2)
804 .\"O A
805 .\"O .BR write (2)
806 .\"O operation on the file sets the register to the
807 .\"O value given in the string.
808 .\"O The string is parsed from the beginning
809 .\"O until the first non-numeric character or the end of the buffer.
810 .\"O Subsequent writes to the same file descriptor overwrite the
811 .\"O previous setting.
812 このファイルへの
813 .BR write (2)
814 操作はレジスタ値を文字列で指定された値に設定する。
815 文字列の解釈は先頭から開始され、数字以外の文字が初めて登場するか、
816 バッファの末尾に達するまで行われる。
817 同じファイルディスクリプタへ続けて write を行うと、
818 後の write により前の設定が上書きされる。
819 .RE
820 .\"O .SH EXAMPLE
821 .SH 例
822 .TP
823 .IR /etc/fstab "  entry"
824 none    /spu    spufs   gid=spu         0       0
825 .\" .SH AUTHORS
826 .\" Arnd Bergmann <arndb@de.ibm.com>,
827 .\" Mark Nutter <mnutter@us.ibm.com> and
828 .\" Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
829 .\"O .SH SEE ALSO
830 .SH 関連項目
831 .BR close (2),
832 .BR spu_create (2),
833 .BR spu_run (2)