blob: 6e74685e430584fd55413d6b8d2809381448ffbf [file] [log] [blame]
Andrew Boiece6c8f32018-02-09 13:58:37 -08001/*
2 * Copyright (c) 2018 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
Anas Nashif46a5d1e2019-06-25 15:53:48 -04007#include <drivers/dma.h>
Andrew Boiece6c8f32018-02-09 13:58:37 -08008#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 Bursztykae18fcbb2020-04-30 20:33:38 +020014static inline int z_vrfy_dma_start(const struct device *dev, uint32_t channel)
Andrew Boiece6c8f32018-02-09 13:58:37 -080015{
Andrew Boie8345e5e2018-05-04 15:57:57 -070016 Z_OOPS(Z_SYSCALL_DRIVER_DMA(dev, start));
Tomasz Bursztykae18fcbb2020-04-30 20:33:38 +020017 return z_impl_dma_start((const struct device *)dev, channel);
Andrew Boiece6c8f32018-02-09 13:58:37 -080018}
Andy Ross075c94f2019-08-13 11:34:34 -070019#include <syscalls/dma_start_mrsh.c>
Andrew Boiece6c8f32018-02-09 13:58:37 -080020
Tomasz Bursztykae18fcbb2020-04-30 20:33:38 +020021static inline int z_vrfy_dma_stop(const struct device *dev, uint32_t channel)
Andrew Boiece6c8f32018-02-09 13:58:37 -080022{
Andrew Boie8345e5e2018-05-04 15:57:57 -070023 Z_OOPS(Z_SYSCALL_DRIVER_DMA(dev, stop));
Tomasz Bursztykae18fcbb2020-04-30 20:33:38 +020024 return z_impl_dma_stop((const struct device *)dev, channel);
Andrew Boiece6c8f32018-02-09 13:58:37 -080025}
Andy Ross075c94f2019-08-13 11:34:34 -070026#include <syscalls/dma_stop_mrsh.c>