Linux 2.6.25.3
[linux/fpc-iii.git] / arch / blackfin / oprofile / op_blackfin.h
blob05dd08c9d1549e3c498c561f5ede90c453d6d823
1 /*
2 * File: arch/blackfin/oprofile/op_blackfin.h
3 * Based on:
4 * Author: Anton Blanchard <anton@au.ibm.com>
6 * Created:
7 * Description:
9 * Modified:
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
31 #ifndef OP_BLACKFIN_H
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 {
40 unsigned long valid;
41 unsigned long enabled;
42 unsigned long event;
43 unsigned long count;
44 unsigned long kernel;
45 unsigned long user;
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 *);
59 void (*stop) (void);
60 int num_counters;
61 char *name;
64 extern struct op_bfin533_model op_model_bfin533;
66 static inline unsigned int ctr_read(void)
68 unsigned int tmp;
70 tmp = bfin_read_PFCTL();
71 CSYNC();
73 return tmp;
76 static inline void ctr_write(unsigned int val)
78 bfin_write_PFCTL(val);
79 CSYNC();
82 static inline void count_read(unsigned int *count)
84 count[0] = bfin_read_PFCNTR0();
85 count[1] = bfin_read_PFCNTR1();
86 CSYNC();
89 static inline void count_write(unsigned int *count)
91 bfin_write_PFCNTR0(count[0]);
92 bfin_write_PFCNTR1(count[1]);
93 CSYNC();
96 extern int pm_overflow_handler(int irq, struct pt_regs *regs);
98 #endif