summaryrefslogtreecommitdiff
path: root/include/queue_policies.h
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2015-06-08 10:40:43 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-11 00:08:49 +0000
commitbd7e885ae780493e37a58418a6f0197a4a3b951a (patch)
tree218facf95bb3ccc6510139f00bbabee4858b6166 /include/queue_policies.h
parent7fab87e488f58e98dc3669b45eb068be8181ff77 (diff)
downloadchrome-ec-bd7e885ae780493e37a58418a6f0197a4a3b951a.tar.gz
Stream: Remove in_stream/out_stream interface
The in_stream and out_stream interfaces were a first attempt at providing an abstraction for multiple stream like devices (usart, USB, I2C/LPC host interfaces...). But, by baking the queue into the device it proved to be hard to use and required additional resources (task or deferred hook) to handle passing data from one stream to another. Since then the queue policy and producer/consumer interfaces have replaced the stream interfaces. This CL removes the old stream interfaces and updates the only users (deleting the test echo code from the discovery-stm32f072 board and updating the mcdp28x0 driver to use the queue interfaces). Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: Ic0d2abf81eafc4fb2e61172540151f2d0ba45caf Reviewed-on: https://chromium-review.googlesource.com/276163 Reviewed-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'include/queue_policies.h')
-rw-r--r--include/queue_policies.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/queue_policies.h b/include/queue_policies.h
index ec6ba1a0ec..61ab75c3a6 100644
--- a/include/queue_policies.h
+++ b/include/queue_policies.h
@@ -40,4 +40,12 @@ void queue_remove_direct(struct queue_policy const *policy, size_t count);
#define QUEUE_DIRECT(SIZE, TYPE, PRODUCER, CONSUMER) \
QUEUE(SIZE, TYPE, QUEUE_POLICY_DIRECT(PRODUCER, CONSUMER).policy)
+/*
+ * The null_producer and null_consumer are useful when constructing a queue
+ * where one end needs notification, but the other end doesn't care. These
+ * producer and consumer structs just ignore all notifications.
+ */
+extern struct producer const null_producer;
+extern struct consumer const null_consumer;
+
#endif /* INCLUDE_QUEUE_POLICIES_H */