/* * Computer System Architecture - Cell GDB tutorial * PPU code */ #include #include #include #include extern spe_program_handle_t spu_bugs; int main(void) { spe_context_ptr_t ctx; if((ctx = spe_context_create(0, NULL)) == NULL) { perror ("Failed creating context"); exit(1); } if(spe_program_load(ctx, &spu_bugs)) { perror ("Failed loading program"); exit(1); } unsigned int entry = SPE_DEFAULT_ENTRY; if(spe_context_run(ctx, &entry, 0, 0, 0, 0) < 0) { perror ("Failed running context"); exit(1); } if(spe_context_destroy(ctx) != 0) { perror("Failed destroying context"); exit(1); } return 0; }