summaryrefslogtreecommitdiff
path: root/gcell/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'gcell/src/include')
-rw-r--r--gcell/src/include/gc_jd_queue_data.h27
-rw-r--r--gcell/src/include/spu/Makefile.am3
-rw-r--r--gcell/src/include/spu/gc_jd_queue.h12
-rw-r--r--gcell/src/include/spu/gc_random.h32
4 files changed, 42 insertions, 32 deletions
diff --git a/gcell/src/include/gc_jd_queue_data.h b/gcell/src/include/gc_jd_queue_data.h
index e5fa874990..3fd7270d5b 100644
--- a/gcell/src/include/gc_jd_queue_data.h
+++ b/gcell/src/include/gc_jd_queue_data.h
@@ -35,31 +35,14 @@ __GC_BEGIN_DECLS
* work. SPE's dequeue from here.
*
* FIXME make it lock free ;) For now, use a spin lock.
+ *
+ * (Fills a single cache line)
*/
-
-typedef struct gc_jd_q_links
-{
- gc_eaddr_t head _AL16;
- gc_eaddr_t tail _AL16;
-} gc_jd_q_links_t;
-
-typedef struct gc_jd_q_mutex
-{
- uint32_t mutex; // libsync mutex (spin lock)
- uint32_t _pad[31]; // pad to cache line so we can use putlluc on SPE
-} _AL128 gc_jd_q_mutex_t;
-
-typedef struct gc_jd_q_flag
-{
- uint32_t flag; // host writes this after enqueuing
- uint32_t _pad[31]; // pad to cache line
-} _AL128 gc_jd_q_flag_t;
-
typedef struct gc_jd_queue
{
- gc_jd_q_links_t l;
- gc_jd_q_mutex_t m;
- gc_jd_q_flag_t f;
+ gc_eaddr_t head _AL16;
+ gc_eaddr_t tail _AL16;
+ uint32_t mutex _AL16; // libsync mutex (spin lock)
} _AL128 gc_jd_queue_t;
__GC_END_DECLS
diff --git a/gcell/src/include/spu/Makefile.am b/gcell/src/include/spu/Makefile.am
index d202336f79..81a8bfdf42 100644
--- a/gcell/src/include/spu/Makefile.am
+++ b/gcell/src/include/spu/Makefile.am
@@ -22,4 +22,5 @@ include $(top_srcdir)/Makefile.common
gcellspuinclude_HEADERS = \
gc_delay.h \
- gc_jd_queue.h
+ gc_jd_queue.h \
+ gc_random.h
diff --git a/gcell/src/include/spu/gc_jd_queue.h b/gcell/src/include/spu/gc_jd_queue.h
index 7a6ac2e219..b65b15febd 100644
--- a/gcell/src/include/spu/gc_jd_queue.h
+++ b/gcell/src/include/spu/gc_jd_queue.h
@@ -39,20 +39,14 @@ __GC_BEGIN_DECLS
* \param[out] item is local store copy of item at head of queue.
* \returns false if the queue is empty, otherwise returns true
* and sets \p item_ea and DMA's job descriptor into \p item
+ *
+ * If return is false, we're holding a lock-line reservation that
+ * covers the queue.
*/
bool
gc_jd_queue_dequeue(gc_eaddr_t q, gc_eaddr_t *item_ea,
int jd_tag, gc_job_desc_t *item);
-
-/*!
- * \brief Get a line reservation on the queue
- *
- * \param[in] q is EA address of queue structure.
- */
-void
-gc_jd_queue_getllar(gc_eaddr_t q);
-
__GC_END_DECLS
diff --git a/gcell/src/include/spu/gc_random.h b/gcell/src/include/spu/gc_random.h
new file mode 100644
index 0000000000..ccb5647317
--- /dev/null
+++ b/gcell/src/include/spu/gc_random.h
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_GC_RANDOM_H
+#define INCLUDED_GC_RANDOM_H
+
+/*!
+ * \brief Return a uniformly distributed value in the range [0, 1.0)
+ * (Linear congruential generator. YMMV. Caveat emptor.)
+ */
+
+float gc_uniform_deviate(void);
+void gc_set_seed(int seed);
+
+#endif /* INCLUDED_GC_RANDOM_H */