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
60 lines (46 loc) · 1.05 KB
/
cpu.h
File metadata and controls
60 lines (46 loc) · 1.05 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
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2018 Intel Corporation. All rights reserved.
*
* Author: Tomasz Lauda <tomasz.lauda@linux.intel.com>
*/
/**
* \file 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__
#include <platform/lib/cpu.h>
#if !defined(__ASSEMBLER__) && !defined(LINKER)
#include <arch/lib/cpu.h>
#include <stdbool.h>
#if PLATFORM_CORE_COUNT > MAX_CORE_COUNT
#error "Invalid core count - exceeding core limit"
#endif
static inline int cpu_get_id(void)
{
return arch_cpu_get_id();
}
static inline bool cpu_is_slave(int id)
{
return id != PLATFORM_MASTER_CORE_ID;
}
static inline bool cpu_is_me(int id)
{
return id == cpu_get_id();
}
static inline void cpu_enable_core(int id)
{
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);
}
#endif
#endif /* __SOF_LIB_CPU_H__ */