commit | 7d5e55389f7c0d798be1ef4217fa0fac3ef34db8 | [log] [tgz] |
---|---|---|
author | Olivier Deprez <olivier.deprez@arm.com> | Tue Sep 22 15:06:58 2020 +0200 |
committer | Olivier Deprez <olivier.deprez@arm.com> | Mon Sep 28 12:20:47 2020 +0200 |
tree | c40791742a6e6578314d17045cdea54b6a13f814 | |
parent | 41890ffad4b624404f509f617c9dd2b3f35f41fc [diff] |
Provide get cpu by index helper Change-Id: I0d080e7a70bca25c80470e5a5d10c7f800a30d48 Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/src/cpu.c b/src/cpu.c index 384814b..0a3fc6f 100644 --- a/src/cpu.c +++ b/src/cpu.c
@@ -118,6 +118,14 @@ return c - cpus; } +/* + * Return cpu with the given index. + */ +struct cpu *cpu_find_index(size_t index) +{ + return (index < MAX_CPUS) ? &cpus[index] : NULL; +} + /** * Turns CPU on and returns the previous state. */