aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-09-06 00:55:35 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-06 02:09:21 -0400
commitdca859329cee9b4cf02c8b7cb805b49973292ed2 (patch)
tree45148a86ec8ad469c4ff81ca7be0a58fde416149 /arch
parent1a410d883023da70806a0190c4bde104545cb9c6 (diff)
[PATCH] ppc64: Move oprofile_impl.h into include/asm-ppc64
Move oprofile_impl.h into include/asm-ppc64 in preparation for moving oprofile_model into cpu feature struct. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc64/oprofile/common.c5
-rw-r--r--arch/ppc64/oprofile/op_impl.h108
-rw-r--r--arch/ppc64/oprofile/op_model_power4.c3
-rw-r--r--arch/ppc64/oprofile/op_model_rs64.c3
4 files changed, 3 insertions, 116 deletions
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index 0260122a8d6c..3e8daabf1021 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -17,11 +17,8 @@
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/pmc.h> 18#include <asm/pmc.h>
19#include <asm/cputable.h> 19#include <asm/cputable.h>
20#include <asm/oprofile_impl.h>
20 21
21#include "op_impl.h"
22
23extern struct op_ppc64_model op_model_rs64;
24extern struct op_ppc64_model op_model_power4;
25static struct op_ppc64_model *model; 22static struct op_ppc64_model *model;
26 23
27static struct op_counter_config ctr[OP_MAX_COUNTER]; 24static struct op_counter_config ctr[OP_MAX_COUNTER];
diff --git a/arch/ppc64/oprofile/op_impl.h b/arch/ppc64/oprofile/op_impl.h
deleted file mode 100644
index 7fa7eaabc035..000000000000
--- a/arch/ppc64/oprofile/op_impl.h
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
3 *
4 * Based on alpha version.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef OP_IMPL_H
13#define OP_IMPL_H 1
14
15#define OP_MAX_COUNTER 8
16
17/* Per-counter configuration as set via oprofilefs. */
18struct op_counter_config {
19 unsigned long valid;
20 unsigned long enabled;
21 unsigned long event;
22 unsigned long count;
23 unsigned long kernel;
24 /* We dont support per counter user/kernel selection */
25 unsigned long user;
26 unsigned long unit_mask;
27};
28
29/* System-wide configuration as set via oprofilefs. */
30struct op_system_config {
31 unsigned long mmcr0;
32 unsigned long mmcr1;
33 unsigned long mmcra;
34 unsigned long enable_kernel;
35 unsigned long enable_user;
36 unsigned long backtrace_spinlocks;
37};
38
39/* Per-arch configuration */
40struct op_ppc64_model {
41 void (*reg_setup) (struct op_counter_config *,
42 struct op_system_config *,
43 int num_counters);
44 void (*cpu_setup) (void *);
45 void (*start) (struct op_counter_config *);
46 void (*stop) (void);
47 void (*handle_interrupt) (struct pt_regs *,
48 struct op_counter_config *);
49 int num_counters;
50};
51
52static inline unsigned int ctr_read(unsigned int i)
53{
54 switch(i) {
55 case 0:
56 return mfspr(SPRN_PMC1);
57 case 1:
58 return mfspr(SPRN_PMC2);
59 case 2:
60 return mfspr(SPRN_PMC3);
61 case 3:
62 return mfspr(SPRN_PMC4);
63 case 4:
64 return mfspr(SPRN_PMC5);
65 case 5:
66 return mfspr(SPRN_PMC6);
67 case 6:
68 return mfspr(SPRN_PMC7);
69 case 7:
70 return mfspr(SPRN_PMC8);
71 default:
72 return 0;
73 }
74}
75
76static inline void ctr_write(unsigned int i, unsigned int val)
77{
78 switch(i) {
79 case 0:
80 mtspr(SPRN_PMC1, val);
81 break;
82 case 1:
83 mtspr(SPRN_PMC2, val);
84 break;
85 case 2:
86 mtspr(SPRN_PMC3, val);
87 break;
88 case 3:
89 mtspr(SPRN_PMC4, val);
90 break;
91 case 4:
92 mtspr(SPRN_PMC5, val);
93 break;
94 case 5:
95 mtspr(SPRN_PMC6, val);
96 break;
97 case 6:
98 mtspr(SPRN_PMC7, val);
99 break;
100 case 7:
101 mtspr(SPRN_PMC8, val);
102 break;
103 default:
104 break;
105 }
106}
107
108#endif
diff --git a/arch/ppc64/oprofile/op_model_power4.c b/arch/ppc64/oprofile/op_model_power4.c
index e469610efde5..32b2bb5625fe 100644
--- a/arch/ppc64/oprofile/op_model_power4.c
+++ b/arch/ppc64/oprofile/op_model_power4.c
@@ -16,11 +16,10 @@
16#include <asm/cputable.h> 16#include <asm/cputable.h>
17#include <asm/systemcfg.h> 17#include <asm/systemcfg.h>
18#include <asm/rtas.h> 18#include <asm/rtas.h>
19#include <asm/oprofile_impl.h>
19 20
20#define dbg(args...) 21#define dbg(args...)
21 22
22#include "op_impl.h"
23
24static unsigned long reset_value[OP_MAX_COUNTER]; 23static unsigned long reset_value[OP_MAX_COUNTER];
25 24
26static int oprofile_running; 25static int oprofile_running;
diff --git a/arch/ppc64/oprofile/op_model_rs64.c b/arch/ppc64/oprofile/op_model_rs64.c
index bcec506c266a..08c5b333f5c4 100644
--- a/arch/ppc64/oprofile/op_model_rs64.c
+++ b/arch/ppc64/oprofile/op_model_rs64.c
@@ -14,11 +14,10 @@
14#include <asm/system.h> 14#include <asm/system.h>
15#include <asm/processor.h> 15#include <asm/processor.h>
16#include <asm/cputable.h> 16#include <asm/cputable.h>
17#include <asm/oprofile_impl.h>
17 18
18#define dbg(args...) 19#define dbg(args...)
19 20
20#include "op_impl.h"
21
22static void ctrl_write(unsigned int i, unsigned int val) 21static void ctrl_write(unsigned int i, unsigned int val)
23{ 22{
24 unsigned int tmp = 0; 23 unsigned int tmp = 0;