zephyr/drivers/misc/timeaware_gpio/timeaware_gpio_handlers.c
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00

60 lines
2.3 KiB
C

/*
* Copyright (c) 2022 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/drivers/misc/timeaware_gpio/timeaware_gpio.h>
#include <zephyr/syscall_handler.h>
static inline int z_vrfy_tgpio_port_get_time(const struct device *port, uint64_t *current_time)
{
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, get_time));
K_OOPS(Z_SYSCALL_MEMORY_WRITE(current_time, sizeof(uint64_t)));
return z_impl_tgpio_port_get_time((const struct device *)port, (uint64_t *)current_time);
}
#include <zephyr/syscalls/tgpio_port_get_time_mrsh.c>
static inline int z_vrfy_tgpio_port_get_cycles_per_second(const struct device *port,
uint32_t *cycles)
{
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, cyc_per_sec));
K_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint32_t)));
return z_impl_tgpio_port_get_cycles_per_second((const struct device *)port,
(uint32_t *)cycles);
}
#include <zephyr/syscalls/tgpio_port_get_cycles_per_second_mrsh.c>
static inline int z_vrfy_tgpio_pin_periodic_output(const struct device *port, uint32_t pin,
uint64_t start_time, uint64_t repeat_interval,
bool periodic_enable)
{
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, set_perout));
return z_impl_tgpio_pin_periodic_output((const struct device *)port, pin, start_time,
repeat_interval, periodic_enable);
}
#include <zephyr/syscalls/tgpio_pin_periodic_output_mrsh.c>
static inline int z_vrfy_tgpio_pin_disable(const struct device *port, uint32_t pin)
{
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, pin_disable));
return z_impl_tgpio_pin_disable((const struct device *)port, pin);
}
#include <zephyr/syscalls/tgpio_pin_disable_mrsh.c>
static inline int z_vrfy_tgpio_pin_config_ext_timestamp(const struct device *port, uint32_t pin,
uint32_t event_polarity)
{
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, config_ext_ts));
return z_impl_tgpio_pin_config_ext_timestamp((const struct device *)port, pin,
event_polarity);
}
#include <zephyr/syscalls/tgpio_pin_config_ext_timestamp_mrsh.c>
static inline int z_vrfy_tgpio_pin_read_ts_ec(const struct device *port, uint32_t pin,
uint64_t *timestamp, uint64_t *event_count)
{
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, read_ts_ec));
return z_impl_tgpio_pin_read_ts_ec((const struct device *)port, pin, (uint64_t *)timestamp,
(uint64_t *)event_count);
}
#include <zephyr/syscalls/tgpio_pin_read_ts_ec_mrsh.c>