[POWERPC] cell: add low-level performance monitoring code
[linux-2.6] / arch / powerpc / platforms / cell / pmu.h
1 /*
2  * Cell Broadband Engine Performance Monitor
3  *
4  * (C) Copyright IBM Corporation 2001,2006
5  *
6  * Author:
7  *   David Erb (djerb@us.ibm.com)
8  *   Kevin Corry (kevcorry@us.ibm.com)
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2, or (at your option)
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24
25 #ifndef __PERFMON_H__
26 #define __PERFMON_H__
27
28 enum pm_reg_name {
29         group_control,
30         debug_bus_control,
31         trace_address,
32         ext_tr_timer,
33         pm_status,
34         pm_control,
35         pm_interval,
36         pm_start_stop,
37 };
38
39 extern u32  cbe_read_phys_ctr(u32 cpu, u32 phys_ctr);
40 extern void cbe_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val);
41 extern u32  cbe_read_ctr(u32 cpu, u32 ctr);
42 extern void cbe_write_ctr(u32 cpu, u32 ctr, u32 val);
43
44 extern u32  cbe_read_pm07_control(u32 cpu, u32 ctr);
45 extern void cbe_write_pm07_control(u32 cpu, u32 ctr, u32 val);
46 extern u32  cbe_read_pm (u32 cpu, enum pm_reg_name reg);
47 extern void cbe_write_pm (u32 cpu, enum pm_reg_name reg, u32 val);
48
49 extern u32  cbe_get_ctr_size(u32 cpu, u32 phys_ctr);
50 extern void cbe_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size);
51
52 extern void cbe_enable_pm(u32 cpu);
53 extern void cbe_disable_pm(u32 cpu);
54
55 extern void cbe_read_trace_buffer(u32 cpu, u64 *buf);
56
57 #endif