spufs(7) Miscellaneous Information Manual spufs(7) spufs - SPU SPU PowerPC, Cell Broadband Engine Architecture c (Synergistic Processor Unit, SPU). POSIX . , , spu_create(2) SPU spufs. SPU . SPU. , . uid= - ; 0 (root). gid= - ; 0 (root). mode=<> spufs, - . 0775. read(2) write(2) spufs, , , . , . , read(2), readv(2), , write(2), writev(2). access(2) stat(2), stat st_mode, st_nlink, st_uid st_gid. All files support the chmod(2)/ fchmod(2) and chown(2)/ fchown(2) operations, but will not be able to grant permissions that contradict the possible operations (e.g., read access on the wbox file). : /capabilities ( ) SPU. : sched . step , . . /mem SPU. SPU. mem: read(2) pread(2) write(2) pwrite(2) lseek(2) , , lseek(2), write(2) pwrite(2) . -- SPU, 256 . mmap(2) mem , SPU . MAP_SHARED. /regs SPU. 128- , 0 127, . . , , . regs , SPU_CREATE_NOSCHED. /mbox (communication mailbox) SPU--CPU. 4 . -- poll(2). mbox: read(2) count , read(2) -1 errno EINVAL. (. ., SPU ), -1, errno EAGAIN. 4. /ibox SPU--CPU. , -, read(2) ibox , SPU ( O_NONBLOCK, ). poll(2) . ibox: read(2) count , read(2) -1 errno EINVAL. O_NONBLOCK, -1, errno EAGAIN. O_NONBLOCK, , SPU . 4. poll(2) ibox (POLLIN | POLLRDNORM) . /wbox CPU--SPU. , . , write(2) ; poll(2). wbox: write(2) count , write(2) -1 errno EINVAL. O_NONBLOCK, -1, errno EAGAIN. O_NONBLOCK, , SPU PPE (PowerPC Processing Element). , 4 . poll(2) wbox (POLLOUT | POLLWRNORM) . /mbox_stat /ibox_stat /wbox_stat 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 mbox or ibox or how many words can be written to wbox 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 *box_stat file is: read(2) count , read(2) -1 errno EINVAL. . -- , ( mbox_stat ibox_stat) ( wbox_stat) , EAGAIN. /npc /decr /decr_status /spu_tag_mask /event_mask /event_status /srr0 /lslr SPU. ASCII, . ( npc, ) , SPU, . : npc -- SPU . decr SPU decr_status spu_tag_mask MFC SPU DMA event_mask SPU event_status SPU ( ) srr0 lslr : read(2) . , read(2), . , . write(2) write(2) , . . . npc, , SPU_CREATE_NOSCHED. /fpcr (fcpr). . fpcr: read(2) count , read(2) -1 errno EINVAL. ; fpcr. write(2) count , write(2) -1 errno EINVAL. , fpcr. /signal1 /signal2 SPU. - . SPU. , , SPU . SPU , . signal1 signal2: read(2) count , read(2) -1 errno EINVAL. ; . write(2) count , write(2) -1 errno EINVAL. , . , signal1_type signal2_type, . /signal1_type /signal2_type signal1 signal2. ASCII, <<1>> <<0>>. 0 () , . 1 ( ) , . signal1_type signal2_type: read(2) , read(2), ( ), . , . write(2) write(2) , . . . /mbox_info /ibox_info /wbox_info /dma_into /proxydma_info 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 mbox_info and ibox_info 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 mbox_stat, ibox_stat, and wbox_stat files contain the available message count. wbox_info , SPU. CBEA , 4 * 4 = 16 . - , . dma_info SPU MFC DMA, : struct spu_dma_info { uint64_t dma_info_type; uint64_t dma_info_mask; uint64_t dma_info_status; uint64_t dma_info_stall_and_notify; uint64_t dma_info_atomic_command_status; struct mfc_cq_sr dma_info_command_data[16]; }; -- DMA, 16 . mfc_cq_sr : struct mfc_cq_sr { uint64_t mfc_cq_data0_RW; uint64_t mfc_cq_data1_RW; uint64_t mfc_cq_data2_RW; uint64_t mfc_cq_data3_RW; }; proxydma_info , -DMA (. ., DMA, SPU). : struct spu_proxydma_info { uint64_t proxydma_info_type; uint64_t proxydma_info_mask; uint64_t proxydma_info_status; struct mfc_cq_sr proxydma_info_command_data[8]; }; , SPU, . . , SPU_CREATE_NOSCHED. /cntl SPU (Run Control) SPU, ASCII. : read(2) cntl ASCII, SPU . write(2) cntl SPU. /mfc Memory Flow Controller, SPU. SPU MFC Tag Status, DMA MFC. : write(2) MFC DMA: struct mfc_dma_command { int32_t pad; /* */ uint32_t lsa; /* */ uint64_t ea; /* */ uint16_t size; /* */ uint16_t tag; /* */ uint16_t class; /* ID */ uint16_t cmd; /* opcode */ }; sizeof(struct mfc_dma_command) . MFC SPU, ( ). read(2) . (. ., O_NONBLOCK), , DMA ( ). MFC. poll(2) poll(2) mfc , DMA ( POLLOUT) DMA ( POLLIN). /mss MFC MultiSource Synchronization (MSS). mmap(2) MSS SPU. : mmap(2) mss , MSS SPU . MAP_SHARED. /psmap (problem-state mapping) SPU. SPU spufs. : mmap(2) psmap SPU. MAP_SHARED. /phys-id SPU, SPU. <<-1>>. SPU ASCII . /object-id ( ) 64- ID . ID . write(2) ASCII ID SPU. ID . read(2) ASCII , ID SPU. To automatically mount(8) the SPU filesystem when booting, at the location /spu chosen by the user, put this line into the fstab(5) configuration file: none /spu spufs gid=spu 0 0 . close(2), spu_create(2), spu_run(2), capabilities(7) The Cell Broadband Engine Architecture (CBEA) specification Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . spufs(7)