Root/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/common/pmu.c

1#include <linux/kernel.h>
2#include <linux/module.h>
3#include <linux/version.h>
4
5#include <ifxmips.h>
6
7void
8ifxmips_pmu_enable(unsigned int module)
9{
10    int err = 1000000;
11
12    ifxmips_w32(ifxmips_r32(IFXMIPS_PMU_PWDCR) & ~module, IFXMIPS_PMU_PWDCR);
13    while (--err && (ifxmips_r32(IFXMIPS_PMU_PWDSR) & module));
14
15    if (!err)
16        panic("activating PMU module failed!");
17}
18EXPORT_SYMBOL(ifxmips_pmu_enable);
19
20void
21ifxmips_pmu_disable(unsigned int module)
22{
23    ifxmips_w32(ifxmips_r32(IFXMIPS_PMU_PWDCR) | module, IFXMIPS_PMU_PWDCR);
24}
25EXPORT_SYMBOL(ifxmips_pmu_disable);
26

Archive Download this file



interactive