From e8faf2f2adeb9066de3c968a57803bb262f61ee1 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 18 Jan 2022 18:57:06 +0000 Subject: 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 --- firmware/buflib.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'firmware/buflib.c') 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 @@ #define BPANICF panicf +struct buflib_callbacks buflib_ops_locked = { + .move_callback = NULL, + .shrink_callback = NULL, + .sync_callback = NULL, +}; + #define IS_MOVABLE(a) (!a[2].ops || a[2].ops->move_callback) static union buflib_data* find_first_free(struct buflib_context *ctx); static union buflib_data* find_block_before(struct buflib_context *ctx, -- cgit v1.2.3