Sound Open Firmware
Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2022 Intel Corporation. All rights reserved.
4 */
5
6#ifndef __ZEPHYR_RTOS_TIMER_H__
7#define __ZEPHYR_RTOS_TIMER_H__
8
9#include <stdint.h>
10#include <zephyr/kernel.h>
11#include <sof/lib/cpu.h>
12#include <rtos/sof.h>
13#include <sof/platform.h>
14
15struct comp_dev;
17
18static inline uint64_t sof_cycle_get_64(void)
19{
20 if (IS_ENABLED(CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER))
21 return k_cycle_get_64();
22 else
23 return k_ticks_to_cyc_floor64(k_uptime_ticks());
24}
25
26static inline uint64_t sys_cycle_get_64_rate(void)
27{
28 return CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
29}
30
31#define sof_cycle_get_64_safe() sof_cycle_get_64()
32#define sof_cycle_get_64_atomic() sof_cycle_get_64()
33#define platform_timer_stop(x)
34
35/* get timestamp for host stream DMA position */
37 struct sof_ipc_stream_posn *posn);
38
39/* get timestamp for DAI stream DMA position */
41 struct sof_ipc_stream_posn *posn);
42
43/* get current wallclock for componnent */
45
46#endif /* __ZEPHYR_RTOS_TIMER_H__ */
#define IS_ENABLED(config)
Definition common.h:173
CPU header file.
Platform API definition.
Audio component base device "class".
Definition component.h:645
Definition dai-zephyr.h:49
Definition stream.h:134
uint64_t wallclock
audio wall clock
Definition stream.h:143
void platform_dai_timestamp(struct comp_dev *dai, struct sof_ipc_stream_posn *posn)
void platform_dai_wallclock(struct comp_dev *dai, uint64_t *wallclock)
static uint64_t sof_cycle_get_64(void)
Definition timer.h:18
static uint64_t sys_cycle_get_64_rate(void)
Definition timer.h:26
void platform_host_timestamp(struct comp_dev *host, struct sof_ipc_stream_posn *posn)