Sound Open Firmware
Loading...
Searching...
No Matches
fast-get.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2024 Intel Corporation. All rights reserved.
4 *
5 * Author: Jyri Sarha <jyri.sarha@linux.intel.com>
6 */
7
14#ifndef __SOF_LIB_FAST_GET_H__
15#define __SOF_LIB_FAST_GET_H__
16
17#include <stddef.h>
18
23struct k_mem_domain;
24struct mod_alloc_ctx;
25
26/*
27 * When built for SOF, fast_get() and fast_put() are only needed when DRAM
28 * storage and execution is enabled (CONFIG_COLD_STORE_EXECUTE_DRAM=y), but not
29 * when building LLEXT extensions (!defined(LL_EXTENSION_BUILD)), using Zephyr
30 * SDK (CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=n while
31 * CONFIG_LLEXT_TYPE_ELF_SHAREDLIB=y).
32 * For unit-testing full versions of fast_get() and fast_put() are checked by
33 * test/ztest/unit/fast-get/ and test/cmocka/src/lib/fast-get/
34 */
35#if (CONFIG_COLD_STORE_EXECUTE_DRAM && \
36 (CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))) || \
37 !CONFIG_SOF_FULL_ZEPHYR_APPLICATION
45const void *fast_get(struct mod_alloc_ctx *alloc, const void * const dram_ptr, size_t size);
46
55void fast_put(struct mod_alloc_ctx *alloc, struct k_mem_domain *mdom, const void *sram_ptr);
56#else
57static inline const void *fast_get(struct mod_alloc_ctx *alloc, const void * const dram_ptr,
58 size_t size)
59{
60 return dram_ptr;
61}
62static inline void fast_put(struct mod_alloc_ctx *alloc, struct k_mem_domain *mdom,
63 const void *sram_ptr) {}
64#endif
65
68#endif /* __SOF_LIB_FAST_GET_H__ */
static const void * fast_get(struct mod_alloc_ctx *alloc, const void *const dram_ptr, size_t size)
Definition fast-get.h:57
static void fast_put(struct mod_alloc_ctx *alloc, struct k_mem_domain *mdom, const void *sram_ptr)
Definition fast-get.h:62
Module and pipeline allocation context aggregating a Zephyr heap and optional virtual region.
Definition alloc.h:251