aboutsummaryrefslogtreecommitdiff
path: root/include/qom/cpu.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-01-15 16:52:39 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2013-01-15 16:52:39 -0600
commitc94bf1c107df6623e54d48b90fb439a1281a36de (patch)
treea4afb786df1d04be6fe2f0f59bf91de0827e2417 /include/qom/cpu.h
parentbdb8872cc14684557db4bef112b02eeb68f4410b (diff)
parente175bce587936bf479889881488821ea8d61c89c (diff)
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
* afaerber/qom-cpu: target-i386: Use switch in check_hw_breakpoints() target-i386: Avoid goto in hw_breakpoint_insert() target-i386: Introduce hw_{local,global}_breakpoint_enabled() target-i386: Define DR7 bit field constants target-i386: Move kvm_check_features_against_host() check to realize time target-i386: cpu_x86_register() consolidate freeing resources target-i386: Move setting defaults out of cpu_x86_parse_featurestr() target-i386: check/enforce: Check all feature words target-i386/cpu.c: Add feature name array for ext4_features target-i386: kvm_check_features_against_host(): Use feature_word_info target-i386/cpu: Introduce FeatureWord typedefs target-i386: Disable kvm_mmu by default kvm: Add fake KVM constants to avoid #ifdefs on KVM-specific code exec: Return CPUState from qemu_get_cpu() xen: Simplify halting of first CPU kvm: Pass CPUState to kvm_init_vcpu() cpu: Move cpu_index field to CPUState cpu: Move numa_node field to CPUState target-mips: Clean up mips_cpu_map_tc() documentation cpu: Move nr_{cores,threads} fields to CPUState Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/qom/cpu.h')
-rw-r--r--include/qom/cpu.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index fbacb2756b..773caf9fa1 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -57,6 +57,10 @@ struct kvm_run;
/**
* CPUState:
+ * @cpu_index: CPU index (informative).
+ * @nr_cores: Number of cores within this CPU package.
+ * @nr_threads: Number of threads within this CPU.
+ * @numa_node: NUMA node this CPU is belonging to.
* @created: Indicates whether the CPU thread has been successfully created.
* @stop: Indicates a pending stop request.
* @stopped: Indicates the CPU has been artificially stopped.
@@ -69,6 +73,10 @@ struct CPUState {
DeviceState parent_obj;
/*< public >*/
+ int nr_cores;
+ int nr_threads;
+ int numa_node;
+
struct QemuThread *thread;
#ifdef _WIN32
HANDLE hThread;
@@ -89,6 +97,7 @@ struct CPUState {
struct kvm_run *kvm_run;
/* TODO Move common fields from CPUArchState here. */
+ int cpu_index; /* used by alpha TCG */
};
@@ -147,5 +156,15 @@ bool cpu_is_stopped(CPUState *cpu);
*/
void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data);
+/**
+ * qemu_get_cpu:
+ * @index: The CPUState@cpu_index value of the CPU to obtain.
+ *
+ * Gets a CPU matching @index.
+ *
+ * Returns: The CPU or %NULL if there is no matching CPU.
+ */
+CPUState *qemu_get_cpu(int index);
+
#endif