.\" Copyright (c) International Business Machines Corp., 2006 .\" .\" %%%LICENSE_START(GPLv2+_SW_3_PARA) .\" This program is free software; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See .\" the GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" HISTORY: .\" 2005-09-28, created by Arnd Bergmann .\" 2006-06-16, revised by Eduardo M. Fleury .\" 2007-07-10, some polishing by mtk .\" 2007-09-28, updates for newer kernels by Jeremy Kerr .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2007-10-23, Akihiro MOTOKI .\" Updated 2013-05-01, Akihiro MOTOKI .\" .TH SPU_CREATE 2 2012\-08\-05 Linux "Linux Programmer's Manual" .SH 名前 spu_create \- 新しい SPU コンテキストを生成する .SH 書式 .nf \fB#include \fP \fB#include \fP \fBint spu_create(const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB);\fP \fBint spu_create(const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB, mode_t \fP\fImode\fP\fB,\fP \fB int \fP\fIneighbor_fd\fP\fB);\fP .fi \fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBspu_create\fP() システムコールは、Cell Broadband Engine アーキテクチャ を実装した PowerPC マシンにおいて、Synergistic Processor Unit (SPU) に アクセスする ために使用される。 このシステムコールは、SPU に対する新し い論理コンテキストを \fIpathname\fP に生成し、そのコンテキストに関連付けら れたファイルディスクリプタを返す。 \fIpathname\fP は SPU ファイルシステム (\fBspufs\fP) のマウントポイント内の 存在しないディレクトリを指していなけ ればならない。 \fBspu_create\fP() が成功すると、 \fIpathname\fP にディレクト リが生成され、そのディレクトリに \fBspufs\fP(7) で説明されているファイル群 が配置される。 When a context is created, the returned file descriptor can only be passed to \fBspu_run\fP(2), used as the \fIdirfd\fP argument to the \fB*at\fP family of system calls (e.g., \fBopenat\fP(2)), or closed; other operations are not defined. A logical SPU context is destroyed (along with all files created within the context's \fIpathname\fP directory) once the last reference to the context has gone; this usually occurs when the file descriptor returned by \fBspu_create\fP() is closed. \fIflags\fP 引き数には 0 か以下の定数の組み合わせ (ビット単位の論理和) を指定できる。 .TP \fBSPU_CREATE_EVENTS_ENABLED\fP Rather than using signals for reporting DMA errors, use the \fIevent\fP argument to \fBspu_run\fP(2). .TP \fBSPU_CREATE_GANG\fP Create an SPU gang instead of a context. (A gang is a group of SPU contexts that are functionally related to each other and which share common scheduling parameters\(empriority and policy. In the future, gang scheduling may be implemented causing the group to be switched in and out as a single unit.) A new directory will be created at the location specified by the \fIpathname\fP argument. This gang may be used to hold other SPU contexts, by providing a pathname that is within the gang directory to further calls to \fBspu_create\fP(). .TP \fBSPU_CREATE_NOSCHED\fP Create a context that is not affected by the SPU scheduler. Once the context is run, it will not be scheduled out until it is destroyed by the creating process. Because the context cannot be removed from the SPU, some functionality is disabled for \fBSPU_CREATE_NOSCHED\fP contexts. Only a subset of the files will be available in this context directory in \fBspufs\fP. Additionally, \fBSPU_CREATE_NOSCHED\fP contexts cannot dump a core file when crashing. Creating \fBSPU_CREATE_NOSCHED\fP contexts requires the \fBCAP_SYS_NICE\fP capability. .TP \fBSPU_CREATE_ISOLATE\fP Create an isolated SPU context. Isolated contexts are protected from some PPE (PowerPC Processing Element) operations, such as access to the SPU local store and the NPC register. Creating \fBSPU_CREATE_ISOLATE\fP contexts also requires the \fBSPU_CREATE_NOSCHED\fP flag. .TP \fBSPU_CREATE_AFFINITY_SPU\fP Create a context with affinity to another SPU context. This affinity information is used within the SPU scheduling algorithm. Using this flag requires that a file descriptor referring to the other SPU context be passed in the \fIneighbor_fd\fP argument. .TP \fBSPU_CREATE_AFFINITY_MEM\fP Create a context with affinity to system memory. This affinity information is used within the SPU scheduling algorithm. .PP The \fImode\fP argument (minus any bits set in the process's \fBumask\fP(2)) specifies the permissions used for creating the new directory in \fBspufs\fP. See \fBstat\fP(2) for a full list of the possible \fImode\fP values. .SH 返り値 成功すると、 \fBspu_create\fP() は新しいファイルディスクリプタを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP に以下のリストに記載のエラーコードの いずれかを設定する。 .SH エラー .TP \fBEACCES\fP 現在のユーザが \fBspufs\fP(7) のマウントポイントへの書き込み許可を持って いない。 .TP \fBEEXIST\fP 指定されたパス名で SPU コンテキストがすでに生成されている。 .TP \fBEFAULT\fP \fIpathname\fP が呼び出し元のプロセスのアドレス空間で有効な文字列ポインタ ではない。 .TP \fBEINVAL\fP \fIpathname\fP が SPUFS マウントポインタ内のディレクトリではない。 または、無効なフラグが指定された。 .TP \fBELOOP\fP \fIpathname\fP を解決するまでに辿ったシンボリックリンクが多過ぎた。 .TP \fBEMFILE\fP そのプロセスがオープンできるファイル数の上限に達していた。 .TP \fBENAMETOOLONG\fP \fIpathname\fP が長過ぎる。 .TP \fBENFILE\fP システム全体でオープンできるファイル数の上限に達していた。 .TP \fBENODEV\fP An isolated context was requested, but the hardware does not support SPU isolation. .TP \fBENOENT\fP \fIpathname\fP の一部が解決できなかった。 .TP \fBENOMEM\fP カーネルが必要なリソースの全てを割り当てることができなかった。 .TP \fBENOSPC\fP 新しいコンテキストを生成するのに十分な SPU リソースがなかった、 または SPU コンテキスト数がそのユーザの特定の上限に達していた。 .TP \fBENOSYS\fP 機能が動作中のシステムで提供されていない。理由は、 ハードウェアで SPU が提供されていないか、 spufs モジュールがロードされていないか、のどちらかである。 .TP \fBENOTDIR\fP \fIpathname\fP の一部がディレクトリではない。 .TP \fBEPERM\fP The \fISPU_CREATE_NOSCHED\fP flag has been given, but the user does not have the \fBCAP_SYS_NICE\fP capability. .SH ファイル \fIpathname\fP は \fBspufs\fP のマウントポイントの配下の場所を指して いなければならない。 慣例では \fI/spu\fP にマウントされる。 .SH バージョン \fBspu_create\fP() システムコールはカーネル 2.6.16 で Linux に追加された。 .SH 準拠 このシステムコールは Linux 固有であり、 PowerPC アーキテクチャでのみ 実装されている。 このシステムコールを使ったプログラムは移植性がない。 .SH 注意 glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使うこと。ただし、 \fBspu_create\fP() は より抽象度の高い SPU へのインタフェースを実装するライブラリから 利用されることを意図したものであり、通常のアプリケーションから 使用は意図されていない。推奨のライブラリについては .UR http://www.bsc.es\:/projects\:/deepcomputing\:/linuxoncell/ .UE を参照のこと。 .SH 例 See \fBspu_run\fP(2) for an example of the use of \fBspu_create\fP() .SH 関連項目 \fBclose\fP(2), \fBspu_run\fP(2), \fBcapabilities\fP(7), \fBspufs\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.64 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。