diff --git a/firmware/export/config.h b/firmware/export/config.h index 65bf9c164f..f9a2ca26ea 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -689,8 +689,12 @@ Lyre prototype 1 */ # endif #endif +#if CONFIG_BINFMT == BINFMT_ROCK +# define HAVE_LC_OPEN_FROM_MEM +#endif + /* Codec buffering requires the ability to load code from RAM */ -#if CONFIG_PLATFORM & PLATFORM_NATIVE +#if defined(HAVE_LC_OPEN_FROM_MEM) # define HAVE_CODEC_BUFFERING #endif diff --git a/firmware/export/lc-dlopen.h b/firmware/export/lc-dlopen.h index c92ffce4ce..ef3b88d2a0 100644 --- a/firmware/export/lc-dlopen.h +++ b/firmware/export/lc-dlopen.h @@ -27,15 +27,4 @@ void *lc_open(const char *filename, unsigned char *buf, size_t buf_size); void *lc_get_header(void *handle); void lc_close(void *handle); -#ifdef APPLICATION -/* App doesn't simulate code loading from a buffer */ -static inline void * lc_open_from_mem(void *addr, size_t blob_size) -{ - return NULL; - (void)addr; (void)blob_size; -} -#else -void *lc_open_from_mem(void* addr, size_t blob_size); -#endif - #endif /* __LC_DLOPEN_H__ */ diff --git a/firmware/export/lc-rock.h b/firmware/export/lc-rock.h index bd4101cb03..43fd815f3a 100644 --- a/firmware/export/lc-rock.h +++ b/firmware/export/lc-rock.h @@ -25,6 +25,7 @@ void *lc_open(const char *filename, unsigned char *buf, size_t buf_size); +#if defined(HAVE_LC_OPEN_FROM_MEM) /* header is always at the beginning of the blob, and handle actually points * to the start of the blob (the header is there) */ static inline void *lc_open_from_mem(void* addr, size_t blob_size) @@ -34,6 +35,7 @@ static inline void *lc_open_from_mem(void* addr, size_t blob_size) commit_discard_idcache(); return addr; } +#endif /* HAVE_LC_OPEN_FROM_MEM */ static inline void *lc_get_header(void *handle) {