Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 Intel Corporation |
| 3 | * |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | */ |
| 6 | |
Anas Nashif | 46a5d1e | 2019-06-25 15:53:48 -0400 | [diff] [blame] | 7 | #include <drivers/dma.h> |
Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 8 | #include <syscall_handler.h> |
| 9 | |
| 10 | /* Both of these APIs are assuming that the drive implementations are checking |
| 11 | * the validity of the channel ID and returning -errno if it's bogus |
| 12 | */ |
| 13 | |
Tomasz Bursztyka | e18fcbb | 2020-04-30 20:33:38 +0200 | [diff] [blame] | 14 | static inline int z_vrfy_dma_start(const struct device *dev, uint32_t channel) |
Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 15 | { |
Andrew Boie | 8345e5e | 2018-05-04 15:57:57 -0700 | [diff] [blame] | 16 | Z_OOPS(Z_SYSCALL_DRIVER_DMA(dev, start)); |
Tomasz Bursztyka | e18fcbb | 2020-04-30 20:33:38 +0200 | [diff] [blame] | 17 | return z_impl_dma_start((const struct device *)dev, channel); |
Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 18 | } |
Andy Ross | 075c94f | 2019-08-13 11:34:34 -0700 | [diff] [blame] | 19 | #include <syscalls/dma_start_mrsh.c> |
Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 20 | |
Tomasz Bursztyka | e18fcbb | 2020-04-30 20:33:38 +0200 | [diff] [blame] | 21 | static inline int z_vrfy_dma_stop(const struct device *dev, uint32_t channel) |
Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 22 | { |
Andrew Boie | 8345e5e | 2018-05-04 15:57:57 -0700 | [diff] [blame] | 23 | Z_OOPS(Z_SYSCALL_DRIVER_DMA(dev, stop)); |
Tomasz Bursztyka | e18fcbb | 2020-04-30 20:33:38 +0200 | [diff] [blame] | 24 | return z_impl_dma_stop((const struct device *)dev, channel); |
Andrew Boie | ce6c8f3 | 2018-02-09 13:58:37 -0800 | [diff] [blame] | 25 | } |
Andy Ross | 075c94f | 2019-08-13 11:34:34 -0700 | [diff] [blame] | 26 | #include <syscalls/dma_stop_mrsh.c> |