Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196781
b: refs/heads/master
c: 86e5a52
h: refs/heads/master
i:
  196779: 0537f6d
v: v3
  • Loading branch information
Wu Zhangjin authored and Ralf Baechle committed May 21, 2010
1 parent 85cdf78 commit c003e1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0103d23f44b1e9f8d2e89cc197e21192f6914f24
refs/heads/master: 86e5a5202148736bffed49499a1dc8c1a311d3ab
8 changes: 4 additions & 4 deletions trunk/arch/mips/oprofile/op_model_loongson2.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
*/
#define LOONGSON2_CPU_TYPE "mips/loongson2"

#define LOONGSON2_COUNTER1_EVENT(event) ((event & 0x0f) << 5)
#define LOONGSON2_COUNTER2_EVENT(event) ((event & 0x0f) << 9)
#define LOONGSON2_PERFCTRL_EVENT(idx, event) \
(((event) & 0x0f) << ((idx) ? 9 : 5))

#define LOONGSON2_PERFCNT_EXL (1UL << 0)
#define LOONGSON2_PERFCNT_KERNEL (1UL << 1)
Expand Down Expand Up @@ -60,12 +60,12 @@ static void loongson2_reg_setup(struct op_counter_config *cfg)
/* Compute the performance counter ctrl word. */
/* For now count kernel and user mode */
if (cfg[0].enabled) {
ctrl |= LOONGSON2_COUNTER1_EVENT(cfg[0].event);
ctrl |= LOONGSON2_PERFCTRL_EVENT(0, cfg[0].event);
reg.reset_counter1 = 0x80000000ULL - cfg[0].count;
}

if (cfg[1].enabled) {
ctrl |= LOONGSON2_COUNTER2_EVENT(cfg[1].event);
ctrl |= LOONGSON2_PERFCTRL_EVENT(1, cfg[1].event);
reg.reset_counter2 = (0x80000000ULL - cfg[1].count);
}

Expand Down

0 comments on commit c003e1e

Please sign in to comment.