diff options
author | Bharata B Rao <bharata@linux.vnet.ibm.com> | 2015-07-02 16:23:16 +1000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-07-07 17:44:52 +0200 |
commit | 8487d1231830917099c801e4f2f0e698e8535063 (patch) | |
tree | adac73e4cc0bf5b938813527d4a0467229a0918b /include/qom | |
parent | db4ef288f4a6d285b39dc8ac477092d76971a300 (diff) |
cpus: Add a macro to walk CPUs in reverse
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>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/qom')
-rw-r--r-- | include/qom/cpu.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 39f0f19fb0..42f42f5a2d 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); |