diff options
author | jkoshy <jkoshy@FreeBSD.org> | 2005-04-28 08:13:19 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 2005-04-28 08:13:19 +0000 |
commit | cb5a9ccd732dad2fb703d20cb1775266c9a916df (patch) | |
tree | 6d64ad42ff8aec2fef5909520668bd5172f0949c /sys/sys/pmc.h | |
parent | b38862d9b3350743b801238ea0108b7ae70baabf (diff) | |
download | FreeBSD-src-cb5a9ccd732dad2fb703d20cb1775266c9a916df.zip FreeBSD-src-cb5a9ccd732dad2fb703d20cb1775266c9a916df.tar.gz |
Return the correct register number in the 'get_msr()' MD function.
Only allow a process to use the x86 RDPMC instruction if it has
allocated and attached a PMC to itself.
Inform the MD layer of the "pseudo context switch out" that needs
to be done when the last thread of a process is exiting.
Diffstat (limited to 'sys/sys/pmc.h')
-rw-r--r-- | sys/sys/pmc.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index b2a3479..76baa16 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -1158,6 +1158,7 @@ struct pmc_targetstate { struct pmc_process { LIST_ENTRY(pmc_process) pp_next; /* hash chain */ int pp_refcnt; /* reference count */ + uint32_t pp_flags; /* flags */ struct proc *pp_proc; /* target thread */ struct pmc_targetstate pp_pmcs[]; /* NHWPMCs */ }; @@ -1183,9 +1184,10 @@ struct pmc_owner { int po_logfd; /* XXX for now */ }; -#define PMC_FLAG_IS_OWNER 0x01 -#define PMC_FLAG_HAS_TS_PMC 0x02 -#define PMC_FLAG_OWNS_LOGFILE 0x04 /* owns system-sampling log file */ +#define PMC_FLAG_IS_OWNER 0x01 +#define PMC_FLAG_HAS_TS_PMC 0x02 +#define PMC_FLAG_OWNS_LOGFILE 0x04 +#define PMC_FLAG_ENABLE_MSR_ACCESS 0x08 /* * struct pmc_hw -- describe the state of the PMC hardware @@ -1283,11 +1285,9 @@ struct pmc_mdep { int (*pmd_init)(int _cpu); /* machine dependent initialization */ int (*pmd_cleanup)(int _cpu); /* machine dependent cleanup */ - /* thread context switch in */ - int (*pmd_switch_in)(struct pmc_cpu *_p); - - /* thread context switch out */ - int (*pmd_switch_out)(struct pmc_cpu *_p); + /* thread context switch in/out */ + int (*pmd_switch_in)(struct pmc_cpu *_p, struct pmc_process *_pp); + int (*pmd_switch_out)(struct pmc_cpu *_p, struct pmc_process *_pp); /* configuring/reading/writing the hardware PMCs */ int (*pmd_config_pmc)(int _cpu, int _ri, struct pmc *_pm); |