Add a circular memory buffer implementation

This will be used to support console recording. It provides for a circular
buffer which can be written at the head and read from the tail. It supports
avoiding data copying by providing raw access to the data.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/lib/Makefile b/lib/Makefile
index 3eecefa..6c36278 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -74,6 +74,7 @@
 obj-y += hang.o
 obj-y += linux_compat.o
 obj-y += linux_string.o
+obj-y += membuff.o
 obj-$(CONFIG_REGEX) += slre.o
 obj-y += string.o
 obj-y += time.o