xref: /OK3568_Linux_fs/kernel/arch/alpha/oprofile/op_impl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /**
2*4882a593Smuzhiyun  * @file arch/alpha/oprofile/op_impl.h
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * @remark Copyright 2002 OProfile authors
5*4882a593Smuzhiyun  * @remark Read the file COPYING
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * @author Richard Henderson <rth@twiddle.net>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #ifndef OP_IMPL_H
11*4882a593Smuzhiyun #define OP_IMPL_H 1
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun /* Per-counter configuration as set via oprofilefs.  */
14*4882a593Smuzhiyun struct op_counter_config {
15*4882a593Smuzhiyun 	unsigned long enabled;
16*4882a593Smuzhiyun 	unsigned long event;
17*4882a593Smuzhiyun 	unsigned long count;
18*4882a593Smuzhiyun 	/* Dummies because I am too lazy to hack the userspace tools.  */
19*4882a593Smuzhiyun 	unsigned long kernel;
20*4882a593Smuzhiyun 	unsigned long user;
21*4882a593Smuzhiyun 	unsigned long unit_mask;
22*4882a593Smuzhiyun };
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun /* System-wide configuration as set via oprofilefs.  */
25*4882a593Smuzhiyun struct op_system_config {
26*4882a593Smuzhiyun 	unsigned long enable_pal;
27*4882a593Smuzhiyun 	unsigned long enable_kernel;
28*4882a593Smuzhiyun 	unsigned long enable_user;
29*4882a593Smuzhiyun };
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun /* Cached values for the various performance monitoring registers.  */
32*4882a593Smuzhiyun struct op_register_config {
33*4882a593Smuzhiyun 	unsigned long enable;
34*4882a593Smuzhiyun 	unsigned long mux_select;
35*4882a593Smuzhiyun 	unsigned long proc_mode;
36*4882a593Smuzhiyun 	unsigned long freq;
37*4882a593Smuzhiyun 	unsigned long reset_values;
38*4882a593Smuzhiyun 	unsigned long need_reset;
39*4882a593Smuzhiyun };
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun /* Per-architecture configuration and hooks.  */
42*4882a593Smuzhiyun struct op_axp_model {
43*4882a593Smuzhiyun 	void (*reg_setup) (struct op_register_config *,
44*4882a593Smuzhiyun 			   struct op_counter_config *,
45*4882a593Smuzhiyun 			   struct op_system_config *);
46*4882a593Smuzhiyun 	void (*cpu_setup) (void *);
47*4882a593Smuzhiyun 	void (*reset_ctr) (struct op_register_config *, unsigned long);
48*4882a593Smuzhiyun 	void (*handle_interrupt) (unsigned long, struct pt_regs *,
49*4882a593Smuzhiyun 				  struct op_counter_config *);
50*4882a593Smuzhiyun 	char *cpu_type;
51*4882a593Smuzhiyun 	unsigned char num_counters;
52*4882a593Smuzhiyun 	unsigned char can_set_proc_mode;
53*4882a593Smuzhiyun };
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun #endif
56