Message ID | 1434432618-19035-4-git-send-email-bharata@linux.vnet.ibm.com |
---|---|
State | New |
Headers | show |
On Tue, Jun 16, 2015 at 11:00:14AM +0530, Bharata B Rao wrote: > Add CPU_FOREACH_REVERSE that walks CPUs in reverse. > > Needed for PowerPC CPU device tree reorganization. > > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> > Reviewed-by: Andreas Färber <afaerber@suse.de> Andreas, I've put this into spapr-next tentatively. Are you ok with this being merged from there, or shoud it go through a different tree?
diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 39f0f19..42f42f5 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -323,6 +323,8 @@ extern struct CPUTailQ cpus; #define CPU_FOREACH(cpu) QTAILQ_FOREACH(cpu, &cpus, node) #define CPU_FOREACH_SAFE(cpu, next_cpu) \ QTAILQ_FOREACH_SAFE(cpu, &cpus, node, next_cpu) +#define CPU_FOREACH_REVERSE(cpu) \ + QTAILQ_FOREACH_REVERSE(cpu, &cpus, CPUTailQ, node) #define first_cpu QTAILQ_FIRST(&cpus) DECLARE_TLS(CPUState *, current_cpu);