1 .\" Copyright (c) International Business Machines Corp., 2006
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" 2005-09-28, created by Arnd Bergmann <arndb@de.ibm.com>,
7 .\" Mark Nutter <mnutter@us.ibm.com> and
8 .\" Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
9 .\" 2006-06-16, revised by Eduardo M. Fleury <efleury@br.ibm.com>
10 .\" 2007-07-10, quite a lot of polishing by mtk
11 .\" 2007-09-28, updates for newer kernels by Jeremy Kerr <jk@ozlabs.org>
13 .TH spufs 7 (date) "Linux man-pages (unreleased)"
15 spufs \- SPU filesystem
17 The SPU filesystem is used on PowerPC machines that implement the
18 Cell Broadband Engine Architecture in order to access Synergistic
19 Processor Units (SPUs).
21 The filesystem provides a name space similar to POSIX shared
22 memory or message queues.
23 Users that have write permissions
24 on the filesystem can use
26 to establish SPU contexts under the
30 Every SPU context is represented by a directory containing
31 a predefined set of files.
33 used for manipulating the state of the logical SPU.
34 Users can change permissions on the files, but can't
39 Set the user owning the mount point; the default is 0 (root).
42 Set the group owning the mount point; the default is 0 (root).
45 Set the mode of the top-level directory in
47 as an octal mode string.
52 mostly follow the standard behavior for regular system calls like
56 but often support only a subset of the operations
57 supported on regular filesystems.
58 This list details the supported
59 operations and the deviations from the standard behavior described
60 in the respective man pages.
62 All files that support the
64 operation also support
66 and all files that support the
68 operation also support
74 family of operations, but for the latter call,
75 the only fields of the returned
77 structure that contain reliable information are
90 operations, but will not be able to grant permissions that contradict
91 the possible operations (e.g., read access on the
95 The current set of files is:
98 Contains a comma-delimited string representing the capabilities of this
100 Possible capabilities are:
104 This context may be scheduled.
107 This context can be run in single-step mode, for debugging.
109 New capabilities flags may be added in the future.
113 the contents of the local storage memory of the SPU.
114 This can be accessed like a regular shared memory
115 file and contains both code and data in the address
117 The possible operations on an open
131 These operate as usual, with the exception that
136 are not supported beyond the end of the file.
138 is the size of the local storage of the SPU,
139 which is normally 256 kilobytes.
144 into the process address space provides access to the SPU local
145 storage within the process address space.
148 mappings are allowed.
152 Contains the saved general-purpose registers of the SPU context.
153 This file contains the 128-bit values of each register,
154 from register 0 to register 127, in order.
155 This allows the general-purpose registers to be
156 inspected for debugging.
158 Reading to or writing from this file requires that the context is
159 scheduled out, so use of this file is not recommended in normal
164 file is not present on contexts that have been created with the
165 .B SPU_CREATE_NOSCHED
169 The first SPU-to-CPU communication mailbox.
170 This file is read-only and can be read in units of 4 bytes.
171 The file can be used only in nonblocking mode \- even
173 cannot be used to block on this file.
174 The only possible operation on an open
182 is smaller than four,
188 If there is no data available in the mailbox (i.e., the SPU has not
189 sent a mailbox message), the return value is set to \-1 and
194 has been read successfully, four bytes are placed in
195 the data buffer and the value four is returned.
199 The second SPU-to-CPU communication mailbox.
200 This file is similar to the first mailbox file, but can be read
201 in blocking I/O mode, thus calling
205 file will block until the SPU has written data to its interrupt mailbox
206 channel (unless the file has been opened with
211 and similar system calls can be used to monitor for the presence
214 The possible operations on an open
222 is smaller than four,
228 If there is no data available in the mailbox and the file
229 descriptor has been opened with
231 the return value is set to \-1 and
236 If there is no data available in the mailbox and the file
237 descriptor has been opened without
240 block until the SPU writes to its interrupt mailbox channel.
241 When data has been read successfully, four bytes are placed in
242 the data buffer and the value four is returned.
248 .I "(POLLIN | POLLRDNORM)"
249 whenever data is available for reading.
253 The CPU-to-SPU communication mailbox.
254 It is write-only and can be written in units of four bytes.
255 If the mailbox is full,
259 can be used to block until the mailbox is available for writing again.
260 The possible operations on an open
268 is smaller than four,
274 If there is no space available in the mailbox and the file
275 descriptor has been opened with
278 value is set to \-1 and
283 If there is no space available in the mailbox and the file
284 descriptor has been opened without
286 the call will block until the SPU reads from its
287 PPE (PowerPC Processing Element)
289 When data has been written successfully,
290 the system call returns four as its function result.
296 .I "(POLLOUT | POLLWRNORM)"
297 whenever space is available for writing.
305 These are read-only files that contain the length of the current
306 queue of each mailbox\[em]that is, how many words can be read from
308 or how many words can be written to
311 The files can be read only in four-byte units and return
312 a big-endian binary integer number.
313 The only possible operation on an open
321 is smaller than four,
327 Otherwise, a four-byte value is placed in the data buffer.
328 This value is the number of elements that can be read from (for
334 the respective mailbox without blocking or returning an
354 Internal registers of the SPU.
355 These files contain an ASCII string
356 representing the hex value of the specified register.
357 Reads and writes on these
360 see below) require that the SPU context be scheduled out,
361 so frequent access to
362 these files is not recommended for normal program operation.
364 The contents of these files are:
368 Next Program Counter \- valid only when the SPU is in a stopped state.
377 MFC tag mask for SPU DMA
380 Event mask for SPU interrupts
383 Number of SPU events pending (read-only)
386 Interrupt Return address register
389 Local Store Limit Register
392 The possible operations on these files are:
396 Reads the current register value.
397 If the register value is larger than the buffer passed to the
399 system call, subsequent reads will continue reading from the same
400 buffer, until the end of the buffer is reached.
402 When a complete string has been read, all subsequent read operations
403 will return zero bytes and a new file descriptor needs to be opened
409 operation on the file sets the register to the
410 value given in the string.
411 The string is parsed from the beginning
412 until the first nonnumeric character or the end of the buffer.
413 Subsequent writes to the same file descriptor overwrite the
418 file, these files are not present on contexts that have been created with
420 .B SPU_CREATE_NOSCHED
425 This file provides access to the Floating Point Status and
426 Control Register (fcpr) as a binary, four-byte file.
427 The operations on the
435 is smaller than four,
441 Otherwise, a four-byte value is placed in the data buffer;
442 this is the current value of the
449 is smaller than four,
455 Otherwise, a four-byte value is copied from the data buffer,
456 updating the value of the
464 The files provide access to the two signal notification channels
466 These are read-write files that operate on four-byte words.
467 Writing to one of these files triggers an interrupt on the SPU.
468 The value written to the signal files can
469 be read from the SPU through a channel read or from
470 host user space through the file.
471 After the value has been read by the SPU, it is reset to zero.
472 The possible operations on an open
482 is smaller than four,
488 Otherwise, a four-byte value is placed in the data buffer;
489 this is the current value of the specified signal notification
495 is smaller than four,
501 Otherwise, a four-byte value is copied from the data buffer,
502 updating the value of the specified signal notification
504 The signal notification register will either be replaced with
505 the input data or will be updated to the bitwise OR operation
506 of the old value and the input data, depending on the contents
517 These two files change the behavior of the
522 They contain a numeric ASCII string which is read
523 as either "1" or "0".
524 In mode 0 (overwrite), the hardware replaces the contents
525 of the signal channel with the data that is written to it.
526 In mode 1 (logical OR), the hardware accumulates the bits
527 that are subsequently written to it.
528 The possible operations on an open
536 When the count supplied to the
538 call is shorter than the required length for the digit (plus a newline
539 character), subsequent reads from the same file descriptor will
541 When a complete string has been read, all subsequent read operations
542 will return zero bytes and a new file descriptor needs to be opened
543 to read the value again.
548 operation on the file sets the register to the
549 value given in the string.
550 The string is parsed from the beginning
551 until the first nonnumeric character or the end of the buffer.
552 Subsequent writes to the same file descriptor overwrite the
565 Read-only files that contain the saved state of the SPU mailboxes and
567 This allows the SPU status to be inspected, mainly for debugging.
572 files each contain the four-byte mailbox message that has been written
574 If no message has been written to these mailboxes, then
575 contents of these files is undefined.
581 files contain the available message count.
585 file contains an array of four-byte mailbox messages, which have been
587 With current CBEA machines, the array is four items in
588 length, so up to 4 * 4 = 16 bytes can be read from this file.
589 If any mailbox queue entry is empty,
590 then the bytes read at the corresponding location are undefined.
594 file contains the contents of the SPU MFC DMA queue, represented as the
599 struct spu_dma_info {
600 uint64_t dma_info_type;
601 uint64_t dma_info_mask;
602 uint64_t dma_info_status;
603 uint64_t dma_info_stall_and_notify;
604 uint64_t dma_info_atomic_command_status;
605 struct mfc_cq_sr dma_info_command_data[16];
610 The last member of this data structure is the actual DMA queue,
611 containing 16 entries.
614 structure is defined as:
619 uint64_t mfc_cq_data0_RW;
620 uint64_t mfc_cq_data1_RW;
621 uint64_t mfc_cq_data2_RW;
622 uint64_t mfc_cq_data3_RW;
629 file contains similar information, but describes the proxy DMA queue
630 (i.e., DMAs initiated by entities outside the SPU) instead.
631 The file is in the following format:
635 struct spu_proxydma_info {
636 uint64_t proxydma_info_type;
637 uint64_t proxydma_info_mask;
638 uint64_t proxydma_info_status;
639 struct mfc_cq_sr proxydma_info_command_data[8];
644 Accessing these files requires that the SPU context is scheduled out -
645 frequent use can be inefficient.
646 These files should not be used for normal program operation.
648 These files are not present on contexts that have been created with the
649 .B SPU_CREATE_NOSCHED
653 This file provides access to the SPU Run Control and SPU status
654 registers, as an ASCII string.
655 The following operations are supported:
661 file will return an ASCII string with the hex
662 value of the SPU Status register.
667 file will set the context's SPU Run Control register.
671 Provides access to the Memory Flow Controller of the SPU.
672 Reading from the file returns the contents of the
673 SPU's MFC Tag Status register, and
674 writing to the file initiates a DMA from the MFC.
675 The following operations are supported:
679 Writes to this file need to be in the format of a MFC DMA command,
684 struct mfc_dma_command {
685 int32_t pad; /* reserved */
686 uint32_t lsa; /* local storage address */
687 uint64_t ea; /* effective address */
688 uint16_t size; /* transfer size */
689 uint16_t tag; /* command tag */
690 uint16_t class; /* class ID */
691 uint16_t cmd; /* command opcode */
696 Writes are required to be exactly
697 .I sizeof(struct mfc_dma_command)
699 The command will be sent to the SPU's MFC proxy queue, and the
700 tag stored in the kernel (see below).
703 Reads the contents of the tag status register.
704 If the file is opened in blocking mode (i.e., without
706 then the read will block until a
707 DMA tag (as performed by a previous write) is complete.
709 the MFC tag status register will be returned without waiting.
716 file will block until a new DMA can be
717 started (by checking for
719 or until a previously started DMA
725 Provides access to the MFC MultiSource Synchronization (MSS) facility.
728 this file, processes can access the MSS area of the SPU.
730 The following operations are supported:
735 into the process address space gives access to the SPU MSS area
736 within the process address space.
739 mappings are allowed.
743 Provides access to the whole problem-state mapping of the SPU.
744 Applications can use this area to interface to the SPU, rather than
745 writing to individual register files in
748 The following operations are supported:
754 gives a process a direct map of the SPU problem state area.
757 mappings are supported.
761 Read-only file containing the physical SPU number that the SPU context
763 When the context is not running, this file contains the
766 The physical SPU number is given by an ASCII hex string.
769 Allows applications to store (or retrieve) a single 64-bit ID into the
771 This ID is later used by profiling tools to uniquely identify
776 By writing an ASCII hex value into this file, applications can set the
777 object ID of the SPU context.
778 Any previous value of the object ID is overwritten.
781 Reading this file gives an ASCII hex string representing the object ID
782 for this SPU context.
787 the SPU filesystem when booting, at the location
789 chosen by the user, put this line into the
793 none /spu spufs gid=spu 0 0
796 .\" Arnd Bergmann <arndb@de.ibm.com>, Mark Nutter <mnutter@us.ibm.com>,
797 .\" Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, Jeremy Kerr <jk@ozlabs.org>
804 .I The Cell Broadband Engine Architecture (CBEA) specification