예제 #1
0
gboolean
xdg_app_builtin_dump_runtime (int argc, char **argv, GCancellable *cancellable, GError **error)
{
  g_autoptr(GOptionContext) context = NULL;
  g_autoptr(XdgAppDir) dir = NULL;
  const char *runtime;
  const char *branch = "master";
  g_autofree char *ref = NULL;
  OstreeRepo *repo;
  g_autofree char *commit = NULL;
  g_autoptr(GFile) root = NULL;

  context = g_option_context_new ("RUNTIME BRANCH - Make branch of application current");

  if (!xdg_app_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error))
    return FALSE;

  if (argc < 3)
    return usage_error (context, "RUNTIME and BRANCH must be specified", error);

  runtime  = argv[1];
  branch = argv[2];

  if (!xdg_app_is_valid_name (runtime))
    return xdg_app_fail (error, "'%s' is not a valid name", runtime);

  if (!xdg_app_is_valid_branch (branch))
    return xdg_app_fail (error, "'%s' is not a valid branch name", branch);

  ref = xdg_app_build_runtime_ref (runtime, branch, opt_arch);

  repo = xdg_app_dir_get_repo (dir);

  if (!ostree_repo_read_commit (repo, ref,
                                &root, &commit, cancellable, error))
    return FALSE;

#ifdef HAVE_LIBARCHIVE
  return dump_runtime (root, cancellable, error);
#else
  return xdg_app_fail (error, "Build without libarchive");
#endif
}
예제 #2
0
static int start_dma_ch(struct snd_pcm_substream *substream)
{
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct nx_runtime_data *rtd = runtime->private_data;
	struct dma_trans 	   *tr  = rtd->dma_tr;
	int stream = substream->stream;
	int ret    = 0;

	DBGOUT("%s\n", __func__);
	if (! tr)
		return -1;

#if (DEBUG_RUNTINE)
	dump_runtime(runtime);
#endif

	/* set buffer */
	rtd->buf_point = 0;
	rtd->buf_base  = runtime->dma_addr;
	rtd->dma_run   = true;

	if (SNDRV_PCM_STREAM_PLAYBACK == stream) {
		tr->length  = snd_pcm_lib_period_bytes(substream);
		tr->srcbase = runtime->dma_addr;

#if (DMA_DOUBLE_BUFFER)
		soc_dma_set_mode(tr, DMA_MODE_BUFFER);
		soc_dma_transfer(tr);
		tr->srcbase += tr->length;
#endif
		soc_dma_transfer(tr);

	} else {
		tr->length  = snd_pcm_lib_period_bytes(substream);
		tr->dstbase = runtime->dma_addr;

		soc_dma_set_mode(tr, DMA_MODE_NORMAL);
		soc_dma_transfer(tr);
	}

	DBGOUT("%s (ret:%d)\n", __func__, ret);
	return ret;
}