Skip to content

Commit c7b0fe9

Browse files
committed
fast-get: fix userspace
Fix userspace z_vrfy_* implementations. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent 7f8edfa commit c7b0fe9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

zephyr/lib/fast-get.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <rtos/spinlock.h>
1515
#include <rtos/symbol.h>
1616
#include <ipc/topology.h>
17+
#include <zephyr/kernel.h>
1718

1819
struct sof_fast_get_entry {
1920
const void *dram_ptr;
@@ -171,27 +172,26 @@ void z_impl_fast_put(struct k_heap *heap, const void *sram_ptr)
171172
EXPORT_SYMBOL(z_impl_fast_put);
172173

173174
#ifdef CONFIG_USERSPACE
175+
#include <zephyr/internal/syscall_handler.h>
174176
void z_vrfy_fast_put(struct k_heap *heap, const void *sram_ptr)
175177
{
176178
K_OOPS(K_SYSCALL_MEMORY_WRITE(heap, sizeof(*heap)));
177-
K_OOPS(K_SYSCALL_MEMORY_WRITE(heap->heap.heap, sizeof(*heap->heap.heap)));
178179
/*
179180
* FIXME: we don't know how much SRAM has been allocated, so cannot
180181
* check. Should fast_put() be changed to pass a size argument?
181182
*/
182183

183184
z_impl_fast_put(heap, sram_ptr);
184185
}
185-
#include <zephyr/syscalls/mod_fast_put_mrsh.c>
186+
#include <zephyr/syscalls/fast_put_mrsh.c>
186187

187188
const void *z_vrfy_fast_get(struct k_heap *heap, const void *dram_ptr, size_t size)
188189
{
189190
K_OOPS(K_SYSCALL_MEMORY_WRITE(heap, sizeof(*heap)));
190-
K_OOPS(K_SYSCALL_MEMORY_WRITE(heap->heap.heap, sizeof(*heap->heap.heap)));
191191
/* We cannot (easily) verify the actual heapp memory */
192192
K_OOPS(K_SYSCALL_MEMORY_READ(dram_ptr, size));
193193

194194
return z_impl_fast_get(heap, dram_ptr, size);
195195
}
196-
#include <zephyr/syscalls/mod_fast_get_mrsh.c>
196+
#include <zephyr/syscalls/fast_get_mrsh.c>
197197
#endif

0 commit comments

Comments
 (0)