summaryrefslogtreecommitdiff
path: root/firmware/buflib.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-01-18 18:57:06 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-02-12 10:24:32 -0500
commite8faf2f2adeb9066de3c968a57803bb262f61ee1 (patch)
tree130c2e3d904da7876ac88ea089f85f48cab5e313 /firmware/buflib.c
parent95dfc489b5a602f68202b206c434f8485e9d3915 (diff)
downloadrockbox-e8faf2f2adeb9066de3c968a57803bb262f61ee1.tar.gz
rockbox-e8faf2f2adeb9066de3c968a57803bb262f61ee1.zip
buflib: add a common dummy callbacks struct & use it
There are various allocations that can't be moved or shrunk. Provide a global callback struct for this use case instead of making each caller declare its own dummy struct. Also fixed ROLO and x1000 installer code which incorrectly used movable allocations. Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
Diffstat (limited to 'firmware/buflib.c')
-rw-r--r--firmware/buflib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c
index 0e90e7fe72..c6ec011653 100644
--- a/firmware/buflib.c
+++ b/firmware/buflib.c
@@ -97,6 +97,12 @@
97 97
98#define BPANICF panicf 98#define BPANICF panicf
99 99
100struct buflib_callbacks buflib_ops_locked = {
101 .move_callback = NULL,
102 .shrink_callback = NULL,
103 .sync_callback = NULL,
104};
105
100#define IS_MOVABLE(a) (!a[2].ops || a[2].ops->move_callback) 106#define IS_MOVABLE(a) (!a[2].ops || a[2].ops->move_callback)
101static union buflib_data* find_first_free(struct buflib_context *ctx); 107static union buflib_data* find_first_free(struct buflib_context *ctx);
102static union buflib_data* find_block_before(struct buflib_context *ctx, 108static union buflib_data* find_block_before(struct buflib_context *ctx,