2017-10-26 02:59:13 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <syscall_handler.h>
|
|
|
|
#include <counter.h>
|
|
|
|
|
|
|
|
/* For those APIs that just take one argument which is a counter driver
|
|
|
|
* instance and return an integral value
|
|
|
|
*/
|
|
|
|
#define COUNTER_HANDLER(name) \
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(counter_ ## name, dev) \
|
2018-04-05 04:50:32 +08:00
|
|
|
{ \
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, name)); \
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_counter_ ## name((struct device *)dev); \
|
2018-04-05 04:50:32 +08:00
|
|
|
}
|
2017-10-26 02:59:13 +08:00
|
|
|
|
2018-04-05 04:50:32 +08:00
|
|
|
COUNTER_HANDLER(get_pending_int)
|
|
|
|
COUNTER_HANDLER(read)
|
|
|
|
COUNTER_HANDLER(stop)
|
|
|
|
COUNTER_HANDLER(start)
|
2019-01-23 15:19:07 +08:00
|
|
|
COUNTER_HANDLER(get_top_value)
|
2018-06-11 17:50:20 +08:00
|
|
|
COUNTER_HANDLER(get_max_relative_alarm)
|