diff --git a/src/include/cbfs.h b/src/include/cbfs.h index b89a13ddd3..37bac308d8 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -67,7 +67,7 @@ * attributes). Must return a pointer to space of the requested size where the file data should * be loaded, or NULL to make the operation fail. */ -typedef void *(*cbfs_allocator_t)(void *arg, size_t size, union cbfs_mdata *mdata); +typedef void *(*cbfs_allocator_t)(void *arg, size_t size, const union cbfs_mdata *mdata); static inline size_t cbfs_load(const char *name, void *buf, size_t size); static inline size_t cbfs_ro_load(const char *name, void *buf, size_t size); @@ -183,9 +183,9 @@ struct _cbfs_default_allocator_arg { void *buf; size_t buf_size; }; -void *_cbfs_default_allocator(void *arg, size_t size, union cbfs_mdata *unused); +void *_cbfs_default_allocator(void *arg, size_t size, const union cbfs_mdata *unused); -void *_cbfs_cbmem_allocator(void *arg, size_t size, union cbfs_mdata *unused); +void *_cbfs_cbmem_allocator(void *arg, size_t size, const union cbfs_mdata *unused); /********************************************************************************************** * INLINE IMPLEMENTATIONS * diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index fbf4531862..65bb721495 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -369,7 +369,7 @@ void *_cbfs_alloc(const char *name, cbfs_allocator_t allocator, void *arg, return loc; } -void *_cbfs_default_allocator(void *arg, size_t size, union cbfs_mdata *unused) +void *_cbfs_default_allocator(void *arg, size_t size, const union cbfs_mdata *unused) { struct _cbfs_default_allocator_arg *darg = arg; if (size > darg->buf_size) @@ -377,7 +377,7 @@ void *_cbfs_default_allocator(void *arg, size_t size, union cbfs_mdata *unused) return darg->buf; } -void *_cbfs_cbmem_allocator(void *arg, size_t size, union cbfs_mdata *unused) +void *_cbfs_cbmem_allocator(void *arg, size_t size, const union cbfs_mdata *unused) { return cbmem_add((uintptr_t)arg, size); } diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c index ac9eb0b306..31bf14190f 100644 --- a/src/lib/rmodule.c +++ b/src/lib/rmodule.c @@ -192,7 +192,7 @@ int rmodule_load(void *base, struct rmodule *module) } static void *rmodule_cbfs_allocator(void *rsl_arg, size_t unused, - union cbfs_mdata *mdata) + const union cbfs_mdata *mdata) { struct rmod_stage_load *rsl = rsl_arg;