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
12#ifndef __ZEPHYR_RTOS_TIMER_H__
13#define __ZEPHYR_RTOS_TIMER_H__
14
15#include <stdint.h>
16#include <zephyr/kernel.h>
17#include <sof/lib/cpu.h>
18#include <rtos/sof.h>
19#include <sof/platform.h>
20
21struct comp_dev;
23
24static inline uint64_t sof_cycle_get_64(void)
25{
26 if (IS_ENABLED(CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER))
27 return k_cycle_get_64();
28 else
29 return k_ticks_to_cyc_floor64(k_uptime_ticks());
30}
31
32static inline uint64_t sys_cycle_get_64_rate(void)
33{
34 return CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
35}
36
37#define sof_cycle_get_64_safe() sof_cycle_get_64()
38#define sof_cycle_get_64_atomic() sof_cycle_get_64()
39#define platform_timer_stop(x)
40
41/* get timestamp for host stream DMA position */
43 struct sof_ipc_stream_posn *posn);
44
45/* get timestamp for DAI stream DMA position */
47 struct sof_ipc_stream_posn *posn);
48
49/* get current wallclock for componnent */
51
52#endif /* __ZEPHYR_RTOS_TIMER_H__ */
CPU header file.
Platform API definition.
Sound Open Firmware global runtime context.
Audio component base device "class" used by all other component types.
Definition component.h:587
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:24
static uint64_t sys_cycle_get_64_rate(void)
Definition timer.h:32
void platform_host_timestamp(struct comp_dev *host, struct sof_ipc_stream_posn *posn)