forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpu.h
More file actions
93 lines (73 loc) · 1.53 KB
/
cpu.h
File metadata and controls
93 lines (73 loc) · 1.53 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2018 Intel Corporation. All rights reserved.
*
* Author: Tomasz Lauda <tomasz.lauda@linux.intel.com>
*/
/**
* \file xtos/include/sof/lib/cpu.h
* \brief CPU header file
* \authors Tomasz Lauda <tomasz.lauda@linux.intel.com>
*/
#ifndef __SOF_LIB_CPU_H__
#define __SOF_LIB_CPU_H__
#ifndef __ZEPHYR__
#include <platform/lib/cpu.h>
#if !defined(__ASSEMBLER__) && !defined(LINKER)
#include <arch/lib/cpu.h>
#include <stdbool.h>
/* let the compiler optimise when in single core mode */
#if CONFIG_CORE_COUNT == 1
static inline int cpu_get_id(void)
{
return 0;
}
static inline bool cpu_is_primary(int id)
{
return 1;
}
static inline bool cpu_is_me(int id)
{
return 1;
}
#else
static inline int cpu_get_id(void)
{
return arch_cpu_get_id();
}
static inline bool cpu_is_primary(int id)
{
return id == PLATFORM_PRIMARY_CORE_ID;
}
static inline bool cpu_is_me(int id)
{
return id == cpu_get_id();
}
#endif
static inline int cpu_enable_core(int id)
{
return arch_cpu_enable_core(id);
}
static inline void cpu_disable_core(int id)
{
arch_cpu_disable_core(id);
}
static inline int cpu_is_core_enabled(int id)
{
return arch_cpu_is_core_enabled(id);
}
static inline int cpu_enabled_cores(void)
{
return arch_cpu_enabled_cores();
}
static inline int cpu_restore_secondary_cores(void)
{
return arch_cpu_restore_secondary_cores();
}
static inline int cpu_secondary_cores_prepare_d0ix(void)
{
return arch_cpu_secondary_cores_prepare_d0ix();
}
#endif
#endif
#endif /* __SOF_LIB_CPU_H__ */