#include "ctrump-libspe2.h"
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
Go to the source code of this file.
Defines | |
#define | _ATFILE_SOURCE |
Enumerations | |
enum | { COMMAND_NONE, COMMAND_RUN, COMMAND_QUIT } |
Functions | |
static void * | spe_thread (void *spe_ptr) |
void | __spe_context_update_event (void) |
void | ctrump_runtime_spe_program_load (spe_context_ptr_t spe, const spe_program_handle_t *prog) |
SPEへプログラムロード. | |
void | ctrump_runtime_spe_start (spe_context_ptr_t spe, void *param) |
SPE開始. | |
void | ctrump_runtime_spe_wait (spe_context_ptr_t spe) |
SPE完了待ち. | |
void | ctrump_runtime_append_spe (spe_context_ptr_t spe, int enable_debugger) |
CTRUMPで使うSPEを追加する. | |
void | ctrump_runtime_remove_spe (spe_context_ptr_t spe) |
CTRUMPで使っていたSPEを終了する. | |
void | ctrump_runtime_initialize (int num_spe) |
初期化 | |
void | ctrump_runtime_finalize (void) |
終了処理 | |
Variables | |
struct ctrump_runtime_spe_context | ctrump_runtime_spes [16] |
spe_program_handle_t | ctrump_libspe2_boot |
int | ctrump_spe_num = 0 |
SPE起動時間短縮のため、context_runは利用しないで、 以下のようにしてSPEプログラムを起動する
1 ctrump_runtime_append_spe が呼ばれると、対象SPE contextに ELF ロードプログラム(spe/ctrump-libspe2-boot.c)を置く
2 PPEはSPEをstartする
3 SPEはPPEから実行要求がくるまでmbox readで待機
4 PPEはSPEにELFイメージの先頭アドレスをmboxで送る
5 SPE側のSPEローダは届いたELFイメージをロードして実行
6 SPE側はロードが完了するとそのプログラムを実行
7 SPE側プログラムは実行完了すると、PPEへintr mboxを使って完了通知
8 SPE側は通知が完了すると、再びELFロードプログラムを実行 -> 3へ
Definition in file ctrump-libspe2.c.
#define _ATFILE_SOURCE |
Definition at line 58 of file ctrump-libspe2.c.
anonymous enum |
void __spe_context_update_event | ( | void | ) |
Referenced by ctrump_runtime_spe_program_load().
void ctrump_runtime_append_spe | ( | spe_context_ptr_t | spe, | |
int | enable_debugger | |||
) |
CTRUMPで使うSPEを追加する.
spe | SPE | |
enable_debugger | ppu-gdbを使う場合は1 |
Definition at line 144 of file ctrump-libspe2.c.
References ctrump_runtime_spes, ctrump_spe_num, ctrump_runtime_spe_context::dir_fd, ctrump_runtime_spe_context::enable_debugger, ctrump_runtime_spe_context::spe_context, spe_thread(), and ctrump_runtime_spe_context::thread.
Referenced by ctrump_runtime_initialize().
void ctrump_runtime_finalize | ( | void | ) |
終了処理
Definition at line 203 of file ctrump-libspe2.c.
References ctrump_runtime_remove_spe(), ctrump_runtime_spes, ctrump_spe_num, and ctrump_runtime_spe_context::spe_context.
void ctrump_runtime_initialize | ( | int | num_spe | ) |
初期化
num_spe | 使うSPEの数 |
Definition at line 194 of file ctrump-libspe2.c.
References ctrump_runtime_append_spe().
void ctrump_runtime_remove_spe | ( | spe_context_ptr_t | spe | ) |
CTRUMPで使っていたSPEを終了する.
spe | SPE |
Definition at line 167 of file ctrump-libspe2.c.
References ctrump_runtime_spes, ctrump_spe_num, ctrump_runtime_spe_context::dir_fd, ctrump_runtime_spe_context::spe_context, and ctrump_runtime_spe_context::thread.
Referenced by ctrump_runtime_finalize().
void ctrump_runtime_spe_program_load | ( | spe_context_ptr_t | spe, | |
const spe_program_handle_t * | prog | |||
) |
SPEへプログラムロード.
spe | SPE | |
prog | プログラム |
Definition at line 92 of file ctrump-libspe2.c.
References __spe_context_update_event(), ctrump_runtime_spes, ctrump_spe_num, ctrump_runtime_spe_context::dir_fd, ctrump_runtime_spe_context::enable_debugger, and ctrump_runtime_spe_context::spe_context.
void ctrump_runtime_spe_start | ( | spe_context_ptr_t | spe, | |
void * | param | |||
) |
SPE開始.
spe | spe context | |
param | SPEに渡すパラメータ |
Definition at line 127 of file ctrump-libspe2.c.
void ctrump_runtime_spe_wait | ( | spe_context_ptr_t | spe | ) |
static void* spe_thread | ( | void * | spe_ptr | ) | [static] |
Definition at line 77 of file ctrump-libspe2.c.
References ctrump_libspe2_boot.
Referenced by ctrump_runtime_append_spe().
spe_program_handle_t ctrump_libspe2_boot |
Referenced by spe_thread().
struct ctrump_runtime_spe_context ctrump_runtime_spes[16] |
Definition at line 72 of file ctrump-libspe2.c.
Referenced by ctrump_runtime_append_spe(), ctrump_runtime_finalize(), ctrump_runtime_remove_spe(), and ctrump_runtime_spe_program_load().
int ctrump_spe_num = 0 |
Definition at line 74 of file ctrump-libspe2.c.
Referenced by ctrump_runtime_append_spe(), ctrump_runtime_finalize(), ctrump_runtime_remove_spe(), and ctrump_runtime_spe_program_load().