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)); \
|
2018-04-05 04:50:32 +08:00
|
|
|
return _impl_counter_ ## name((struct device *)dev); \
|
|
|
|
}
|
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)
|