Commit Graph

3 Commits

Author SHA1 Message Date
Anton Staaf
a6da62d284 Queue: Add functionality needed by new USART stream driver
Previously there was no way to remove multiple units at a time
from the queue, and the queue was wasting an entry to disambiguate
full from empty.  There was also no way to get the free entry
count from the queue, only the ability to query if it was above
a required amount.  The queue was also storing its constant
compile time configuration as well as its dynamic state in the
same structure.  This wasted RAM on configuration information
that doesn't change.

This refactor fixes these issues, making the queue suitable for
use in the new USART stream driver.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=None
BUG=None
TEST=make buildall -j

Change-Id: I284cee52d8189928dbc4c499f87ab34e14019e5a
Reviewed-on: https://chromium-review.googlesource.com/210533
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
2014-09-18 02:59:24 +00:00
Vic Yang
61ae739eef More queue unit test
Check queue_remove_unit returns 0 on queue empty.

BUG=chrome-os-partner:19236
TEST=Pass the test.
BRANCH=None

Change-Id: I3162ba5e57e9111e1896954d815c26882fa372eb
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58331
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-06-13 18:13:19 -07:00
Vic Yang
cbee574e64 Unit test for queue implementation
BUG=chrome-os-partner:19236
TEST=Pass the test.
BRANCH=None

Change-Id: I575e4a9abfd9431e3b74c36da8c3d69285e5c0fb
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58032
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
2013-06-10 01:48:46 -07:00