diff options
Diffstat (limited to 'arch/avr32/kernel/cpu.c')
-rw-r--r-- | arch/avr32/kernel/cpu.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c index b8409caeb23d..e84faffbbeca 100644 --- a/arch/avr32/kernel/cpu.c +++ b/arch/avr32/kernel/cpu.c | |||
@@ -26,14 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); | |||
26 | * XXX: If/when a SMP-capable implementation of AVR32 will ever be | 26 | * XXX: If/when a SMP-capable implementation of AVR32 will ever be |
27 | * made, we must make sure that the code executes on the correct CPU. | 27 | * made, we must make sure that the code executes on the correct CPU. |
28 | */ | 28 | */ |
29 | static ssize_t show_pc0event(struct sys_device *dev, char *buf) | 29 | static ssize_t show_pc0event(struct sys_device *dev, |
30 | struct sysdev_attribute *attr, char *buf) | ||
30 | { | 31 | { |
31 | unsigned long pccr; | 32 | unsigned long pccr; |
32 | 33 | ||
33 | pccr = sysreg_read(PCCR); | 34 | pccr = sysreg_read(PCCR); |
34 | return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f); | 35 | return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f); |
35 | } | 36 | } |
36 | static ssize_t store_pc0event(struct sys_device *dev, const char *buf, | 37 | static ssize_t store_pc0event(struct sys_device *dev, |
38 | struct sysdev_attribute *attr, const char *buf, | ||
37 | size_t count) | 39 | size_t count) |
38 | { | 40 | { |
39 | unsigned long val; | 41 | unsigned long val; |
@@ -46,15 +48,17 @@ static ssize_t store_pc0event(struct sys_device *dev, const char *buf, | |||
46 | sysreg_write(PCCR, val); | 48 | sysreg_write(PCCR, val); |
47 | return count; | 49 | return count; |
48 | } | 50 | } |
49 | static ssize_t show_pc0count(struct sys_device *dev, char *buf) | 51 | static ssize_t show_pc0count(struct sys_device *dev, |
52 | struct sysdev_attribute *attr, char *buf) | ||
50 | { | 53 | { |
51 | unsigned long pcnt0; | 54 | unsigned long pcnt0; |
52 | 55 | ||
53 | pcnt0 = sysreg_read(PCNT0); | 56 | pcnt0 = sysreg_read(PCNT0); |
54 | return sprintf(buf, "%lu\n", pcnt0); | 57 | return sprintf(buf, "%lu\n", pcnt0); |
55 | } | 58 | } |
56 | static ssize_t store_pc0count(struct sys_device *dev, const char *buf, | 59 | static ssize_t store_pc0count(struct sys_device *dev, |
57 | size_t count) | 60 | struct sysdev_attribute *attr, |
61 | const char *buf, size_t count) | ||
58 | { | 62 | { |
59 | unsigned long val; | 63 | unsigned long val; |
60 | char *endp; | 64 | char *endp; |
@@ -67,14 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev, const char *buf, | |||
67 | return count; | 71 | return count; |
68 | } | 72 | } |
69 | 73 | ||
70 | static ssize_t show_pc1event(struct sys_device *dev, char *buf) | 74 | static ssize_t show_pc1event(struct sys_device *dev, |
75 | struct sysdev_attribute *attr, char *buf) | ||
71 | { | 76 | { |
72 | unsigned long pccr; | 77 | unsigned long pccr; |
73 | 78 | ||
74 | pccr = sysreg_read(PCCR); | 79 | pccr = sysreg_read(PCCR); |
75 | return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f); | 80 | return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f); |
76 | } | 81 | } |
77 | static ssize_t store_pc1event(struct sys_device *dev, const char *buf, | 82 | static ssize_t store_pc1event(struct sys_device *dev, |
83 | struct sysdev_attribute *attr, const char *buf, | ||
78 | size_t count) | 84 | size_t count) |
79 | { | 85 | { |
80 | unsigned long val; | 86 | unsigned long val; |
@@ -87,14 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev, const char *buf, | |||
87 | sysreg_write(PCCR, val); | 93 | sysreg_write(PCCR, val); |
88 | return count; | 94 | return count; |
89 | } | 95 | } |
90 | static ssize_t show_pc1count(struct sys_device *dev, char *buf) | 96 | static ssize_t show_pc1count(struct sys_device *dev, |
97 | struct sysdev_attribute *attr, char *buf) | ||
91 | { | 98 | { |
92 | unsigned long pcnt1; | 99 | unsigned long pcnt1; |
93 | 100 | ||
94 | pcnt1 = sysreg_read(PCNT1); | 101 | pcnt1 = sysreg_read(PCNT1); |
95 | return sprintf(buf, "%lu\n", pcnt1); | 102 | return sprintf(buf, "%lu\n", pcnt1); |
96 | } | 103 | } |
97 | static ssize_t store_pc1count(struct sys_device *dev, const char *buf, | 104 | static ssize_t store_pc1count(struct sys_device *dev, |
105 | struct sysdev_attribute *attr, const char *buf, | ||
98 | size_t count) | 106 | size_t count) |
99 | { | 107 | { |
100 | unsigned long val; | 108 | unsigned long val; |
@@ -108,14 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev, const char *buf, | |||
108 | return count; | 116 | return count; |
109 | } | 117 | } |
110 | 118 | ||
111 | static ssize_t show_pccycles(struct sys_device *dev, char *buf) | 119 | static ssize_t show_pccycles(struct sys_device *dev, |
120 | struct sysdev_attribute *attr, char *buf) | ||
112 | { | 121 | { |
113 | unsigned long pccnt; | 122 | unsigned long pccnt; |
114 | 123 | ||
115 | pccnt = sysreg_read(PCCNT); | 124 | pccnt = sysreg_read(PCCNT); |
116 | return sprintf(buf, "%lu\n", pccnt); | 125 | return sprintf(buf, "%lu\n", pccnt); |
117 | } | 126 | } |
118 | static ssize_t store_pccycles(struct sys_device *dev, const char *buf, | 127 | static ssize_t store_pccycles(struct sys_device *dev, |
128 | struct sysdev_attribute *attr, const char *buf, | ||
119 | size_t count) | 129 | size_t count) |
120 | { | 130 | { |
121 | unsigned long val; | 131 | unsigned long val; |
@@ -129,14 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev, const char *buf, | |||
129 | return count; | 139 | return count; |
130 | } | 140 | } |
131 | 141 | ||
132 | static ssize_t show_pcenable(struct sys_device *dev, char *buf) | 142 | static ssize_t show_pcenable(struct sys_device *dev, |
143 | struct sysdev_attribute *attr, char *buf) | ||
133 | { | 144 | { |
134 | unsigned long pccr; | 145 | unsigned long pccr; |
135 | 146 | ||
136 | pccr = sysreg_read(PCCR); | 147 | pccr = sysreg_read(PCCR); |
137 | return sprintf(buf, "%c\n", (pccr & 1)?'1':'0'); | 148 | return sprintf(buf, "%c\n", (pccr & 1)?'1':'0'); |
138 | } | 149 | } |
139 | static ssize_t store_pcenable(struct sys_device *dev, const char *buf, | 150 | static ssize_t store_pcenable(struct sys_device *dev, |
151 | struct sysdev_attribute *attr, const char *buf, | ||
140 | size_t count) | 152 | size_t count) |
141 | { | 153 | { |
142 | unsigned long pccr, val; | 154 | unsigned long pccr, val; |