1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
.\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :)
.\"
.\" Copyright (c) International Business Machines Corp., 2006
.\"
.\" 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 program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
.\" MA 02111-1307 USA
.\"
.\" HISTORY:
.\" 2005-09-28, created by Arnd Bergmann <arndb@de.ibm.com>
.\" 2006-06-16, revised by Eduardo M. Fleury <efleury@br.ibm.com>
.\" 2007-07-10, some polishing by mtk
.\"
.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI
.\" all rights reserved.
.\" Translated 2007-10-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.TH SPU_RUN 2 2007-07-10 "Linux" "Linux Programmer's Manual"
.SH ̾
spu_run \- SPU ƥȤ¹Ԥ
.SH
.nf
.B #include <sys/spu.h>
.BI "int spu_run(int " fd ", unsigned int *" npc \
", unsigned int *" event ");"
.fi
.SH
.BR spu_run ()
ƥॳϡCell Broadband Engine ƥ
PowerPC ޥ Synergistic Processor Units (SPU) ˥뤿
Ѥ롣
.I fd
.BR spu_create (2)
֤եǥץǡ
SPU ƥȤꤹΤǤ롣
ΥƥȤʪ SPU ˳Ƥȡ
.I npc
Ϥ줿̿ݥ (instruction pointer) ¹ԤϤ롣
SPU ɤμ¹ԤƱŪ (synchronously) ˹Ԥ롢Ĥޤ
SPU ¹
.BR spu_run ()
֤뤳ȤϤʤ
SPU ɤμ¹Ԥᥤ CPU ¾ SPU ¹ԤƹԤɬפϡ
ǽˡ SPU ɤ¹Ԥ뿷åɤ
.BR pthread_create (3)
ʤɤȤäʤФʤʤ
.BR spu_run ()
֤ȤˤϡSPU ̿ݥθͤ
.I npc
˽ޤ롣λȤߤˤꡢݥɬפʤ
.BR spu_run ()
ٸƤӽФȤǤ롣
.I event
ˤϡNULL ݥ
.BR spu_run ()
ĥơɤ֤Τ˻ѤХåեؤΥݥ
ꤹ롣ơɤˤϡʲΤ줫ĤǤ롣
.TP
.B SPE_EVENT_DMA_ALIGNMENT
DMA (direct memory access) Υ饤ȡ顼ȯ
.RB ( SIGBUS ,
.I si_code
.B BUS_ADRALN
åȤ)
.TP
.B SPE_EVENT_INVALID_DMA
MFC (Memory Flow Controller) DMA Ǥä
.RB ( SIGBUS ,
.I si_code
.B BUS_OBJERR
åȤ)
.\" .B SPE_EVENT_SPE_DATA_SEGMENT
.\" A DMA segmentation error occurred.
.TP
.B SPE_EVENT_SPE_DATA_STORAGE
DMA ȥ졼顼ȯ
.RB ( SIGBUS ,
.I si_code
.B BUS_ADRERR
åȤ)
.TP
.B SPE_EVENT_SPE_ERROR
̿ᥨ顼
.RB ( SIGBUS ,
.I si_code
.B BUS_ADRALN
åȤ)
.PP
.I event
NULL ξ硢Υ顼ȯȡ
嵭ΥꥹȤˤб륷ʥ뤬ƤӽФΥץ롣
.SH ֤
ȡ
.BR spu_run ()
.I spu_status
쥸֤ͤ
顼ξ硢\-1 ֤
.I errno
Υ顼ɤΤ줫ꤹ롣
.I spu_status
쥸ͤϡơɤ
SPU stop-and-signal ֤̿ 14 ӥåȤΥɤ
ӥåȥޥǹ롣
Ԥ 14 ӥåȤΥɤϥץǤ롣
ơɤΥӥåȥޥϲ̤Ǥ롣
.TP
.B 0x02
SPU stop-and-signal ߤ
ξ硢stop-and-signal ̿ᤫ֤줿 14 ӥåȤΥɤϡ
.I 0x3fff0000
ΥޥŬѤ뤳ȤǼǤ롣
.TP
.B 0x04
SPU halt () ǻߤޤä
.TP
.B 0x08
SPU ϥͥΥǤ롣
.TP
.B 0x10
SPU ϥ륹ƥåץ⡼ɤǤä
.TP
.B 0x20
SPU ̿¹Ԥ褦Ȥ
.TP
.B 0x40
SPU ʥͥ˥褦Ȥ
.PP
.BR spu_run ()
顼֤ʤä硢 8 ӥåȤΤ 1 İʾ
˥åȤ롣
.SH 顼
.TP
.BR EAGAIN " ޤ " EWOULDBLOCK
.I fd
(non-blocking) ⡼ɤǡ
.BR spu_run ()
ߤǤä
.TP
.B EBADF
.I fd
ͭʥեǥץǤʤ
.TP
.B EFAULT
.I npc
ͭʥݥǤʤޤ
.I status
NULL ǤͭʥݥǤʤ
.TP
.B EINTR
.BR spu_run ()
μ¹˥ʥ뤬ȯ
ɬפǤС
.I npc
ͤϿץ५ͤ˹롣
.TP
.B EINVAL
.I fd
.BR spu_create (2)
֤줿եǥץǤʤ
.TP
.B ENOMEM
Memory Flow Controller (MFC) DMA ˤȯڡեȤ
Τɬפʥ꤬ʤä
.TP
.B ENOSYS
ǽưΥƥƤʤͳϡ
ϡɥ SPU Ƥʤ
spufs ⥸塼뤬ɤƤʤΤɤ餫Ǥ롣
.SH С
.BR spu_run (2)
ƥॳϥͥ 2.6.16 Linux ɲä줿
.SH
Υƥॳ Linux ͭǤꡢ
ppc64 ƥǤΤƤ롣
ΥƥॳȤäץϰܿʤ
.SH
glibc ϤΥƥॳФåѡؿƤʤ
.BR syscall (2)
Ȥȡ
.BR spu_run ()
٤ι⤤ SPU ؤΥե饤֥꤫
Ѥ뤳ȤտޤΤǤꡢ̾Υץꥱ
ѤϰտޤƤʤ侩Υ饤֥ˤĤƤ
.I http://www.bsc.es/projects/deepcomputing/linuxoncell/
ȤΤȡ
.SH Х
ºݤΥɤǤϤǽҤ٤Ƥεǽ˼Ƥ櫓ǤϤʤ
.\" .SH AUTHOR
.\" Arnd Bergmann <arndb@de.ibm.com>
.SH Ϣ
.BR close (2),
.BR spu_create (2),
.BR spufs (7)
|