diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-11-29 15:36:42 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-03 21:49:12 -0600 |
commit | f84a8a1c749d8ee7b5e91d5a04a98c6332c182b1 (patch) | |
tree | 415c2806cec79189632d660815df3f8ac105c5e1 /include | |
parent | ff230a3e9cdfd493c85de33407ae03875af80d2f (diff) | |
download | skiboot-f84a8a1c749d8ee7b5e91d5a04a98c6332c182b1.zip skiboot-f84a8a1c749d8ee7b5e91d5a04a98c6332c182b1.tar.gz skiboot-f84a8a1c749d8ee7b5e91d5a04a98c6332c182b1.tar.bz2 |
fast-reboot: clean up some common cpu iteration processes with macros
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/cpu.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/cpu.h b/include/cpu.h index 5db4ccb..3d5dbd4 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -190,6 +190,10 @@ extern struct cpu_thread *first_available_cpu(void); extern struct cpu_thread *next_available_cpu(struct cpu_thread *cpu); extern struct cpu_thread *first_present_cpu(void); extern struct cpu_thread *next_present_cpu(struct cpu_thread *cpu); +extern struct cpu_thread *first_ungarded_cpu(void); +extern struct cpu_thread *next_ungarded_cpu(struct cpu_thread *cpu); +extern struct cpu_thread *first_ungarded_primary(void); +extern struct cpu_thread *next_ungarded_primary(struct cpu_thread *cpu); #define for_each_cpu(cpu) \ for (cpu = first_cpu(); cpu; cpu = next_cpu(cpu)) @@ -200,6 +204,12 @@ extern struct cpu_thread *next_present_cpu(struct cpu_thread *cpu); #define for_each_present_cpu(cpu) \ for (cpu = first_present_cpu(); cpu; cpu = next_present_cpu(cpu)) +#define for_each_ungarded_cpu(cpu) \ + for (cpu = first_ungarded_cpu(); cpu; cpu = next_ungarded_cpu(cpu)) + +#define for_each_ungarded_primary(cpu) \ + for (cpu = first_ungarded_primary(); cpu; cpu = next_ungarded_primary(cpu)) + extern struct cpu_thread *first_available_core_in_chip(u32 chip_id); extern struct cpu_thread *next_available_core_in_chip(struct cpu_thread *cpu, u32 chip_id); extern u8 get_available_nr_cores_in_chip(u32 chip_id); |