Exemplo n.º 1
0
void
videoFinish ( videoData *vdata )
{
  dbgprintf ( "video finishing" ) ;

  static s32 i ;
  /* make sure no flip is in progress */
  gcmSetWaitFlip ( vdata->context ) ;

  /* free rsx buffers */
  for ( i = 0 ; i < MAX_BUFFERS ; i++ )
  {
    rsxFree ( vdata->rsx_buffers[i].ptr ) ;
  }

  /* finish rsx context */
  rsxFinish ( vdata->context, 1 ) ;

  /* free host_addr memory */
  free ( vdata->host_addr ) ;

  /* destroy semaphore */
  sysSemDestroy ( vdata->sem ) ;

  /* destroy cond */
  sysCondDestroy ( vdata->cond ) ;

  /* destroy mutex */
  sysMutexDestroy ( vdata->mutex ) ;
}
Exemplo n.º 2
0
/* release controller */
inline void
padFinish ( padBtnData *pdata )
{
  dbgprintf ( "pad finishing" ) ;

  /* destroy semaphore */
  sysSemDestroy ( pdata->sem ) ;

  /* destroy cond */
  sysCondDestroy ( pdata->cond ) ;

  /* destroy mutex */
  sysMutexDestroy ( pdata->mutex ) ;

  ioPadEnd () ;

  dbgprintf ( "pad finished" ) ;
}
Exemplo n.º 3
0
int destroy_sac_accessor(void)
{
    int ret = 0;

    if (sa == NULL)
    {
        return 0;
    }

    if (sa->module_buffer)
    {
        free(sa->module_buffer);
        sa->module_buffer = 0;
    }

    if (sa->id != -1)
    {
        ret = sysSpuRawReadProblemStorage(sa->id, SPU_Status);
        EIEIO;

        if (ret & 0x1)
        {
            sysSpuRawWriteProblemStorage(sa->id, SPU_In_MBox, EXIT_SAC_CMD);
            EIEIO;

            sysSpuRawWriteProblemStorage(sa->id, SPU_In_MBox, 0);
            EIEIO;
        }
    }

    if ((ret = sysInterruptThreadDisestablish(sa->ih)) != 0)
    {
        LOG(lm_main, LOG_ERROR, ("sysInterruptThreadDisestablish returned %d\n", ret));
    }

    if ((ret = sysInterruptTagDestroy(sa->intrtag)) != 0)
    {
        LOG(lm_main, LOG_ERROR, ("sys_interrupt_tag_destroy returned %d\n", ret));
    }

    if (sa->id != -1)
    {
#ifdef USE_ISOSELF
        if ((ret = sys_isoself_spu_destroy(sa->id)) != 0)
        {
            LOG(lm_main, LOG_ERROR, ("sys_isoself_spu_destroy returned %d\n", ret));
        }
#else
        if ((ret = sysSpuRawDestroy(sa->id)) != 0)
        {
            LOG(lm_main, LOG_ERROR, ("sys_raw_spu_destroy returned %d\n", ret));
        }
#endif
    }

    if (sa->buffer)
    {
        free(sa->buffer);
        sa->buffer = 0;
    }

    if (sa->read_buffer)
    {   
        free(sa->read_buffer);
        sa->read_buffer = 0;
    }
    
    if (sa->write_buffer)
    {
        free(sa->write_buffer);
        sa->write_buffer = 0;
    }

    if ((ret = sysCondDestroy(sa->mmio_cond)) != 0)
    {
        LOG(lm_main, LOG_ERROR, ("destroy mmio_cond failed.\n"));
    }

    if ((ret = sysMutexDestroy(sa->mmio_mutex)) != 0)
    {
        LOG(lm_main, LOG_ERROR, ("destroy mmio_mutex failed.\n"));
    }

    free(sa);
    sa = NULL;

    return ret;
}