mirror of https://github.com/thesofproject/sof.git
cpu: single core: Give the compiler some hints to save memory.
Save memory when only a single core is enabled. Compiler can now see always false/true conditions and optimise out unused TEXT. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
parent
d4af413687
commit
b77149cff3
|
@ -21,6 +21,26 @@
|
|||
#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();
|
||||
|
@ -35,6 +55,7 @@ static inline bool cpu_is_me(int id)
|
|||
{
|
||||
return id == cpu_get_id();
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int cpu_enable_core(int id)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue