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/m32r/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/m32r/kernel')
-rw-r--r-- | arch/m32r/kernel/irq.c | 45 | ||||
-rw-r--r-- | arch/m32r/kernel/ptrace.c | 11 | ||||
-rw-r--r-- | arch/m32r/kernel/smp.c | 68 | ||||
-rw-r--r-- | arch/m32r/kernel/smpboot.c | 48 | ||||
-rw-r--r-- | arch/m32r/kernel/syscall_table.S | 1 | ||||
-rw-r--r-- | arch/m32r/kernel/time.c | 5 | ||||
-rw-r--r-- | arch/m32r/kernel/vmlinux.lds.S | 3 |
7 files changed, 64 insertions, 117 deletions
diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c index 3c71f776872c..c7272b894283 100644 --- a/arch/m32r/kernel/irq.c +++ b/arch/m32r/kernel/irq.c | |||
@@ -18,53 +18,10 @@ | |||
18 | 18 | ||
19 | #include <linux/kernel_stat.h> | 19 | #include <linux/kernel_stat.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/seq_file.h> | ||
22 | #include <linux/module.h> | 21 | #include <linux/module.h> |
23 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
24 | 23 | ||
25 | /* | 24 | /* |
26 | * Generic, controller-independent functions: | ||
27 | */ | ||
28 | |||
29 | int show_interrupts(struct seq_file *p, void *v) | ||
30 | { | ||
31 | int i = *(loff_t *) v, j; | ||
32 | struct irqaction * action; | ||
33 | unsigned long flags; | ||
34 | |||
35 | if (i == 0) { | ||
36 | seq_printf(p, " "); | ||
37 | for_each_online_cpu(j) | ||
38 | seq_printf(p, "CPU%d ",j); | ||
39 | seq_putc(p, '\n'); | ||
40 | } | ||
41 | |||
42 | if (i < NR_IRQS) { | ||
43 | raw_spin_lock_irqsave(&irq_desc[i].lock, flags); | ||
44 | action = irq_desc[i].action; | ||
45 | if (!action) | ||
46 | goto skip; | ||
47 | seq_printf(p, "%3d: ",i); | ||
48 | #ifndef CONFIG_SMP | ||
49 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
50 | #else | ||
51 | for_each_online_cpu(j) | ||
52 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | ||
53 | #endif | ||
54 | seq_printf(p, " %14s", irq_desc[i].chip->typename); | ||
55 | seq_printf(p, " %s", action->name); | ||
56 | |||
57 | for (action=action->next; action; action = action->next) | ||
58 | seq_printf(p, ", %s", action->name); | ||
59 | |||
60 | seq_putc(p, '\n'); | ||
61 | skip: | ||
62 | raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); | ||
63 | } | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | /* | ||
68 | * do_IRQ handles all normal device IRQs (the special | 25 | * do_IRQ handles all normal device IRQs (the special |
69 | * SMP cross-CPU interrupts have their own specific | 26 | * SMP cross-CPU interrupts have their own specific |
70 | * handlers). | 27 | * handlers). |
@@ -78,7 +35,7 @@ asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs) | |||
78 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 35 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
79 | /* FIXME M32R */ | 36 | /* FIXME M32R */ |
80 | #endif | 37 | #endif |
81 | __do_IRQ(irq); | 38 | generic_handle_irq(irq); |
82 | irq_exit(); | 39 | irq_exit(); |
83 | set_irq_regs(old_regs); | 40 | set_irq_regs(old_regs); |
84 | 41 | ||
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index 0021ade4cba8..20743754f2b2 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c | |||
@@ -622,9 +622,11 @@ void ptrace_disable(struct task_struct *child) | |||
622 | } | 622 | } |
623 | 623 | ||
624 | long | 624 | long |
625 | arch_ptrace(struct task_struct *child, long request, long addr, long data) | 625 | arch_ptrace(struct task_struct *child, long request, |
626 | unsigned long addr, unsigned long data) | ||
626 | { | 627 | { |
627 | int ret; | 628 | int ret; |
629 | unsigned long __user *datap = (unsigned long __user *) data; | ||
628 | 630 | ||
629 | switch (request) { | 631 | switch (request) { |
630 | /* | 632 | /* |
@@ -639,8 +641,7 @@ arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
639 | * read the word at location addr in the USER area. | 641 | * read the word at location addr in the USER area. |
640 | */ | 642 | */ |
641 | case PTRACE_PEEKUSR: | 643 | case PTRACE_PEEKUSR: |
642 | ret = ptrace_read_user(child, addr, | 644 | ret = ptrace_read_user(child, addr, datap); |
643 | (unsigned long __user *)data); | ||
644 | break; | 645 | break; |
645 | 646 | ||
646 | /* | 647 | /* |
@@ -661,11 +662,11 @@ arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
661 | break; | 662 | break; |
662 | 663 | ||
663 | case PTRACE_GETREGS: | 664 | case PTRACE_GETREGS: |
664 | ret = ptrace_getregs(child, (void __user *)data); | 665 | ret = ptrace_getregs(child, datap); |
665 | break; | 666 | break; |
666 | 667 | ||
667 | case PTRACE_SETREGS: | 668 | case PTRACE_SETREGS: |
668 | ret = ptrace_setregs(child, (void __user *)data); | 669 | ret = ptrace_setregs(child, datap); |
669 | break; | 670 | break; |
670 | 671 | ||
671 | default: | 672 | default: |
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c index 31cef20b2996..092d40a6708e 100644 --- a/arch/m32r/kernel/smp.c +++ b/arch/m32r/kernel/smp.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | #include <asm/mmu_context.h> | 31 | #include <asm/mmu_context.h> |
32 | #include <asm/m32r.h> | 32 | #include <asm/m32r.h> |
33 | #include <asm/tlbflush.h> | ||
33 | 34 | ||
34 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ | 35 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ |
35 | /* Data structures and variables */ | 36 | /* Data structures and variables */ |
@@ -61,33 +62,22 @@ extern spinlock_t ipi_lock[]; | |||
61 | /* Function Prototypes */ | 62 | /* Function Prototypes */ |
62 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ | 63 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ |
63 | 64 | ||
64 | void smp_send_reschedule(int); | ||
65 | void smp_reschedule_interrupt(void); | 65 | void smp_reschedule_interrupt(void); |
66 | |||
67 | void smp_flush_cache_all(void); | ||
68 | void smp_flush_cache_all_interrupt(void); | 66 | void smp_flush_cache_all_interrupt(void); |
69 | 67 | ||
70 | void smp_flush_tlb_all(void); | ||
71 | static void flush_tlb_all_ipi(void *); | 68 | static void flush_tlb_all_ipi(void *); |
72 | |||
73 | void smp_flush_tlb_mm(struct mm_struct *); | ||
74 | void smp_flush_tlb_range(struct vm_area_struct *, unsigned long, \ | ||
75 | unsigned long); | ||
76 | void smp_flush_tlb_page(struct vm_area_struct *, unsigned long); | ||
77 | static void flush_tlb_others(cpumask_t, struct mm_struct *, | 69 | static void flush_tlb_others(cpumask_t, struct mm_struct *, |
78 | struct vm_area_struct *, unsigned long); | 70 | struct vm_area_struct *, unsigned long); |
71 | |||
79 | void smp_invalidate_interrupt(void); | 72 | void smp_invalidate_interrupt(void); |
80 | 73 | ||
81 | void smp_send_stop(void); | ||
82 | static void stop_this_cpu(void *); | 74 | static void stop_this_cpu(void *); |
83 | 75 | ||
84 | void smp_send_timer(void); | ||
85 | void smp_ipi_timer_interrupt(struct pt_regs *); | 76 | void smp_ipi_timer_interrupt(struct pt_regs *); |
86 | void smp_local_timer_interrupt(void); | 77 | void smp_local_timer_interrupt(void); |
87 | 78 | ||
88 | static void send_IPI_allbutself(int, int); | 79 | static void send_IPI_allbutself(int, int); |
89 | static void send_IPI_mask(const struct cpumask *, int, int); | 80 | static void send_IPI_mask(const struct cpumask *, int, int); |
90 | unsigned long send_IPI_mask_phys(cpumask_t, int, int); | ||
91 | 81 | ||
92 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ | 82 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ |
93 | /* Rescheduling request Routines */ | 83 | /* Rescheduling request Routines */ |
@@ -122,8 +112,6 @@ void smp_send_reschedule(int cpu_id) | |||
122 | * | 112 | * |
123 | * Description: This routine executes on CPU which received | 113 | * Description: This routine executes on CPU which received |
124 | * 'RESCHEDULE_IPI'. | 114 | * 'RESCHEDULE_IPI'. |
125 | * Rescheduling is processed at the exit of interrupt | ||
126 | * operation. | ||
127 | * | 115 | * |
128 | * Born on Date: 2002.02.05 | 116 | * Born on Date: 2002.02.05 |
129 | * | 117 | * |
@@ -138,7 +126,7 @@ void smp_send_reschedule(int cpu_id) | |||
138 | *==========================================================================*/ | 126 | *==========================================================================*/ |
139 | void smp_reschedule_interrupt(void) | 127 | void smp_reschedule_interrupt(void) |
140 | { | 128 | { |
141 | /* nothing to do */ | 129 | scheduler_ipi(); |
142 | } | 130 | } |
143 | 131 | ||
144 | /*==========================================================================* | 132 | /*==========================================================================* |
@@ -164,10 +152,10 @@ void smp_flush_cache_all(void) | |||
164 | unsigned long *mask; | 152 | unsigned long *mask; |
165 | 153 | ||
166 | preempt_disable(); | 154 | preempt_disable(); |
167 | cpumask = cpu_online_map; | 155 | cpumask_copy(&cpumask, cpu_online_mask); |
168 | cpu_clear(smp_processor_id(), cpumask); | 156 | cpumask_clear_cpu(smp_processor_id(), &cpumask); |
169 | spin_lock(&flushcache_lock); | 157 | spin_lock(&flushcache_lock); |
170 | mask=cpus_addr(cpumask); | 158 | mask=cpumask_bits(&cpumask); |
171 | atomic_set_mask(*mask, (atomic_t *)&flushcache_cpumask); | 159 | atomic_set_mask(*mask, (atomic_t *)&flushcache_cpumask); |
172 | send_IPI_mask(&cpumask, INVALIDATE_CACHE_IPI, 0); | 160 | send_IPI_mask(&cpumask, INVALIDATE_CACHE_IPI, 0); |
173 | _flush_cache_copyback_all(); | 161 | _flush_cache_copyback_all(); |
@@ -265,8 +253,8 @@ void smp_flush_tlb_mm(struct mm_struct *mm) | |||
265 | preempt_disable(); | 253 | preempt_disable(); |
266 | cpu_id = smp_processor_id(); | 254 | cpu_id = smp_processor_id(); |
267 | mmc = &mm->context[cpu_id]; | 255 | mmc = &mm->context[cpu_id]; |
268 | cpu_mask = *mm_cpumask(mm); | 256 | cpumask_copy(&cpu_mask, mm_cpumask(mm)); |
269 | cpu_clear(cpu_id, cpu_mask); | 257 | cpumask_clear_cpu(cpu_id, &cpu_mask); |
270 | 258 | ||
271 | if (*mmc != NO_CONTEXT) { | 259 | if (*mmc != NO_CONTEXT) { |
272 | local_irq_save(flags); | 260 | local_irq_save(flags); |
@@ -277,7 +265,7 @@ void smp_flush_tlb_mm(struct mm_struct *mm) | |||
277 | cpumask_clear_cpu(cpu_id, mm_cpumask(mm)); | 265 | cpumask_clear_cpu(cpu_id, mm_cpumask(mm)); |
278 | local_irq_restore(flags); | 266 | local_irq_restore(flags); |
279 | } | 267 | } |
280 | if (!cpus_empty(cpu_mask)) | 268 | if (!cpumask_empty(&cpu_mask)) |
281 | flush_tlb_others(cpu_mask, mm, NULL, FLUSH_ALL); | 269 | flush_tlb_others(cpu_mask, mm, NULL, FLUSH_ALL); |
282 | 270 | ||
283 | preempt_enable(); | 271 | preempt_enable(); |
@@ -335,8 +323,8 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long va) | |||
335 | preempt_disable(); | 323 | preempt_disable(); |
336 | cpu_id = smp_processor_id(); | 324 | cpu_id = smp_processor_id(); |
337 | mmc = &mm->context[cpu_id]; | 325 | mmc = &mm->context[cpu_id]; |
338 | cpu_mask = *mm_cpumask(mm); | 326 | cpumask_copy(&cpu_mask, mm_cpumask(mm)); |
339 | cpu_clear(cpu_id, cpu_mask); | 327 | cpumask_clear_cpu(cpu_id, &cpu_mask); |
340 | 328 | ||
341 | #ifdef DEBUG_SMP | 329 | #ifdef DEBUG_SMP |
342 | if (!mm) | 330 | if (!mm) |
@@ -350,7 +338,7 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long va) | |||
350 | __flush_tlb_page(va); | 338 | __flush_tlb_page(va); |
351 | local_irq_restore(flags); | 339 | local_irq_restore(flags); |
352 | } | 340 | } |
353 | if (!cpus_empty(cpu_mask)) | 341 | if (!cpumask_empty(&cpu_mask)) |
354 | flush_tlb_others(cpu_mask, mm, vma, va); | 342 | flush_tlb_others(cpu_mask, mm, vma, va); |
355 | 343 | ||
356 | preempt_enable(); | 344 | preempt_enable(); |
@@ -397,14 +385,14 @@ static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, | |||
397 | * - current CPU must not be in mask | 385 | * - current CPU must not be in mask |
398 | * - mask must exist :) | 386 | * - mask must exist :) |
399 | */ | 387 | */ |
400 | BUG_ON(cpus_empty(cpumask)); | 388 | BUG_ON(cpumask_empty(&cpumask)); |
401 | 389 | ||
402 | BUG_ON(cpu_isset(smp_processor_id(), cpumask)); | 390 | BUG_ON(cpumask_test_cpu(smp_processor_id(), &cpumask)); |
403 | BUG_ON(!mm); | 391 | BUG_ON(!mm); |
404 | 392 | ||
405 | /* If a CPU which we ran on has gone down, OK. */ | 393 | /* If a CPU which we ran on has gone down, OK. */ |
406 | cpus_and(cpumask, cpumask, cpu_online_map); | 394 | cpumask_and(&cpumask, &cpumask, cpu_online_mask); |
407 | if (cpus_empty(cpumask)) | 395 | if (cpumask_empty(&cpumask)) |
408 | return; | 396 | return; |
409 | 397 | ||
410 | /* | 398 | /* |
@@ -418,7 +406,7 @@ static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, | |||
418 | flush_mm = mm; | 406 | flush_mm = mm; |
419 | flush_vma = vma; | 407 | flush_vma = vma; |
420 | flush_va = va; | 408 | flush_va = va; |
421 | mask=cpus_addr(cpumask); | 409 | mask=cpumask_bits(&cpumask); |
422 | atomic_set_mask(*mask, (atomic_t *)&flush_cpumask); | 410 | atomic_set_mask(*mask, (atomic_t *)&flush_cpumask); |
423 | 411 | ||
424 | /* | 412 | /* |
@@ -427,7 +415,7 @@ static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, | |||
427 | */ | 415 | */ |
428 | send_IPI_mask(&cpumask, INVALIDATE_TLB_IPI, 0); | 416 | send_IPI_mask(&cpumask, INVALIDATE_TLB_IPI, 0); |
429 | 417 | ||
430 | while (!cpus_empty(flush_cpumask)) { | 418 | while (!cpumask_empty((cpumask_t*)&flush_cpumask)) { |
431 | /* nothing. lockup detection does not belong here */ | 419 | /* nothing. lockup detection does not belong here */ |
432 | mb(); | 420 | mb(); |
433 | } | 421 | } |
@@ -462,7 +450,7 @@ void smp_invalidate_interrupt(void) | |||
462 | int cpu_id = smp_processor_id(); | 450 | int cpu_id = smp_processor_id(); |
463 | unsigned long *mmc = &flush_mm->context[cpu_id]; | 451 | unsigned long *mmc = &flush_mm->context[cpu_id]; |
464 | 452 | ||
465 | if (!cpu_isset(cpu_id, flush_cpumask)) | 453 | if (!cpumask_test_cpu(cpu_id, &flush_cpumask)) |
466 | return; | 454 | return; |
467 | 455 | ||
468 | if (flush_va == FLUSH_ALL) { | 456 | if (flush_va == FLUSH_ALL) { |
@@ -480,7 +468,7 @@ void smp_invalidate_interrupt(void) | |||
480 | __flush_tlb_page(va); | 468 | __flush_tlb_page(va); |
481 | } | 469 | } |
482 | } | 470 | } |
483 | cpu_clear(cpu_id, flush_cpumask); | 471 | cpumask_clear_cpu(cpu_id, (cpumask_t*)&flush_cpumask); |
484 | } | 472 | } |
485 | 473 | ||
486 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ | 474 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ |
@@ -532,7 +520,7 @@ static void stop_this_cpu(void *dummy) | |||
532 | /* | 520 | /* |
533 | * Remove this CPU: | 521 | * Remove this CPU: |
534 | */ | 522 | */ |
535 | cpu_clear(cpu_id, cpu_online_map); | 523 | set_cpu_online(cpu_id, false); |
536 | 524 | ||
537 | /* | 525 | /* |
538 | * PSW IE = 1; | 526 | * PSW IE = 1; |
@@ -727,8 +715,8 @@ static void send_IPI_allbutself(int ipi_num, int try) | |||
727 | { | 715 | { |
728 | cpumask_t cpumask; | 716 | cpumask_t cpumask; |
729 | 717 | ||
730 | cpumask = cpu_online_map; | 718 | cpumask_copy(&cpumask, cpu_online_mask); |
731 | cpu_clear(smp_processor_id(), cpumask); | 719 | cpumask_clear_cpu(smp_processor_id(), &cpumask); |
732 | 720 | ||
733 | send_IPI_mask(&cpumask, ipi_num, try); | 721 | send_IPI_mask(&cpumask, ipi_num, try); |
734 | } | 722 | } |
@@ -765,13 +753,13 @@ static void send_IPI_mask(const struct cpumask *cpumask, int ipi_num, int try) | |||
765 | cpumask_and(&tmp, cpumask, cpu_online_mask); | 753 | cpumask_and(&tmp, cpumask, cpu_online_mask); |
766 | BUG_ON(!cpumask_equal(cpumask, &tmp)); | 754 | BUG_ON(!cpumask_equal(cpumask, &tmp)); |
767 | 755 | ||
768 | physid_mask = CPU_MASK_NONE; | 756 | cpumask_clear(&physid_mask); |
769 | for_each_cpu(cpu_id, cpumask) { | 757 | for_each_cpu(cpu_id, cpumask) { |
770 | if ((phys_id = cpu_to_physid(cpu_id)) != -1) | 758 | if ((phys_id = cpu_to_physid(cpu_id)) != -1) |
771 | cpu_set(phys_id, physid_mask); | 759 | cpumask_set_cpu(phys_id, &physid_mask); |
772 | } | 760 | } |
773 | 761 | ||
774 | send_IPI_mask_phys(physid_mask, ipi_num, try); | 762 | send_IPI_mask_phys(&physid_mask, ipi_num, try); |
775 | } | 763 | } |
776 | 764 | ||
777 | /*==========================================================================* | 765 | /*==========================================================================* |
@@ -794,14 +782,14 @@ static void send_IPI_mask(const struct cpumask *cpumask, int ipi_num, int try) | |||
794 | * ---------- --- -------------------------------------------------------- | 782 | * ---------- --- -------------------------------------------------------- |
795 | * | 783 | * |
796 | *==========================================================================*/ | 784 | *==========================================================================*/ |
797 | unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num, | 785 | unsigned long send_IPI_mask_phys(const cpumask_t *physid_mask, int ipi_num, |
798 | int try) | 786 | int try) |
799 | { | 787 | { |
800 | spinlock_t *ipilock; | 788 | spinlock_t *ipilock; |
801 | volatile unsigned long *ipicr_addr; | 789 | volatile unsigned long *ipicr_addr; |
802 | unsigned long ipicr_val; | 790 | unsigned long ipicr_val; |
803 | unsigned long my_physid_mask; | 791 | unsigned long my_physid_mask; |
804 | unsigned long mask = cpus_addr(physid_mask)[0]; | 792 | unsigned long mask = cpumask_bits(physid_mask)[0]; |
805 | 793 | ||
806 | 794 | ||
807 | if (mask & ~physids_coerce(phys_cpu_present_map)) | 795 | if (mask & ~physids_coerce(phys_cpu_present_map)) |
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index e034844cfc0d..cfdbe5d15002 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c | |||
@@ -135,9 +135,9 @@ void __devinit smp_prepare_boot_cpu(void) | |||
135 | { | 135 | { |
136 | bsp_phys_id = hard_smp_processor_id(); | 136 | bsp_phys_id = hard_smp_processor_id(); |
137 | physid_set(bsp_phys_id, phys_cpu_present_map); | 137 | physid_set(bsp_phys_id, phys_cpu_present_map); |
138 | cpu_set(0, cpu_online_map); /* BSP's cpu_id == 0 */ | 138 | set_cpu_online(0, true); /* BSP's cpu_id == 0 */ |
139 | cpu_set(0, cpu_callout_map); | 139 | cpumask_set_cpu(0, &cpu_callout_map); |
140 | cpu_set(0, cpu_callin_map); | 140 | cpumask_set_cpu(0, &cpu_callin_map); |
141 | 141 | ||
142 | /* | 142 | /* |
143 | * Initialize the logical to physical CPU number mapping | 143 | * Initialize the logical to physical CPU number mapping |
@@ -178,7 +178,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
178 | for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++) | 178 | for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++) |
179 | physid_set(phys_id, phys_cpu_present_map); | 179 | physid_set(phys_id, phys_cpu_present_map); |
180 | #ifndef CONFIG_HOTPLUG_CPU | 180 | #ifndef CONFIG_HOTPLUG_CPU |
181 | init_cpu_present(&cpu_possible_map); | 181 | init_cpu_present(cpu_possible_mask); |
182 | #endif | 182 | #endif |
183 | 183 | ||
184 | show_mp_info(nr_cpu); | 184 | show_mp_info(nr_cpu); |
@@ -294,10 +294,10 @@ static void __init do_boot_cpu(int phys_id) | |||
294 | send_status = 0; | 294 | send_status = 0; |
295 | boot_status = 0; | 295 | boot_status = 0; |
296 | 296 | ||
297 | cpu_set(phys_id, cpu_bootout_map); | 297 | cpumask_set_cpu(phys_id, &cpu_bootout_map); |
298 | 298 | ||
299 | /* Send Startup IPI */ | 299 | /* Send Startup IPI */ |
300 | send_IPI_mask_phys(cpumask_of_cpu(phys_id), CPU_BOOT_IPI, 0); | 300 | send_IPI_mask_phys(cpumask_of(phys_id), CPU_BOOT_IPI, 0); |
301 | 301 | ||
302 | Dprintk("Waiting for send to finish...\n"); | 302 | Dprintk("Waiting for send to finish...\n"); |
303 | timeout = 0; | 303 | timeout = 0; |
@@ -306,7 +306,7 @@ static void __init do_boot_cpu(int phys_id) | |||
306 | do { | 306 | do { |
307 | Dprintk("+"); | 307 | Dprintk("+"); |
308 | udelay(1000); | 308 | udelay(1000); |
309 | send_status = !cpu_isset(phys_id, cpu_bootin_map); | 309 | send_status = !cpumask_test_cpu(phys_id, &cpu_bootin_map); |
310 | } while (send_status && (timeout++ < 100)); | 310 | } while (send_status && (timeout++ < 100)); |
311 | 311 | ||
312 | Dprintk("After Startup.\n"); | 312 | Dprintk("After Startup.\n"); |
@@ -316,19 +316,19 @@ static void __init do_boot_cpu(int phys_id) | |||
316 | * allow APs to start initializing. | 316 | * allow APs to start initializing. |
317 | */ | 317 | */ |
318 | Dprintk("Before Callout %d.\n", cpu_id); | 318 | Dprintk("Before Callout %d.\n", cpu_id); |
319 | cpu_set(cpu_id, cpu_callout_map); | 319 | cpumask_set_cpu(cpu_id, &cpu_callout_map); |
320 | Dprintk("After Callout %d.\n", cpu_id); | 320 | Dprintk("After Callout %d.\n", cpu_id); |
321 | 321 | ||
322 | /* | 322 | /* |
323 | * Wait 5s total for a response | 323 | * Wait 5s total for a response |
324 | */ | 324 | */ |
325 | for (timeout = 0; timeout < 5000; timeout++) { | 325 | for (timeout = 0; timeout < 5000; timeout++) { |
326 | if (cpu_isset(cpu_id, cpu_callin_map)) | 326 | if (cpumask_test_cpu(cpu_id, &cpu_callin_map)) |
327 | break; /* It has booted */ | 327 | break; /* It has booted */ |
328 | udelay(1000); | 328 | udelay(1000); |
329 | } | 329 | } |
330 | 330 | ||
331 | if (cpu_isset(cpu_id, cpu_callin_map)) { | 331 | if (cpumask_test_cpu(cpu_id, &cpu_callin_map)) { |
332 | /* number CPUs logically, starting from 1 (BSP is 0) */ | 332 | /* number CPUs logically, starting from 1 (BSP is 0) */ |
333 | Dprintk("OK.\n"); | 333 | Dprintk("OK.\n"); |
334 | } else { | 334 | } else { |
@@ -340,9 +340,9 @@ static void __init do_boot_cpu(int phys_id) | |||
340 | 340 | ||
341 | if (send_status || boot_status) { | 341 | if (send_status || boot_status) { |
342 | unmap_cpu_to_physid(cpu_id, phys_id); | 342 | unmap_cpu_to_physid(cpu_id, phys_id); |
343 | cpu_clear(cpu_id, cpu_callout_map); | 343 | cpumask_clear_cpu(cpu_id, &cpu_callout_map); |
344 | cpu_clear(cpu_id, cpu_callin_map); | 344 | cpumask_clear_cpu(cpu_id, &cpu_callin_map); |
345 | cpu_clear(cpu_id, cpu_initialized); | 345 | cpumask_clear_cpu(cpu_id, &cpu_initialized); |
346 | cpucount--; | 346 | cpucount--; |
347 | } | 347 | } |
348 | } | 348 | } |
@@ -351,17 +351,17 @@ int __cpuinit __cpu_up(unsigned int cpu_id) | |||
351 | { | 351 | { |
352 | int timeout; | 352 | int timeout; |
353 | 353 | ||
354 | cpu_set(cpu_id, smp_commenced_mask); | 354 | cpumask_set_cpu(cpu_id, &smp_commenced_mask); |
355 | 355 | ||
356 | /* | 356 | /* |
357 | * Wait 5s total for a response | 357 | * Wait 5s total for a response |
358 | */ | 358 | */ |
359 | for (timeout = 0; timeout < 5000; timeout++) { | 359 | for (timeout = 0; timeout < 5000; timeout++) { |
360 | if (cpu_isset(cpu_id, cpu_online_map)) | 360 | if (cpu_online(cpu_id)) |
361 | break; | 361 | break; |
362 | udelay(1000); | 362 | udelay(1000); |
363 | } | 363 | } |
364 | if (!cpu_isset(cpu_id, cpu_online_map)) | 364 | if (!cpu_online(cpu_id)) |
365 | BUG(); | 365 | BUG(); |
366 | 366 | ||
367 | return 0; | 367 | return 0; |
@@ -373,11 +373,11 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
373 | unsigned long bogosum = 0; | 373 | unsigned long bogosum = 0; |
374 | 374 | ||
375 | for (timeout = 0; timeout < 5000; timeout++) { | 375 | for (timeout = 0; timeout < 5000; timeout++) { |
376 | if (cpus_equal(cpu_callin_map, cpu_online_map)) | 376 | if (cpumask_equal(&cpu_callin_map, cpu_online_mask)) |
377 | break; | 377 | break; |
378 | udelay(1000); | 378 | udelay(1000); |
379 | } | 379 | } |
380 | if (!cpus_equal(cpu_callin_map, cpu_online_map)) | 380 | if (!cpumask_equal(&cpu_callin_map, cpu_online_mask)) |
381 | BUG(); | 381 | BUG(); |
382 | 382 | ||
383 | for (cpu_id = 0 ; cpu_id < num_online_cpus() ; cpu_id++) | 383 | for (cpu_id = 0 ; cpu_id < num_online_cpus() ; cpu_id++) |
@@ -388,7 +388,7 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
388 | */ | 388 | */ |
389 | Dprintk("Before bogomips.\n"); | 389 | Dprintk("Before bogomips.\n"); |
390 | if (cpucount) { | 390 | if (cpucount) { |
391 | for_each_cpu_mask(cpu_id, cpu_online_map) | 391 | for_each_cpu(cpu_id,cpu_online_mask) |
392 | bogosum += cpu_data[cpu_id].loops_per_jiffy; | 392 | bogosum += cpu_data[cpu_id].loops_per_jiffy; |
393 | 393 | ||
394 | printk(KERN_INFO "Total of %d processors activated " \ | 394 | printk(KERN_INFO "Total of %d processors activated " \ |
@@ -425,7 +425,7 @@ int __init start_secondary(void *unused) | |||
425 | cpu_init(); | 425 | cpu_init(); |
426 | preempt_disable(); | 426 | preempt_disable(); |
427 | smp_callin(); | 427 | smp_callin(); |
428 | while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) | 428 | while (!cpumask_test_cpu(smp_processor_id(), &smp_commenced_mask)) |
429 | cpu_relax(); | 429 | cpu_relax(); |
430 | 430 | ||
431 | smp_online(); | 431 | smp_online(); |
@@ -463,7 +463,7 @@ static void __init smp_callin(void) | |||
463 | int cpu_id = smp_processor_id(); | 463 | int cpu_id = smp_processor_id(); |
464 | unsigned long timeout; | 464 | unsigned long timeout; |
465 | 465 | ||
466 | if (cpu_isset(cpu_id, cpu_callin_map)) { | 466 | if (cpumask_test_cpu(cpu_id, &cpu_callin_map)) { |
467 | printk("huh, phys CPU#%d, CPU#%d already present??\n", | 467 | printk("huh, phys CPU#%d, CPU#%d already present??\n", |
468 | phys_id, cpu_id); | 468 | phys_id, cpu_id); |
469 | BUG(); | 469 | BUG(); |
@@ -474,7 +474,7 @@ static void __init smp_callin(void) | |||
474 | timeout = jiffies + (2 * HZ); | 474 | timeout = jiffies + (2 * HZ); |
475 | while (time_before(jiffies, timeout)) { | 475 | while (time_before(jiffies, timeout)) { |
476 | /* Has the boot CPU finished it's STARTUP sequence ? */ | 476 | /* Has the boot CPU finished it's STARTUP sequence ? */ |
477 | if (cpu_isset(cpu_id, cpu_callout_map)) | 477 | if (cpumask_test_cpu(cpu_id, &cpu_callout_map)) |
478 | break; | 478 | break; |
479 | cpu_relax(); | 479 | cpu_relax(); |
480 | } | 480 | } |
@@ -486,7 +486,7 @@ static void __init smp_callin(void) | |||
486 | } | 486 | } |
487 | 487 | ||
488 | /* Allow the master to continue. */ | 488 | /* Allow the master to continue. */ |
489 | cpu_set(cpu_id, cpu_callin_map); | 489 | cpumask_set_cpu(cpu_id, &cpu_callin_map); |
490 | } | 490 | } |
491 | 491 | ||
492 | static void __init smp_online(void) | 492 | static void __init smp_online(void) |
@@ -503,7 +503,7 @@ static void __init smp_online(void) | |||
503 | /* Save our processor parameters */ | 503 | /* Save our processor parameters */ |
504 | smp_store_cpu_info(cpu_id); | 504 | smp_store_cpu_info(cpu_id); |
505 | 505 | ||
506 | cpu_set(cpu_id, cpu_online_map); | 506 | set_cpu_online(cpu_id, true); |
507 | } | 507 | } |
508 | 508 | ||
509 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ | 509 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ |
diff --git a/arch/m32r/kernel/syscall_table.S b/arch/m32r/kernel/syscall_table.S index 60536e271233..528f2e6ad064 100644 --- a/arch/m32r/kernel/syscall_table.S +++ b/arch/m32r/kernel/syscall_table.S | |||
@@ -324,3 +324,4 @@ ENTRY(sys_call_table) | |||
324 | .long sys_ni_syscall | 324 | .long sys_ni_syscall |
325 | .long sys_eventfd | 325 | .long sys_eventfd |
326 | .long sys_fallocate | 326 | .long sys_fallocate |
327 | .long sys_setns /* 325 */ | ||
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index bda86820bffd..84dd04048db9 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c | |||
@@ -107,15 +107,14 @@ u32 arch_gettimeoffset(void) | |||
107 | 107 | ||
108 | /* | 108 | /* |
109 | * timer_interrupt() needs to keep up the real-time clock, | 109 | * timer_interrupt() needs to keep up the real-time clock, |
110 | * as well as call the "do_timer()" routine every clocktick | 110 | * as well as call the "xtime_update()" routine every clocktick |
111 | */ | 111 | */ |
112 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 112 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
113 | { | 113 | { |
114 | #ifndef CONFIG_SMP | 114 | #ifndef CONFIG_SMP |
115 | profile_tick(CPU_PROFILING); | 115 | profile_tick(CPU_PROFILING); |
116 | #endif | 116 | #endif |
117 | /* XXX FIXME. Uh, the xtime_lock should be held here, no? */ | 117 | xtime_update(1); |
118 | do_timer(1); | ||
119 | 118 | ||
120 | #ifndef CONFIG_SMP | 119 | #ifndef CONFIG_SMP |
121 | update_process_times(user_mode(get_irq_regs())); | 120 | update_process_times(user_mode(get_irq_regs())); |
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S index 7da94eaa082b..018e4a711d79 100644 --- a/arch/m32r/kernel/vmlinux.lds.S +++ b/arch/m32r/kernel/vmlinux.lds.S | |||
@@ -44,6 +44,7 @@ SECTIONS | |||
44 | EXCEPTION_TABLE(16) | 44 | EXCEPTION_TABLE(16) |
45 | NOTES | 45 | NOTES |
46 | 46 | ||
47 | _sdata = .; /* Start of data section */ | ||
47 | RODATA | 48 | RODATA |
48 | RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) | 49 | RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) |
49 | _edata = .; /* End of data section */ | 50 | _edata = .; /* End of data section */ |
@@ -53,7 +54,7 @@ SECTIONS | |||
53 | __init_begin = .; | 54 | __init_begin = .; |
54 | INIT_TEXT_SECTION(PAGE_SIZE) | 55 | INIT_TEXT_SECTION(PAGE_SIZE) |
55 | INIT_DATA_SECTION(16) | 56 | INIT_DATA_SECTION(16) |
56 | PERCPU(PAGE_SIZE) | 57 | PERCPU_SECTION(32) |
57 | . = ALIGN(PAGE_SIZE); | 58 | . = ALIGN(PAGE_SIZE); |
58 | __init_end = .; | 59 | __init_end = .; |
59 | /* freed after init ends here */ | 60 | /* freed after init ends here */ |