1052 lines
25 KiB
HTML
1052 lines
25 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SPUFS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SPUFS</H1>
|
|
Section: Linux Programmer's Manual (7)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
spufs - SPU filesystem
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The SPU filesystem is used on PowerPC machines that implement the
|
|
Cell Broadband Engine Architecture in order to access Synergistic
|
|
Processor Units (SPUs).
|
|
<P>
|
|
|
|
The filesystem provides a name space similar to POSIX shared
|
|
memory or message queues.
|
|
Users that have write permissions
|
|
on the filesystem can use
|
|
<B><A HREF="/cgi-bin/man/man2html?2+spu_create">spu_create</A></B>(2)
|
|
|
|
to establish SPU contexts under the
|
|
<B>spufs</B>
|
|
|
|
root directory.
|
|
<P>
|
|
|
|
Every SPU context is represented by a directory containing
|
|
a predefined set of files.
|
|
These files can be
|
|
used for manipulating the state of the logical SPU.
|
|
Users can change permissions on the files, but can't
|
|
add or remove files.
|
|
<A NAME="lbAD"> </A>
|
|
<H3>Mount options</H3>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>uid=<uid></B>
|
|
|
|
<DD>
|
|
Set the user owning the mount point; the default is 0 (root).
|
|
<DT id="2"><B>gid=<gid></B>
|
|
|
|
<DD>
|
|
Set the group owning the mount point; the default is 0 (root).
|
|
<DT id="3"><B>mode=<mode></B>
|
|
|
|
<DD>
|
|
Set the mode of the top-level directory in
|
|
<B>spufs</B>,
|
|
|
|
as an octal mode string.
|
|
The default is 0775.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H3>Files</H3>
|
|
|
|
The files in
|
|
<B>spufs</B>
|
|
|
|
mostly follow the standard behavior for regular system calls like
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
or
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2),
|
|
|
|
but often support only a subset of the operations
|
|
supported on regular filesystems.
|
|
This list details the supported
|
|
operations and the deviations from the standard behavior described
|
|
in the respective man pages.
|
|
<P>
|
|
|
|
All files that support the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
operation also support
|
|
<B><A HREF="/cgi-bin/man/man2html?2+readv">readv</A></B>(2)
|
|
|
|
and all files that support the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
operation also support
|
|
<B><A HREF="/cgi-bin/man/man2html?2+writev">writev</A></B>(2).
|
|
|
|
All files support the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+access">access</A></B>(2)
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+stat">stat</A></B>(2)
|
|
|
|
family of operations, but for the latter call,
|
|
the only fields of the returned
|
|
<I>stat</I>
|
|
|
|
structure that contain reliable information are
|
|
<I>st_mode</I>,
|
|
|
|
<I>st_nlink</I>,
|
|
|
|
<I>st_uid</I>,
|
|
|
|
and
|
|
<I>st_gid</I>.
|
|
|
|
<P>
|
|
|
|
All files support the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+chmod">chmod</A></B>(2)/<B><A HREF="/cgi-bin/man/man2html?2+fchmod">fchmod</A></B>(2)
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+chown">chown</A></B>(2)/<B><A HREF="/cgi-bin/man/man2html?2+fchown">fchown</A></B>(2)
|
|
|
|
operations, but will not be able to grant permissions that contradict
|
|
the possible operations (e.g., read access on the
|
|
<I>wbox</I>
|
|
|
|
file).
|
|
<P>
|
|
|
|
The current set of files is:
|
|
<DL COMPACT>
|
|
<DT id="4"><I>/capabilities</I>
|
|
|
|
<DD>
|
|
Contains a comma-delimited string representing the capabilities of this
|
|
SPU context.
|
|
Possible capabilities are:
|
|
<DL COMPACT><DT id="5"><DD>
|
|
<DL COMPACT>
|
|
<DT id="6"><B>sched</B>
|
|
|
|
<DD>
|
|
This context may be scheduled.
|
|
<DT id="7"><B>step</B>
|
|
|
|
<DD>
|
|
This context can be run in single-step mode, for debugging.
|
|
</DL>
|
|
<P>
|
|
|
|
New capabilities flags may be added in the future.
|
|
</DL>
|
|
|
|
<DT id="8"><I>/mem</I>
|
|
|
|
<DD>
|
|
the contents of the local storage memory of the SPU.
|
|
This can be accessed like a regular shared memory
|
|
file and contains both code and data in the address
|
|
space of the SPU.
|
|
The possible operations on an open
|
|
<I>mem</I>
|
|
|
|
file are:
|
|
<DL COMPACT><DT id="9"><DD>
|
|
<DL COMPACT>
|
|
<DT id="10"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2), <B><A HREF="/cgi-bin/man/man2html?2+pread">pread</A></B>(2), <B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2), <B><A HREF="/cgi-bin/man/man2html?2+pwrite">pwrite</A></B>(2), <B><A HREF="/cgi-bin/man/man2html?2+lseek">lseek</A></B>(2)
|
|
|
|
<DD>
|
|
These operate as usual, with the exception that
|
|
<B><A HREF="/cgi-bin/man/man2html?2+lseek">lseek</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2),
|
|
|
|
and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+pwrite">pwrite</A></B>(2)
|
|
|
|
are not supported beyond the end of the file.
|
|
The file size
|
|
is the size of the local storage of the SPU,
|
|
which is normally 256 kilobytes.
|
|
<DT id="11"><B><A HREF="/cgi-bin/man/man2html?2+mmap">mmap</A></B>(2)
|
|
|
|
<DD>
|
|
Mapping
|
|
<I>mem</I>
|
|
|
|
into the process address space provides access to the SPU local
|
|
storage within the process address space.
|
|
Only
|
|
<B>MAP_SHARED</B>
|
|
|
|
mappings are allowed.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="12"><I>/regs</I>
|
|
|
|
<DD>
|
|
Contains the saved general-purpose registers of the SPU context.
|
|
This file contains the 128-bit values of each register,
|
|
from register 0 to register 127, in order.
|
|
This allows the general-purpose registers to be
|
|
inspected for debugging.
|
|
<DT id="13"><DD>
|
|
Reading to or writing from this file requires that the context is
|
|
scheduled out, so use of this file is not recommended in normal
|
|
program operation.
|
|
<DT id="14"><DD>
|
|
The
|
|
<I>regs</I>
|
|
|
|
file is not present on contexts that have been created with the
|
|
<B>SPU_CREATE_NOSCHED</B>
|
|
|
|
flag.
|
|
<DT id="15"><I>/mbox</I>
|
|
|
|
<DD>
|
|
The first SPU-to-CPU communication mailbox.
|
|
This file is read-only and can be read in units of 4 bytes.
|
|
The file can be used only in nonblocking mode - even
|
|
<B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
cannot be used to block on this file.
|
|
The only possible operation on an open
|
|
<I>mbox</I>
|
|
|
|
file is:
|
|
<DL COMPACT><DT id="16"><DD>
|
|
<DL COMPACT>
|
|
<DT id="17"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
If there is no data available in the mailbox (i.e., the SPU has not
|
|
sent a mailbox message), the return value is set to -1 and
|
|
<I>errno</I>
|
|
|
|
is set to
|
|
<B>EAGAIN</B>.
|
|
|
|
When data
|
|
has been read successfully, four bytes are placed in
|
|
the data buffer and the value four is returned.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="18"><I>/ibox</I>
|
|
|
|
<DD>
|
|
The second SPU-to-CPU communication mailbox.
|
|
This file is similar to the first mailbox file, but can be read
|
|
in blocking I/O mode, thus calling
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
on an open
|
|
<I>ibox</I>
|
|
|
|
file will block until the SPU has written data to its interrupt mailbox
|
|
channel (unless the file has been opened with
|
|
<B>O_NONBLOCK</B>,
|
|
|
|
see below).
|
|
Also,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
and similar system calls can be used to monitor for the presence
|
|
of mailbox data.
|
|
<DT id="19"><DD>
|
|
The possible operations on an open
|
|
<I>ibox</I>
|
|
|
|
file are:
|
|
<DL COMPACT><DT id="20"><DD>
|
|
<DL COMPACT>
|
|
<DT id="21"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
If there is no data available in the mailbox and the file
|
|
descriptor has been opened with
|
|
<B>O_NONBLOCK</B>,
|
|
|
|
the return value is set to -1 and
|
|
<I>errno</I>
|
|
|
|
is set to
|
|
<B>EAGAIN</B>.
|
|
|
|
<DT id="22"><DD>
|
|
If there is no data available in the mailbox and the file
|
|
descriptor has been opened without
|
|
<B>O_NONBLOCK</B>,
|
|
|
|
the call will
|
|
block until the SPU writes to its interrupt mailbox channel.
|
|
When data has been read successfully, four bytes are placed in
|
|
the data buffer and the value four is returned.
|
|
<DT id="23"><B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
<DD>
|
|
Poll on the
|
|
<I>ibox</I>
|
|
|
|
file returns
|
|
<I>(POLLIN | POLLRDNORM)</I>
|
|
|
|
whenever data is available for reading.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="24"><I>/wbox</I>
|
|
|
|
<DD>
|
|
The CPU-to-SPU communication mailbox.
|
|
It is write-only and can be written in units of four bytes.
|
|
If the mailbox is full,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
will block, and
|
|
<B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
can be used to block until the mailbox is available for writing again.
|
|
The possible operations on an open
|
|
<I>wbox</I>
|
|
|
|
file are:
|
|
<DL COMPACT><DT id="25"><DD>
|
|
<DL COMPACT>
|
|
<DT id="26"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
If there is no space available in the mailbox and the file
|
|
descriptor has been opened with
|
|
<B>O_NONBLOCK</B>,
|
|
|
|
the return
|
|
value is set to -1 and
|
|
<I>errno</I>
|
|
|
|
is set to
|
|
<B>EAGAIN</B>.
|
|
|
|
<DT id="27"><DD>
|
|
If there is no space available in the mailbox and the file
|
|
descriptor has been opened without
|
|
<B>O_NONBLOCK</B>,
|
|
|
|
the call will block until the SPU reads from its
|
|
PPE (PowerPC Processing Element)
|
|
mailbox channel.
|
|
When data has been written successfully,
|
|
the system call returns four as its function result.
|
|
<DT id="28"><B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
<DD>
|
|
A poll on the
|
|
<I>wbox</I>
|
|
|
|
file returns
|
|
<I>(POLLOUT | POLLWRNORM)</I>
|
|
|
|
whenever space is available for writing.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="29"><I>/mbox_stat</I>, <I>/ibox_stat</I>, <I>/wbox_stat</I>
|
|
|
|
<DD>
|
|
These are read-only files that contain the length of the current
|
|
queue of each mailbox---that is, how many words can be read from
|
|
<I>mbox</I> or <I>ibox</I>
|
|
|
|
or how many words can be written to
|
|
<I>wbox</I>
|
|
|
|
without blocking.
|
|
The files can be read only in four-byte units and return
|
|
a big-endian binary integer number.
|
|
The only possible operation on an open
|
|
<I>*box_stat</I>
|
|
|
|
file is:
|
|
<DL COMPACT><DT id="30"><DD>
|
|
<DL COMPACT>
|
|
<DT id="31"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
Otherwise, a four-byte value is placed in the data buffer.
|
|
This value is the number of elements that can be read from (for
|
|
<I>mbox_stat</I>
|
|
|
|
and
|
|
<I>ibox_stat</I>)
|
|
|
|
or written to (for
|
|
<I>wbox_stat</I>)
|
|
|
|
the respective mailbox without blocking or returning an
|
|
<B>EAGAIN</B>
|
|
|
|
error.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="32"><I>/npc</I>, <I>/decr</I>, <I>/decr_status</I>, <I>/spu_tag_mask</I>, <I>/event_mask</I>, <I>/event_status</I>, <I>/srr0</I>, <I>/lslr</I>
|
|
|
|
<DD>
|
|
Internal registers of the SPU.
|
|
These files contain an ASCII string
|
|
representing the hex value of the specified register.
|
|
Reads and writes on these
|
|
files (except for
|
|
<I>npc</I>,
|
|
|
|
see below) require that the SPU context be scheduled out,
|
|
so frequent access to
|
|
these files is not recommended for normal program operation.
|
|
<DT id="33"><DD>
|
|
The contents of these files are:
|
|
<DL COMPACT><DT id="34"><DD>
|
|
<DL COMPACT>
|
|
<DT id="35"><I>npc</I>
|
|
|
|
<DD>
|
|
Next Program Counter - valid only when the SPU is in a stopped state.
|
|
<DT id="36"><I>decr</I>
|
|
|
|
<DD>
|
|
SPU Decrementer
|
|
<DT id="37"><I>decr_status</I>
|
|
|
|
<DD>
|
|
Decrementer Status
|
|
<DT id="38"><I>spu_tag_mask</I>
|
|
|
|
<DD>
|
|
MFC tag mask for SPU DMA
|
|
<DT id="39"><I>event_mask</I>
|
|
|
|
<DD>
|
|
Event mask for SPU interrupts
|
|
<DT id="40"><I>event_status</I>
|
|
|
|
<DD>
|
|
Number of SPU events pending (read-only)
|
|
<DT id="41"><I>srr0</I>
|
|
|
|
<DD>
|
|
Interrupt Return address register
|
|
<DT id="42"><I>lslr</I>
|
|
|
|
<DD>
|
|
Local Store Limit Register
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="43"><DD>
|
|
The possible operations on these files are:
|
|
<DL COMPACT><DT id="44"><DD>
|
|
<DL COMPACT>
|
|
<DT id="45"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
Reads the current register value.
|
|
If the register value is larger than the buffer passed to the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
system call, subsequent reads will continue reading from the same
|
|
buffer, until the end of the buffer is reached.
|
|
<DT id="46"><DD>
|
|
When a complete string has been read, all subsequent read operations
|
|
will return zero bytes and a new file descriptor needs to be opened
|
|
to read a new value.
|
|
<DT id="47"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
A
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
operation on the file sets the register to the
|
|
value given in the string.
|
|
The string is parsed from the beginning
|
|
until the first nonnumeric character or the end of the buffer.
|
|
Subsequent writes to the same file descriptor overwrite the
|
|
previous setting.
|
|
<DT id="48"><DD>
|
|
Except for the
|
|
<I>npc</I>
|
|
|
|
file, these files are not present on contexts that have been created with
|
|
the
|
|
<B>SPU_CREATE_NOSCHED</B>
|
|
|
|
flag.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="49"><I>/fpcr</I>
|
|
|
|
<DD>
|
|
This file provides access to the Floating Point Status and
|
|
Control Register (fcpr) as a binary, four-byte file.
|
|
The operations on the
|
|
<I>fpcr</I>
|
|
|
|
file are:
|
|
<DL COMPACT><DT id="50"><DD>
|
|
<DL COMPACT>
|
|
<DT id="51"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
Otherwise, a four-byte value is placed in the data buffer;
|
|
this is the current value of the
|
|
<I>fpcr</I>
|
|
|
|
register.
|
|
<DT id="52"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
Otherwise, a four-byte value is copied from the data buffer,
|
|
updating the value of the
|
|
<I>fpcr</I>
|
|
|
|
register.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="53"><I>/signal1</I>, <I>/signal2</I>
|
|
|
|
<DD>
|
|
The files provide access to the two signal notification channels
|
|
of an SPU.
|
|
These are read-write files that operate on four-byte words.
|
|
Writing to one of these files triggers an interrupt on the SPU.
|
|
The value written to the signal files can
|
|
be read from the SPU through a channel read or from
|
|
host user space through the file.
|
|
After the value has been read by the SPU, it is reset to zero.
|
|
The possible operations on an open
|
|
<I>signal1</I>
|
|
|
|
or
|
|
<I>signal2</I>
|
|
|
|
file are:
|
|
<DL COMPACT><DT id="54"><DD>
|
|
<DL COMPACT>
|
|
<DT id="55"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
Otherwise, a four-byte value is placed in the data buffer;
|
|
this is the current value of the specified signal notification
|
|
register.
|
|
<DT id="56"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
If
|
|
<I>count</I>
|
|
|
|
is smaller than four,
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
returns -1 and sets
|
|
<I>errno</I>
|
|
|
|
to
|
|
<B>EINVAL</B>.
|
|
|
|
Otherwise, a four-byte value is copied from the data buffer,
|
|
updating the value of the specified signal notification
|
|
register.
|
|
The signal notification register will either be replaced with
|
|
the input data or will be updated to the bitwise OR operation
|
|
of the old value and the input data, depending on the contents
|
|
of the
|
|
<I>signal1_type</I>
|
|
|
|
or
|
|
<I>signal2_type</I>
|
|
|
|
files respectively.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="57"><I>/signal1_type</I>, <I>/signal2_type</I>
|
|
|
|
<DD>
|
|
These two files change the behavior of the
|
|
<I>signal1</I>
|
|
|
|
and
|
|
<I>signal2</I>
|
|
|
|
notification files.
|
|
They contain a numeric ASCII string which is read
|
|
as either "1" or "0".
|
|
In mode 0 (overwrite), the hardware replaces the contents
|
|
of the signal channel with the data that is written to it.
|
|
In mode 1 (logical OR), the hardware accumulates the bits
|
|
that are subsequently written to it.
|
|
The possible operations on an open
|
|
<I>signal1_type</I>
|
|
|
|
or
|
|
<I>signal2_type</I>
|
|
|
|
file are:
|
|
<DL COMPACT><DT id="58"><DD>
|
|
<DL COMPACT>
|
|
<DT id="59"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
When the count supplied to the
|
|
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
call is shorter than the required length for the digit (plus a newline
|
|
character), subsequent reads from the same file descriptor will
|
|
complete the string.
|
|
When a complete string has been read, all subsequent read operations
|
|
will return zero bytes and a new file descriptor needs to be opened
|
|
to read the value again.
|
|
<DT id="60"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
A
|
|
<B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
operation on the file sets the register to the
|
|
value given in the string.
|
|
The string is parsed from the beginning
|
|
until the first nonnumeric character or the end of the buffer.
|
|
Subsequent writes to the same file descriptor overwrite the
|
|
previous setting.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="61"><I>/mbox_info</I>, <I>/ibox_info</I>, <I>/wbox_info</I>, <I>/dma_into</I>, <I>/proxydma_info</I>
|
|
|
|
<DD>
|
|
Read-only files that contain the saved state of the SPU mailboxes and
|
|
DMA queues.
|
|
This allows the SPU status to be inspected, mainly for debugging.
|
|
The
|
|
<I>mbox_info</I>
|
|
|
|
and
|
|
<I>ibox_info</I>
|
|
|
|
files each contain the four-byte mailbox message that has been written
|
|
by the SPU.
|
|
If no message has been written to these mailboxes, then
|
|
contents of these files is undefined.
|
|
The
|
|
<I>mbox_stat</I>,
|
|
|
|
<I>ibox_stat</I>
|
|
|
|
and
|
|
<I>wbox_stat</I>
|
|
|
|
files contain the available message count.
|
|
<DT id="62"><DD>
|
|
The
|
|
<I>wbox_info</I>
|
|
|
|
file contains an array of four-byte mailbox messages, which have been
|
|
sent to the SPU.
|
|
With current CBEA machines, the array is four items in
|
|
length, so up to 4 * 4 = 16 bytes can be read from this file.
|
|
If any mailbox queue entry is empty,
|
|
then the bytes read at the corresponding location are undefined.
|
|
<DT id="63"><DD>
|
|
The
|
|
<I>dma_info</I>
|
|
|
|
file contains the contents of the SPU MFC DMA queue, represented as the
|
|
following structure:
|
|
<DT id="64"><DD>
|
|
|
|
|
|
struct spu_dma_info {
|
|
<BR> uint64_t dma_info_type;
|
|
<BR> uint64_t dma_info_mask;
|
|
<BR> uint64_t dma_info_status;
|
|
<BR> uint64_t dma_info_stall_and_notify;
|
|
<BR> uint64_t dma_info_atomic_command_status;
|
|
<BR> struct mfc_cq_sr dma_info_command_data[16];
|
|
};
|
|
|
|
|
|
<DT id="65"><DD>
|
|
The last member of this data structure is the actual DMA queue,
|
|
containing 16 entries.
|
|
The
|
|
<I>mfc_cq_sr</I>
|
|
|
|
structure is defined as:
|
|
<DT id="66"><DD>
|
|
|
|
|
|
struct mfc_cq_sr {
|
|
<BR> uint64_t mfc_cq_data0_RW;
|
|
<BR> uint64_t mfc_cq_data1_RW;
|
|
<BR> uint64_t mfc_cq_data2_RW;
|
|
<BR> uint64_t mfc_cq_data3_RW;
|
|
};
|
|
|
|
|
|
<DT id="67"><DD>
|
|
The
|
|
<I>proxydma_info</I>
|
|
|
|
file contains similar information, but describes the proxy DMA queue
|
|
(i.e., DMAs initiated by entities outside the SPU) instead.
|
|
The file is in the following format:
|
|
<DT id="68"><DD>
|
|
|
|
|
|
struct spu_proxydma_info {
|
|
<BR> uint64_t proxydma_info_type;
|
|
<BR> uint64_t proxydma_info_mask;
|
|
<BR> uint64_t proxydma_info_status;
|
|
<BR> struct mfc_cq_sr proxydma_info_command_data[8];
|
|
};
|
|
|
|
|
|
<DT id="69"><DD>
|
|
Accessing these files requires that the SPU context is scheduled out -
|
|
frequent use can be inefficient.
|
|
These files should not be used for normal program operation.
|
|
<DT id="70"><DD>
|
|
These files are not present on contexts that have been created with the
|
|
<B>SPU_CREATE_NOSCHED</B>
|
|
|
|
flag.
|
|
<DT id="71"><I>/cntl</I>
|
|
|
|
<DD>
|
|
This file provides access to the SPU Run Control and SPU status
|
|
registers, as an ASCII string.
|
|
The following operations are supported:
|
|
<DL COMPACT><DT id="72"><DD>
|
|
<DL COMPACT>
|
|
<DT id="73"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
Reads from the
|
|
<I>cntl</I>
|
|
|
|
file will return an ASCII string with the hex
|
|
value of the SPU Status register.
|
|
<DT id="74"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
Writes to the
|
|
<I>cntl</I>
|
|
|
|
file will set the context's SPU Run Control register.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="75"><I>/mfc</I>
|
|
|
|
<DD>
|
|
Provides access to the Memory Flow Controller of the SPU.
|
|
Reading from the file returns the contents of the
|
|
SPU's MFC Tag Status register, and
|
|
writing to the file initiates a DMA from the MFC.
|
|
The following operations are supported:
|
|
<DL COMPACT><DT id="76"><DD>
|
|
<DL COMPACT>
|
|
<DT id="77"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
Writes to this file need to be in the format of a MFC DMA command,
|
|
defined as follows:
|
|
<DT id="78"><DD>
|
|
|
|
|
|
struct mfc_dma_command {
|
|
<BR> int32_t pad; /* reserved */
|
|
<BR> uint32_t lsa; /* local storage address */
|
|
<BR> uint64_t ea; /* effective address */
|
|
<BR> uint16_t size; /* transfer size */
|
|
<BR> uint16_t tag; /* command tag */
|
|
<BR> uint16_t class; /* class ID */
|
|
<BR> uint16_t cmd; /* command opcode */
|
|
};
|
|
|
|
|
|
<DT id="79"><DD>
|
|
Writes are required to be exactly
|
|
<I>sizeof(struct mfc_dma_command)</I>
|
|
|
|
bytes in size.
|
|
The command will be sent to the SPU's MFC proxy queue, and the
|
|
tag stored in the kernel (see below).
|
|
<DT id="80"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
Reads the contents of the tag status register.
|
|
If the file is opened in blocking mode (i.e., without
|
|
<B>O_NONBLOCK</B>),
|
|
|
|
then the read will block until a
|
|
DMA tag (as performed by a previous write) is complete.
|
|
In nonblocking mode,
|
|
the MFC tag status register will be returned without waiting.
|
|
<DT id="81"><B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
<DD>
|
|
Calling
|
|
<B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2)
|
|
|
|
on the
|
|
<I>mfc</I>
|
|
|
|
file will block until a new DMA can be
|
|
started (by checking for
|
|
<B>POLLOUT</B>)
|
|
|
|
or until a previously started DMA
|
|
(by checking for
|
|
<B>POLLIN</B>)
|
|
|
|
has been completed.
|
|
<DT id="82"><DD>
|
|
<I>/mss</I>
|
|
|
|
Provides access to the MFC MultiSource Synchronization (MSS) facility.
|
|
By
|
|
<B><A HREF="/cgi-bin/man/man2html?2+mmap">mmap</A></B>(2)-ing
|
|
|
|
this file, processes can access the MSS area of the SPU.
|
|
<DT id="83"><DD>
|
|
The following operations are supported:
|
|
<DT id="84"><B><A HREF="/cgi-bin/man/man2html?2+mmap">mmap</A></B>(2)
|
|
|
|
<DD>
|
|
Mapping
|
|
<B>mss</B>
|
|
|
|
into the process address space gives access to the SPU MSS area
|
|
within the process address space.
|
|
Only
|
|
<B>MAP_SHARED</B>
|
|
|
|
mappings are allowed.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="85"><I>/psmap</I>
|
|
|
|
<DD>
|
|
Provides access to the whole problem-state mapping of the SPU.
|
|
Applications can use this area to interface to the SPU, rather than
|
|
writing to individual register files in
|
|
<B>spufs</B>.
|
|
|
|
<DT id="86"><DD>
|
|
The following operations are supported:
|
|
<DL COMPACT><DT id="87"><DD>
|
|
<DL COMPACT>
|
|
<DT id="88"><B><A HREF="/cgi-bin/man/man2html?2+mmap">mmap</A></B>(2)
|
|
|
|
<DD>
|
|
Mapping
|
|
<B>psmap</B>
|
|
|
|
gives a process a direct map of the SPU problem state area.
|
|
Only
|
|
<B>MAP_SHARED</B>
|
|
|
|
mappings are supported.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="89"><I>/phys-id</I>
|
|
|
|
<DD>
|
|
Read-only file containing the physical SPU number that the SPU context
|
|
is running on.
|
|
When the context is not running, this file contains the
|
|
string "-1".
|
|
<DT id="90"><DD>
|
|
The physical SPU number is given by an ASCII hex string.
|
|
<DT id="91"><I>/object-id</I>
|
|
|
|
<DD>
|
|
Allows applications to store (or retrieve) a single 64-bit ID into the
|
|
context.
|
|
This ID is later used by profiling tools to uniquely identify
|
|
the context.
|
|
<DL COMPACT><DT id="92"><DD>
|
|
<DL COMPACT>
|
|
<DT id="93"><B><A HREF="/cgi-bin/man/man2html?2+write">write</A></B>(2)
|
|
|
|
<DD>
|
|
By writing an ASCII hex value into this file, applications can set the
|
|
object ID of the SPU context.
|
|
Any previous value of the object ID is overwritten.
|
|
<DT id="94"><B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
|
|
|
|
<DD>
|
|
Reading this file gives an ASCII hex string representing the object ID
|
|
for this SPU context.
|
|
</DL>
|
|
</DL>
|
|
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXAMPLE</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="95"><I>/etc/fstab</I> entry
|
|
|
|
<DD>
|
|
none <TT> </TT>/spu <TT> </TT>spufs <TT> </TT>gid=spu <TT> </TT>0<TT> </TT>0<BR>
|
|
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+close">close</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+spu_create">spu_create</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+spu_run">spu_run</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+capabilities">capabilities</A></B>(7)
|
|
|
|
<P>
|
|
|
|
<I>The Cell Broadband Engine Architecture (CBEA) specification</I>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="96"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="97"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="98"><A HREF="#lbAD">Mount options</A><DD>
|
|
<DT id="99"><A HREF="#lbAE">Files</A><DD>
|
|
</DL>
|
|
<DT id="100"><A HREF="#lbAF">EXAMPLE</A><DD>
|
|
<DT id="101"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="102"><A HREF="#lbAH">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:10 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|