zephyr/drivers/sensor/sensor_handlers.c
Andy Ross 075c94f6e2 kernel: Port remaining syscalls to new API
These calls are not accessible in CI test, nor do they get built on
common platforms (in at least one case I found a typo which proved the
code was truly unused).  These changes are blind, so live in a
separate commit.  But the nature of the port is mechanical, all other
syscalls in the system work fine, and any errors should be easily
corrected.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00

47 lines
1.5 KiB
C

/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <drivers/sensor.h>
#include <syscall_handler.h>
static inline int z_vrfy_sensor_attr_set(struct device *dev,
enum sensor_channel chan,
enum sensor_attribute attr,
const struct sensor_value *val)
{
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, attr_set));
Z_OOPS(Z_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value)));
return z_impl_sensor_attr_set((struct device *)dev, chan, attr,
(const struct sensor_value *)val);
}
#include <syscalls/sensor_attr_set_mrsh.c>
static inline int z_vrfy_sensor_sample_fetch(struct device *dev)
{
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, sample_fetch));
return z_impl_sensor_sample_fetch((struct device *)dev);
}
#include <syscalls/sensor_sample_fetch_mrsh.c>
static inline int z_vrfy_sensor_sample_fetch_chan(struct device *dev,
enum sensor_channel type)
{
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, sample_fetch));
return z_impl_sensor_sample_fetch_chan((struct device *)dev, type);
}
#include <syscalls/sensor_sample_fetch_chan_mrsh.c>
static inline int z_vrfy_sensor_channel_get(struct device *dev,
enum sensor_channel chan,
struct sensor_value *val)
{
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, channel_get));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
return z_impl_sensor_channel_get((struct device *)dev, chan,
(struct sensor_value *)val);
}
#include <syscalls/sensor_channel_get_mrsh.c>