summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc')
-rw-r--r--include/asm-sparc/asm_offsets.h448
-rw-r--r--include/asm-sparc/asmmacro.h4
-rw-r--r--include/asm-sparc/atomic.h22
-rw-r--r--include/asm-sparc/cache.h4
-rw-r--r--include/asm-sparc/checksum.h7
-rw-r--r--include/asm-sparc/dma.h4
-rw-r--r--include/asm-sparc/ethtool.h79
-rw-r--r--include/asm-sparc/floppy.h16
-rw-r--r--include/asm-sparc/hardirq.h27
-rw-r--r--include/asm-sparc/head.h4
-rw-r--r--include/asm-sparc/init.h3
-rw-r--r--include/asm-sparc/io-unit.h20
-rw-r--r--include/asm-sparc/irq.h53
-rw-r--r--include/asm-sparc/keyboard.h4
-rw-r--r--include/asm-sparc/mmu_context.h6
-rw-r--r--include/asm-sparc/namei.h5
-rw-r--r--include/asm-sparc/page.h1
-rw-r--r--include/asm-sparc/pgtable.h4
-rw-r--r--include/asm-sparc/posix_types.h8
-rw-r--r--include/asm-sparc/processor.h11
-rw-r--r--include/asm-sparc/resource.h4
-rw-r--r--include/asm-sparc/sbus.h9
-rw-r--r--include/asm-sparc/semaphore-helper.h167
-rw-r--r--include/asm-sparc/semaphore.h156
-rw-r--r--include/asm-sparc/siginfo.h4
-rw-r--r--include/asm-sparc/smp.h11
-rw-r--r--include/asm-sparc/softirq.h40
-rw-r--r--include/asm-sparc/spinlock.h18
-rw-r--r--include/asm-sparc/system.h38
-rw-r--r--include/asm-sparc/termbits.h16
-rw-r--r--include/asm-sparc/termios.h3
-rw-r--r--include/asm-sparc/timer.h6
-rw-r--r--include/asm-sparc/timex.h5
-rw-r--r--include/asm-sparc/uaccess.h5
-rw-r--r--include/asm-sparc/unistd.h190
-rw-r--r--include/asm-sparc/vaddrs.h4
36 files changed, 891 insertions, 515 deletions
diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h
index 655987dd5..c45a7b4a7 100644
--- a/include/asm-sparc/asm_offsets.h
+++ b/include/asm-sparc/asm_offsets.h
@@ -2,7 +2,9 @@
#ifndef __ASM_OFFSETS_H__
#define __ASM_OFFSETS_H__
-#ifndef __SMP__
+#include <linux/config.h>
+
+#ifndef CONFIG_SMP
#define AOFF_task_state 0x00000000
#define ASIZ_task_state 0x00000004
@@ -20,217 +22,219 @@
#define ASIZ_task_counter 0x00000004
#define AOFF_task_priority 0x0000001c
#define ASIZ_task_priority 0x00000004
-#define AOFF_task_has_cpu 0x00000020
+#define AOFF_task_avg_slice 0x00000020
+#define ASIZ_task_avg_slice 0x00000004
+#define AOFF_task_has_cpu 0x00000024
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000024
+#define AOFF_task_processor 0x00000028
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000028
+#define AOFF_task_last_processor 0x0000002c
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x0000002c
+#define AOFF_task_lock_depth 0x00000030
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_next_task 0x00000030
+#define AOFF_task_next_task 0x00000034
#define ASIZ_task_next_task 0x00000004
-#define AOFF_task_prev_task 0x00000034
+#define AOFF_task_prev_task 0x00000038
#define ASIZ_task_prev_task 0x00000004
-#define AOFF_task_next_run 0x00000038
+#define AOFF_task_next_run 0x0000003c
#define ASIZ_task_next_run 0x00000004
-#define AOFF_task_prev_run 0x0000003c
+#define AOFF_task_prev_run 0x00000040
#define ASIZ_task_prev_run 0x00000004
-#define AOFF_task_binfmt 0x00000040
+#define AOFF_task_binfmt 0x00000044
#define ASIZ_task_binfmt 0x00000004
-#define AOFF_task_exit_code 0x00000044
+#define AOFF_task_exit_code 0x00000048
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x00000048
+#define AOFF_task_exit_signal 0x0000004c
#define ASIZ_task_exit_signal 0x00000004
-#define AOFF_task_pdeath_signal 0x0000004c
+#define AOFF_task_pdeath_signal 0x00000050
#define ASIZ_task_pdeath_signal 0x00000004
-#define AOFF_task_personality 0x00000050
+#define AOFF_task_personality 0x00000054
#define ASIZ_task_personality 0x00000004
-#define AOFF_task_pid 0x00000058
+#define AOFF_task_pid 0x0000005c
#define ASIZ_task_pid 0x00000004
-#define AOFF_task_pgrp 0x0000005c
+#define AOFF_task_pgrp 0x00000060
#define ASIZ_task_pgrp 0x00000004
-#define AOFF_task_tty_old_pgrp 0x00000060
+#define AOFF_task_tty_old_pgrp 0x00000064
#define ASIZ_task_tty_old_pgrp 0x00000004
-#define AOFF_task_session 0x00000064
+#define AOFF_task_session 0x00000068
#define ASIZ_task_session 0x00000004
-#define AOFF_task_leader 0x00000068
+#define AOFF_task_leader 0x0000006c
#define ASIZ_task_leader 0x00000004
-#define AOFF_task_p_opptr 0x0000006c
+#define AOFF_task_p_opptr 0x00000070
#define ASIZ_task_p_opptr 0x00000004
-#define AOFF_task_p_pptr 0x00000070
+#define AOFF_task_p_pptr 0x00000074
#define ASIZ_task_p_pptr 0x00000004
-#define AOFF_task_p_cptr 0x00000074
+#define AOFF_task_p_cptr 0x00000078
#define ASIZ_task_p_cptr 0x00000004
-#define AOFF_task_p_ysptr 0x00000078
+#define AOFF_task_p_ysptr 0x0000007c
#define ASIZ_task_p_ysptr 0x00000004
-#define AOFF_task_p_osptr 0x0000007c
+#define AOFF_task_p_osptr 0x00000080
#define ASIZ_task_p_osptr 0x00000004
-#define AOFF_task_pidhash_next 0x00000080
+#define AOFF_task_pidhash_next 0x00000084
#define ASIZ_task_pidhash_next 0x00000004
-#define AOFF_task_pidhash_pprev 0x00000084
+#define AOFF_task_pidhash_pprev 0x00000088
#define ASIZ_task_pidhash_pprev 0x00000004
-#define AOFF_task_tarray_ptr 0x00000088
+#define AOFF_task_tarray_ptr 0x0000008c
#define ASIZ_task_tarray_ptr 0x00000004
-#define AOFF_task_wait_chldexit 0x0000008c
+#define AOFF_task_wait_chldexit 0x00000090
#define ASIZ_task_wait_chldexit 0x00000004
-#define AOFF_task_policy 0x00000090
+#define AOFF_task_vfork_sem 0x00000094
+#define ASIZ_task_vfork_sem 0x00000004
+#define AOFF_task_policy 0x00000098
#define ASIZ_task_policy 0x00000004
-#define AOFF_task_rt_priority 0x00000094
+#define AOFF_task_rt_priority 0x0000009c
#define ASIZ_task_rt_priority 0x00000004
-#define AOFF_task_it_real_value 0x00000098
+#define AOFF_task_it_real_value 0x000000a0
#define ASIZ_task_it_real_value 0x00000004
-#define AOFF_task_it_prof_value 0x0000009c
+#define AOFF_task_it_prof_value 0x000000a4
#define ASIZ_task_it_prof_value 0x00000004
-#define AOFF_task_it_virt_value 0x000000a0
+#define AOFF_task_it_virt_value 0x000000a8
#define ASIZ_task_it_virt_value 0x00000004
-#define AOFF_task_it_real_incr 0x000000a4
+#define AOFF_task_it_real_incr 0x000000ac
#define ASIZ_task_it_real_incr 0x00000004
-#define AOFF_task_it_prof_incr 0x000000a8
+#define AOFF_task_it_prof_incr 0x000000b0
#define ASIZ_task_it_prof_incr 0x00000004
-#define AOFF_task_it_virt_incr 0x000000ac
+#define AOFF_task_it_virt_incr 0x000000b4
#define ASIZ_task_it_virt_incr 0x00000004
-#define AOFF_task_real_timer 0x000000b0
+#define AOFF_task_real_timer 0x000000b8
#define ASIZ_task_real_timer 0x00000014
-#define AOFF_task_times 0x000000c4
+#define AOFF_task_times 0x000000cc
#define ASIZ_task_times 0x00000010
-#define AOFF_task_start_time 0x000000d4
+#define AOFF_task_start_time 0x000000dc
#define ASIZ_task_start_time 0x00000004
-#define AOFF_task_per_cpu_utime 0x000000d8
+#define AOFF_task_per_cpu_utime 0x000000e0
#define ASIZ_task_per_cpu_utime 0x00000004
-#define AOFF_task_min_flt 0x000000e0
+#define AOFF_task_min_flt 0x000000e8
#define ASIZ_task_min_flt 0x00000004
-#define AOFF_task_maj_flt 0x000000e4
+#define AOFF_task_maj_flt 0x000000ec
#define ASIZ_task_maj_flt 0x00000004
-#define AOFF_task_nswap 0x000000e8
+#define AOFF_task_nswap 0x000000f0
#define ASIZ_task_nswap 0x00000004
-#define AOFF_task_cmin_flt 0x000000ec
+#define AOFF_task_cmin_flt 0x000000f4
#define ASIZ_task_cmin_flt 0x00000004
-#define AOFF_task_cmaj_flt 0x000000f0
+#define AOFF_task_cmaj_flt 0x000000f8
#define ASIZ_task_cmaj_flt 0x00000004
-#define AOFF_task_cnswap 0x000000f4
+#define AOFF_task_cnswap 0x000000fc
#define ASIZ_task_cnswap 0x00000004
-#define AOFF_task_swap_address 0x000000fc
-#define ASIZ_task_swap_address 0x00000004
-#define AOFF_task_old_maj_flt 0x00000100
-#define ASIZ_task_old_maj_flt 0x00000004
-#define AOFF_task_dec_flt 0x00000104
-#define ASIZ_task_dec_flt 0x00000004
-#define AOFF_task_swap_cnt 0x00000108
-#define ASIZ_task_swap_cnt 0x00000004
-#define AOFF_task_uid 0x0000010c
+#define AOFF_task_uid 0x00000102
#define ASIZ_task_uid 0x00000002
-#define AOFF_task_euid 0x0000010e
+#define AOFF_task_euid 0x00000104
#define ASIZ_task_euid 0x00000002
-#define AOFF_task_suid 0x00000110
+#define AOFF_task_suid 0x00000106
#define ASIZ_task_suid 0x00000002
-#define AOFF_task_fsuid 0x00000112
+#define AOFF_task_fsuid 0x00000108
#define ASIZ_task_fsuid 0x00000002
-#define AOFF_task_gid 0x00000114
+#define AOFF_task_gid 0x0000010a
#define ASIZ_task_gid 0x00000002
-#define AOFF_task_egid 0x00000116
+#define AOFF_task_egid 0x0000010c
#define ASIZ_task_egid 0x00000002
-#define AOFF_task_sgid 0x00000118
+#define AOFF_task_sgid 0x0000010e
#define ASIZ_task_sgid 0x00000002
-#define AOFF_task_fsgid 0x0000011a
+#define AOFF_task_fsgid 0x00000110
#define ASIZ_task_fsgid 0x00000002
-#define AOFF_task_ngroups 0x0000011c
+#define AOFF_task_ngroups 0x00000114
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x00000120
+#define AOFF_task_groups 0x00000118
#define ASIZ_task_groups 0x00000040
-#define AOFF_task_cap_effective 0x00000160
+#define AOFF_task_cap_effective 0x00000158
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x00000164
+#define AOFF_task_cap_inheritable 0x0000015c
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000168
+#define AOFF_task_cap_permitted 0x00000160
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x0000016c
+#define AOFF_task_user 0x00000164
#define ASIZ_task_user 0x00000004
-#define AOFF_task_rlim 0x00000170
+#define AOFF_task_rlim 0x00000168
#define ASIZ_task_rlim 0x00000050
-#define AOFF_task_used_math 0x000001c0
+#define AOFF_task_used_math 0x000001b8
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x000001c2
+#define AOFF_task_comm 0x000001ba
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x000001d4
+#define AOFF_task_link_count 0x000001cc
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x000001d8
+#define AOFF_task_tty 0x000001d0
#define ASIZ_task_tty 0x00000004
-#define AOFF_task_semundo 0x000001dc
+#define AOFF_task_semundo 0x000001d4
#define ASIZ_task_semundo 0x00000004
-#define AOFF_task_semsleeping 0x000001e0
+#define AOFF_task_semsleeping 0x000001d8
#define ASIZ_task_semsleeping 0x00000004
-#define AOFF_task_tss 0x000001e8
+#define AOFF_task_tss 0x000001e0
#define ASIZ_task_tss 0x00000388
-#define AOFF_task_fs 0x00000570
+#define AOFF_task_fs 0x00000568
#define ASIZ_task_fs 0x00000004
-#define AOFF_task_files 0x00000574
+#define AOFF_task_files 0x0000056c
#define ASIZ_task_files 0x00000004
-#define AOFF_task_mm 0x00000578
+#define AOFF_task_mm 0x00000570
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_sigmask_lock 0x0000057c
+#define AOFF_task_sigmask_lock 0x00000574
#define ASIZ_task_sigmask_lock 0x00000001
-#define AOFF_task_sig 0x00000580
+#define AOFF_task_sig 0x00000578
#define ASIZ_task_sig 0x00000004
-#define AOFF_task_signal 0x00000584
+#define AOFF_task_signal 0x0000057c
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x0000058c
+#define AOFF_task_blocked 0x00000584
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x00000594
+#define AOFF_task_sigqueue 0x0000058c
#define ASIZ_task_sigqueue 0x00000004
-#define AOFF_task_sigqueue_tail 0x00000598
+#define AOFF_task_sigqueue_tail 0x00000590
#define ASIZ_task_sigqueue_tail 0x00000004
-#define AOFF_task_sas_ss_sp 0x0000059c
+#define AOFF_task_sas_ss_sp 0x00000594
#define ASIZ_task_sas_ss_sp 0x00000004
-#define AOFF_task_sas_ss_size 0x000005a0
+#define AOFF_task_sas_ss_size 0x00000598
#define ASIZ_task_sas_ss_size 0x00000004
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000004
-#define AOFF_mm_mmap_cache 0x00000004
+#define AOFF_mm_mmap_avl 0x00000004
+#define ASIZ_mm_mmap_avl 0x00000004
+#define AOFF_mm_mmap_cache 0x00000008
#define ASIZ_mm_mmap_cache 0x00000004
-#define AOFF_mm_pgd 0x00000008
+#define AOFF_mm_pgd 0x0000000c
#define ASIZ_mm_pgd 0x00000004
-#define AOFF_mm_count 0x0000000c
+#define AOFF_mm_count 0x00000010
#define ASIZ_mm_count 0x00000004
-#define AOFF_mm_map_count 0x00000010
+#define AOFF_mm_map_count 0x00000014
#define ASIZ_mm_map_count 0x00000004
-#define AOFF_mm_mmap_sem 0x00000014
+#define AOFF_mm_mmap_sem 0x00000018
#define ASIZ_mm_mmap_sem 0x0000000c
-#define AOFF_mm_context 0x00000020
+#define AOFF_mm_context 0x00000024
#define ASIZ_mm_context 0x00000004
-#define AOFF_mm_start_code 0x00000024
+#define AOFF_mm_start_code 0x00000028
#define ASIZ_mm_start_code 0x00000004
-#define AOFF_mm_end_code 0x00000028
+#define AOFF_mm_end_code 0x0000002c
#define ASIZ_mm_end_code 0x00000004
-#define AOFF_mm_start_data 0x0000002c
+#define AOFF_mm_start_data 0x00000030
#define ASIZ_mm_start_data 0x00000004
-#define AOFF_mm_end_data 0x00000030
+#define AOFF_mm_end_data 0x00000034
#define ASIZ_mm_end_data 0x00000004
-#define AOFF_mm_start_brk 0x00000034
+#define AOFF_mm_start_brk 0x00000038
#define ASIZ_mm_start_brk 0x00000004
-#define AOFF_mm_brk 0x00000038
+#define AOFF_mm_brk 0x0000003c
#define ASIZ_mm_brk 0x00000004
-#define AOFF_mm_start_stack 0x0000003c
+#define AOFF_mm_start_stack 0x00000040
#define ASIZ_mm_start_stack 0x00000004
-#define AOFF_mm_arg_start 0x00000040
+#define AOFF_mm_arg_start 0x00000044
#define ASIZ_mm_arg_start 0x00000004
-#define AOFF_mm_arg_end 0x00000044
+#define AOFF_mm_arg_end 0x00000048
#define ASIZ_mm_arg_end 0x00000004
-#define AOFF_mm_env_start 0x00000048
+#define AOFF_mm_env_start 0x0000004c
#define ASIZ_mm_env_start 0x00000004
-#define AOFF_mm_env_end 0x0000004c
+#define AOFF_mm_env_end 0x00000050
#define ASIZ_mm_env_end 0x00000004
-#define AOFF_mm_rss 0x00000050
+#define AOFF_mm_rss 0x00000054
#define ASIZ_mm_rss 0x00000004
-#define AOFF_mm_total_vm 0x00000054
+#define AOFF_mm_total_vm 0x00000058
#define ASIZ_mm_total_vm 0x00000004
-#define AOFF_mm_locked_vm 0x00000058
+#define AOFF_mm_locked_vm 0x0000005c
#define ASIZ_mm_locked_vm 0x00000004
-#define AOFF_mm_def_flags 0x0000005c
+#define AOFF_mm_def_flags 0x00000060
#define ASIZ_mm_def_flags 0x00000004
-#define AOFF_mm_cpu_vm_mask 0x00000060
+#define AOFF_mm_cpu_vm_mask 0x00000064
#define ASIZ_mm_cpu_vm_mask 0x00000004
-#define AOFF_mm_segments 0x00000064
+#define AOFF_mm_swap_cnt 0x00000068
+#define ASIZ_mm_swap_cnt 0x00000004
+#define AOFF_mm_swap_address 0x0000006c
+#define ASIZ_mm_swap_address 0x00000004
+#define AOFF_mm_segments 0x00000070
#define ASIZ_mm_segments 0x00000004
#define AOFF_thread_uwinmask 0x00000000
#define ASIZ_thread_uwinmask 0x00000004
@@ -275,7 +279,7 @@
#define AOFF_thread_new_signal 0x00000380
#define ASIZ_thread_new_signal 0x00000004
-#else /* __SMP__ */
+#else /* CONFIG_SMP */
#define AOFF_task_state 0x00000000
#define ASIZ_task_state 0x00000004
@@ -293,217 +297,219 @@
#define ASIZ_task_counter 0x00000004
#define AOFF_task_priority 0x0000001c
#define ASIZ_task_priority 0x00000004
-#define AOFF_task_has_cpu 0x00000020
+#define AOFF_task_avg_slice 0x00000020
+#define ASIZ_task_avg_slice 0x00000004
+#define AOFF_task_has_cpu 0x00000024
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000024
+#define AOFF_task_processor 0x00000028
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000028
+#define AOFF_task_last_processor 0x0000002c
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x0000002c
+#define AOFF_task_lock_depth 0x00000030
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_next_task 0x00000030
+#define AOFF_task_next_task 0x00000034
#define ASIZ_task_next_task 0x00000004
-#define AOFF_task_prev_task 0x00000034
+#define AOFF_task_prev_task 0x00000038
#define ASIZ_task_prev_task 0x00000004
-#define AOFF_task_next_run 0x00000038
+#define AOFF_task_next_run 0x0000003c
#define ASIZ_task_next_run 0x00000004
-#define AOFF_task_prev_run 0x0000003c
+#define AOFF_task_prev_run 0x00000040
#define ASIZ_task_prev_run 0x00000004
-#define AOFF_task_binfmt 0x00000040
+#define AOFF_task_binfmt 0x00000044
#define ASIZ_task_binfmt 0x00000004
-#define AOFF_task_exit_code 0x00000044
+#define AOFF_task_exit_code 0x00000048
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x00000048
+#define AOFF_task_exit_signal 0x0000004c
#define ASIZ_task_exit_signal 0x00000004
-#define AOFF_task_pdeath_signal 0x0000004c
+#define AOFF_task_pdeath_signal 0x00000050
#define ASIZ_task_pdeath_signal 0x00000004
-#define AOFF_task_personality 0x00000050
+#define AOFF_task_personality 0x00000054
#define ASIZ_task_personality 0x00000004
-#define AOFF_task_pid 0x00000058
+#define AOFF_task_pid 0x0000005c
#define ASIZ_task_pid 0x00000004
-#define AOFF_task_pgrp 0x0000005c
+#define AOFF_task_pgrp 0x00000060
#define ASIZ_task_pgrp 0x00000004
-#define AOFF_task_tty_old_pgrp 0x00000060
+#define AOFF_task_tty_old_pgrp 0x00000064
#define ASIZ_task_tty_old_pgrp 0x00000004
-#define AOFF_task_session 0x00000064
+#define AOFF_task_session 0x00000068
#define ASIZ_task_session 0x00000004
-#define AOFF_task_leader 0x00000068
+#define AOFF_task_leader 0x0000006c
#define ASIZ_task_leader 0x00000004
-#define AOFF_task_p_opptr 0x0000006c
+#define AOFF_task_p_opptr 0x00000070
#define ASIZ_task_p_opptr 0x00000004
-#define AOFF_task_p_pptr 0x00000070
+#define AOFF_task_p_pptr 0x00000074
#define ASIZ_task_p_pptr 0x00000004
-#define AOFF_task_p_cptr 0x00000074
+#define AOFF_task_p_cptr 0x00000078
#define ASIZ_task_p_cptr 0x00000004
-#define AOFF_task_p_ysptr 0x00000078
+#define AOFF_task_p_ysptr 0x0000007c
#define ASIZ_task_p_ysptr 0x00000004
-#define AOFF_task_p_osptr 0x0000007c
+#define AOFF_task_p_osptr 0x00000080
#define ASIZ_task_p_osptr 0x00000004
-#define AOFF_task_pidhash_next 0x00000080
+#define AOFF_task_pidhash_next 0x00000084
#define ASIZ_task_pidhash_next 0x00000004
-#define AOFF_task_pidhash_pprev 0x00000084
+#define AOFF_task_pidhash_pprev 0x00000088
#define ASIZ_task_pidhash_pprev 0x00000004
-#define AOFF_task_tarray_ptr 0x00000088
+#define AOFF_task_tarray_ptr 0x0000008c
#define ASIZ_task_tarray_ptr 0x00000004
-#define AOFF_task_wait_chldexit 0x0000008c
+#define AOFF_task_wait_chldexit 0x00000090
#define ASIZ_task_wait_chldexit 0x00000004
-#define AOFF_task_policy 0x00000090
+#define AOFF_task_vfork_sem 0x00000094
+#define ASIZ_task_vfork_sem 0x00000004
+#define AOFF_task_policy 0x00000098
#define ASIZ_task_policy 0x00000004
-#define AOFF_task_rt_priority 0x00000094
+#define AOFF_task_rt_priority 0x0000009c
#define ASIZ_task_rt_priority 0x00000004
-#define AOFF_task_it_real_value 0x00000098
+#define AOFF_task_it_real_value 0x000000a0
#define ASIZ_task_it_real_value 0x00000004
-#define AOFF_task_it_prof_value 0x0000009c
+#define AOFF_task_it_prof_value 0x000000a4
#define ASIZ_task_it_prof_value 0x00000004
-#define AOFF_task_it_virt_value 0x000000a0
+#define AOFF_task_it_virt_value 0x000000a8
#define ASIZ_task_it_virt_value 0x00000004
-#define AOFF_task_it_real_incr 0x000000a4
+#define AOFF_task_it_real_incr 0x000000ac
#define ASIZ_task_it_real_incr 0x00000004
-#define AOFF_task_it_prof_incr 0x000000a8
+#define AOFF_task_it_prof_incr 0x000000b0
#define ASIZ_task_it_prof_incr 0x00000004
-#define AOFF_task_it_virt_incr 0x000000ac
+#define AOFF_task_it_virt_incr 0x000000b4
#define ASIZ_task_it_virt_incr 0x00000004
-#define AOFF_task_real_timer 0x000000b0
+#define AOFF_task_real_timer 0x000000b8
#define ASIZ_task_real_timer 0x00000014
-#define AOFF_task_times 0x000000c4
+#define AOFF_task_times 0x000000cc
#define ASIZ_task_times 0x00000010
-#define AOFF_task_start_time 0x000000d4
+#define AOFF_task_start_time 0x000000dc
#define ASIZ_task_start_time 0x00000004
-#define AOFF_task_per_cpu_utime 0x000000d8
+#define AOFF_task_per_cpu_utime 0x000000e0
#define ASIZ_task_per_cpu_utime 0x00000080
-#define AOFF_task_min_flt 0x000001d8
+#define AOFF_task_min_flt 0x000001e0
#define ASIZ_task_min_flt 0x00000004
-#define AOFF_task_maj_flt 0x000001dc
+#define AOFF_task_maj_flt 0x000001e4
#define ASIZ_task_maj_flt 0x00000004
-#define AOFF_task_nswap 0x000001e0
+#define AOFF_task_nswap 0x000001e8
#define ASIZ_task_nswap 0x00000004
-#define AOFF_task_cmin_flt 0x000001e4
+#define AOFF_task_cmin_flt 0x000001ec
#define ASIZ_task_cmin_flt 0x00000004
-#define AOFF_task_cmaj_flt 0x000001e8
+#define AOFF_task_cmaj_flt 0x000001f0
#define ASIZ_task_cmaj_flt 0x00000004
-#define AOFF_task_cnswap 0x000001ec
+#define AOFF_task_cnswap 0x000001f4
#define ASIZ_task_cnswap 0x00000004
-#define AOFF_task_swap_address 0x000001f4
-#define ASIZ_task_swap_address 0x00000004
-#define AOFF_task_old_maj_flt 0x000001f8
-#define ASIZ_task_old_maj_flt 0x00000004
-#define AOFF_task_dec_flt 0x000001fc
-#define ASIZ_task_dec_flt 0x00000004
-#define AOFF_task_swap_cnt 0x00000200
-#define ASIZ_task_swap_cnt 0x00000004
-#define AOFF_task_uid 0x00000204
+#define AOFF_task_uid 0x000001fa
#define ASIZ_task_uid 0x00000002
-#define AOFF_task_euid 0x00000206
+#define AOFF_task_euid 0x000001fc
#define ASIZ_task_euid 0x00000002
-#define AOFF_task_suid 0x00000208
+#define AOFF_task_suid 0x000001fe
#define ASIZ_task_suid 0x00000002
-#define AOFF_task_fsuid 0x0000020a
+#define AOFF_task_fsuid 0x00000200
#define ASIZ_task_fsuid 0x00000002
-#define AOFF_task_gid 0x0000020c
+#define AOFF_task_gid 0x00000202
#define ASIZ_task_gid 0x00000002
-#define AOFF_task_egid 0x0000020e
+#define AOFF_task_egid 0x00000204
#define ASIZ_task_egid 0x00000002
-#define AOFF_task_sgid 0x00000210
+#define AOFF_task_sgid 0x00000206
#define ASIZ_task_sgid 0x00000002
-#define AOFF_task_fsgid 0x00000212
+#define AOFF_task_fsgid 0x00000208
#define ASIZ_task_fsgid 0x00000002
-#define AOFF_task_ngroups 0x00000214
+#define AOFF_task_ngroups 0x0000020c
#define ASIZ_task_ngroups 0x00000004
-#define AOFF_task_groups 0x00000218
+#define AOFF_task_groups 0x00000210
#define ASIZ_task_groups 0x00000040
-#define AOFF_task_cap_effective 0x00000258
+#define AOFF_task_cap_effective 0x00000250
#define ASIZ_task_cap_effective 0x00000004
-#define AOFF_task_cap_inheritable 0x0000025c
+#define AOFF_task_cap_inheritable 0x00000254
#define ASIZ_task_cap_inheritable 0x00000004
-#define AOFF_task_cap_permitted 0x00000260
+#define AOFF_task_cap_permitted 0x00000258
#define ASIZ_task_cap_permitted 0x00000004
-#define AOFF_task_user 0x00000264
+#define AOFF_task_user 0x0000025c
#define ASIZ_task_user 0x00000004
-#define AOFF_task_rlim 0x00000268
+#define AOFF_task_rlim 0x00000260
#define ASIZ_task_rlim 0x00000050
-#define AOFF_task_used_math 0x000002b8
+#define AOFF_task_used_math 0x000002b0
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x000002ba
+#define AOFF_task_comm 0x000002b2
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x000002cc
+#define AOFF_task_link_count 0x000002c4
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x000002d0
+#define AOFF_task_tty 0x000002c8
#define ASIZ_task_tty 0x00000004
-#define AOFF_task_semundo 0x000002d4
+#define AOFF_task_semundo 0x000002cc
#define ASIZ_task_semundo 0x00000004
-#define AOFF_task_semsleeping 0x000002d8
+#define AOFF_task_semsleeping 0x000002d0
#define ASIZ_task_semsleeping 0x00000004
-#define AOFF_task_tss 0x000002e0
+#define AOFF_task_tss 0x000002d8
#define ASIZ_task_tss 0x00000388
-#define AOFF_task_fs 0x00000668
+#define AOFF_task_fs 0x00000660
#define ASIZ_task_fs 0x00000004
-#define AOFF_task_files 0x0000066c
+#define AOFF_task_files 0x00000664
#define ASIZ_task_files 0x00000004
-#define AOFF_task_mm 0x00000670
+#define AOFF_task_mm 0x00000668
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_sigmask_lock 0x00000674
+#define AOFF_task_sigmask_lock 0x0000066c
#define ASIZ_task_sigmask_lock 0x00000008
-#define AOFF_task_sig 0x0000067c
+#define AOFF_task_sig 0x00000674
#define ASIZ_task_sig 0x00000004
-#define AOFF_task_signal 0x00000680
+#define AOFF_task_signal 0x00000678
#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x00000688
+#define AOFF_task_blocked 0x00000680
#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_sigqueue 0x00000690
+#define AOFF_task_sigqueue 0x00000688
#define ASIZ_task_sigqueue 0x00000004
-#define AOFF_task_sigqueue_tail 0x00000694
+#define AOFF_task_sigqueue_tail 0x0000068c
#define ASIZ_task_sigqueue_tail 0x00000004
-#define AOFF_task_sas_ss_sp 0x00000698
+#define AOFF_task_sas_ss_sp 0x00000690
#define ASIZ_task_sas_ss_sp 0x00000004
-#define AOFF_task_sas_ss_size 0x0000069c
+#define AOFF_task_sas_ss_size 0x00000694
#define ASIZ_task_sas_ss_size 0x00000004
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000004
-#define AOFF_mm_mmap_cache 0x00000004
+#define AOFF_mm_mmap_avl 0x00000004
+#define ASIZ_mm_mmap_avl 0x00000004
+#define AOFF_mm_mmap_cache 0x00000008
#define ASIZ_mm_mmap_cache 0x00000004
-#define AOFF_mm_pgd 0x00000008
+#define AOFF_mm_pgd 0x0000000c
#define ASIZ_mm_pgd 0x00000004
-#define AOFF_mm_count 0x0000000c
+#define AOFF_mm_count 0x00000010
#define ASIZ_mm_count 0x00000004
-#define AOFF_mm_map_count 0x00000010
+#define AOFF_mm_map_count 0x00000014
#define ASIZ_mm_map_count 0x00000004
-#define AOFF_mm_mmap_sem 0x00000014
+#define AOFF_mm_mmap_sem 0x00000018
#define ASIZ_mm_mmap_sem 0x0000000c
-#define AOFF_mm_context 0x00000020
+#define AOFF_mm_context 0x00000024
#define ASIZ_mm_context 0x00000004
-#define AOFF_mm_start_code 0x00000024
+#define AOFF_mm_start_code 0x00000028
#define ASIZ_mm_start_code 0x00000004
-#define AOFF_mm_end_code 0x00000028
+#define AOFF_mm_end_code 0x0000002c
#define ASIZ_mm_end_code 0x00000004
-#define AOFF_mm_start_data 0x0000002c
+#define AOFF_mm_start_data 0x00000030
#define ASIZ_mm_start_data 0x00000004
-#define AOFF_mm_end_data 0x00000030
+#define AOFF_mm_end_data 0x00000034
#define ASIZ_mm_end_data 0x00000004
-#define AOFF_mm_start_brk 0x00000034
+#define AOFF_mm_start_brk 0x00000038
#define ASIZ_mm_start_brk 0x00000004
-#define AOFF_mm_brk 0x00000038
+#define AOFF_mm_brk 0x0000003c
#define ASIZ_mm_brk 0x00000004
-#define AOFF_mm_start_stack 0x0000003c
+#define AOFF_mm_start_stack 0x00000040
#define ASIZ_mm_start_stack 0x00000004
-#define AOFF_mm_arg_start 0x00000040
+#define AOFF_mm_arg_start 0x00000044
#define ASIZ_mm_arg_start 0x00000004
-#define AOFF_mm_arg_end 0x00000044
+#define AOFF_mm_arg_end 0x00000048
#define ASIZ_mm_arg_end 0x00000004
-#define AOFF_mm_env_start 0x00000048
+#define AOFF_mm_env_start 0x0000004c
#define ASIZ_mm_env_start 0x00000004
-#define AOFF_mm_env_end 0x0000004c
+#define AOFF_mm_env_end 0x00000050
#define ASIZ_mm_env_end 0x00000004
-#define AOFF_mm_rss 0x00000050
+#define AOFF_mm_rss 0x00000054
#define ASIZ_mm_rss 0x00000004
-#define AOFF_mm_total_vm 0x00000054
+#define AOFF_mm_total_vm 0x00000058
#define ASIZ_mm_total_vm 0x00000004
-#define AOFF_mm_locked_vm 0x00000058
+#define AOFF_mm_locked_vm 0x0000005c
#define ASIZ_mm_locked_vm 0x00000004
-#define AOFF_mm_def_flags 0x0000005c
+#define AOFF_mm_def_flags 0x00000060
#define ASIZ_mm_def_flags 0x00000004
-#define AOFF_mm_cpu_vm_mask 0x00000060
+#define AOFF_mm_cpu_vm_mask 0x00000064
#define ASIZ_mm_cpu_vm_mask 0x00000004
-#define AOFF_mm_segments 0x00000064
+#define AOFF_mm_swap_cnt 0x00000068
+#define ASIZ_mm_swap_cnt 0x00000004
+#define AOFF_mm_swap_address 0x0000006c
+#define ASIZ_mm_swap_address 0x00000004
+#define AOFF_mm_segments 0x00000070
#define ASIZ_mm_segments 0x00000004
#define AOFF_thread_uwinmask 0x00000000
#define ASIZ_thread_uwinmask 0x00000004
@@ -548,6 +554,6 @@
#define AOFF_thread_new_signal 0x00000380
#define ASIZ_thread_new_signal 0x00000004
-#endif /* __SMP__ */
+#endif /* CONFIG_SMP */
#endif /* __ASM_OFFSETS_H__ */
diff --git a/include/asm-sparc/asmmacro.h b/include/asm-sparc/asmmacro.h
index ed49f6ea0..553495c08 100644
--- a/include/asm-sparc/asmmacro.h
+++ b/include/asm-sparc/asmmacro.h
@@ -26,7 +26,7 @@
#define GET_PROCESSOR_MID(reg, tmp) \
rd %tbr, %reg; \
- sethi C_LABEL(mid_xlate), %tmp; \
+ sethi %hi(C_LABEL(mid_xlate)), %tmp; \
srl %reg, 12, %reg; \
or %tmp, %lo(C_LABEL(mid_xlate)), %tmp; \
and %reg, 3, %reg; \
@@ -34,7 +34,7 @@
#define GET_PROCESSOR_OFFSET(reg, tmp) \
GET_PROCESSOR_ID(reg) \
- sethi C_LABEL(cpu_offset), %tmp; \
+ sethi %hi(C_LABEL(cpu_offset)), %tmp; \
sll %reg, 2, %reg; \
or %tmp, %lo(C_LABEL(cpu_offset)), %tmp; \
ld [%tmp + %reg], %reg;
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
index b74eebb46..5b96e139b 100644
--- a/include/asm-sparc/atomic.h
+++ b/include/asm-sparc/atomic.h
@@ -9,16 +9,22 @@
#ifdef __SMP__
/* This is a temporary measure. -DaveM */
typedef struct { volatile int counter; } atomic_t;
+#define ATOMIC_INIT(i) { (i << 8) }
#else
typedef struct { int counter; } atomic_t;
+#define ATOMIC_INIT(i) { (i) }
#endif
-#define ATOMIC_INIT(i) { (i << 8) }
-
#ifdef __KERNEL__
#include <asm/system.h>
#include <asm/psr.h>
+#ifndef __SMP__
+
+#define atomic_read(v) ((v)->counter)
+#define atomic_set(v, i) (((v)->counter) = i)
+
+#else
/* We do the bulk of the actual work out of line in two common
* routines in assembler, see arch/sparc/lib/atomic.S for the
* "fun" details.
@@ -35,14 +41,16 @@ typedef struct { int counter; } atomic_t;
static __inline__ int atomic_read(atomic_t *v)
{
- int val;
+ int ret = v->counter;
+
+ while(ret & 0xff)
+ ret = v->counter;
- __asm__ __volatile__("sra %1, 0x8, %0"
- : "=r" (val)
- : "r" (v->counter));
- return val;
+ return ret >> 8;
}
+
#define atomic_set(v, i) (((v)->counter) = ((i) << 8))
+#endif
/* Make sure gcc doesn't try to be clever and move things around
* on us. We need to use _exactly_ the address the user gave us,
diff --git a/include/asm-sparc/cache.h b/include/asm-sparc/cache.h
index 55475a5a1..19885d7e9 100644
--- a/include/asm-sparc/cache.h
+++ b/include/asm-sparc/cache.h
@@ -1,4 +1,4 @@
-/* $Id: cache.h,v 1.7 1997/05/06 09:31:46 davem Exp $
+/* $Id: cache.h,v 1.8 1999/03/11 00:14:45 davem Exp $
* cache.h: Cache specific code for the Sparc. These include flushing
* and direct tag/data line access.
*
@@ -13,6 +13,8 @@
#define L1_CACHE_BYTES 32
#define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)))
+#define SMP_CACHE_BYTES 32
+
/* Direct access to the instruction cache is provided through and
* alternate address space. The IDC bit must be off in the ICCR on
* HyperSparcs for these accesses to work. The code below does not do
diff --git a/include/asm-sparc/checksum.h b/include/asm-sparc/checksum.h
index 90bb1976a..e552cfc6a 100644
--- a/include/asm-sparc/checksum.h
+++ b/include/asm-sparc/checksum.h
@@ -1,4 +1,4 @@
-/* $Id: checksum.h,v 1.28 1998/04/17 02:37:25 davem Exp $ */
+/* $Id: checksum.h,v 1.29 1999/03/21 05:22:07 davem Exp $ */
#ifndef __SPARC_CHECKSUM_H
#define __SPARC_CHECKSUM_H
@@ -117,7 +117,10 @@ csum_partial_copy_to_user(const char *src, char *dst, int len,
return ret;
}
}
-
+
+#define HAVE_CSUM_COPY_USER
+#define csum_and_copy_to_user csum_partial_copy_to_user
+
/* ihl is always 5 or greater, almost always is 5, and iph is word aligned
* the majority of the time.
*/
diff --git a/include/asm-sparc/dma.h b/include/asm-sparc/dma.h
index 7c502a17a..133e497c4 100644
--- a/include/asm-sparc/dma.h
+++ b/include/asm-sparc/dma.h
@@ -1,4 +1,4 @@
-/* $Id: dma.h,v 1.28 1998/10/26 20:03:09 davem Exp $
+/* $Id: dma.h,v 1.29 1998/11/29 15:49:44 davem Exp $
* include/asm-sparc/dma.h
*
* Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu)
@@ -127,6 +127,7 @@ extern void dvma_init(struct linux_sbus *);
#define DMA_DSBL_RD_DRN 0x00001000 /* No EC drain on slave reads */
#define DMA_BCNT_ENAB 0x00002000 /* If on, use the byte counter */
#define DMA_TERM_CNTR 0x00004000 /* Terminal counter */
+#define DMA_SCSI_SBUS64 0x00008000 /* HME: Enable 64-bit SBUS mode. */
#define DMA_CSR_DISAB 0x00010000 /* No FIFO drains during csr */
#define DMA_SCSI_DISAB 0x00020000 /* No FIFO drains during reg */
#define DMA_DSBL_WR_INV 0x00020000 /* No EC inval. on slave writes */
@@ -147,6 +148,7 @@ extern void dvma_init(struct linux_sbus *);
#define DMA_PARITY_OFF 0x02000000 /* HME: disable parity checking */
#define DMA_LOADED_ADDR 0x04000000 /* Address has been loaded */
#define DMA_LOADED_NADDR 0x08000000 /* Next address has been loaded */
+#define DMA_RESET_FAS366 0x08000000 /* HME: Assert RESET to FAS366 */
/* Values describing the burst-size property from the PROM */
#define DMA_BURST1 0x01
diff --git a/include/asm-sparc/ethtool.h b/include/asm-sparc/ethtool.h
new file mode 100644
index 000000000..bea36b6c6
--- /dev/null
+++ b/include/asm-sparc/ethtool.h
@@ -0,0 +1,79 @@
+/* $Id: ethtool.h,v 1.1 1998/12/19 15:09:38 davem Exp $
+ * ethtool.h: Defines for SparcLinux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@dm.cobaltmicro.com)
+ */
+
+#ifndef _SPARC_ETHTOOL_H
+#define _SPARC_ETHTOOL_H
+
+/* We do things like this so it does not matter what kernel
+ * headers you have on your system etc.
+ */
+#undef SIOCETHTOOL
+#define SIOCETHTOOL (SIOCDEVPRIVATE + 0x0f)
+
+/* This should work for both 32 and 64 bit userland. */
+struct ethtool_cmd {
+ u32 cmd;
+ u32 supported;
+ u16 speed;
+ u8 duplex;
+ u8 port;
+ u8 phy_address;
+ u8 transceiver;
+ u8 autoneg;
+};
+
+/* CMDs currently supported */
+#define SPARC_ETH_GSET 0x00000001 /* Get settings, non-privileged. */
+#define SPARC_ETH_SSET 0x00000002 /* Set settings, privileged. */
+
+/* Indicates what features are supported by the interface. */
+#define SUPPORTED_10baseT_Half 0x00000001
+#define SUPPORTED_10baseT_Full 0x00000002
+#define SUPPORTED_100baseT_Half 0x00000004
+#define SUPPORTED_100baseT_Full 0x00000008
+#define SUPPORTED_1000baseT_Half 0x00000010
+#define SUPPORTED_1000baseT_Full 0x00000020
+#define SUPPORTED_Autoneg 0x00000040
+#define SUPPORTED_TP 0x00000080
+#define SUPPORTED_AUI 0x00000100
+#define SUPPORTED_MII 0x00000200
+#define SUPPORTED_FIBRE 0x00000400
+
+/* The following are all involved in forcing a particular link
+ * mode for the device for setting things. When getting the
+ * devices settings, these indicate the current mode and whether
+ * it was foced up into this mode or autonegotiated.
+ */
+
+/* The forced speec, 10Mb, 100Mb, gigabit. */
+#define SPEED_10 10
+#define SPEED_100 100
+#define SPEED_1000 1000
+
+/* Duplex, half or full. */
+#define DUPLEX_HALF 0x00
+#define DUPLEX_FULL 0x01
+
+/* Which connector port. */
+#define PORT_TP 0x00
+#define PORT_AUI 0x01
+#define PORT_MII 0x02
+#define PORT_FIBRE 0x03
+
+/* Which tranceiver to use. */
+#define XCVR_INTERNAL 0x00
+#define XCVR_EXTERNAL 0x01
+#define XCVR_DUMMY1 0x02
+#define XCVR_DUMMY2 0x03
+#define XCVR_DUMMY3 0x04
+
+/* Enable or disable autonegotiation. If this is set to enable,
+ * the forced link modes above are completely ignored.
+ */
+#define AUTONEG_DISABLE 0x00
+#define AUTONEG_ENABLE 0x01
+
+#endif /* _SPARC_ETHTOOL_H */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index a653498c9..a8e415dbd 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -15,6 +15,14 @@
#include <asm/auxio.h>
#include <asm/irq.h>
+/* We don't need no stinkin' I/O port allocation crap. */
+#undef release_region
+#undef check_region
+#undef request_region
+#define release_region(X, Y) do { } while(0)
+#define check_region(X, Y) (0)
+#define request_region(X, Y, Z) do { } while(0)
+
/* References:
* 1) Netbsd Sun floppy driver.
* 2) NCR 82077 controller manual
@@ -101,6 +109,7 @@ static int FDC2=-1;
/* Routines unique to each controller type on a Sun. */
static unsigned char sun_82072_fd_inb(int port)
{
+ udelay(5);
switch(port & 7) {
default:
printk("floppy: Asked to read unknown port %d\n", port);
@@ -117,6 +126,7 @@ static unsigned char sun_82072_fd_inb(int port)
static void sun_82072_fd_outb(unsigned char value, int port)
{
+ udelay(5);
switch(port & 7) {
default:
printk("floppy: Asked to write to unknown port %d\n", port);
@@ -152,6 +162,7 @@ static void sun_82072_fd_outb(unsigned char value, int port)
static unsigned char sun_82077_fd_inb(int port)
{
+ udelay(5);
switch(port & 7) {
default:
printk("floppy: Asked to read unknown port %d\n", port);
@@ -169,6 +180,7 @@ static unsigned char sun_82077_fd_inb(int port)
static void sun_82077_fd_outb(unsigned char value, int port)
{
+ udelay(5);
switch(port & 7) {
default:
printk("floppy: Asked to write to unknown port %d\n", port);
@@ -318,8 +330,7 @@ static int sun_floppy_init(void)
"floppy",
fd_regs[0].which_io,
0x0);
- release_region((long)sun_fdc & PAGE_MASK,
- (((long)sun_fdc & ~PAGE_MASK) + fd_regs[0].reg_size + PAGE_SIZE - 1) & PAGE_MASK);
+
/* Last minute sanity check... */
if(sun_fdc->status_82072 == 0xff) {
sun_fdc = NULL;
@@ -339,6 +350,7 @@ static int sun_floppy_init(void)
}
/* Success... */
+ allowed_drive_mask = 0x01;
return (int) sun_fdc;
no_sun_fdc:
diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h
index 359ad6e4d..12452e839 100644
--- a/include/asm-sparc/hardirq.h
+++ b/include/asm-sparc/hardirq.h
@@ -1,7 +1,7 @@
/* hardirq.h: 32-bit Sparc hard IRQ support.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1998 Anton Blanchard (anton@progsoc.uts.edu.au)
+ * Copyright (C) 1998-99 Anton Blanchard (anton@progsoc.uts.edu.au)
*/
#ifndef __SPARC_HARDIRQ_H
@@ -9,22 +9,20 @@
#include <linux/tasks.h>
-extern unsigned int local_irq_count[NR_CPUS];
+#ifndef __SMP__
+extern unsigned int local_irq_count;
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
*/
-#define in_interrupt() ({ int __cpu = smp_processor_id(); \
- (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
+#define in_interrupt() ((local_irq_count + local_bh_count) != 0)
-#ifndef __SMP__
-
-#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu) (local_irq_count == 0)
#define hardirq_endlock(cpu) do { } while (0)
-#define hardirq_enter(cpu) (local_irq_count[cpu]++)
-#define hardirq_exit(cpu) (local_irq_count[cpu]--)
+#define hardirq_enter(cpu) (local_irq_count++)
+#define hardirq_exit(cpu) (local_irq_count--)
#define synchronize_irq() barrier()
@@ -35,10 +33,18 @@ extern unsigned int local_irq_count[NR_CPUS];
#include <asm/system.h>
#include <asm/smp.h>
+extern unsigned int local_irq_count[NR_CPUS];
extern unsigned char global_irq_holder;
extern spinlock_t global_irq_lock;
extern atomic_t global_irq_count;
+/*
+ * Are we in an interrupt context? Either doing bottom half
+ * or hardware interrupt processing?
+ */
+#define in_interrupt() ({ int __cpu = smp_processor_id(); \
+ (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
+
static inline void release_irqlock(int cpu)
{
/* if we didn't own the irq lock, just ignore.. */
@@ -62,7 +68,8 @@ static inline void hardirq_exit(int cpu)
static inline int hardirq_trylock(int cpu)
{
- return !atomic_read(&global_irq_count) && !*(((volatile unsigned char *)(&global_irq_lock)));
+ return (! atomic_read(&global_irq_count) &&
+ ! spin_is_locked (&global_irq_lock));
}
#define hardirq_endlock(cpu) do { } while (0)
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h
index 94e6b8333..991584449 100644
--- a/include/asm-sparc/head.h
+++ b/include/asm-sparc/head.h
@@ -1,4 +1,4 @@
-/* $Id: head.h,v 1.35 1998/03/18 09:15:40 jj Exp $ */
+/* $Id: head.h,v 1.36 1999/04/20 13:22:42 anton Exp $ */
#ifndef __SPARC_HEAD_H
#define __SPARC_HEAD_H
@@ -8,8 +8,6 @@
#define SRMMU_L1_KBASE_OFFSET ((KERNBASE>>24)<<2) /* Used in boot remapping. */
#define INTS_ENAB 0x01 /* entry.S uses this. */
-#define NCPUS 4 /* Architectural limit of sun4m. */
-
#define SUN4_PROM_VECTOR 0xFFE81000 /* SUN4 PROM needs to be hardwired */
#define WRITE_PAUSE nop; nop; nop; /* Have to do this after %wim/%psr chg */
diff --git a/include/asm-sparc/init.h b/include/asm-sparc/init.h
index eddd82ca8..b5b1bbc47 100644
--- a/include/asm-sparc/init.h
+++ b/include/asm-sparc/init.h
@@ -7,6 +7,8 @@
#define __initfunc(__arginit) \
__arginit __init; \
__arginit
+#define __cacheline_aligned __attribute__ \
+ ((__section__ (".data.cacheline_aligned")))
/* For assembly routines */
#define __INIT .section ".text.init",#alloc,#execinstr
#define __FINIT .previous
@@ -15,6 +17,7 @@
#define __init
#define __initdata
#define __initfunc(__arginit) __arginit
+#define __cacheline_aligned
/* For assembly routines */
#define __INIT
#define __FINIT
diff --git a/include/asm-sparc/io-unit.h b/include/asm-sparc/io-unit.h
index aac5f374c..fa020cd3f 100644
--- a/include/asm-sparc/io-unit.h
+++ b/include/asm-sparc/io-unit.h
@@ -27,14 +27,18 @@
#define IOUNIT_DVMA_SIZE 0x00100000 /* 1M */
/* The format of an iopte in the external page tables */
-#define IOUPTE_PAGE 0xffffff00 /* Physical page number (PA[35:12]) */
-#define IOUPTE_CACHE 0x00000080 /* Cached (in Viking/MXCC) */
-#define IOUPTE_STREAM 0x00000040
-#define IOUPTE_INTRA 0x00000008 /* Not regular memory - probably direct sbus<->sbus dma
- FIXME: Play with this and find out how we can make use of this */
-#define IOUPTE_WRITE 0x00000004 /* Writeable */
-#define IOUPTE_VALID 0x00000002 /* IOPTE is valid */
-#define IOUPTE_PARITY 0x00000001
+#define IOUPTE_PAGE 0xffffff00 /* Physical page number (PA[35:12]) */
+#define IOUPTE_CACHE 0x00000080 /* Cached (in Viking/MXCC) */
+/* XXX Jakub, find out how to program SBUS streaming cache on XDBUS/sun4d.
+ * XXX Actually, all you should need to do is find out where the registers
+ * XXX are and copy over the sparc64 implementation I wrote. There may be
+ * XXX some horrible hwbugs though, so be careful. -DaveM
+ */
+#define IOUPTE_STREAM 0x00000040 /* Translation can use streaming cache */
+#define IOUPTE_INTRA 0x00000008 /* SBUS direct slot->slot transfer */
+#define IOUPTE_WRITE 0x00000004 /* Writeable */
+#define IOUPTE_VALID 0x00000002 /* IOPTE is valid */
+#define IOUPTE_PARITY 0x00000001 /* Parity is checked during DVMA */
struct iounit_struct {
unsigned int bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned int)];
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index 342c90e64..38e861eb6 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.25 1998/06/04 09:55:04 jj Exp $
+/* $Id: irq.h,v 1.26 1999/04/20 13:22:44 anton Exp $
* irq.h: IRQ registers on the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -8,8 +8,9 @@
#define _SPARC_IRQ_H
#include <linux/linkage.h>
+#include <linux/tasks.h> /* For NR_CPUS */
-#include <asm/system.h> /* For NCPUS */
+#include <asm/system.h> /* For SUN4M_NCPUS */
#include <asm/btfixup.h>
#define __irq_ino(irq) irq
@@ -19,46 +20,18 @@ BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int)
#define NR_IRQS 15
-/* Get rid of this when lockups have gone away. -DaveM */
-#ifndef DEBUG_IRQLOCK
-#define DEBUG_IRQLOCK
-#endif
-
/* IRQ handler dispatch entry and exit. */
#ifdef __SMP__
-#ifdef DEBUG_IRQLOCK
-extern void irq_enter(int cpu, int irq, void *regs);
-extern void irq_exit(int cpu, int irq);
-#else
-extern __inline__ void irq_enter(int cpu, int irq, void *regs)
-{
- register int proc asm("g1");
- proc = cpu;
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___irq_enter
- add %%o7, 8, %%o7
-" : "=&r" (proc)
- : "0" (proc)
- : "g2", "g3", "g4", "g5", "memory", "cc");
-}
-
-extern __inline__ void irq_exit(int cpu, int irq)
-{
- register int proc asm("g7");
- proc = cpu;
- __asm__ __volatile__("
- mov %%o7, %%g4
- call ___irq_exit
- add %%o7, 8, %%o7
-" : "=&r" (proc)
- : "0" (proc)
- : "g1", "g2", "g3", "g4", "g5", "memory", "cc");
-}
-#endif /* DEBUG_IRQLOCK */
+extern unsigned int local_irq_count[NR_CPUS];
+#define irq_enter(cpu, irq) \
+do { hardirq_enter(cpu); \
+ spin_unlock_wait(&global_irq_lock); \
+ } while(0)
+#define irq_exit(cpu, irq) hardirq_exit(cpu)
#else
-#define irq_enter(cpu, irq, regs) (local_irq_count[cpu]++)
-#define irq_exit(cpu, irq) (local_irq_count[cpu]--)
+extern unsigned int local_irq_count;
+#define irq_enter(cpu, irq) (local_irq_count++)
+#define irq_exit(cpu, irq) (local_irq_count--)
#endif
/* Dave Redman (djhr@tadpole.co.uk)
@@ -133,7 +106,7 @@ struct sun4m_intreg_percpu {
* sun4m machines, for MP the layout makes more sense.
*/
struct sun4m_intregs {
- struct sun4m_intreg_percpu cpu_intregs[NCPUS];
+ struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS];
unsigned int tbt; /* IRQ's that are still pending. */
unsigned int irqs; /* Master IRQ bits. */
diff --git a/include/asm-sparc/keyboard.h b/include/asm-sparc/keyboard.h
index 9dd63c3cb..7b1cbb0be 100644
--- a/include/asm-sparc/keyboard.h
+++ b/include/asm-sparc/keyboard.h
@@ -1,4 +1,4 @@
-/* $Id: keyboard.h,v 1.1 1998/09/22 05:54:42 jj Exp $
+/* $Id: keyboard.h,v 1.2 1999/04/28 11:59:07 davem Exp $
* linux/include/asm-sparc/keyboard.h
*
* sparc64 Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be)
@@ -18,7 +18,6 @@
extern int pcikbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pcikbd_getkeycode(unsigned int scancode);
-extern int pcikbd_pretranslate(unsigned char scancode, char raw_mode);
extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pcikbd_unexpected_up(unsigned char keycode);
@@ -28,7 +27,6 @@ extern unsigned char pcikbd_sysrq_xlate[128];
#define kbd_setkeycode pcikbd_setkeycode
#define kbd_getkeycode pcikbd_getkeycode
-#define kbd_pretranslate pcikbd_pretranslate
#define kbd_translate pcikbd_translate
#define kbd_unexpected_up pcikbd_unexpected_up
#define kbd_leds pcikbd_leds
diff --git a/include/asm-sparc/mmu_context.h b/include/asm-sparc/mmu_context.h
index d73b71f94..d31a9ea6b 100644
--- a/include/asm-sparc/mmu_context.h
+++ b/include/asm-sparc/mmu_context.h
@@ -22,10 +22,8 @@ BTFIXUPDEF_CALL(void, destroy_context, struct mm_struct *)
#define destroy_context(mm) BTFIXUP_CALL(destroy_context)(mm)
-/*
- * After we have set current->mm to a new value, this activates
- * the context for the new mm so we see the new mappings.
- * XXX this presumably needs a sensible implementation - paulus.
+/* This need not do anything on Sparc32. The switch happens
+ * properly later as a side effect of calling flush_thread.
*/
#define activate_context(tsk) do { } while(0)
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h
index 29f672eb5..8d6b911fc 100644
--- a/include/asm-sparc/namei.h
+++ b/include/asm-sparc/namei.h
@@ -1,4 +1,4 @@
-/* $Id: namei.h,v 1.12 1998/10/28 08:13:42 jj Exp $
+/* $Id: namei.h,v 1.13 1999/04/06 06:54:36 jj Exp $
* linux/include/asm-sparc/namei.h
*
* Routines to handle famous /usr/gnemul/s*.
@@ -18,11 +18,8 @@ __sparc_lookup_dentry(const char *name, int lookup_flags)
char *emul;
switch (current->personality) {
-#if 0
-/* Until we solve, why SunOS apps sometime crash, disable gnemul support for SunOS */
case PER_BSD:
emul = SPARC_BSD_EMUL; break;
-#endif
case PER_SVR4:
emul = SPARC_SOL_EMUL; break;
default:
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index 14513a0b6..57e46e7b0 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -19,6 +19,7 @@
#ifdef __KERNEL__
+#include <linux/config.h>
#include <asm/head.h> /* for KERNBASE */
#include <asm/btfixup.h>
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index 2de010213..76f7fc6bc 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.77 1998/08/04 20:51:19 davem Exp $ */
+/* $Id: pgtable.h,v 1.78 1999/01/07 14:14:05 jj Exp $ */
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
@@ -574,8 +574,10 @@ __get_iospace (unsigned long addr)
#define module_map vmalloc
#define module_unmap vfree
+extern unsigned long *sparc_valid_addr_bitmap;
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
#define PageSkip(page) (test_bit(PG_skip, &(page)->flags))
+#define kern_addr_valid(addr) (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
#endif /* !(_SPARC_PGTABLE_H) */
diff --git a/include/asm-sparc/posix_types.h b/include/asm-sparc/posix_types.h
index a3fb5bb58..4ec175150 100644
--- a/include/asm-sparc/posix_types.h
+++ b/include/asm-sparc/posix_types.h
@@ -37,9 +37,15 @@ typedef long long __kernel_loff_t;
#endif
typedef struct {
+#if defined(__KERNEL__) || defined(__USE_ALL)
int val[2];
+#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+ int __val[2];
+#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
} __kernel_fsid_t;
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
#undef __FD_SET
static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
{
@@ -109,4 +115,6 @@ static __inline__ void __FD_ZERO(__kernel_fd_set *p)
}
}
+#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+
#endif /* !(__ARCH_SPARC_POSIX_TYPES_H) */
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index 14a4621dd..f2ab4d947 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.67 1998/07/31 20:03:23 zaitcev Exp $
+/* $Id: processor.h,v 1.70 1999/03/24 11:42:44 davem Exp $
* include/asm-sparc/processor.h
*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
@@ -88,7 +88,7 @@ struct thread_struct {
#define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */
#define INIT_MMAP { &init_mm, (0), (0), \
- __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+ NULL, __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
#define INIT_TSS { \
/* uwinmask, kregs, sig_address, sig_desc, ksp, kpc, kpsr, kwim */ \
@@ -145,8 +145,13 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
/* Free all resources held by a thread. */
#define release_thread(tsk) do { } while(0)
+extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-#define copy_segments(nr, tsk, mm) do { } while (0)
+
+#define copy_segments(__nr, __tsk, __mm) \
+ if((__tsk) == current && \
+ (__mm) != NULL) \
+ flush_user_windows()
#define release_segments(mm) do { } while (0)
#define forget_segments() do { } while (0)
diff --git a/include/asm-sparc/resource.h b/include/asm-sparc/resource.h
index bcfa8c06a..7e4f49093 100644
--- a/include/asm-sparc/resource.h
+++ b/include/asm-sparc/resource.h
@@ -1,4 +1,4 @@
-/* $Id: resource.h,v 1.6 1996/11/25 03:30:25 ecd Exp $
+/* $Id: resource.h,v 1.7 1998/11/19 20:01:44 davem Exp $
* resource.h: Resource definitions.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -29,7 +29,7 @@
#define INIT_RLIMITS \
{ \
{LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
- {LONG_MAX, LONG_MAX}, {_STK_LIM, _STK_LIM}, \
+ {LONG_MAX, LONG_MAX}, {_STK_LIM, LONG_MAX}, \
{ 0, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
{NR_OPEN, NR_OPEN}, {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, \
{LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX} \
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index e04656e6c..f4468fa58 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -1,4 +1,4 @@
-/* $Id: sbus.h,v 1.15 1998/05/22 14:33:36 jj Exp $
+/* $Id: sbus.h,v 1.16 1998/12/16 04:33:52 davem Exp $
* sbus.h: Defines for the Sun SBus.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -95,6 +95,13 @@ sbus_is_slave(struct linux_sbus_device *dev)
#define for_all_sbusdev(device, bus) \
for((bus) = SBus_chain, (device) = (bus)->devices; (bus); (device)=((device)->next ? (device)->next : ((bus) = (bus)->next, (bus) ? (bus)->devices : 0)))
+/* If you did not get the buffer from mmu_get_*() or sparc_alloc_dvma()
+ * then you must use this to get the 32-bit SBUS dvma address.
+ * And in this case it is your responsibility to make sure the buffer
+ * is GFP_DMA, ie. that it is not greater than MAX_DMA_ADDRESS.
+ */
+#define sbus_dvma_addr(__addr) ((__u32)(__addr))
+
/* Apply promlib probed SBUS ranges to registers. */
extern void prom_apply_sbus_ranges(struct linux_sbus *sbus,
struct linux_prom_registers *sbusregs,
diff --git a/include/asm-sparc/semaphore-helper.h b/include/asm-sparc/semaphore-helper.h
new file mode 100644
index 000000000..e3b5a8f88
--- /dev/null
+++ b/include/asm-sparc/semaphore-helper.h
@@ -0,0 +1,167 @@
+#ifndef _SPARC_SEMAPHORE_HELPER_H
+#define _SPARC_SEMAPHORE_HELPER_H
+
+/*
+ * (barely) SMP- and interrupt-safe semaphore helper functions, sparc version.
+ *
+ * (C) Copyright 1999 David S. Miller (davem@redhat.com)
+ * (C) Copyright 1999 Jakub Jelinek (jj@ultra.linux.cz)
+ */
+#define wake_one_more(sem) atomic_inc(&(sem)->waking)
+static __inline__ int waking_non_zero(struct semaphore *sem)
+{
+ int ret;
+
+#ifdef __SMP__
+ int tmp;
+
+ __asm__ __volatile__("
+ rd %%psr, %%g1
+ or %%g1, %3, %0
+ wr %0, 0x0, %%psr
+ nop; nop; nop;
+1: ldstub [%2 + 3], %0
+ tst %0
+ bne 1b
+ ld [%2], %0
+ andn %0, 0xff, %1
+ subcc %0, 0x1ff, %0
+ bl,a 1f
+ mov 0, %0
+ mov %0, %1
+ mov 1, %0
+1: st %1, [%2]
+ wr %%g1, 0x0, %%psr
+ nop; nop; nop\n"
+ : "=&r" (ret), "=&r" (tmp)
+ : "r" (&sem->waking), "i" (PSR_PIL)
+ : "g1", "memory", "cc");
+#else
+ __asm__ __volatile__("
+ rd %%psr, %%g1
+ or %%g1, %2, %0
+ wr %0, 0x0, %%psr
+ nop; nop; nop;
+ ld [%1], %0
+ subcc %0, 1, %0
+ bl,a 1f
+ mov 0, %0
+ st %0, [%1]
+ mov 1, %0
+1: wr %%g1, 0x0, %%psr
+ nop; nop; nop\n"
+ : "=&r" (ret)
+ : "r" (&sem->waking), "i" (PSR_PIL)
+ : "g1", "memory", "cc");
+#endif
+ return ret;
+}
+
+static __inline__ int waking_non_zero_interruptible(struct semaphore *sem,
+ struct task_struct *tsk)
+{
+ int ret;
+
+#ifdef __SMP__
+ int tmp;
+
+ __asm__ __volatile__("
+ rd %%psr, %%g1
+ or %%g1, %3, %0
+ wr %0, 0x0, %%psr
+ nop; nop; nop;
+1: ldstub [%2 + 3], %0
+ tst %0
+ bne 1b
+ ld [%2], %0
+ andn %0, 0xff, %1
+ subcc %0, 0x1ff, %0
+ bl,a 1f
+ mov 0, %0
+ mov %0, %1
+ mov 1, %0
+1: st %1, [%2]
+ wr %%g1, 0x0, %%psr
+ nop; nop; nop\n"
+ : "=&r" (ret), "=&r" (tmp)
+ : "r" (&sem->waking), "i" (PSR_PIL)
+ : "g1", "memory", "cc");
+#else
+ __asm__ __volatile__("
+ rd %%psr, %%g1
+ or %%g1, %2, %0
+ wr %0, 0x0, %%psr
+ nop; nop; nop;
+ ld [%1], %0
+ subcc %0, 1, %0
+ bl,a 1f
+ mov 0, %0
+ st %0, [%1]
+ mov 1, %0
+1: wr %%g1, 0x0, %%psr
+ nop; nop; nop\n"
+ : "=&r" (ret)
+ : "r" (&sem->waking), "i" (PSR_PIL)
+ : "g1", "memory", "cc");
+#endif
+ if(ret == 0 && signal_pending(tsk)) {
+ atomic_inc(&sem->count);
+ ret = -EINTR;
+ }
+ return ret;
+}
+
+static __inline__ int waking_non_zero_trylock(struct semaphore *sem)
+{
+ int ret;
+
+#ifdef __SMP__
+ int tmp;
+
+ __asm__ __volatile__("
+ rd %%psr, %%g1
+ or %%g1, %3, %0
+ wr %0, 0x0, %%psr
+ nop; nop; nop;
+1: ldstub [%2 + 3], %0
+ tst %0
+ bne 1b
+ ld [%2], %0
+ andn %0, 0xff, %1
+ subcc %0, 0x1ff, %0
+ bl,a 1f
+ mov 0, %0
+ mov %0, %1
+ mov 1, %0
+1: st %1, [%2]
+ wr %%g1, 0x0, %%psr
+ nop; nop; nop\n"
+ : "=&r" (ret), "=&r" (tmp)
+ : "r" (&sem->waking), "i" (PSR_PIL)
+ : "g1", "memory", "cc");
+#else
+ __asm__ __volatile__("
+ rd %%psr, %%g1
+ or %%g1, %2, %0
+ wr %0, 0x0, %%psr
+ nop; nop; nop;
+ ld [%1], %0
+ subcc %0, 1, %0
+ bl,a 1f
+ mov 0, %0
+ st %0, [%1]
+ mov 1, %0
+1: wr %%g1, 0x0, %%psr
+ nop; nop; nop\n"
+ : "=&r" (ret)
+ : "r" (&sem->waking), "i" (PSR_PIL)
+ : "g1", "memory", "cc");
+#endif
+ ret = !ret;
+ if(ret == 1)
+ atomic_inc(&sem->count);
+ return ret;
+}
+
+#endif /* !(_SPARC_SEMAPHORE_HELPER_H) */
+
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h
index e9b490a5a..1123c966e 100644
--- a/include/asm-sparc/semaphore.h
+++ b/include/asm-sparc/semaphore.h
@@ -9,60 +9,148 @@
struct semaphore {
atomic_t count;
- int waking;
+ atomic_t waking;
struct wait_queue * wait;
};
-#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), 0, NULL })
-#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL })
+#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
+#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
+extern int __down_trylock(struct semaphore * sem);
extern void __up(struct semaphore * sem);
#define sema_init(sem, val) atomic_set(&((sem)->count), val)
-#define wake_one_more(sem) \
-do { \
- unsigned long flags; \
- save_and_cli(flags); \
- sem->waking++; \
- restore_flags(flags); \
-} while(0)
-
-#define waking_non_zero(sem,tsk)\
-({ unsigned long flags; \
- int ret = 0; \
- save_and_cli(flags); \
- if (sem->waking > 0) { \
- sem->waking--; \
- ret = 1; \
- } \
- restore_flags(flags); \
- ret; \
-})
-
-/* This isn't quite as clever as the x86 side, I'll be fixing this
- * soon enough.
- */
extern inline void down(struct semaphore * sem)
{
- if (atomic_dec_return(&sem->count) < 0)
- __down(sem);
+ register atomic_t *ptr asm("g1");
+ register int increment asm("g2");
+
+ ptr = (atomic_t *) __atomic_fool_gcc(sem);
+ increment = 1;
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___atomic_sub
+ add %%o7, 8, %%o7
+ tst %%g2
+ bl 2f
+ nop
+1:
+ .subsection 2
+2: save %%sp, -64, %%sp
+ mov %%g1, %%l1
+ mov %%g5, %%l5
+ call %3
+ mov %%g1, %%o0
+ mov %%l1, %%g1
+ ba 1b
+ restore %%l5, %%g0, %%g5
+ .previous\n"
+ : "=&r" (increment)
+ : "0" (increment), "r" (ptr), "i" (__down)
+ : "g3", "g4", "g7", "memory", "cc");
}
extern inline int down_interruptible(struct semaphore * sem)
{
- int ret = 0;
- if(atomic_dec_return(&sem->count) < 0)
- ret = __down_interruptible(sem);
- return ret;
+ register atomic_t *ptr asm("g1");
+ register int increment asm("g2");
+
+ ptr = (atomic_t *) __atomic_fool_gcc(sem);
+ increment = 1;
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___atomic_sub
+ add %%o7, 8, %%o7
+ tst %%g2
+ bl 2f
+ clr %%g2
+1:
+ .subsection 2
+2: save %%sp, -64, %%sp
+ mov %%g1, %%l1
+ mov %%g5, %%l5
+ call %3
+ mov %%g1, %%o0
+ mov %%l1, %%g1
+ mov %%l5, %%g5
+ ba 1b
+ restore %%o0, %%g0, %%g2
+ .previous\n"
+ : "=&r" (increment)
+ : "0" (increment), "r" (ptr), "i" (__down_interruptible)
+ : "g3", "g4", "g7", "memory", "cc");
+
+ return increment;
+}
+
+extern inline int down_trylock(struct semaphore * sem)
+{
+ register atomic_t *ptr asm("g1");
+ register int increment asm("g2");
+
+ ptr = (atomic_t *) __atomic_fool_gcc(sem);
+ increment = 1;
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___atomic_sub
+ add %%o7, 8, %%o7
+ tst %%g2
+ bl 2f
+ clr %%g2
+1:
+ .subsection 2
+2: save %%sp, -64, %%sp
+ mov %%g1, %%l1
+ mov %%g5, %%l5
+ call %3
+ mov %%g1, %%o0
+ mov %%l1, %%g1
+ mov %%l5, %%g5
+ ba 1b
+ restore %%o0, %%g0, %%g2
+ .previous\n"
+ : "=&r" (increment)
+ : "0" (increment), "r" (ptr), "i" (__down_trylock)
+ : "g3", "g4", "g7", "memory", "cc");
+
+ return increment;
}
extern inline void up(struct semaphore * sem)
{
- if (atomic_inc_return(&sem->count) <= 0)
- __up(sem);
+ register atomic_t *ptr asm("g1");
+ register int increment asm("g2");
+
+ ptr = (atomic_t *) __atomic_fool_gcc(sem);
+ increment = 1;
+
+ __asm__ __volatile__("
+ mov %%o7, %%g4
+ call ___atomic_add
+ add %%o7, 8, %%o7
+ tst %%g2
+ ble 2f
+ nop
+1:
+ .subsection 2
+2: save %%sp, -64, %%sp
+ mov %%g1, %%l1
+ mov %%g5, %%l5
+ call %3
+ mov %%g1, %%o0
+ mov %%l1, %%g1
+ ba 1b
+ restore %%l5, %%g0, %%g5
+ .previous\n"
+ : "=&r" (increment)
+ : "0" (increment), "r" (ptr), "i" (__up)
+ : "g3", "g4", "g7", "memory", "cc");
}
#endif /* __KERNEL__ */
diff --git a/include/asm-sparc/siginfo.h b/include/asm-sparc/siginfo.h
index f20a5a81c..0a838c3a9 100644
--- a/include/asm-sparc/siginfo.h
+++ b/include/asm-sparc/siginfo.h
@@ -1,4 +1,4 @@
-/* $Id: siginfo.h,v 1.3 1998/08/26 10:33:29 davem Exp $
+/* $Id: siginfo.h,v 1.4 1999/04/28 19:45:20 davem Exp $
* siginfo.c:
*/
@@ -142,7 +142,7 @@ typedef struct siginfo {
*/
#define TRAP_BRKPT 1 /* process breakpoint */
#define TRAP_TRACE 2 /* process trace trap */
-#define NSIGTRAP
+#define NSIGTRAP 2
/*
* SIGCHLD si_codes
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h
index 91afa0840..e1ba06201 100644
--- a/include/asm-sparc/smp.h
+++ b/include/asm-sparc/smp.h
@@ -96,10 +96,6 @@ extern __volatile__ int cpu_number_map[NR_CPUS];
extern __volatile__ int __cpu_logical_map[NR_CPUS];
extern unsigned long smp_proc_in_lock[NR_CPUS];
-/* As idle task checks need_resched in a tight loop, it is not necessary to
- wake it up. -jj */
-#define smp_send_reschedule(cpu) do {} while (0)
-
extern __inline__ int cpu_logical_map(int cpu)
{
return __cpu_logical_map[cpu];
@@ -161,6 +157,9 @@ extern __inline__ int hard_smp_processor_id(void)
#endif
#define smp_processor_id() hard_smp_processor_id()
+/* XXX We really need to implement this now. -DaveM */
+extern __inline__ void smp_send_reschedule(int cpu) { }
+extern __inline__ void smp_send_stop(void) { }
#endif /* !(__ASSEMBLY__) */
@@ -178,10 +177,8 @@ extern __inline__ int hard_smp_processor_id(void)
#define MBOX_IDLECPU2 0xFD
#define MBOX_STOPCPU2 0xFE
-#define PROC_CHANGE_PENALTY 20
+#define PROC_CHANGE_PENALTY 15
-#define SMP_FROM_INT 1
-#define SMP_FROM_SYSCALL 2
#endif /* !(__SMP__) */
#define NO_PROC_ID 0xFF
diff --git a/include/asm-sparc/softirq.h b/include/asm-sparc/softirq.h
index 80c5d2e3e..4920aa865 100644
--- a/include/asm-sparc/softirq.h
+++ b/include/asm-sparc/softirq.h
@@ -1,21 +1,23 @@
/* softirq.h: 32-bit Sparc soft IRQ support.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1998 Anton Blanchard (anton@progsoc.uts.edu.au)
+ * Copyright (C) 1998-99 Anton Blanchard (anton@progsoc.uts.edu.au)
*/
#ifndef __SPARC_SOFTIRQ_H
#define __SPARC_SOFTIRQ_H
+#include <linux/tasks.h> /* For NR_CPUS */
+
#include <asm/atomic.h>
#include <asm/smp.h>
#include <asm/hardirq.h>
-extern unsigned int local_bh_count[NR_CPUS];
#define get_active_bhs() (bh_mask & bh_active)
#ifdef __SMP__
+extern unsigned int local_bh_count[NR_CPUS];
/*
* The locking mechanism for base handlers, to prevent re-entrancy,
@@ -23,7 +25,7 @@ extern unsigned int local_bh_count[NR_CPUS];
* referenced at all outside of this file.
*/
extern atomic_t global_bh_lock;
-extern atomic_t global_bh_count;
+extern spinlock_t global_bh_count;
extern spinlock_t sparc_bh_lock;
extern void synchronize_bh(void);
@@ -41,7 +43,7 @@ extern inline void init_bh(int nr, void (*routine)(void))
unsigned long flags;
spin_lock_irqsave(&sparc_bh_lock, flags);
bh_base[nr] = routine;
- bh_mask_count[nr] = 0;
+ atomic_set(&bh_mask_count[nr], 0);
bh_mask |= 1 << nr;
spin_unlock_irqrestore(&sparc_bh_lock, flags);
}
@@ -50,8 +52,8 @@ extern inline void remove_bh(int nr)
{
unsigned long flags;
spin_lock_irqsave(&sparc_bh_lock, flags);
- bh_base[nr] = NULL;
bh_mask &= ~(1 << nr);
+ bh_base[nr] = NULL;
spin_unlock_irqrestore(&sparc_bh_lock, flags);
}
@@ -72,7 +74,7 @@ extern inline void disable_bh(int nr)
unsigned long flags;
spin_lock_irqsave(&sparc_bh_lock, flags);
bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
+ atomic_inc(&bh_mask_count[nr]);
spin_unlock_irqrestore(&sparc_bh_lock, flags);
synchronize_bh();
}
@@ -81,7 +83,7 @@ extern inline void enable_bh(int nr)
{
unsigned long flags;
spin_lock_irqsave(&sparc_bh_lock, flags);
- if (!--bh_mask_count[nr])
+ if (atomic_dec_and_test(&bh_mask_count[nr]))
bh_mask |= 1 << nr;
spin_unlock_irqrestore(&sparc_bh_lock, flags);
}
@@ -100,30 +102,31 @@ static inline void end_bh_atomic(void)
/* These are for the IRQs testing the lock */
static inline int softirq_trylock(int cpu)
{
- if (atomic_add_return(1, &global_bh_count) == 1) {
+ if (spin_trylock(&global_bh_count)) {
if (atomic_read(&global_bh_lock) == 0) {
++local_bh_count[cpu];
return 1;
}
+ spin_unlock(&global_bh_count);
}
- atomic_dec(&global_bh_count);
return 0;
}
static inline void softirq_endlock(int cpu)
{
local_bh_count[cpu]--;
- atomic_dec(&global_bh_count);
+ spin_unlock(&global_bh_count);
}
#else
+extern unsigned int local_bh_count;
#define clear_active_bhs(x) (bh_active &= ~(x))
#define mark_bh(nr) (bh_active |= (1 << (nr)))
/* These are for the irq's testing the lock */
-#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
-#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
+#define softirq_trylock(cpu) (local_bh_count ? 0 : (local_bh_count=1))
+#define softirq_endlock(cpu) (local_bh_count = 0)
#define synchronize_bh() barrier()
/*
@@ -133,39 +136,40 @@ static inline void softirq_endlock(int cpu)
extern inline void disable_bh(int nr)
{
bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
+ atomic_inc(&bh_mask_count[nr]);
synchronize_bh();
}
extern inline void enable_bh(int nr)
{
- if (!--bh_mask_count[nr])
+ if (atomic_dec_and_test(&bh_mask_count[nr]))
bh_mask |= 1 << nr;
}
extern inline void init_bh(int nr, void (*routine)(void))
{
bh_base[nr] = routine;
- bh_mask_count[nr] = 0;
+ atomic_set(&bh_mask_count[nr], 0);
bh_mask |= 1 << nr;
}
extern inline void remove_bh(int nr)
{
- bh_base[nr] = NULL;
bh_mask &= ~(1 << nr);
+ mb();
+ bh_base[nr] = NULL;
}
extern inline void start_bh_atomic(void)
{
- local_bh_count[0]++;
+ local_bh_count++;
barrier();
}
extern inline void end_bh_atomic(void)
{
barrier();
- local_bh_count[0]--;
+ local_bh_count--;
}
#endif /* SMP */
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h
index e58ffe605..c676dcc4c 100644
--- a/include/asm-sparc/spinlock.h
+++ b/include/asm-sparc/spinlock.h
@@ -6,6 +6,8 @@
#ifndef __SPARC_SPINLOCK_H
#define __SPARC_SPINLOCK_H
+#include <linux/tasks.h> /* For NR_CPUS */
+
#ifndef __ASSEMBLY__
#ifndef __SMP__
@@ -67,6 +69,7 @@ typedef struct _spinlock_debug spinlock_t;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 0 }
#define spin_lock_init(lp) do { (lp)->owner_pc = 0; (lp)->lock = 0; } while(0)
+#define spin_is_locked(lp) (*((volatile unsigned char *)(&((lp)->lock))) != 0)
#define spin_unlock_wait(lp) do { barrier(); } while(*(volatile unsigned char *)(&(lp)->lock))
extern void _do_spin_lock(spinlock_t *lock, char *str);
@@ -86,7 +89,7 @@ extern void _do_spin_unlock(spinlock_t *lock);
struct _rwlock_debug {
volatile unsigned int lock;
unsigned long owner_pc;
- unsigned long reader_pc[NCPUS];
+ unsigned long reader_pc[NR_CPUS];
};
typedef struct _rwlock_debug rwlock_t;
@@ -112,7 +115,7 @@ do { unsigned long flags; \
_do_read_unlock(lock, "read_unlock"); \
__restore_flags(flags); \
} while(0)
-#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti() } while(0)
+#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti(); } while(0)
#define read_unlock_irqrestore(lock, flags) do { _do_read_unlock(lock, "read_unlock_irqrestore"); __restore_flags(flags); } while(0)
#define write_lock(lock) \
@@ -139,7 +142,8 @@ typedef unsigned char spinlock_t;
#define SPIN_LOCK_UNLOCKED 0
#define spin_lock_init(lock) (*(lock) = 0)
-#define spin_unlock_wait(lock) do { barrier(); } while(*(volatile spinlock_t *)lock)
+#define spin_is_locked(lock) (*((volatile unsigned char *)(lock)) != 0)
+#define spin_unlock_wait(lock) do { barrier(); } while(*(volatile unsigned char *)lock)
extern __inline__ void spin_lock(spinlock_t *lock)
{
@@ -209,10 +213,10 @@ extern __inline__ void spin_unlock_irq(spinlock_t *lock)
: "g2", "memory");
}
-#define spin_lock_irqsave(lock, flags) \
+#define spin_lock_irqsave(__lock, flags) \
do { \
- register spinlock_t *lp asm("g1"); \
- lp = lock; \
+ register spinlock_t *__lp asm("g1"); \
+ __lp = (__lock); \
__asm__ __volatile__( \
"rd %%psr, %0\n\t" \
"or %0, %1, %%g2\n\t" \
@@ -231,7 +235,7 @@ do { \
"b,a 1b\n\t" \
".previous\n" \
: "=r" (flags) \
- : "i" (PSR_PIL), "r" (lp) \
+ : "i" (PSR_PIL), "r" (__lp) \
: "g2", "memory", "cc"); \
} while(0)
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 6dc074c78..3a4ee58a3 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.71 1998/10/13 03:51:06 jj Exp $ */
+/* $Id: system.h,v 1.74 1999/05/08 03:03:14 davem Exp $ */
#include <linux/config.h>
#ifndef __SPARC_SYSTEM_H
@@ -48,6 +48,8 @@ extern enum sparc_cpu sparc_cpu_model;
#define ARCH_SUN4 1
#endif
+#define SUN4M_NCPUS 4 /* Architectural limit of sun4m. */
+
extern unsigned long empty_bad_page;
extern unsigned long empty_bad_page_table;
extern unsigned long empty_zero_page;
@@ -82,8 +84,15 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
#define SWITCH_DO_LAZY_FPU if(last_task_used_math != next) next->tss.kregs->psr&=~PSR_EF;
#endif
- /* Much care has gone into this code, do not touch it. */
-#define switch_to(prev, next) do { \
+ /* Much care has gone into this code, do not touch it.
+ *
+ * We need to loadup regs l0/l1 for the newly forked child
+ * case because the trap return path relies on those registers
+ * holding certain values, gcc is told that they are clobbered.
+ * Gcc needs registers for 3 values in and 1 value out, so we
+ * clobber every non-fixed-usage register besides l2/l3/o4/o5. -DaveM
+ */
+#define switch_to(prev, next, last) do { \
__label__ here; \
register unsigned long task_pc asm("o7"); \
extern struct task_struct *current_set[NR_CPUS]; \
@@ -101,21 +110,22 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
next->mm->cpu_vm_mask |= (1 << smp_processor_id()); \
task_pc = ((unsigned long) &&here) - 0x8; \
__asm__ __volatile__( \
+ "mov %%g6, %%g3\n\t" \
"rd %%psr, %%g4\n\t" \
- "std %%sp, [%%g6 + %3]\n\t" \
+ "std %%sp, [%%g6 + %4]\n\t" \
"rd %%wim, %%g5\n\t" \
"wr %%g4, 0x20, %%psr\n\t" \
"nop\n\t" \
- "std %%g4, [%%g6 + %2]\n\t" \
- "ldd [%1 + %2], %%g4\n\t" \
- "mov %1, %%g6\n\t" \
+ "std %%g4, [%%g6 + %3]\n\t" \
+ "ldd [%2 + %3], %%g4\n\t" \
+ "mov %2, %%g6\n\t" \
".globl patchme_store_new_current\n" \
"patchme_store_new_current:\n\t" \
- "st %1, [%0]\n\t" \
+ "st %2, [%1]\n\t" \
"wr %%g4, 0x20, %%psr\n\t" \
"nop\n\t" \
"nop\n\t" \
- "ldd [%%g6 + %3], %%sp\n\t" \
+ "ldd [%%g6 + %4], %%sp\n\t" \
"wr %%g5, 0x0, %%wim\n\t" \
"ldd [%%sp + 0x00], %%l0\n\t" \
"ldd [%%sp + 0x38], %%i6\n\t" \
@@ -123,11 +133,13 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
"nop\n\t" \
"nop\n\t" \
"jmpl %%o7 + 0x8, %%g0\n\t" \
- " nop\n\t" : : "r" (&(current_set[hard_smp_processor_id()])), "r" (next), \
+ " mov %%g3, %0\n\t" \
+ : "=&r" (last) \
+ : "r" (&(current_set[hard_smp_processor_id()])), "r" (next), \
"i" ((const unsigned long)(&((struct task_struct *)0)->tss.kpsr)), \
"i" ((const unsigned long)(&((struct task_struct *)0)->tss.ksp)), \
"r" (task_pc) \
- : "g1", "g2", "g3", "g4", "g5", "g7", "l2", "l3", \
+ : "g1", "g2", "g3", "g4", "g5", "g7", "l0", "l1", \
"l4", "l5", "l6", "l7", "i0", "i1", "i2", "i3", "i4", "i5", "o0", "o1", "o2", \
"o3"); \
here: } while(0)
@@ -294,7 +306,9 @@ do { register unsigned long bits asm("g7"); \
#endif
/* XXX Change this if we ever use a PSO mode kernel. */
-#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define rmb() mb()
+#define wmb() mb()
#define nop() __asm__ __volatile__ ("nop");
diff --git a/include/asm-sparc/termbits.h b/include/asm-sparc/termbits.h
index 1e4ed5e50..c0c4959a2 100644
--- a/include/asm-sparc/termbits.h
+++ b/include/asm-sparc/termbits.h
@@ -153,6 +153,22 @@ struct termios {
#define B460800 0x00001004
/* This is what we can do with the Zilogs. */
#define B76800 0x00001005
+/* This is what we can do with the SAB82532. */
+#define B153600 0x00001006
+#define B307200 0x00001007
+#define B614400 0x00001008
+#define B921600 0x00001009
+/* And these are the rest... */
+#define B500000 0x0000100a
+#define B576000 0x0000100b
+#define B1000000 0x0000100c
+#define B1152000 0x0000100d
+#define B1500000 0x0000100e
+#define B2000000 0x0000100f
+#define B2500000 0x00001010
+#define B3000000 0x00001011
+#define B3500000 0x00001012
+#define B4000000 0x00001013
#define CIBAUD 0x100f0000 /* input baud rate (not used) */
#define CMSPAR 0x40000000 /* mark or space (stick) parity */
#define CRTSCTS 0x80000000 /* flow control */
diff --git a/include/asm-sparc/termios.h b/include/asm-sparc/termios.h
index d00d6558c..b24f9a324 100644
--- a/include/asm-sparc/termios.h
+++ b/include/asm-sparc/termios.h
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.27 1998/10/04 06:50:13 davem Exp $ */
+/* $Id: termios.h,v 1.29 1999/03/25 09:11:18 davem Exp $ */
#ifndef _SPARC_TERMIOS_H
#define _SPARC_TERMIOS_H
@@ -68,6 +68,7 @@ struct winsize {
#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
#define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */
#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
+#define N_HDLC 13 /* synchronous HDLC */
#ifdef __KERNEL__
diff --git a/include/asm-sparc/timer.h b/include/asm-sparc/timer.h
index 843ff4b7c..226937aca 100644
--- a/include/asm-sparc/timer.h
+++ b/include/asm-sparc/timer.h
@@ -1,4 +1,4 @@
-/* $Id: timer.h,v 1.20 1998/09/21 05:07:37 jj Exp $
+/* $Id: timer.h,v 1.21 1999/04/20 13:22:51 anton Exp $
* timer.h: Definitions for the timer chips on the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -9,7 +9,7 @@
#ifndef _SPARC_TIMER_H
#define _SPARC_TIMER_H
-#include <asm/system.h> /* For NCPUS */
+#include <asm/system.h> /* For SUN4M_NCPUS */
#include <asm/sun4paddr.h>
#include <asm/btfixup.h>
@@ -70,7 +70,7 @@ struct sun4m_timer_percpu_info {
};
struct sun4m_timer_regs {
- struct sun4m_timer_percpu_info cpu_timers[NCPUS];
+ struct sun4m_timer_percpu_info cpu_timers[SUN4M_NCPUS];
volatile unsigned int l10_timer_limit;
volatile unsigned int l10_cur_count;
diff --git a/include/asm-sparc/timex.h b/include/asm-sparc/timex.h
index 4b2b3850f..4b628788b 100644
--- a/include/asm-sparc/timex.h
+++ b/include/asm-sparc/timex.h
@@ -12,4 +12,9 @@
(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
<< (SHIFT_SCALE-SHIFT_HZ)) / HZ)
+/* XXX Maybe do something better at some point... -DaveM */
+typedef unsigned long cycles_t;
+extern cycles_t cacheflush_time;
+#define get_cycles() (0)
+
#endif
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index a2affc181..56f81b81f 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.17 1998/09/16 12:25:29 jj Exp $
+/* $Id: uaccess.h,v 1.18 1999/03/30 06:38:38 jj Exp $
* uaccess.h: User space memore access functions.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -349,9 +349,8 @@ extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size)
.align 4
.word 1f,3
.previous
-1:
mov %2, %%o1
- call __bzero
+1: call __bzero
mov %1, %%o0
mov %%o0, %0
" : "=r" (ret) : "r" (addr), "r" (size) :
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 501197be4..139dc32b5 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.48 1998/10/07 01:27:50 davem Exp $ */
+/* $Id: unistd.h,v 1.55 1999/04/07 17:14:15 davem Exp $ */
#ifndef _SPARC_UNISTD_H
#define _SPARC_UNISTD_H
@@ -28,29 +28,29 @@
#define __NR_unlink 10 /* Common */
#define __NR_execv 11 /* SunOS Specific */
#define __NR_chdir 12 /* Common */
-#define __NR_chown 13 /* Common */
+#define __NR_chown 13 /* Common */
#define __NR_mknod 14 /* Common */
#define __NR_chmod 15 /* Common */
#define __NR_lchown 16 /* Common */
#define __NR_brk 17 /* Common */
-/* #define __NR_ni_syscall 18 RESERVED for sparc64 perf-counter syscall */
+#define __NR_perfctr 18 /* Performance counter operations */
#define __NR_lseek 19 /* Common */
#define __NR_getpid 20 /* Common */
#define __NR_capget 21 /* Linux Specific */
#define __NR_capset 22 /* Linux Specific */
#define __NR_setuid 23 /* Implemented via setreuid in SunOS */
#define __NR_getuid 24 /* Common */
-/* #define __NR_ni_syscall 25 ENOSYS under SunOS */
+/* #define __NR_time alias 25 ENOSYS under SunOS */
#define __NR_ptrace 26 /* Common */
#define __NR_alarm 27 /* Implemented via setitimer in SunOS */
#define __NR_sigaltstack 28 /* Common */
#define __NR_pause 29 /* Is sigblock(0)->sigpause() in SunOS */
#define __NR_utime 30 /* Implemented via utimes() under SunOS */
-#define __NR_stty 31 /* Implemented via ioctl() under SunOS */
-#define __NR_gtty 32 /* Implemented via ioctl() under SunOS */
+/* #define __NR_stty 31 Implemented via ioctl() under SunOS */
+/* #define __NR_gtty 32 Implemented via ioctl() under SunOS */
#define __NR_access 33 /* Common */
#define __NR_nice 34 /* Implemented via get/setpriority() in SunOS */
-#define __NR_ftime 35 /* Implemented via gettimeofday() in SunOS */
+/* #define __NR_ftime 35 Implemented via gettimeofday() in SunOS */
#define __NR_sync 36 /* Common */
#define __NR_kill 37 /* Common */
#define __NR_stat 38 /* Common */
@@ -59,16 +59,16 @@
#define __NR_dup 41 /* Common */
#define __NR_pipe 42 /* Common */
#define __NR_times 43 /* Implemented via getrusage() in SunOS */
-#define __NR_profil 44 /* Common */
-/* #define __NR_ni_syscall 45 ENOSYS under SunOS */
+/* #define __NR_profil 44 Common */
+#define __NR_umount2 45 /* Linux Specific */
#define __NR_setgid 46 /* Implemented via setregid() in SunOS */
#define __NR_getgid 47 /* Common */
#define __NR_signal 48 /* Implemented via sigvec() in SunOS */
#define __NR_geteuid 49 /* SunOS calls getuid() */
#define __NR_getegid 50 /* SunOS calls getgid() */
#define __NR_acct 51 /* Common */
-/* #define __NR_ni_syscall 52 ENOSYS under SunOS */
-#define __NR_mctl 53 /* SunOS specific */
+/* #define __NR_ni_syscall 52 ENOSYS under SunOS */
+/* #define __NR_mctl 53 SunOS specific */
#define __NR_ioctl 54 /* Common */
#define __NR_reboot 55 /* Common */
/* #define __NR_ni_syscall 56 ENOSYS under SunOS */
@@ -81,60 +81,60 @@
/* #define __NR_ni_syscall 63 ENOSYS under SunOS */
#define __NR_getpagesize 64 /* Common */
#define __NR_msync 65 /* Common in newer 1.3.x revs... */
-/* #define __NR_ni_syscall 66 ENOSYS under SunOS */
+#define __NR_vfork 66 /* Common */
#define __NR_pread 67 /* Linux Specific */
#define __NR_pwrite 68 /* Linux Specific */
-#define __NR_sbrk 69 /* SunOS Specific */
-#define __NR_sstk 70 /* SunOS Specific */
+/* #define __NR_sbrk 69 SunOS Specific */
+/* #define __NR_sstk 70 SunOS Specific */
#define __NR_mmap 71 /* Common */
-#define __NR_vadvise 72 /* SunOS Specific */
+/* #define __NR_vadvise 72 SunOS Specific */
#define __NR_munmap 73 /* Common */
#define __NR_mprotect 74 /* Common */
-#define __NR_madvise 75 /* SunOS Specific */
+/* #define __NR_madvise 75 SunOS Specific */
#define __NR_vhangup 76 /* Common */
/* #define __NR_ni_syscall 77 ENOSYS under SunOS */
-#define __NR_mincore 78 /* SunOS Specific */
+/* #define __NR_mincore 78 SunOS Specific */
#define __NR_getgroups 79 /* Common */
#define __NR_setgroups 80 /* Common */
#define __NR_getpgrp 81 /* Common */
-#define __NR_setpgrp 82 /* setpgid, same difference... */
+/* #define __NR_setpgrp 82 setpgid, same difference... */
#define __NR_setitimer 83 /* Common */
/* #define __NR_ni_syscall 84 ENOSYS under SunOS */
#define __NR_swapon 85 /* Common */
#define __NR_getitimer 86 /* Common */
-#define __NR_gethostname 87 /* SunOS Specific */
+/* #define __NR_gethostname 87 SunOS Specific */
#define __NR_sethostname 88 /* Common */
-#define __NR_getdtablesize 89 /* SunOS Specific */
+/* #define __NR_getdtablesize 89 SunOS Specific */
#define __NR_dup2 90 /* Common */
-#define __NR_getdopt 91 /* SunOS Specific */
+/* #define __NR_getdopt 91 SunOS Specific */
#define __NR_fcntl 92 /* Common */
#define __NR_select 93 /* Common */
-#define __NR_setdopt 94 /* SunOS Specific */
+/* #define __NR_setdopt 94 SunOS Specific */
#define __NR_fsync 95 /* Common */
#define __NR_setpriority 96 /* Common */
#define __NR_socket 97 /* Common */
#define __NR_connect 98 /* Common */
#define __NR_accept 99 /* Common */
#define __NR_getpriority 100 /* Common */
-#define __NR_rt_sigreturn 101 /* Linux Specific */
-#define __NR_rt_sigaction 102 /* Linux Specific */
-#define __NR_rt_sigprocmask 103 /* Linux Specific */
-#define __NR_rt_sigpending 104 /* Linux Specific */
-#define __NR_rt_sigtimedwait 105 /* Linux Specific */
-#define __NR_rt_sigqueueinfo 106 /* Linux Specific */
-#define __NR_rt_sigsuspend 107 /* Linux Specific */
-#define __NR_sigvec 108 /* SunOS Specific */
-#define __NR_sigblock 109 /* SunOS Specific */
-#define __NR_sigsetmask 110 /* SunOS Specific */
-#define __NR_sigpause 111 /* SunOS Specific */
-#define __NR_sigstack 112 /* SunOS Specific */
+#define __NR_rt_sigreturn 101 /* Linux Specific */
+#define __NR_rt_sigaction 102 /* Linux Specific */
+#define __NR_rt_sigprocmask 103 /* Linux Specific */
+#define __NR_rt_sigpending 104 /* Linux Specific */
+#define __NR_rt_sigtimedwait 105 /* Linux Specific */
+#define __NR_rt_sigqueueinfo 106 /* Linux Specific */
+#define __NR_rt_sigsuspend 107 /* Linux Specific */
+/* #define __NR_sigvec 108 SunOS Specific */
+/* #define __NR_sigblock 109 SunOS Specific */
+/* #define __NR_sigsetmask 110 SunOS Specific */
+/* #define __NR_sigpause 111 SunOS Specific */
+/* #define __NR_sigstack 112 SunOS Specific */
#define __NR_recvmsg 113 /* Common */
#define __NR_sendmsg 114 /* Common */
-#define __NR_vtrace 115 /* SunOS Specific */
+/* #define __NR_vtrace 115 SunOS Specific */
#define __NR_gettimeofday 116 /* Common */
#define __NR_getrusage 117 /* Common */
#define __NR_getsockopt 118 /* Common */
-#define __NR_getcwd 119 /* Linux Specific */
+#define __NR_getcwd 119 /* Linux Specific */
#define __NR_readv 120 /* Common */
#define __NR_writev 121 /* Common */
#define __NR_settimeofday 122 /* Common */
@@ -155,63 +155,63 @@
#define __NR_rmdir 137 /* Common */
#define __NR_utimes 138 /* SunOS Specific */
/* #define __NR_ni_syscall 139 ENOSYS under SunOS */
-#define __NR_adjtime 140 /* SunOS Specific */
+/* #define __NR_adjtime 140 SunOS Specific */
#define __NR_getpeername 141 /* Common */
-#define __NR_gethostid 142 /* SunOS Specific */
+/* #define __NR_gethostid 142 SunOS Specific */
/* #define __NR_ni_syscall 143 ENOSYS under SunOS */
#define __NR_getrlimit 144 /* Common */
#define __NR_setrlimit 145 /* Common */
-#define __NR_killpg 146 /* SunOS Specific */
+/* #define __NR_killpg 146 SunOS Specific */
#define __NR_prctl 147 /* ENOSYS under SunOS */
-#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */
-#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */
+#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */
+#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */
#define __NR_getsockname 150 /* Common */
-#define __NR_getmsg 151 /* SunOS Specific */
-#define __NR_putmsg 152 /* SunOS Specific */
+/* #define __NR_getmsg 151 SunOS Specific */
+/* #define __NR_putmsg 152 SunOS Specific */
#define __NR_poll 153 /* Common */
/* #define __NR_ni_syscall 154 ENOSYS under SunOS */
-#define __NR_nfssvc 155 /* SunOS Specific */
-#define __NR_getdirentries 156 /* SunOS Specific */
+/* #define __NR_nfssvc 155 SunOS Specific */
+/* #define __NR_getdirentries 156 SunOS Specific */
#define __NR_statfs 157 /* Common */
#define __NR_fstatfs 158 /* Common */
#define __NR_umount 159 /* Common */
-#define __NR_async_daemon 160 /* SunOS Specific */
-#define __NR_getfh 161 /* SunOS Specific */
+/* #define __NR_async_daemon 160 SunOS Specific */
+/* #define __NR_getfh 161 SunOS Specific */
#define __NR_getdomainname 162 /* SunOS Specific */
#define __NR_setdomainname 163 /* Common */
-/* #define __NR_ni_syscall 164 ENOSYS under SunOS */
+/* #define __NR_ni_syscall 164 ENOSYS under SunOS */
#define __NR_quotactl 165 /* Common */
-#define __NR_exportfs 166 /* SunOS Specific */
+/* #define __NR_exportfs 166 SunOS Specific */
#define __NR_mount 167 /* Common */
#define __NR_ustat 168 /* Common */
-#define __NR_semsys 169 /* SunOS Specific */
-#define __NR_msgsys 170 /* SunOS Specific */
-#define __NR_shmsys 171 /* SunOS Specific */
-#define __NR_auditsys 172 /* SunOS Specific */
-#define __NR_rfssys 173 /* SunOS Specific */
+/* #define __NR_semsys 169 SunOS Specific */
+/* #define __NR_msgsys 170 SunOS Specific */
+/* #define __NR_shmsys 171 SunOS Specific */
+/* #define __NR_auditsys 172 SunOS Specific */
+/* #define __NR_rfssys 173 SunOS Specific */
#define __NR_getdents 174 /* Common */
#define __NR_setsid 175 /* Common */
#define __NR_fchdir 176 /* Common */
-#define __NR_fchroot 177 /* SunOS Specific */
-#define __NR_vpixsys 178 /* SunOS Specific */
-#define __NR_aioread 179 /* SunOS Specific */
-#define __NR_aiowrite 180 /* SunOS Specific */
-#define __NR_aiowait 181 /* SunOS Specific */
-#define __NR_aiocancel 182 /* SunOS Specific */
+/* #define __NR_fchroot 177 SunOS Specific */
+/* #define __NR_vpixsys 178 SunOS Specific */
+/* #define __NR_aioread 179 SunOS Specific */
+/* #define __NR_aiowrite 180 SunOS Specific */
+/* #define __NR_aiowait 181 SunOS Specific */
+/* #define __NR_aiocancel 182 SunOS Specific */
#define __NR_sigpending 183 /* Common */
-#define __NR_query_module 184 /* Linux Specific */
+#define __NR_query_module 184 /* Linux Specific */
#define __NR_setpgid 185 /* Common */
-#define __NR_pathconf 186 /* SunOS Specific */
-#define __NR_fpathconf 187 /* SunOS Specific */
-#define __NR_sysconf 188 /* SunOS Specific */
+/* #define __NR_pathconf 186 SunOS Specific */
+/* #define __NR_fpathconf 187 SunOS Specific */
+/* #define __NR_sysconf 188 SunOS Specific */
#define __NR_uname 189 /* Linux Specific */
#define __NR_init_module 190 /* Linux Specific */
#define __NR_personality 191 /* Linux Specific */
-#define __NR_prof 192 /* Linux Specific */
-#define __NR_break 193 /* Linux Specific */
-#define __NR_lock 194 /* Linux Specific */
-#define __NR_mpx 195 /* Linux Specific */
-#define __NR_ulimit 196 /* Linux Specific */
+/* #define __NR_prof 192 Linux Specific */
+/* #define __NR_break 193 Linux Specific */
+/* #define __NR_lock 194 Linux Specific */
+/* #define __NR_mpx 195 Linux Specific */
+/* #define __NR_ulimit 196 Linux Specific */
#define __NR_getppid 197 /* Linux Specific */
#define __NR_sigaction 198 /* Linux Specific */
#define __NR_sgetmask 199 /* Linux Specific */
@@ -220,20 +220,20 @@
#define __NR_oldlstat 202 /* Linux Specific */
#define __NR_uselib 203 /* Linux Specific */
#define __NR_readdir 204 /* Linux Specific */
-#define __NR_ioperm 205 /* Linux Specific - i386 specific, unused */
+/* #define __NR_ioperm 205 Linux Specific - i386 specific, unused */
#define __NR_socketcall 206 /* Linux Specific */
#define __NR_syslog 207 /* Linux Specific */
-#define __NR_olduname 208 /* Linux Specific */
-#define __NR_iopl 209 /* Linux Specific - i386 specific, unused */
+/* #define __NR_olduname 208 Linux Specific */
+/* #define __NR_iopl 209 Linux Specific - i386 specific, unused */
#define __NR_idle 210 /* Linux Specific */
-#define __NR_vm86 211 /* Linux Specific - i386 specific, unused */
+/* #define __NR_vm86 211 Linux Specific - i386 specific, unused */
#define __NR_waitpid 212 /* Linux Specific */
#define __NR_swapoff 213 /* Linux Specific */
#define __NR_sysinfo 214 /* Linux Specific */
#define __NR_ipc 215 /* Linux Specific */
#define __NR_sigreturn 216 /* Linux Specific */
#define __NR_clone 217 /* Linux Specific */
-#define __NR_modify_ldt 218 /* Linux Specific - i386 specific, unused */
+/* #define __NR_modify_ldt 218 Linux Specific - i386 specific, unused */
#define __NR_adjtimex 219 /* Linux Specific */
#define __NR_sigprocmask 220 /* Linux Specific */
#define __NR_create_module 221 /* Linux Specific */
@@ -247,10 +247,10 @@
#define __NR_setfsgid 229 /* Linux Specific */
#define __NR__newselect 230 /* Linux Specific */
#define __NR_time 231 /* Linux Specific */
-#define __NR_oldstat 232 /* Linux Specific */
+/* #define __NR_oldstat 232 Linux Specific */
#define __NR_stime 233 /* Linux Specific */
-#define __NR_oldfstat 234 /* Linux Specific */
-#define __NR_phys 235 /* Linux Specific */
+/* #define __NR_oldfstat 234 Linux Specific */
+/* #define __NR_phys 235 Linux Specific */
#define __NR__llseek 236 /* Linux Specific */
#define __NR_mlock 237
#define __NR_munlock 238
@@ -428,6 +428,8 @@ static __inline__ _syscall0(int,pause)
static __inline__ _syscall0(int,sync)
static __inline__ _syscall0(pid_t,setsid)
static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
+static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
+static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
static __inline__ _syscall1(int,dup,int,fd)
static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp)
static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
@@ -441,40 +443,6 @@ static __inline__ pid_t wait(int * wait_stat)
return waitpid(-1,wait_stat,0);
}
-/*
- * This is the mechanism for creating a new kernel thread.
- *
- * NOTE! Only a kernel-only process(ie the swapper or direct descendants
- * who haven't done an "execve()") should use this: it will work within
- * a system call from a "real" process, but the process memory space will
- * not be free'd until both the parent and the child have exited.
- */
-static __inline__ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
-{
- long retval;
-
- __asm__ __volatile("mov %4, %%g2\n\t" /* Set aside fn ptr... */
- "mov %5, %%g3\n\t" /* and arg. */
- "mov %1, %%g1\n\t"
- "mov %2, %%o0\n\t" /* Clone flags. */
- "mov 0, %%o1\n\t" /* usp arg == 0 */
- "t 0x10\n\t" /* Linux/Sparc clone(). */
- "cmp %%o1, 0\n\t"
- "be 1f\n\t" /* The parent, just return. */
- " nop\n\t" /* Delay slot. */
- "jmpl %%g2, %%o7\n\t" /* Call the function. */
- " mov %%g3, %%o0\n\t" /* Get back the arg in delay. */
- "mov %3, %%g1\n\t"
- "t 0x10\n\t" /* Linux/Sparc exit(). */
- /* Notreached by child. */
- "1: mov %%o0, %0\n\t" :
- "=r" (retval) :
- "i" (__NR_clone), "r" (flags | CLONE_VM),
- "i" (__NR_exit), "r" (fn), "r" (arg) :
- "g1", "g2", "g3", "o0", "o1", "memory", "cc");
- return retval;
-}
-
#endif /* __KERNEL_SYSCALLS__ */
#endif /* _SPARC_UNISTD_H */
diff --git a/include/asm-sparc/vaddrs.h b/include/asm-sparc/vaddrs.h
index 30e927b1b..7f5c464a4 100644
--- a/include/asm-sparc/vaddrs.h
+++ b/include/asm-sparc/vaddrs.h
@@ -1,4 +1,4 @@
-/* $Id: vaddrs.h,v 1.21 1996/10/07 03:03:02 davem Exp $ */
+/* $Id: vaddrs.h,v 1.22 1999/04/20 13:22:55 anton Exp $ */
#ifndef _SPARC_VADDRS_H
#define _SPARC_VADDRS_H
@@ -51,7 +51,7 @@
/* On sun4m machines we need per-cpu virtual areas */
#define PERCPU_VADDR 0xffc00000 /* Base for per-cpu virtual mappings */
#define PERCPU_ENTSIZE 0x00100000
-#define PERCPU_LEN ((PERCPU_ENTSIZE*NCPUS))
+#define PERCPU_LEN ((PERCPU_ENTSIZE*SUN4M_NCPUS))
/* per-cpu offsets */
#define PERCPU_TBR_OFFSET 0x00000 /* %tbr, mainly used for identification. */