3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <gcell/gc_declare_proc.h>
23 #include <gcell/spu/gc_delay.h>
27 benchmark_udelay(const gc_job_direct_args_t *input,
28 gc_job_direct_args_t *output _UNUSED,
29 const gc_job_ea_args_t *eaa _UNUSED)
31 gc_udelay(input->arg[0].u32);
34 GC_DECLARE_PROC(benchmark_udelay, "benchmark_udelay");
39 benchmark_put_zeros(const gc_job_direct_args_t *input _UNUSED,
40 gc_job_direct_args_t *output _UNUSED,
41 const gc_job_ea_args_t *eaa)
43 for (unsigned int i = 0; i < eaa->nargs; i++){
44 if (eaa->arg[i].direction == GCJD_DMA_PUT)
45 memset(eaa->arg[i].ls_addr, 0, eaa->arg[i].put_size);
49 GC_DECLARE_PROC(benchmark_put_zeros, "benchmark_put_zeros");
53 benchmark_copy(const gc_job_direct_args_t *input _UNUSED,
54 gc_job_direct_args_t *output,
55 const gc_job_ea_args_t *eaa)
58 || eaa->arg[0].direction != GCJD_DMA_PUT
59 || eaa->arg[1].direction != GCJD_DMA_GET){
60 output->arg[0].s32 = -1;
64 output->arg[0].s32 = 0;
65 unsigned n = eaa->arg[0].put_size;
66 if (eaa->arg[1].get_size < n)
67 n = eaa->arg[1].get_size;
69 memcpy(eaa->arg[0].ls_addr, eaa->arg[1].ls_addr, n);
72 GC_DECLARE_PROC(benchmark_copy, "benchmark_copy");