2017-10-26 04:26:14 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <syscall_handler.h>
|
|
|
|
#include <rtc.h>
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(rtc_read, dev)
|
2018-04-05 04:50:32 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, read));
|
2018-04-05 04:50:32 +08:00
|
|
|
return _impl_rtc_read((struct device *)dev);
|
|
|
|
}
|
2017-10-26 04:26:14 +08:00
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(rtc_enable, dev)
|
2018-04-05 04:50:32 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, enable));
|
2018-04-05 04:50:32 +08:00
|
|
|
return _impl_rtc_enable((struct device *)dev);
|
|
|
|
}
|
2017-10-26 04:26:14 +08:00
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(rtc_disable, dev)
|
2018-04-05 04:50:32 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, disable));
|
2018-04-05 04:50:32 +08:00
|
|
|
return _impl_rtc_disable((struct device *)dev);
|
|
|
|
}
|
2017-10-26 04:26:14 +08:00
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(rtc_set_alarm, dev, alarm_val)
|
2017-10-26 04:26:14 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, set_alarm));
|
2017-10-26 04:26:14 +08:00
|
|
|
return _impl_rtc_set_alarm((struct device *)dev, alarm_val);
|
|
|
|
}
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(rtc_get_pending_int, dev)
|
2018-04-05 04:50:32 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_pending_int));
|
2018-04-05 04:50:32 +08:00
|
|
|
return _impl_rtc_get_pending_int((struct device *)dev);
|
|
|
|
}
|