summaryrefslogtreecommitdiff
path: root/firmware/include
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/buflib.h30
-rw-r--r--firmware/include/buflib_mempool.h4
-rw-r--r--firmware/include/chunk_alloc.h2
-rw-r--r--firmware/include/core_alloc.h2
4 files changed, 36 insertions, 2 deletions
diff --git a/firmware/include/buflib.h b/firmware/include/buflib.h
new file mode 100644
index 0000000000..36d171963a
--- /dev/null
+++ b/firmware/include/buflib.h
@@ -0,0 +1,30 @@
1/**************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2023 Aidan MacDonald
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _BUFLIB_H_
22#define _BUFLIB_H_
23
24#include "config.h"
25
26#if CONFIG_BUFLIB_BACKEND == BUFLIB_BACKEND_MEMPOOL
27#include "buflib_mempool.h"
28#endif
29
30#endif /* _BUFLIB_H_ */
diff --git a/firmware/include/buflib_mempool.h b/firmware/include/buflib_mempool.h
index 61fe2168b0..f261d4abda 100644
--- a/firmware/include/buflib_mempool.h
+++ b/firmware/include/buflib_mempool.h
@@ -26,6 +26,10 @@
26#ifndef _BUFLIB_MEMPOOL_H_ 26#ifndef _BUFLIB_MEMPOOL_H_
27#define _BUFLIB_MEMPOOL_H_ 27#define _BUFLIB_MEMPOOL_H_
28 28
29#ifndef _BUFLIB_H_
30# error "include buflib.h instead"
31#endif
32
29#include <stdint.h> 33#include <stdint.h>
30#include <stdbool.h> 34#include <stdbool.h>
31#include <string.h> 35#include <string.h>
diff --git a/firmware/include/chunk_alloc.h b/firmware/include/chunk_alloc.h
index f589cc0870..7d64d4b591 100644
--- a/firmware/include/chunk_alloc.h
+++ b/firmware/include/chunk_alloc.h
@@ -24,7 +24,7 @@
24#include <stdbool.h> 24#include <stdbool.h>
25#include <string.h> 25#include <string.h>
26#include "config.h" 26#include "config.h"
27#include "buflib_mempool.h" 27#include "buflib.h"
28 28
29#define CHUNK_ALLOC_INVALID ((size_t)-1) 29#define CHUNK_ALLOC_INVALID ((size_t)-1)
30 30
diff --git a/firmware/include/core_alloc.h b/firmware/include/core_alloc.h
index 382200dd75..22cc1988da 100644
--- a/firmware/include/core_alloc.h
+++ b/firmware/include/core_alloc.h
@@ -4,7 +4,7 @@
4#include <string.h> 4#include <string.h>
5#include <stdbool.h> 5#include <stdbool.h>
6#include "config.h" 6#include "config.h"
7#include "buflib_mempool.h" 7#include "buflib.h"
8#include "chunk_alloc.h" 8#include "chunk_alloc.h"
9 9
10/* All functions below are wrappers for functions in buflib.h, except 10/* All functions below are wrappers for functions in buflib.h, except