sh: add SMP method selection to device tree pseudo-board
Allow selection of plat_smp_ops based on the enable-method cpu property from device tree and provide dummy ops for booting with a device tree that does not enable SMP. Signed-off-by: Rich Felker <dalias@libc.org>
This commit is contained in:
@@ -69,6 +69,16 @@ static inline int hard_smp_processor_id(void)
|
||||
return mp_ops->smp_processor_id();
|
||||
}
|
||||
|
||||
struct of_cpu_method {
|
||||
const char *method;
|
||||
struct plat_smp_ops *ops;
|
||||
};
|
||||
|
||||
#define CPU_METHOD_OF_DECLARE(name, _method, _ops) \
|
||||
static const struct of_cpu_method __cpu_method_of_table_##name \
|
||||
__used __section(__cpu_method_of_table) \
|
||||
= { .method = _method, .ops = _ops }
|
||||
|
||||
#else
|
||||
|
||||
#define hard_smp_processor_id() (0)
|
||||
|
Reference in New Issue
Block a user