forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.h
More file actions
44 lines (32 loc) · 838 Bytes
/
kernel.h
File metadata and controls
44 lines (32 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2022 Intel Corporation. All rights reserved.
*
* Author: Jyri Sarha <jyri.sarha@intel.com>
*/
#ifndef __XTOS_RTOS_KERNEL_H__
#define __XTOS_RTOS_KERNEL_H__
#include <rtos/wait.h>
#include <stdint.h>
#ifdef __ZEPHYR__
#error "This file should only be included in XTOS builds."
#endif
typedef uint32_t k_ticks_t;
typedef struct {
k_ticks_t ticks;
} k_timeout_t;
#define Z_TIMEOUT_TICKS(t) ((k_timeout_t) { .ticks = (t) })
#define Z_TIMEOUT_US(t) ((k_timeout_t) { .ticks = clock_us_to_ticks(PLATFORM_DEFAULT_CLOCK, t) })
static inline void k_sleep(k_timeout_t timeout)
{
wait_delay(timeout.ticks);
}
static inline void k_msleep(int32_t ms)
{
wait_delay_ms(ms);
}
static inline void k_usleep(int32_t us)
{
wait_delay_us(us);
}
#endif /* __XTOS_RTOS_KERNEL_H__ */