net: ptp: clock: Add usermode support to ptp_clock_get()
It is useful that the ptp_clock_get() function can be called from the userspace. Create also unit test for calling that function from userspace. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
95e8498c27
commit
c9aaab74db
7 changed files with 94 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
|||
#ifndef ZEPHYR_INCLUDE_PTP_CLOCK_H_
|
||||
#define ZEPHYR_INCLUDE_PTP_CLOCK_H_
|
||||
|
||||
#include <kernel.h>
|
||||
#include <stdint.h>
|
||||
#include <device.h>
|
||||
#include <misc/util.h>
|
||||
|
@ -51,7 +52,10 @@ static inline int ptp_clock_set(struct device *dev, struct net_ptp_time *tm)
|
|||
*
|
||||
* @return 0 if ok, <0 if error
|
||||
*/
|
||||
static inline int ptp_clock_get(struct device *dev, struct net_ptp_time *tm)
|
||||
__syscall int ptp_clock_get(struct device *dev, struct net_ptp_time *tm);
|
||||
|
||||
static inline int z_impl_ptp_clock_get(struct device *dev,
|
||||
struct net_ptp_time *tm)
|
||||
{
|
||||
const struct ptp_clock_driver_api *api = dev->driver_api;
|
||||
|
||||
|
@ -88,6 +92,8 @@ static inline int ptp_clock_rate_adjust(struct device *dev, float rate)
|
|||
return api->rate_adjust(dev, rate);
|
||||
}
|
||||
|
||||
#include <syscalls/ptp_clock.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue