Files
OpenCellular/include/consumer.h
Nicolas Boichat bbb40ce21d consumer: Remove flush operation
Nobody is calling the flush function for consumer_ops structure,
so let's remove it to save flash space, until we find a use for it.

CQ-DEPEND=CL:*529221
BRANCH=none
BUG=chromium:795624
TEST=make buildall -j, saves from 40 to 128 bytes on some boards.

Change-Id: Iad18b30f419ccebc54a90914ec46da84b8d19601
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/826905
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-18 20:32:58 -08:00

42 lines
1.1 KiB
C

/* Copyright 2015 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Consumer interface
*
* The consumer abstraction allows for code that wants to be able to read from
* a queue, and be notified of new additions to the queue, or of requests to
* flush (empty) the queue.
*/
#ifndef __CROS_EC_CONSUMER_H
#define __CROS_EC_CONSUMER_H
#include "queue.h"
#include <stddef.h>
#include <stdint.h>
struct consumer;
struct producer;
struct consumer_ops {
/*
* Inform the consumer that count units were written to the queue.
* This gives it the oportunity to read additional units from the queue
* or to wake up a task or interrupt to do the same. If a consumer has
* no need for this information it can set this to NULL.
*/
void (*written)(struct consumer const *consumer, size_t count);
};
struct consumer {
/*
* A consumer references the queue that it is reading from.
*/
struct queue const *queue;
struct consumer_ops const *ops;
};
#endif /* __CROS_EC_CONSUMER_H */