diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/include/pool.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/include/pool.h')
-rw-r--r-- | roms/skiboot/include/pool.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/roms/skiboot/include/pool.h b/roms/skiboot/include/pool.h new file mode 100644 index 000000000..967e463c5 --- /dev/null +++ b/roms/skiboot/include/pool.h @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +/* Copyright 2014 IBM Corp. */ + +#ifndef __POOL_H +#define __POOL_H + +#include <ccan/list/list.h> +#include <stddef.h> +#include <compiler.h> + +struct pool { + void *buf; + size_t obj_size; + struct list_head free_list; + int free_count; + int reserved; +}; + +enum pool_priority {POOL_NORMAL, POOL_HIGH}; + +void* pool_get(struct pool *pool, enum pool_priority priority) __warn_unused_result; +void pool_free_object(struct pool *pool, void *obj); +int pool_init(struct pool *pool, size_t obj_size, int count, int reserved) __warn_unused_result; + +#endif /* __POOL_H */ |