summaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile/nmi_int.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-07-10 15:47:17 +0200
committerRobert Richter <robert.richter@amd.com>2009-07-20 16:43:21 +0200
commit61d149d5248ad7428801cdede0f5fcc2b90cd61c (patch)
tree7cfc04e6567cf34f2cba40f86287a51566d163ad /arch/x86/oprofile/nmi_int.c
parent1b294f5960cd89e49eeb3e797860c552b03f2272 (diff)
x86/oprofile: Implement op_x86_virt_to_phys()
This patch implements a common x86 function to convert virtual counter numbers to physical. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile/nmi_int.c')
-rw-r--r--arch/x86/oprofile/nmi_int.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 7b3362f9abd..5856e61cb09 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -129,6 +129,11 @@ inline int op_x86_phys_to_virt(int phys)
return __get_cpu_var(switch_index) + phys;
}
+inline int op_x86_virt_to_phys(int virt)
+{
+ return virt % model->num_counters;
+}
+
static void nmi_shutdown_mux(void)
{
int i;
@@ -270,6 +275,7 @@ static void mux_clone(int cpu)
#else
inline int op_x86_phys_to_virt(int phys) { return phys; }
+inline int op_x86_virt_to_phys(int virt) { return virt; }
static inline void nmi_shutdown_mux(void) { }
static inline int nmi_setup_mux(void) { return 1; }
static inline void