Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion drivers/dma/dma_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <zephyr/drivers/dma.h>
#include <zephyr/internal/syscall_handler.h>

/* Both of these APIs are assuming that the drive implementations are checking
/* All of these APIs are assuming that the drive implementations are checking
* the validity of the channel ID and returning -errno if it's bogus
*/

Expand All @@ -24,3 +24,39 @@
return z_impl_dma_stop((const struct device *)dev, channel);
}
#include <zephyr/syscalls/dma_stop_mrsh.c>

static int z_vrfy_dma_chan_filter(const struct device * dev, int channel, void * filter_param)

Check failure on line 28 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:28 "foo * bar" should be "foo *bar"

Check failure on line 28 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:28 "foo * bar" should be "foo *bar"
{
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, chan_filter));
return z_impl_dma_chan_filter((const struct device *)dev, channel, filter_param);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teburd I marked this as draft for now, but wanted to share for some early comments.

I'm not 100% sure if this is enough to verify given filter param is a pointer. Most DMA drivers I checked just use the 'filter_param' to pass a value, so this would also work from user-space. But of course, if an actual pointer to something is passed, that won't work from user-space....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call should not be a syscall.

}
#include <zephyr/syscalls/dma_chan_filter_mrsh.c>

static inline int z_vrfy_dma_request_channel(const struct device * dev, void * filter_param)

Check failure on line 35 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:35 "foo * bar" should be "foo *bar"

Check failure on line 35 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:35 "foo * bar" should be "foo *bar"
{
/* uses 'chan_filter' op in the implementation */
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, chan_filter));
return z_impl_dma_request_channel((const struct device *)dev, filter_param);
}
#include <zephyr/syscalls/dma_request_channel_mrsh.c>

static inline void z_vrfy_dma_release_channel(const struct device * dev, uint32_t channel)

Check failure on line 43 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:43 "foo * bar" should be "foo *bar"
{
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, chan_release));
z_impl_dma_release_channel((const struct device *)dev, channel);
}
#include <zephyr/syscalls/dma_release_channel_mrsh.c>

static inline int z_vrfy_dma_suspend(const struct device * dev, uint32_t channel)

Check failure on line 50 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:50 "foo * bar" should be "foo *bar"
{
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, suspend));
return z_impl_dma_suspend((const struct device *)dev, channel);
}
#include <zephyr/syscalls/dma_suspend_mrsh.c>

static inline int z_vrfy_dma_resume(const struct device * dev, uint32_t channel)

Check failure on line 57 in drivers/dma/dma_handlers.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/dma/dma_handlers.c:57 "foo * bar" should be "foo *bar"
{
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, resume));
return z_impl_dma_resume((const struct device *)dev, channel);
}
#include <zephyr/syscalls/dma_resume_mrsh.c>
Loading