diff options
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/entry.S | 17 | ||||
-rw-r--r-- | arch/sparc64/kernel/irq.c | 20 | ||||
-rw-r--r-- | arch/sparc64/kernel/power.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/systbls.S | 8 | ||||
-rw-r--r-- | arch/sparc64/kernel/traps.c | 2 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 23 |
8 files changed, 40 insertions, 40 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index d781f10adc52..88332f00094a 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S | |||
@@ -1600,11 +1600,11 @@ sys_clone: flushw | |||
1600 | ba,pt %xcc, sparc_do_fork | 1600 | ba,pt %xcc, sparc_do_fork |
1601 | add %sp, PTREGS_OFF, %o2 | 1601 | add %sp, PTREGS_OFF, %o2 |
1602 | ret_from_syscall: | 1602 | ret_from_syscall: |
1603 | /* Clear SPARC_FLAG_NEWCHILD, switch_to leaves thread.flags in | 1603 | /* Clear current_thread_info()->new_child, and |
1604 | * %o7 for us. Check performance counter stuff too. | 1604 | * check performance counter stuff too. |
1605 | */ | 1605 | */ |
1606 | andn %o7, _TIF_NEWCHILD, %l0 | 1606 | stb %g0, [%g6 + TI_NEW_CHILD] |
1607 | stx %l0, [%g6 + TI_FLAGS] | 1607 | ldx [%g6 + TI_FLAGS], %l0 |
1608 | call schedule_tail | 1608 | call schedule_tail |
1609 | mov %g7, %o0 | 1609 | mov %g7, %o0 |
1610 | andcc %l0, _TIF_PERFCTR, %g0 | 1610 | andcc %l0, _TIF_PERFCTR, %g0 |
@@ -1720,12 +1720,11 @@ ret_sys_call: | |||
1720 | /* Check if force_successful_syscall_return() | 1720 | /* Check if force_successful_syscall_return() |
1721 | * was invoked. | 1721 | * was invoked. |
1722 | */ | 1722 | */ |
1723 | ldx [%curptr + TI_FLAGS], %l0 | 1723 | ldub [%curptr + TI_SYS_NOERROR], %l0 |
1724 | andcc %l0, _TIF_SYSCALL_SUCCESS, %g0 | 1724 | brz,pt %l0, 1f |
1725 | be,pt %icc, 1f | 1725 | nop |
1726 | andn %l0, _TIF_SYSCALL_SUCCESS, %l0 | ||
1727 | ba,pt %xcc, 80f | 1726 | ba,pt %xcc, 80f |
1728 | stx %l0, [%curptr + TI_FLAGS] | 1727 | stb %g0, [%curptr + TI_SYS_NOERROR] |
1729 | 1728 | ||
1730 | 1: | 1729 | 1: |
1731 | cmp %o0, -ERESTART_RESTARTBLOCK | 1730 | cmp %o0, -ERESTART_RESTARTBLOCK |
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index daa2fb93052c..c9b69167632a 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -782,8 +782,14 @@ static void distribute_irqs(void) | |||
782 | } | 782 | } |
783 | #endif | 783 | #endif |
784 | 784 | ||
785 | struct sun5_timer { | ||
786 | u64 count0; | ||
787 | u64 limit0; | ||
788 | u64 count1; | ||
789 | u64 limit1; | ||
790 | }; | ||
785 | 791 | ||
786 | struct sun5_timer *prom_timers; | 792 | static struct sun5_timer *prom_timers; |
787 | static u64 prom_limit0, prom_limit1; | 793 | static u64 prom_limit0, prom_limit1; |
788 | 794 | ||
789 | static void map_prom_timers(void) | 795 | static void map_prom_timers(void) |
@@ -839,18 +845,6 @@ static void kill_prom_timer(void) | |||
839 | : "g1", "g2"); | 845 | : "g1", "g2"); |
840 | } | 846 | } |
841 | 847 | ||
842 | void enable_prom_timer(void) | ||
843 | { | ||
844 | if (!prom_timers) | ||
845 | return; | ||
846 | |||
847 | /* Set it to whatever was there before. */ | ||
848 | prom_timers->limit1 = prom_limit1; | ||
849 | prom_timers->count1 = 0; | ||
850 | prom_timers->limit0 = prom_limit0; | ||
851 | prom_timers->count0 = 0; | ||
852 | } | ||
853 | |||
854 | void init_irqwork_curcpu(void) | 848 | void init_irqwork_curcpu(void) |
855 | { | 849 | { |
856 | register struct irq_work_struct *workp asm("o2"); | 850 | register struct irq_work_struct *workp asm("o2"); |
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c index 533104c7907d..946cee0257ea 100644 --- a/arch/sparc64/kernel/power.c +++ b/arch/sparc64/kernel/power.c | |||
@@ -69,8 +69,6 @@ void machine_power_off(void) | |||
69 | machine_halt(); | 69 | machine_halt(); |
70 | } | 70 | } |
71 | 71 | ||
72 | EXPORT_SYMBOL(machine_power_off); | ||
73 | |||
74 | #ifdef CONFIG_PCI | 72 | #ifdef CONFIG_PCI |
75 | static int powerd(void *__unused) | 73 | static int powerd(void *__unused) |
76 | { | 74 | { |
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index a0cd2b2494d6..07424b075938 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c | |||
@@ -124,8 +124,6 @@ void machine_halt(void) | |||
124 | panic("Halt failed!"); | 124 | panic("Halt failed!"); |
125 | } | 125 | } |
126 | 126 | ||
127 | EXPORT_SYMBOL(machine_halt); | ||
128 | |||
129 | void machine_alt_power_off(void) | 127 | void machine_alt_power_off(void) |
130 | { | 128 | { |
131 | if (!serial_console && prom_palette) | 129 | if (!serial_console && prom_palette) |
@@ -154,8 +152,6 @@ void machine_restart(char * cmd) | |||
154 | panic("Reboot failed!"); | 152 | panic("Reboot failed!"); |
155 | } | 153 | } |
156 | 154 | ||
157 | EXPORT_SYMBOL(machine_restart); | ||
158 | |||
159 | static void show_regwindow32(struct pt_regs *regs) | 155 | static void show_regwindow32(struct pt_regs *regs) |
160 | { | 156 | { |
161 | struct reg_window32 __user *rw; | 157 | struct reg_window32 __user *rw; |
@@ -621,8 +617,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
621 | memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); | 617 | memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); |
622 | 618 | ||
623 | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | | 619 | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | |
624 | _TIF_NEWCHILD | | ||
625 | (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); | 620 | (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); |
621 | t->new_child = 1; | ||
626 | t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; | 622 | t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; |
627 | t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf)); | 623 | t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf)); |
628 | t->fpsaved[0] = 0; | 624 | t->fpsaved[0] = 0; |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 7e8e2919e186..b9b42491e118 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -137,7 +137,7 @@ void __init smp_callin(void) | |||
137 | /* Clear this or we will die instantly when we | 137 | /* Clear this or we will die instantly when we |
138 | * schedule back to this idler... | 138 | * schedule back to this idler... |
139 | */ | 139 | */ |
140 | clear_thread_flag(TIF_NEWCHILD); | 140 | current_thread_info()->new_child = 0; |
141 | 141 | ||
142 | /* Attach to the address space of init_task. */ | 142 | /* Attach to the address space of init_task. */ |
143 | atomic_inc(&init_mm.mm_count); | 143 | atomic_inc(&init_mm.mm_count); |
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index bceb91a8a2bd..53eaf2345fe9 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S | |||
@@ -50,8 +50,8 @@ sys_call_table32: | |||
50 | .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64 | 50 | .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64 |
51 | /*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit | 51 | /*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit |
52 | .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write | 52 | .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write |
53 | /*150*/ .word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 | 53 | /*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
54 | .word compat_sys_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount | 54 | .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount |
55 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall | 55 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall |
56 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr | 56 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr |
57 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents | 57 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents |
@@ -116,8 +116,8 @@ sys_call_table: | |||
116 | .word sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 | 116 | .word sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 |
117 | /*140*/ .word sys_sendfile64, sys_getpeername, sys_futex, sys_gettid, sys_getrlimit | 117 | /*140*/ .word sys_sendfile64, sys_getpeername, sys_futex, sys_gettid, sys_getrlimit |
118 | .word sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write | 118 | .word sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write |
119 | /*150*/ .word sys_getsockname, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 | 119 | /*150*/ .word sys_getsockname, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
120 | .word sys_nis_syscall, sys_ni_syscall, sys_statfs, sys_fstatfs, sys_oldumount | 120 | .word sys_nis_syscall, sys_inotify_rm_watch, sys_statfs, sys_fstatfs, sys_oldumount |
121 | /*160*/ .word sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_utrap_install | 121 | /*160*/ .word sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_utrap_install |
122 | .word sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr | 122 | .word sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr |
123 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents | 123 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents |
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index a9f4596d7c2b..100b0107c4be 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2125,6 +2125,8 @@ void __init trap_init(void) | |||
2125 | TI_PCR != offsetof(struct thread_info, pcr_reg) || | 2125 | TI_PCR != offsetof(struct thread_info, pcr_reg) || |
2126 | TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) || | 2126 | TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) || |
2127 | TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || | 2127 | TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || |
2128 | TI_NEW_CHILD != offsetof(struct thread_info, new_child) || | ||
2129 | TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || | ||
2128 | TI_FPREGS != offsetof(struct thread_info, fpregs) || | 2130 | TI_FPREGS != offsetof(struct thread_info, fpregs) || |
2129 | (TI_FPREGS & (64 - 1))) | 2131 | (TI_FPREGS & (64 - 1))) |
2130 | thread_info_offsets_are_bolixed_dave(); | 2132 | thread_info_offsets_are_bolixed_dave(); |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 8fc413cb6acd..3fbaf342a452 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -121,15 +121,24 @@ __inline__ void flush_dcache_page_impl(struct page *page) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | #define PG_dcache_dirty PG_arch_1 | 123 | #define PG_dcache_dirty PG_arch_1 |
124 | #define PG_dcache_cpu_shift 24 | ||
125 | #define PG_dcache_cpu_mask (256 - 1) | ||
126 | |||
127 | #if NR_CPUS > 256 | ||
128 | #error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus | ||
129 | #endif | ||
124 | 130 | ||
125 | #define dcache_dirty_cpu(page) \ | 131 | #define dcache_dirty_cpu(page) \ |
126 | (((page)->flags >> 24) & (NR_CPUS - 1UL)) | 132 | (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) |
127 | 133 | ||
128 | static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) | 134 | static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) |
129 | { | 135 | { |
130 | unsigned long mask = this_cpu; | 136 | unsigned long mask = this_cpu; |
131 | unsigned long non_cpu_bits = ~((NR_CPUS - 1UL) << 24UL); | 137 | unsigned long non_cpu_bits; |
132 | mask = (mask << 24) | (1UL << PG_dcache_dirty); | 138 | |
139 | non_cpu_bits = ~(PG_dcache_cpu_mask << PG_dcache_cpu_shift); | ||
140 | mask = (mask << PG_dcache_cpu_shift) | (1UL << PG_dcache_dirty); | ||
141 | |||
133 | __asm__ __volatile__("1:\n\t" | 142 | __asm__ __volatile__("1:\n\t" |
134 | "ldx [%2], %%g7\n\t" | 143 | "ldx [%2], %%g7\n\t" |
135 | "and %%g7, %1, %%g1\n\t" | 144 | "and %%g7, %1, %%g1\n\t" |
@@ -151,7 +160,7 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c | |||
151 | __asm__ __volatile__("! test_and_clear_dcache_dirty\n" | 160 | __asm__ __volatile__("! test_and_clear_dcache_dirty\n" |
152 | "1:\n\t" | 161 | "1:\n\t" |
153 | "ldx [%2], %%g7\n\t" | 162 | "ldx [%2], %%g7\n\t" |
154 | "srlx %%g7, 24, %%g1\n\t" | 163 | "srlx %%g7, %4, %%g1\n\t" |
155 | "and %%g1, %3, %%g1\n\t" | 164 | "and %%g1, %3, %%g1\n\t" |
156 | "cmp %%g1, %0\n\t" | 165 | "cmp %%g1, %0\n\t" |
157 | "bne,pn %%icc, 2f\n\t" | 166 | "bne,pn %%icc, 2f\n\t" |
@@ -164,7 +173,8 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c | |||
164 | "2:" | 173 | "2:" |
165 | : /* no outputs */ | 174 | : /* no outputs */ |
166 | : "r" (cpu), "r" (mask), "r" (&page->flags), | 175 | : "r" (cpu), "r" (mask), "r" (&page->flags), |
167 | "i" (NR_CPUS - 1UL) | 176 | "i" (PG_dcache_cpu_mask), |
177 | "i" (PG_dcache_cpu_shift) | ||
168 | : "g1", "g7"); | 178 | : "g1", "g7"); |
169 | } | 179 | } |
170 | 180 | ||
@@ -180,7 +190,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
180 | if (pfn_valid(pfn) && | 190 | if (pfn_valid(pfn) && |
181 | (page = pfn_to_page(pfn), page_mapping(page)) && | 191 | (page = pfn_to_page(pfn), page_mapping(page)) && |
182 | ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { | 192 | ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { |
183 | int cpu = ((pg_flags >> 24) & (NR_CPUS - 1UL)); | 193 | int cpu = ((pg_flags >> PG_dcache_cpu_shift) & |
194 | PG_dcache_cpu_mask); | ||
184 | int this_cpu = get_cpu(); | 195 | int this_cpu = get_cpu(); |
185 | 196 | ||
186 | /* This is just to optimize away some function calls | 197 | /* This is just to optimize away some function calls |