2017-10-25 13:26:14 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <syscall_handler.h>
|
2019-06-25 15:53:59 -04:00
|
|
|
#include <drivers/rtc.h>
|
2017-10-25 13:26:14 -07:00
|
|
|
|
2019-08-13 11:34:34 -07:00
|
|
|
static inline u32_t z_vrfy_rtc_read(struct device *dev)
|
2018-04-04 13:50:32 -07:00
|
|
|
{
|
2018-05-04 15:57:57 -07:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, read));
|
2019-03-08 14:19:05 -07:00
|
|
|
return z_impl_rtc_read((struct device *)dev);
|
2018-04-04 13:50:32 -07:00
|
|
|
}
|
2017-10-25 13:26:14 -07:00
|
|
|
|
2019-08-13 11:34:34 -07:00
|
|
|
static inline void z_vrfy_rtc_enable(struct device *dev)
|
2018-04-04 13:50:32 -07:00
|
|
|
{
|
2018-05-04 15:57:57 -07:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, enable));
|
2019-03-08 14:19:05 -07:00
|
|
|
z_impl_rtc_enable((struct device *)dev);
|
2018-06-19 16:39:48 +02:00
|
|
|
return 0;
|
2018-04-04 13:50:32 -07:00
|
|
|
}
|
2017-10-25 13:26:14 -07:00
|
|
|
|
2019-08-13 11:34:34 -07:00
|
|
|
static inline void z_vrfy_rtc_disable(struct device *dev)
|
2018-04-04 13:50:32 -07:00
|
|
|
{
|
2018-05-04 15:57:57 -07:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, disable));
|
2019-03-08 14:19:05 -07:00
|
|
|
z_impl_rtc_disable((struct device *)dev);
|
2018-06-19 16:39:48 +02:00
|
|
|
return 0;
|
2018-04-04 13:50:32 -07:00
|
|
|
}
|
2017-10-25 13:26:14 -07:00
|
|
|
|
2019-08-13 11:34:34 -07:00
|
|
|
static inline int z_vrfy_rtc_set_alarm(struct device *dev,
|
|
|
|
const u32_t alarm_val)
|
2017-10-25 13:26:14 -07:00
|
|
|
{
|
2018-05-04 15:57:57 -07:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, set_alarm));
|
2019-03-08 14:19:05 -07:00
|
|
|
return z_impl_rtc_set_alarm((struct device *)dev, alarm_val);
|
2017-10-25 13:26:14 -07:00
|
|
|
}
|
|
|
|
|
2019-08-13 11:34:34 -07:00
|
|
|
static inline int z_vrfy_rtc_get_pending_int(struct device *dev)
|
2018-04-04 13:50:32 -07:00
|
|
|
{
|
2018-05-04 15:57:57 -07:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_pending_int));
|
2019-03-08 14:19:05 -07:00
|
|
|
return z_impl_rtc_get_pending_int((struct device *)dev);
|
2018-04-04 13:50:32 -07:00
|
|
|
}
|
2019-08-13 11:34:34 -07:00
|
|
|
|
|
|
|
#include <syscalls/rtc_read_mrsh.c>
|
|
|
|
#include <syscalls/rtc_enable_mrsh.c>
|
|
|
|
#include <syscalls/rtc_disable_mrsh.c>
|
|
|
|
#include <syscalls/rtc_set_alarm_mrsh.c>
|
|
|
|
#include <syscalls/rtc_get_pending_int_mrsh.c>
|