GNU Radio 3.4.2 C++ API
gc_declare_proc.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008 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_DECLARE_PROC_H
00022 #define INCLUDED_GCELL_GC_DECLARE_PROC_H
00023 
00024 #include <stdint.h>
00025 #include <gcell/gc_job_desc.h>
00026 
00027 /*
00028  * This is C, not C++ code...
00029  *
00030  * ...and is used by both PPE and SPE code
00031  */
00032 __GC_BEGIN_DECLS
00033 
00034 #define GC_PROC_DEF_SECTION ".gcell.proc_def"
00035 
00036 typedef struct gc_proc_def {
00037 #if defined(__SPU__)
00038   gc_spu_proc_t proc;
00039 #else
00040   uint32_t      proc;
00041 #endif
00042   char          name[28];
00043 } _AL16 gc_proc_def_t;
00044 
00045 
00046 #if defined(__SPU__)
00047 /*!
00048  * \brief Tell gcell about a SPU procedure
00049  *
00050  * \param _proc_   pointer to function (gc_spu_proc_t)
00051  * \param _name_   the name of the procedure ("quoted string")
00052  *
00053  * This macro registers the given procedure with the gcell runtime.
00054  * From the PPE, use gc_job_manager::lookup_proc to map \p _name_ to a gc_proc_id_t
00055  */
00056 #define GC_DECLARE_PROC(_proc_, _name_) \
00057 static struct gc_proc_def \
00058   _GCPD_ ## _proc_ __attribute__((section(GC_PROC_DEF_SECTION), used)) = \
00059   { _proc_, _name_ }
00060 #endif
00061 
00062 __GC_END_DECLS
00063 
00064 #endif /* INCLUDED_GCELL_GC_DECLARE_PROC_H */