Esempio n. 1
0
int SPE_Start(_THIS, spu_data_t * spe_data)
{
	deprintf(2, "[PS3->SPU] Start SPE: %s\n", spe_data->program_name);
	if (!(spe_data->booted))
		SPE_Boot(this, spe_data);

	
	spe_data->entry = SPE_DEFAULT_ENTRY;
	spe_data->error_code = 0;

	
	deprintf(2, "[PS3->SPU] Create Thread: %s\n", spe_data->program_name);
	if (pthread_create
	    (&spe_data->thread, NULL, (void *)&SPE_RunContext, (void *)spe_data)) {
		deprintf(2, "[PS3->SPU] Could not create pthread for spe: %s\n", spe_data->program_name);
		SDL_SetError("[PS3->SPU] Could not create pthread for spe");
		return -1;
	}

	if (spe_data->keepalive)
		SPE_WaitForMsg(this, spe_data, SPU_READY);
}
/* Start the SPE thread */
int SPE_Start(spu_data_t * spe_data)
{
  deprintf(2, "[PS3->SPU] Start SPE: %s\n", spe_data->program_name);
  if (!(spe_data->booted))
    SPE_Boot(spe_data);

  /* To allow re-running of context, spe_ctx_entry has to be set before each call */
  spe_data->entry = SPE_DEFAULT_ENTRY;
  spe_data->error_code = 0;

  /* Create SPE thread and run */
  deprintf(2, "[PS3->SPU] Create Thread: %s\n", spe_data->program_name);
  if (pthread_create
      (&spe_data->thread, NULL, (void *)&SPE_RunContext, (void *)spe_data)) {
    deprintf(2, "[PS3->SPU] Could not create pthread for spe: %s\n", spe_data->program_name);
    SDL_SetError("[PS3->SPU] Could not create pthread for spe");
    return -1;
  }

  if (spe_data->keepalive)
    SPE_WaitForMsg(spe_data, SPU_READY);
}