diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/xtensa/kernel | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r-- | arch/xtensa/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/irq.c | 100 | ||||
-rw-r--r-- | arch/xtensa/kernel/ptrace.c | 14 | ||||
-rw-r--r-- | arch/xtensa/kernel/time.c | 6 | ||||
-rw-r--r-- | arch/xtensa/kernel/vmlinux.lds.S | 2 |
5 files changed, 40 insertions, 84 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 5fd01f6aaf37..6223f3346b5c 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -1026,7 +1026,7 @@ ENTRY(fast_syscall_unrecoverable) | |||
1026 | * TRY adds an entry to the __ex_table fixup table for the immediately | 1026 | * TRY adds an entry to the __ex_table fixup table for the immediately |
1027 | * following instruction. | 1027 | * following instruction. |
1028 | * | 1028 | * |
1029 | * CATCH catches any exception that occurred at one of the preceeding TRY | 1029 | * CATCH catches any exception that occurred at one of the preceding TRY |
1030 | * statements and continues from there | 1030 | * statements and continues from there |
1031 | * | 1031 | * |
1032 | * Usage TRY l32i a0, a1, 0 | 1032 | * Usage TRY l32i a0, a1, 0 |
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index c64a5d387de5..4340ee076bd5 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c | |||
@@ -35,7 +35,6 @@ atomic_t irq_err_count; | |||
35 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs) | 35 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs) |
36 | { | 36 | { |
37 | struct pt_regs *old_regs = set_irq_regs(regs); | 37 | struct pt_regs *old_regs = set_irq_regs(regs); |
38 | struct irq_desc *desc = irq_desc + irq; | ||
39 | 38 | ||
40 | if (irq >= NR_IRQS) { | 39 | if (irq >= NR_IRQS) { |
41 | printk(KERN_EMERG "%s: cannot handle IRQ %d\n", | 40 | printk(KERN_EMERG "%s: cannot handle IRQ %d\n", |
@@ -57,104 +56,63 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) | |||
57 | sp - sizeof(struct thread_info)); | 56 | sp - sizeof(struct thread_info)); |
58 | } | 57 | } |
59 | #endif | 58 | #endif |
60 | desc->handle_irq(irq, desc); | 59 | generic_handle_irq(irq); |
61 | 60 | ||
62 | irq_exit(); | 61 | irq_exit(); |
63 | set_irq_regs(old_regs); | 62 | set_irq_regs(old_regs); |
64 | } | 63 | } |
65 | 64 | ||
66 | /* | 65 | int arch_show_interrupts(struct seq_file *p, int prec) |
67 | * Generic, controller-independent functions: | ||
68 | */ | ||
69 | |||
70 | int show_interrupts(struct seq_file *p, void *v) | ||
71 | { | 66 | { |
72 | int i = *(loff_t *) v, j; | 67 | seq_printf(p, "%*s: ", prec, "ERR"); |
73 | struct irqaction * action; | 68 | seq_printf(p, "%10u\n", atomic_read(&irq_err_count)); |
74 | unsigned long flags; | ||
75 | |||
76 | if (i == 0) { | ||
77 | seq_printf(p, " "); | ||
78 | for_each_online_cpu(j) | ||
79 | seq_printf(p, "CPU%d ",j); | ||
80 | seq_putc(p, '\n'); | ||
81 | } | ||
82 | |||
83 | if (i < NR_IRQS) { | ||
84 | raw_spin_lock_irqsave(&irq_desc[i].lock, flags); | ||
85 | action = irq_desc[i].action; | ||
86 | if (!action) | ||
87 | goto skip; | ||
88 | seq_printf(p, "%3d: ",i); | ||
89 | #ifndef CONFIG_SMP | ||
90 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
91 | #else | ||
92 | for_each_online_cpu(j) | ||
93 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | ||
94 | #endif | ||
95 | seq_printf(p, " %14s", irq_desc[i].chip->typename); | ||
96 | seq_printf(p, " %s", action->name); | ||
97 | |||
98 | for (action=action->next; action; action = action->next) | ||
99 | seq_printf(p, ", %s", action->name); | ||
100 | |||
101 | seq_putc(p, '\n'); | ||
102 | skip: | ||
103 | raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); | ||
104 | } else if (i == NR_IRQS) { | ||
105 | seq_printf(p, "NMI: "); | ||
106 | for_each_online_cpu(j) | ||
107 | seq_printf(p, "%10u ", nmi_count(j)); | ||
108 | seq_putc(p, '\n'); | ||
109 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); | ||
110 | } | ||
111 | return 0; | 69 | return 0; |
112 | } | 70 | } |
113 | 71 | ||
114 | static void xtensa_irq_mask(unsigned int irq) | 72 | static void xtensa_irq_mask(struct irq_data *d) |
115 | { | 73 | { |
116 | cached_irq_mask &= ~(1 << irq); | 74 | cached_irq_mask &= ~(1 << d->irq); |
117 | set_sr (cached_irq_mask, INTENABLE); | 75 | set_sr (cached_irq_mask, INTENABLE); |
118 | } | 76 | } |
119 | 77 | ||
120 | static void xtensa_irq_unmask(unsigned int irq) | 78 | static void xtensa_irq_unmask(struct irq_data *d) |
121 | { | 79 | { |
122 | cached_irq_mask |= 1 << irq; | 80 | cached_irq_mask |= 1 << d->irq; |
123 | set_sr (cached_irq_mask, INTENABLE); | 81 | set_sr (cached_irq_mask, INTENABLE); |
124 | } | 82 | } |
125 | 83 | ||
126 | static void xtensa_irq_enable(unsigned int irq) | 84 | static void xtensa_irq_enable(struct irq_data *d) |
127 | { | 85 | { |
128 | variant_irq_enable(irq); | 86 | variant_irq_enable(d->irq); |
129 | xtensa_irq_unmask(irq); | 87 | xtensa_irq_unmask(d->irq); |
130 | } | 88 | } |
131 | 89 | ||
132 | static void xtensa_irq_disable(unsigned int irq) | 90 | static void xtensa_irq_disable(struct irq_data *d) |
133 | { | 91 | { |
134 | xtensa_irq_mask(irq); | 92 | xtensa_irq_mask(d->irq); |
135 | variant_irq_disable(irq); | 93 | variant_irq_disable(d->irq); |
136 | } | 94 | } |
137 | 95 | ||
138 | static void xtensa_irq_ack(unsigned int irq) | 96 | static void xtensa_irq_ack(struct irq_data *d) |
139 | { | 97 | { |
140 | set_sr(1 << irq, INTCLEAR); | 98 | set_sr(1 << d->irq, INTCLEAR); |
141 | } | 99 | } |
142 | 100 | ||
143 | static int xtensa_irq_retrigger(unsigned int irq) | 101 | static int xtensa_irq_retrigger(struct irq_data *d) |
144 | { | 102 | { |
145 | set_sr (1 << irq, INTSET); | 103 | set_sr (1 << d->irq, INTSET); |
146 | return 1; | 104 | return 1; |
147 | } | 105 | } |
148 | 106 | ||
149 | 107 | ||
150 | static struct irq_chip xtensa_irq_chip = { | 108 | static struct irq_chip xtensa_irq_chip = { |
151 | .name = "xtensa", | 109 | .name = "xtensa", |
152 | .enable = xtensa_irq_enable, | 110 | .irq_enable = xtensa_irq_enable, |
153 | .disable = xtensa_irq_disable, | 111 | .irq_disable = xtensa_irq_disable, |
154 | .mask = xtensa_irq_mask, | 112 | .irq_mask = xtensa_irq_mask, |
155 | .unmask = xtensa_irq_unmask, | 113 | .irq_unmask = xtensa_irq_unmask, |
156 | .ack = xtensa_irq_ack, | 114 | .irq_ack = xtensa_irq_ack, |
157 | .retrigger = xtensa_irq_retrigger, | 115 | .irq_retrigger = xtensa_irq_retrigger, |
158 | }; | 116 | }; |
159 | 117 | ||
160 | void __init init_IRQ(void) | 118 | void __init init_IRQ(void) |
@@ -165,25 +123,25 @@ void __init init_IRQ(void) | |||
165 | int mask = 1 << index; | 123 | int mask = 1 << index; |
166 | 124 | ||
167 | if (mask & XCHAL_INTTYPE_MASK_SOFTWARE) | 125 | if (mask & XCHAL_INTTYPE_MASK_SOFTWARE) |
168 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 126 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
169 | handle_simple_irq); | 127 | handle_simple_irq); |
170 | 128 | ||
171 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_EDGE) | 129 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_EDGE) |
172 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 130 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
173 | handle_edge_irq); | 131 | handle_edge_irq); |
174 | 132 | ||
175 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_LEVEL) | 133 | else if (mask & XCHAL_INTTYPE_MASK_EXTERN_LEVEL) |
176 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 134 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
177 | handle_level_irq); | 135 | handle_level_irq); |
178 | 136 | ||
179 | else if (mask & XCHAL_INTTYPE_MASK_TIMER) | 137 | else if (mask & XCHAL_INTTYPE_MASK_TIMER) |
180 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 138 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
181 | handle_edge_irq); | 139 | handle_edge_irq); |
182 | 140 | ||
183 | else /* XCHAL_INTTYPE_MASK_WRITE_ERROR */ | 141 | else /* XCHAL_INTTYPE_MASK_WRITE_ERROR */ |
184 | /* XCHAL_INTTYPE_MASK_NMI */ | 142 | /* XCHAL_INTTYPE_MASK_NMI */ |
185 | 143 | ||
186 | set_irq_chip_and_handler(index, &xtensa_irq_chip, | 144 | irq_set_chip_and_handler(index, &xtensa_irq_chip, |
187 | handle_level_irq); | 145 | handle_level_irq); |
188 | } | 146 | } |
189 | 147 | ||
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 9d4e1ceb3f09..c72c9473ef99 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c | |||
@@ -256,9 +256,11 @@ int ptrace_pokeusr(struct task_struct *child, long regno, long val) | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
259 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 259 | long arch_ptrace(struct task_struct *child, long request, |
260 | unsigned long addr, unsigned long data) | ||
260 | { | 261 | { |
261 | int ret = -EPERM; | 262 | int ret = -EPERM; |
263 | void __user *datap = (void __user *) data; | ||
262 | 264 | ||
263 | switch (request) { | 265 | switch (request) { |
264 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | 266 | case PTRACE_PEEKTEXT: /* read word at location addr. */ |
@@ -267,7 +269,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
267 | break; | 269 | break; |
268 | 270 | ||
269 | case PTRACE_PEEKUSR: /* read register specified by addr. */ | 271 | case PTRACE_PEEKUSR: /* read register specified by addr. */ |
270 | ret = ptrace_peekusr(child, addr, (void __user *) data); | 272 | ret = ptrace_peekusr(child, addr, datap); |
271 | break; | 273 | break; |
272 | 274 | ||
273 | case PTRACE_POKETEXT: /* write the word at location addr. */ | 275 | case PTRACE_POKETEXT: /* write the word at location addr. */ |
@@ -280,19 +282,19 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
280 | break; | 282 | break; |
281 | 283 | ||
282 | case PTRACE_GETREGS: | 284 | case PTRACE_GETREGS: |
283 | ret = ptrace_getregs(child, (void __user *) data); | 285 | ret = ptrace_getregs(child, datap); |
284 | break; | 286 | break; |
285 | 287 | ||
286 | case PTRACE_SETREGS: | 288 | case PTRACE_SETREGS: |
287 | ret = ptrace_setregs(child, (void __user *) data); | 289 | ret = ptrace_setregs(child, datap); |
288 | break; | 290 | break; |
289 | 291 | ||
290 | case PTRACE_GETXTREGS: | 292 | case PTRACE_GETXTREGS: |
291 | ret = ptrace_getxregs(child, (void __user *) data); | 293 | ret = ptrace_getxregs(child, datap); |
292 | break; | 294 | break; |
293 | 295 | ||
294 | case PTRACE_SETXTREGS: | 296 | case PTRACE_SETXTREGS: |
295 | ret = ptrace_setxregs(child, (void __user *) data); | 297 | ret = ptrace_setxregs(child, datap); |
296 | break; | 298 | break; |
297 | 299 | ||
298 | default: | 300 | default: |
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 19df764f6399..f3e5eb43f71c 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c | |||
@@ -96,16 +96,12 @@ again: | |||
96 | update_process_times(user_mode(get_irq_regs())); | 96 | update_process_times(user_mode(get_irq_regs())); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | write_seqlock(&xtime_lock); | 99 | xtime_update(1); /* Linux handler in kernel/time/timekeeping */ |
100 | |||
101 | do_timer(1); /* Linux handler in kernel/timer.c */ | ||
102 | 100 | ||
103 | /* Note that writing CCOMPARE clears the interrupt. */ | 101 | /* Note that writing CCOMPARE clears the interrupt. */ |
104 | 102 | ||
105 | next += CCOUNT_PER_JIFFY; | 103 | next += CCOUNT_PER_JIFFY; |
106 | set_linux_timer(next); | 104 | set_linux_timer(next); |
107 | |||
108 | write_sequnlock(&xtime_lock); | ||
109 | } | 105 | } |
110 | 106 | ||
111 | /* Allow platform to do something useful (Wdog). */ | 107 | /* Allow platform to do something useful (Wdog). */ |
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index 9b526154c9ba..88ecea3facb4 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S | |||
@@ -155,7 +155,7 @@ SECTIONS | |||
155 | INIT_RAM_FS | 155 | INIT_RAM_FS |
156 | } | 156 | } |
157 | 157 | ||
158 | PERCPU(PAGE_SIZE) | 158 | PERCPU_SECTION(XCHAL_ICACHE_LINESIZE) |
159 | 159 | ||
160 | /* We need this dummy segment here */ | 160 | /* We need this dummy segment here */ |
161 | 161 | ||