GNU Radio 3.4.0 C++ API
gc_spu_args.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2007 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License along
00018  * with this program; if not, write to the Free Software Foundation, Inc.,
00019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00020  */
00021 #ifndef INCLUDED_GCELL_GC_SPU_ARGS_H
00022 #define INCLUDED_GCELL_GC_SPU_ARGS_H
00023 
00024 #include <gcell/gc_types.h>
00025 #include <gcell/gc_logging.h>
00026 
00027 // args passed to SPE at initialization time
00028 
00029 typedef struct gc_spu_args {
00030   gc_eaddr_t    queue;          // address of job queue (gc_jd_queue_t *)
00031   gc_eaddr_t    comp_info[2];   // completion info (gc_comp_info_t *)
00032   uint32_t      spu_idx;        // which spu we are: [0,nspus-1]
00033   uint32_t      nspus;          // number of spus we're using
00034   uint32_t      proc_def_ls_addr;  // LS addr of proc_def table
00035   uint32_t      nproc_defs;        // number of proc_defs in table
00036   gc_log_t      log;               // logging info
00037 } _AL16 gc_spu_args_t;
00038 
00039 
00040 #define GC_CI_NJOBS     62      // makes gc_comp_info 1 cache line long
00041 
00042 /*!
00043  * \brief Used to return info to PPE on which jobs are completed.
00044  *
00045  * When each SPE is initalized, it is passed EA pointers to two of
00046  * these structures.  The SPE uses these to communicate which jobs
00047  * that it has worked on are complete.  The SPE notifies the PPE by
00048  * sending an OP_JOBS_DONE message (see gc_mbox.h) with an argument of
00049  * 0 or 1, indicating which of the two comp_info's to examine.  The
00050  * SPE sets the in_use flag to 1 before DMA'ing to the PPE.  When the
00051  * PPE is done with the structure, it must clear the in_use field to
00052  * let the SPE know it can begin using it again.
00053  */
00054 typedef struct gc_comp_info {
00055   uint16_t      in_use;         // set by SPE, cleared by PPE when it's finished
00056   uint16_t      ncomplete;      // number of valid job_id's
00057   uint16_t      job_id[GC_CI_NJOBS];    // job_id's of completed jobs
00058 } _AL128 gc_comp_info_t;
00059 
00060 #endif /* INCLUDED_GCELL_GC_SPU_ARGS_H */