GNU Radio 3.4.2 C++ API
gc_jd_queue.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2007,2009 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 
00022 #ifndef INCLUDED_GCELL_SPU_GC_JD_QUEUE_H
00023 #define INCLUDED_GCELL_SPU_GC_JD_QUEUE_H
00024 
00025 #include <gcell/gc_jd_queue_data.h>
00026 
00027 /*
00028  * Declarations for SPU side of job queue interface
00029  */
00030 
00031 __GC_BEGIN_DECLS
00032 
00033 typedef enum {
00034   GCQ_OK,               // Got an item
00035   GCQ_EMPTY,            // Q is empty
00036   GCQ_LOCKED,           // Somebody else has the queue locked
00037 } gc_dequeue_status_t;
00038 
00039 /*!
00040  * \brief Remove and return item at head of queue.
00041  *
00042  * \param[in]  q is EA address of queue structure.
00043  * \param[out] item_ea is EA address of item at head of queue.
00044  * \param[in]  jd_tag is the tag to use to get the LS copy of the item.
00045  * \param[out] item is local store copy of item at head of queue.
00046  * \returns false if the queue is empty, otherwise returns true
00047  *   and sets \p item_ea and DMA's job descriptor into \p item
00048  *
00049  * If return is not GCQ_OK, we're holding a lock-line reservation that
00050  * covers the queue.
00051  */
00052 gc_dequeue_status_t
00053 gc_jd_queue_dequeue(gc_eaddr_t q, gc_eaddr_t *item_ea,
00054                     int jd_tag, gc_job_desc_t *item);
00055 
00056 __GC_END_DECLS
00057 
00058 
00059 #endif /* INCLUDED_GCELL_SPU_GC_JD_QUEUE_H */