diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2005-03-04 17:34:58 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-04 17:34:58 -0800 |
| commit | e7becb964e374e84ed564b4832f4a966d9878668 (patch) | |
| tree | ea908e8b4b1d6da6c138a28ddd302d844e5c68d3 /include | |
| parent | 2fe0c005382d0498d43cc7a781a7be5a116a42c8 (diff) | |
[PATCH] ppc64: functions to reserve performance monitor hardware
The PPC64 interrupt code includes a hook to call when an exception
from the performance monitor unit occurs. However, there's no way of
reserving the hook properly, so if more than one bit of code tries to
use it things will get ugly. Currently oprofile is the only user, but
there are likely to be more in future e.g. perfctr, if and when it
reaches a fit state for merging.
This patch creates functions to reserve and release the performance
monitor hardware (including its interrupt), and makes oprofile use
them. It also creates a new arch/ppc64/kernel/pmc.c, in which we can
put any future helper functions for handling the performance monitor
counters.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ppc64/pmc.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/asm-ppc64/pmc.h b/include/asm-ppc64/pmc.h new file mode 100644 index 000000000000..c924748c0bea --- /dev/null +++ b/include/asm-ppc64/pmc.h @@ -0,0 +1,29 @@ +/* + * pmc.h + * Copyright (C) 2004 David Gibson, IBM Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _PPC64_PMC_H +#define _PPC64_PMC_H + +#include <asm/ptrace.h> + +typedef void (*perf_irq_t)(struct pt_regs *); + +int reserve_pmc_hardware(perf_irq_t new_perf_irq); +void release_pmc_hardware(void); + +#endif /* _PPC64_PMC_H */ |
