diff options
author | Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> | 2012-02-09 06:08:02 -0800 |
---|---|---|
committer | Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> | 2012-02-09 06:08:02 -0800 |
commit | f0d14d7fdbf4a9ea2d02989230d15577670092c7 (patch) | |
tree | 546599f22acd7251f84988073063376628ccf029 /xen/arch/x86/oprofile | |
parent | 5873f70310c716846dd017cd53d5ac2fa7e024e7 (diff) | |
download | xen-f0d14d7fdbf4a9ea2d02989230d15577670092c7.tar.gz xen-f0d14d7fdbf4a9ea2d02989230d15577670092c7.tar.bz2 xen-f0d14d7fdbf4a9ea2d02989230d15577670092c7.zip |
vpmu: Use macros to access struct vpmu_struct.flags
This patch introduces some macros realising the access to the item
'flags' in the struct vpmu_struct (see
xen/include/asm-x86/hvm/vpmu.h). Only bits within 'flags' are
set/reset/checked.
Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/oprofile')
-rw-r--r-- | xen/arch/x86/oprofile/nmi_int.c | 4 | ||||
-rw-r--r-- | xen/arch/x86/oprofile/op_model_ppro.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c index a58a0e9892..dacaca3e6f 100644 --- a/xen/arch/x86/oprofile/nmi_int.c +++ b/xen/arch/x86/oprofile/nmi_int.c @@ -47,7 +47,7 @@ static int passive_domain_msr_op_checks(unsigned int msr, int *typep, int *index if ( !model->is_arch_pmu_msr(msr, typep, indexp) ) return 0; - if ( !(vpmu->flags & PASSIVE_DOMAIN_ALLOCATED) ) + if ( !vpmu_is_set(vpmu, PASSIVE_DOMAIN_ALLOCATED) ) if ( ! model->allocated_msr(current) ) return 0; return 1; @@ -78,7 +78,7 @@ int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content) void passive_domain_destroy(struct vcpu *v) { struct vpmu_struct *vpmu = vcpu_vpmu(v); - if ( vpmu->flags & PASSIVE_DOMAIN_ALLOCATED ) + if ( vpmu_is_set(vpmu, PASSIVE_DOMAIN_ALLOCATED) ) model->free_msr(v); } diff --git a/xen/arch/x86/oprofile/op_model_ppro.c b/xen/arch/x86/oprofile/op_model_ppro.c index e56e5370ba..e2aa859b3e 100644 --- a/xen/arch/x86/oprofile/op_model_ppro.c +++ b/xen/arch/x86/oprofile/op_model_ppro.c @@ -143,7 +143,7 @@ static int ppro_check_ctrs(unsigned int const cpu, xenoprof_log_event(current, regs, eip, mode, i); wrmsrl(msrs->counters[i].addr, -reset_value[i]); if ( is_passive(current->domain) && (mode != 2) && - (vcpu_vpmu(current)->flags & PASSIVE_DOMAIN_ALLOCATED) ) + vpmu_is_set(vcpu_vpmu(current), PASSIVE_DOMAIN_ALLOCATED) ) { if ( IS_ACTIVE(msrs_content[i].control) ) { @@ -230,8 +230,8 @@ static int ppro_allocate_msr(struct vcpu *v) if ( !msr_content ) goto out; vpmu->context = (void *)msr_content; - vpmu->flags = 0; - vpmu->flags |= PASSIVE_DOMAIN_ALLOCATED; + vpmu_clear(vpmu); + vpmu_set(vpmu, PASSIVE_DOMAIN_ALLOCATED); return 1; out: gdprintk(XENLOG_WARNING, "Insufficient memory for oprofile, oprofile is " @@ -244,10 +244,10 @@ static void ppro_free_msr(struct vcpu *v) { struct vpmu_struct *vpmu = vcpu_vpmu(v); - if ( !(vpmu->flags & PASSIVE_DOMAIN_ALLOCATED) ) + if ( !vpmu_is_set(vpmu, PASSIVE_DOMAIN_ALLOCATED) ) return; xfree(vpmu->context); - vpmu->flags &= ~PASSIVE_DOMAIN_ALLOCATED; + vpmu_reset(vpmu, PASSIVE_DOMAIN_ALLOCATED); } static void ppro_load_msr(struct vcpu *v, int type, int index, u64 *msr_content) |