diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-14 18:50:15 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-15 08:57:45 -0500 |
commit | 67cb2e3cdc9495ab00ad13c2971222c3da7bb78e (patch) | |
tree | bdce76457c9b4d9e0b818042320408f2820b26f0 /firmware/include/core_alloc.h | |
parent | 9e53d5541fd29dc39d051f9e4f106e0e15df615e (diff) | |
download | rockbox-67cb2e3cdc9495ab00ad13c2971222c3da7bb78e.tar.gz rockbox-67cb2e3cdc9495ab00ad13c2971222c3da7bb78e.zip |
Add core_get_data_pinned(), use it where possible
Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
Diffstat (limited to 'firmware/include/core_alloc.h')
-rw-r--r-- | firmware/include/core_alloc.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/include/core_alloc.h b/firmware/include/core_alloc.h index 22cc1988da..dc9b2036ec 100644 --- a/firmware/include/core_alloc.h +++ b/firmware/include/core_alloc.h | |||
@@ -45,6 +45,18 @@ static inline void* core_get_data(int handle) | |||
45 | return buflib_get_data(&core_ctx, handle); | 45 | return buflib_get_data(&core_ctx, handle); |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline void* core_get_data_pinned(int handle) | ||
49 | { | ||
50 | extern struct buflib_context core_ctx; | ||
51 | return buflib_get_data_pinned(&core_ctx, handle); | ||
52 | } | ||
53 | |||
54 | static inline void core_put_data_pinned(void *data) | ||
55 | { | ||
56 | extern struct buflib_context core_ctx; | ||
57 | buflib_put_data_pinned(&core_ctx, data); | ||
58 | } | ||
59 | |||
48 | /* core context chunk_alloc */ | 60 | /* core context chunk_alloc */ |
49 | static inline bool core_chunk_alloc_init(struct chunk_alloc_header *hdr, | 61 | static inline bool core_chunk_alloc_init(struct chunk_alloc_header *hdr, |
50 | size_t chunk_size, size_t max_chunks) | 62 | size_t chunk_size, size_t max_chunks) |