[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cdi-devel] [PATCH 1/6] Mempool
From: Max Reitz <max@xxxxxxxxxx>
+ Added mempool header written by Kevin as a temporary solution for
the USB host controller drivers coming soon
Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
include/cdi/mempool.h | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
create mode 100644 include/cdi/mempool.h
diff --git a/include/cdi/mempool.h b/include/cdi/mempool.h
new file mode 100644
index 0000000..83d2ab2
--- /dev/null
+++ b/include/cdi/mempool.h
@@ -0,0 +1,35 @@
+/******************************************************************************
+* Copyright (c) 2009 Kevin Wolf *
+* *
+* Permission is hereby granted, free of charge, to any person obtaining a *
+* copy of this software and associated documentation files (the "Software"), *
+* to deal in the Software without restriction, including without limitation *
+* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
+* and/or sell copies of the Software, and to permit persons to whom the *
+* Software is furnished to do so, subject to the following conditions: *
+* *
+* The above copyright notice and this permission notice shall be included in *
+* all copies or substantial portions of the Software. *
+* *
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
+* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
+* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
+* DEALINGS IN THE SOFTWARE. *
+*****************************************************************************/
+
+#ifndef MEMPOOL_H
+#define MEMPOOL_H
+
+#include <stdlib.h>
+#include <stdint.h>
+
+struct mempool;
+
+struct mempool* mempool_create(size_t pool_size, size_t object_size);
+int mempool_get(struct mempool* pool, void** obj, uintptr_t* phys_obj);
+int mempool_put(struct mempool* pool, void* obj);
+
+#endif
--
1.6.4.2