2 * File: arch/blackfin/oprofile/op_blackfin.h
4 * Author: Anton Blanchard <anton@au.ibm.com>
10 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #define OP_BLACKFIN_H 1
34 #define OP_MAX_COUNTER 2
36 #include <asm/blackfin.h>
38 /* Per-counter configuration as set via oprofilefs. */
39 struct op_counter_config
{
41 unsigned long enabled
;
46 unsigned long unit_mask
;
49 /* System-wide configuration as set via oprofilefs. */
50 struct op_system_config
{
51 unsigned long enable_kernel
;
52 unsigned long enable_user
;
55 /* Per-arch configuration */
56 struct op_bfin533_model
{
57 int (*reg_setup
) (struct op_counter_config
*);
58 int (*start
) (struct op_counter_config
*);
64 extern struct op_bfin533_model op_model_bfin533
;
66 static inline unsigned int ctr_read(void)
70 tmp
= bfin_read_PFCTL();
76 static inline void ctr_write(unsigned int val
)
78 bfin_write_PFCTL(val
);
82 static inline void count_read(unsigned int *count
)
84 count
[0] = bfin_read_PFCNTR0();
85 count
[1] = bfin_read_PFCNTR1();
89 static inline void count_write(unsigned int *count
)
91 bfin_write_PFCNTR0(count
[0]);
92 bfin_write_PFCNTR1(count
[1]);
96 extern int pm_overflow_handler(int irq
, struct pt_regs
*regs
);