Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

fsl_shw_return_t fsl_shw_get_results ( fsl_shw_uco_t user_ctx,
unsigned  result_size,
fsl_shw_result_t  results[],
unsigned *  result_count 
)

Retrieve results from earlier operations.

Parameters:
user_ctx The user's context.
result_size The number of array elements of results.
[in,out] results Pointer to first of the (array of) locations to store results.
[out] result_count Pointer to store the number of results which were returned.
Returns:
A return code of type fsl_shw_return_t.

Definition at line 1679 of file shw_driver.c.

References sah_results::actual, shw_queue_entry_t::code, fsl_shw_result_t::code, fsl_shw_result_t::detail1, fsl_shw_result_t::detail2, FSL_RETURN_OK_S, os_free_memory, os_lock_save_context, os_unlock_restore_context, shw_queue_entry_t::postprocess, sah_results::requested, sah_results::results, sah_get_results(), sah_validate_uco(), shw_queue_lock, shw_queue_entry_t::user_mode_req, shw_queue_entry_t::user_ref, fsl_shw_result_t::user_ref, and fsl_shw_result_t::user_req.

{
      shw_queue_entry_t *finished_request;
      unsigned loop = 0;

      do {
            os_lock_context_t lock_context;

            /* Protect state of user's result pool until we have retrieved and
             * remove the first entry, or determined that the pool is empty. */
            os_lock_save_context(shw_queue_lock, lock_context);
            finished_request = user_ctx->result_pool.head;

            if (finished_request != NULL) {
                  uint32_t code = 0;

                  SHW_QUEUE_REMOVE_ENTRY(&user_ctx->result_pool,
                                     finished_request);
                  os_unlock_restore_context(shw_queue_lock, lock_context);

                  results[loop].user_ref = finished_request->user_ref;
                  results[loop].code = finished_request->code;
                  results[loop].detail1 = 0;
                  results[loop].detail2 = 0;
                  results[loop].user_req =
                      finished_request->user_mode_req;
                  if (finished_request->postprocess != NULL) {
                        code =
                            finished_request->
                            postprocess(finished_request);
                  }

                  results[loop].code = finished_request->code;
                  os_free_memory(finished_request);
                  if (code == 0) {
                        loop++;
                  }
            } else {    /* finished_request is NULL */
                  /* pool is empty */
                  os_unlock_restore_context(shw_queue_lock, lock_context);
            }

      } while ((loop < result_size) && (finished_request != NULL));

      *result_count = loop;

      return FSL_RETURN_OK_S;
}


Generated by  Doxygen 1.6.0   Back to index