patch-1.3.5 linux/arch/i386/kernel/entry.S

Next file: linux/arch/i386/kernel/head.S
Previous file: linux/arch/i386/kernel/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.4/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
@@ -41,6 +41,7 @@
  */
 
 #include <linux/sys.h>
+#include <linux/linkage.h>
 #include <asm/segment.h>
 
 EBX		= 0x00
@@ -82,15 +83,6 @@
 
 ENOSYS = 38
 
-.globl _system_call,_lcall7
-.globl _device_not_available, _coprocessor_error
-.globl _divide_error,_debug,_nmi,_int3,_overflow,_bounds,_invalid_op
-.globl _double_fault,_coprocessor_segment_overrun
-.globl _invalid_TSS,_segment_not_present,_stack_segment
-.globl _general_protection,_reserved
-.globl _alignment_check,_page_fault
-.globl ret_from_sys_call, _sys_call_table
-
 #define SAVE_ALL \
 	cld; \
 	push %gs; \
@@ -113,7 +105,7 @@
 #define RESTORE_ALL \
 	cmpw $(KERNEL_CS),CS(%esp); \
 	je 1f;   \
-	movl _current,%eax; \
+	movl SYMBOL_NAME(current),%eax; \
 	movl dbgreg7(%eax),%ebx; \
 	movl %ebx,%db7;	\
 1:	popl %ebx; \
@@ -130,8 +122,7 @@
 	addl $4,%esp; \
 	iret
 
-.align 4
-_lcall7:
+ENTRY(lcall7)
 	pushfl			# We get a different stack layout with call gates,
 	pushl %eax		# which has to be cleaned up later..
 	SAVE_ALL
@@ -142,7 +133,7 @@
 	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
 	movl %ecx,CS(%esp)	#
 	movl %esp,%eax
-	movl _current,%edx
+	movl SYMBOL_NAME(current),%edx
 	pushl %eax
 	movl exec_domain(%edx),%edx	# Get the execution domain
 	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
@@ -150,30 +141,30 @@
 	popl %eax
 	jmp ret_from_sys_call
 
-.align 4
+	ALIGN
 handle_bottom_half:
 	pushfl
-	incl _intr_count
+	incl SYMBOL_NAME(intr_count)
 	sti
-	call _do_bottom_half
+	call SYMBOL_NAME(do_bottom_half)
 	popfl
-	decl _intr_count
+	decl SYMBOL_NAME(intr_count)
 	jmp 9f
-.align 4
+	ALIGN
 reschedule:
 	pushl $ret_from_sys_call
-	jmp _schedule
-.align 4
-_system_call:
+	jmp SYMBOL_NAME(schedule)
+
+ENTRY(system_call)
 	pushl %eax			# save orig_eax
 	SAVE_ALL
 	movl $-ENOSYS,EAX(%esp)
 	cmpl $(NR_syscalls),%eax
 	jae ret_from_sys_call
-	movl _sys_call_table(,%eax,4),%eax
+	movl SYMBOL_NAME(sys_call_table)(,%eax,4),%eax
 	testl %eax,%eax
 	je ret_from_sys_call
-	movl _current,%ebx
+	movl SYMBOL_NAME(current),%ebx
 	andl $~CF_MASK,EFLAGS(%esp)	# clear carry - assume no errors
 	movl $0,errno(%ebx)
 	movl %db6,%edx
@@ -188,25 +179,26 @@
 	movl %edx,EAX(%esp)
 	orl $(CF_MASK),EFLAGS(%esp)	# set carry to indicate error
 	jmp ret_from_sys_call
-.align 4
-1:	call _syscall_trace
+	ALIGN
+1:	call SYMBOL_NAME(syscall_trace)
 	movl ORIG_EAX(%esp),%eax
-	call _sys_call_table(,%eax,4)
+	call SYMBOL_NAME(sys_call_table)(,%eax,4)
 	movl %eax,EAX(%esp)		# save the return value
-	movl _current,%eax
+	movl SYMBOL_NAME(current),%eax
 	movl errno(%eax),%edx
 	negl %edx
 	je 1f
 	movl %edx,EAX(%esp)
 	orl $(CF_MASK),EFLAGS(%esp)	# set carry to indicate error
-1:	call _syscall_trace
+1:	call SYMBOL_NAME(syscall_trace)
 
-	.align 4,0x90
+	ALIGN
+	.globl ret_from_sys_call
 ret_from_sys_call:
-	cmpl $0,_intr_count
+	cmpl $0,SYMBOL_NAME(intr_count)
 	jne 2f
-9:	movl _bh_mask,%eax
-	andl _bh_active,%eax
+9:	movl SYMBOL_NAME(bh_mask),%eax
+	andl SYMBOL_NAME(bh_active),%eax
 	jne handle_bottom_half
 	movl EFLAGS(%esp),%eax		# check VM86 flag: CS/SS are
 	testl $(VM_MASK),%eax		# different then
@@ -217,10 +209,10 @@
 	orl $(IF_MASK),%eax		# these just try to make sure
 	andl $~NT_MASK,%eax		# the program doesn't do anything
 	movl %eax,EFLAGS(%esp)		# stupid
-	cmpl $0,_need_resched
+	cmpl $0,SYMBOL_NAME(need_resched)
 	jne reschedule
-	movl _current,%eax
-	cmpl _task,%eax			# task[0] cannot have signals
+	movl SYMBOL_NAME(current),%eax
+	cmpl SYMBOL_NAME(task),%eax	# task[0] cannot have signals
 	je 2f
 	cmpl $0,state(%eax)		# state
 	jne reschedule
@@ -232,33 +224,32 @@
 	andl signal(%eax),%ecx
 	jne signal_return
 2:	RESTORE_ALL
-.align 4
+	ALIGN
 signal_return:
 	movl %esp,%ecx
 	pushl %ecx
 	testl $(VM_MASK),EFLAGS(%ecx)
 	jne v86_signal_return
 	pushl %ebx
-	call _do_signal
+	call SYMBOL_NAME(do_signal)
 	popl %ebx
 	popl %ebx
 	RESTORE_ALL
-.align 4
+	ALIGN
 v86_signal_return:
-	call _save_v86_state
+	call SYMBOL_NAME(save_v86_state)
 	movl %eax,%esp
 	pushl %eax
 	pushl %ebx
-	call _do_signal
+	call SYMBOL_NAME(do_signal)
 	popl %ebx
 	popl %ebx
 	RESTORE_ALL
 
-.align 4
-_divide_error:
+ENTRY(divide_error)
 	pushl $0		# no error code
-	pushl $_do_divide_error
-.align 4,0x90
+	pushl $ SYMBOL_NAME(do_divide_error)
+	ALIGN
 error_code:
 	push %fs
 	push %es
@@ -287,7 +278,7 @@
 	movl $(USER_DS),%edx
 	mov %dx,%fs
 	pushl %eax
-	movl _current,%eax
+	movl SYMBOL_NAME(current),%eax
 	movl %db6,%edx
 	movl %edx,dbgreg6(%eax)  # save current hardware debugging status
 	popl %eax
@@ -295,253 +286,235 @@
 	addl $8,%esp
 	jmp ret_from_sys_call
 
-.align 4
-_coprocessor_error:
+ENTRY(coprocessor_error)
 	pushl $0
-	pushl $_do_coprocessor_error
+	pushl $ SYMBOL_NAME(do_coprocessor_error)
 	jmp error_code
 
-.align 4
-_device_not_available:
+ENTRY(device_not_available)
 	pushl $-1		# mark this as an int
 	SAVE_ALL
 	pushl $ret_from_sys_call
 	movl %cr0,%eax
 	testl $0x4,%eax			# EM (math emulation bit)
-	je _math_state_restore
+	je SYMBOL_NAME(math_state_restore)
 	pushl $0		# temporary storage for ORIG_EIP
-	call _math_emulate
+	call  SYMBOL_NAME(math_emulate)
 	addl $4,%esp
 	ret
 
-.align 4
-_debug:
+ENTRY(debug)
 	pushl $0
-	pushl $_do_debug
+	pushl $ SYMBOL_NAME(do_debug)
 	jmp error_code
 
-.align 4
-_nmi:
+ENTRY(nmi)
 	pushl $0
-	pushl $_do_nmi
+	pushl $ SYMBOL_NAME(do_nmi)
 	jmp error_code
 
-.align 4
-_int3:
+ENTRY(int3)
 	pushl $0
-	pushl $_do_int3
+	pushl $ SYMBOL_NAME(do_int3)
 	jmp error_code
 
-.align 4
-_overflow:
+ENTRY(overflow)
 	pushl $0
-	pushl $_do_overflow
+	pushl $ SYMBOL_NAME(do_overflow)
 	jmp error_code
 
-.align 4
-_bounds:
+ENTRY(bounds)
 	pushl $0
-	pushl $_do_bounds
+	pushl $ SYMBOL_NAME(do_bounds)
 	jmp error_code
 
-.align 4
-_invalid_op:
+ENTRY(invalid_op)
 	pushl $0
-	pushl $_do_invalid_op
+	pushl $ SYMBOL_NAME(do_invalid_op)
 	jmp error_code
 
-.align 4
-_coprocessor_segment_overrun:
+ENTRY(coprocessor_segment_overrun)
 	pushl $0
-	pushl $_do_coprocessor_segment_overrun
+	pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
 	jmp error_code
 
-.align 4
-_reserved:
+ENTRY(reserved)
 	pushl $0
-	pushl $_do_reserved
+	pushl $ SYMBOL_NAME(do_reserved)
 	jmp error_code
 
-.align 4
-_double_fault:
-	pushl $_do_double_fault
+ENTRY(double_fault)
+	pushl $ SYMBOL_NAME(do_double_fault)
 	jmp error_code
 
-.align 4
-_invalid_TSS:
-	pushl $_do_invalid_TSS
+ENTRY(invalid_TSS)
+	pushl $ SYMBOL_NAME(do_invalid_TSS)
 	jmp error_code
 
-.align 4
-_segment_not_present:
-	pushl $_do_segment_not_present
+ENTRY(segment_not_present)
+	pushl $ SYMBOL_NAME(do_segment_not_present)
 	jmp error_code
 
-.align 4
-_stack_segment:
-	pushl $_do_stack_segment
+ENTRY(stack_segment)
+	pushl $ SYMBOL_NAME(do_stack_segment)
 	jmp error_code
 
-.align 4
-_general_protection:
-	pushl $_do_general_protection
+ENTRY(general_protection)
+	pushl $ SYMBOL_NAME(do_general_protection)
 	jmp error_code
 
-.align 4
-_alignment_check:
-	pushl $_do_alignment_check
+ENTRY(alignment_check)
+	pushl $ SYMBOL_NAME(do_alignment_check)
 	jmp error_code
 
-.align 4
-_page_fault:
-	pushl $_do_page_fault
+ENTRY(page_fault)
+	pushl $ SYMBOL_NAME(do_page_fault)
 	jmp error_code
 
 .data
-.align 4
-_sys_call_table:
-	.long _sys_setup		/* 0 */
-	.long _sys_exit
-	.long _sys_fork
-	.long _sys_read
-	.long _sys_write
-	.long _sys_open			/* 5 */
-	.long _sys_close
-	.long _sys_waitpid
-	.long _sys_creat
-	.long _sys_link
-	.long _sys_unlink		/* 10 */
-	.long _sys_execve
-	.long _sys_chdir
-	.long _sys_time
-	.long _sys_mknod
-	.long _sys_chmod		/* 15 */
-	.long _sys_chown
-	.long _sys_break
-	.long _sys_stat
-	.long _sys_lseek
-	.long _sys_getpid		/* 20 */
-	.long _sys_mount
-	.long _sys_umount
-	.long _sys_setuid
-	.long _sys_getuid
-	.long _sys_stime		/* 25 */
-	.long _sys_ptrace
-	.long _sys_alarm
-	.long _sys_fstat
-	.long _sys_pause
-	.long _sys_utime		/* 30 */
-	.long _sys_stty
-	.long _sys_gtty
-	.long _sys_access
-	.long _sys_nice
-	.long _sys_ftime		/* 35 */
-	.long _sys_sync
-	.long _sys_kill
-	.long _sys_rename
-	.long _sys_mkdir
-	.long _sys_rmdir		/* 40 */
-	.long _sys_dup
-	.long _sys_pipe
-	.long _sys_times
-	.long _sys_prof
-	.long _sys_brk			/* 45 */
-	.long _sys_setgid
-	.long _sys_getgid
-	.long _sys_signal
-	.long _sys_geteuid
-	.long _sys_getegid		/* 50 */
-	.long _sys_acct
-	.long _sys_phys
-	.long _sys_lock
-	.long _sys_ioctl
-	.long _sys_fcntl		/* 55 */
-	.long _sys_mpx
-	.long _sys_setpgid
-	.long _sys_ulimit
-	.long _sys_olduname
-	.long _sys_umask		/* 60 */
-	.long _sys_chroot
-	.long _sys_ustat
-	.long _sys_dup2
-	.long _sys_getppid
-	.long _sys_getpgrp		/* 65 */
-	.long _sys_setsid
-	.long _sys_sigaction
-	.long _sys_sgetmask
-	.long _sys_ssetmask
-	.long _sys_setreuid		/* 70 */
-	.long _sys_setregid
-	.long _sys_sigsuspend
-	.long _sys_sigpending
-	.long _sys_sethostname
-	.long _sys_setrlimit		/* 75 */
-	.long _sys_getrlimit
-	.long _sys_getrusage
-	.long _sys_gettimeofday
-	.long _sys_settimeofday
-	.long _sys_getgroups		/* 80 */
-	.long _sys_setgroups
-	.long _old_select
-	.long _sys_symlink
-	.long _sys_lstat
-	.long _sys_readlink		/* 85 */
-	.long _sys_uselib
-	.long _sys_swapon
-	.long _sys_reboot
-	.long _old_readdir
-	.long _old_mmap			/* 90 */
-	.long _sys_munmap
-	.long _sys_truncate
-	.long _sys_ftruncate
-	.long _sys_fchmod
-	.long _sys_fchown		/* 95 */
-	.long _sys_getpriority
-	.long _sys_setpriority
-	.long _sys_profil
-	.long _sys_statfs
-	.long _sys_fstatfs		/* 100 */
-	.long _sys_ioperm
-	.long _sys_socketcall
-	.long _sys_syslog
-	.long _sys_setitimer
-	.long _sys_getitimer		/* 105 */
-	.long _sys_newstat
-	.long _sys_newlstat
-	.long _sys_newfstat
-	.long _sys_uname
-	.long _sys_iopl			/* 110 */
-	.long _sys_vhangup
-	.long _sys_idle
-	.long _sys_vm86
-	.long _sys_wait4
-	.long _sys_swapoff		/* 115 */
-	.long _sys_sysinfo
-	.long _sys_ipc
-	.long _sys_fsync
-	.long _sys_sigreturn
-	.long _sys_clone		/* 120 */
-	.long _sys_setdomainname
-	.long _sys_newuname
-	.long _sys_modify_ldt
-	.long _sys_adjtimex
-	.long _sys_mprotect		/* 125 */
-	.long _sys_sigprocmask
-	.long _sys_create_module
-	.long _sys_init_module
-	.long _sys_delete_module
-	.long _sys_get_kernel_syms	/* 130 */
-	.long _sys_quotactl
-	.long _sys_getpgid
-	.long _sys_fchdir
-	.long _sys_bdflush
-	.long _sys_sysfs		/* 135 */
-	.long _sys_personality
-	.long 0				/* for afs_syscall */
-	.long _sys_setfsuid
-	.long _sys_setfsgid
-	.long _sys_llseek		/* 140 */
-	.long _sys_getdents
-	.long _sys_select
-	.long _sys_flock
+ENTRY(sys_call_table)
+	.long SYMBOL_NAME(sys_setup)		/* 0 */
+	.long SYMBOL_NAME(sys_exit)
+	.long SYMBOL_NAME(sys_fork)
+	.long SYMBOL_NAME(sys_read)
+	.long SYMBOL_NAME(sys_write)
+	.long SYMBOL_NAME(sys_open)		/* 5 */
+	.long SYMBOL_NAME(sys_close)
+	.long SYMBOL_NAME(sys_waitpid)
+	.long SYMBOL_NAME(sys_creat)
+	.long SYMBOL_NAME(sys_link)
+	.long SYMBOL_NAME(sys_unlink)		/* 10 */
+	.long SYMBOL_NAME(sys_execve)
+	.long SYMBOL_NAME(sys_chdir)
+	.long SYMBOL_NAME(sys_time)
+	.long SYMBOL_NAME(sys_mknod)
+	.long SYMBOL_NAME(sys_chmod)		/* 15 */
+	.long SYMBOL_NAME(sys_chown)
+	.long SYMBOL_NAME(sys_break)
+	.long SYMBOL_NAME(sys_stat)
+	.long SYMBOL_NAME(sys_lseek)
+	.long SYMBOL_NAME(sys_getpid)		/* 20 */
+	.long SYMBOL_NAME(sys_mount)
+	.long SYMBOL_NAME(sys_umount)
+	.long SYMBOL_NAME(sys_setuid)
+	.long SYMBOL_NAME(sys_getuid)
+	.long SYMBOL_NAME(sys_stime)		/* 25 */
+	.long SYMBOL_NAME(sys_ptrace)
+	.long SYMBOL_NAME(sys_alarm)
+	.long SYMBOL_NAME(sys_fstat)
+	.long SYMBOL_NAME(sys_pause)
+	.long SYMBOL_NAME(sys_utime)		/* 30 */
+	.long SYMBOL_NAME(sys_stty)
+	.long SYMBOL_NAME(sys_gtty)
+	.long SYMBOL_NAME(sys_access)
+	.long SYMBOL_NAME(sys_nice)
+	.long SYMBOL_NAME(sys_ftime)		/* 35 */
+	.long SYMBOL_NAME(sys_sync)
+	.long SYMBOL_NAME(sys_kill)
+	.long SYMBOL_NAME(sys_rename)
+	.long SYMBOL_NAME(sys_mkdir)
+	.long SYMBOL_NAME(sys_rmdir)		/* 40 */
+	.long SYMBOL_NAME(sys_dup)
+	.long SYMBOL_NAME(sys_pipe)
+	.long SYMBOL_NAME(sys_times)
+	.long SYMBOL_NAME(sys_prof)
+	.long SYMBOL_NAME(sys_brk)		/* 45 */
+	.long SYMBOL_NAME(sys_setgid)
+	.long SYMBOL_NAME(sys_getgid)
+	.long SYMBOL_NAME(sys_signal)
+	.long SYMBOL_NAME(sys_geteuid)
+	.long SYMBOL_NAME(sys_getegid)		/* 50 */
+	.long SYMBOL_NAME(sys_acct)
+	.long SYMBOL_NAME(sys_phys)
+	.long SYMBOL_NAME(sys_lock)
+	.long SYMBOL_NAME(sys_ioctl)
+	.long SYMBOL_NAME(sys_fcntl)		/* 55 */
+	.long SYMBOL_NAME(sys_mpx)
+	.long SYMBOL_NAME(sys_setpgid)
+	.long SYMBOL_NAME(sys_ulimit)
+	.long SYMBOL_NAME(sys_olduname)
+	.long SYMBOL_NAME(sys_umask)		/* 60 */
+	.long SYMBOL_NAME(sys_chroot)
+	.long SYMBOL_NAME(sys_ustat)
+	.long SYMBOL_NAME(sys_dup2)
+	.long SYMBOL_NAME(sys_getppid)
+	.long SYMBOL_NAME(sys_getpgrp)		/* 65 */
+	.long SYMBOL_NAME(sys_setsid)
+	.long SYMBOL_NAME(sys_sigaction)
+	.long SYMBOL_NAME(sys_sgetmask)
+	.long SYMBOL_NAME(sys_ssetmask)
+	.long SYMBOL_NAME(sys_setreuid)		/* 70 */
+	.long SYMBOL_NAME(sys_setregid)
+	.long SYMBOL_NAME(sys_sigsuspend)
+	.long SYMBOL_NAME(sys_sigpending)
+	.long SYMBOL_NAME(sys_sethostname)
+	.long SYMBOL_NAME(sys_setrlimit)	/* 75 */
+	.long SYMBOL_NAME(sys_getrlimit)
+	.long SYMBOL_NAME(sys_getrusage)
+	.long SYMBOL_NAME(sys_gettimeofday)
+	.long SYMBOL_NAME(sys_settimeofday)
+	.long SYMBOL_NAME(sys_getgroups)	/* 80 */
+	.long SYMBOL_NAME(sys_setgroups)
+	.long SYMBOL_NAME(old_select)
+	.long SYMBOL_NAME(sys_symlink)
+	.long SYMBOL_NAME(sys_lstat)
+	.long SYMBOL_NAME(sys_readlink)		/* 85 */
+	.long SYMBOL_NAME(sys_uselib)
+	.long SYMBOL_NAME(sys_swapon)
+	.long SYMBOL_NAME(sys_reboot)
+	.long SYMBOL_NAME(old_readdir)
+	.long SYMBOL_NAME(old_mmap)		/* 90 */
+	.long SYMBOL_NAME(sys_munmap)
+	.long SYMBOL_NAME(sys_truncate)
+	.long SYMBOL_NAME(sys_ftruncate)
+	.long SYMBOL_NAME(sys_fchmod)
+	.long SYMBOL_NAME(sys_fchown)		/* 95 */
+	.long SYMBOL_NAME(sys_getpriority)
+	.long SYMBOL_NAME(sys_setpriority)
+	.long SYMBOL_NAME(sys_profil)
+	.long SYMBOL_NAME(sys_statfs)
+	.long SYMBOL_NAME(sys_fstatfs)		/* 100 */
+	.long SYMBOL_NAME(sys_ioperm)
+	.long SYMBOL_NAME(sys_socketcall)
+	.long SYMBOL_NAME(sys_syslog)
+	.long SYMBOL_NAME(sys_setitimer)
+	.long SYMBOL_NAME(sys_getitimer)	/* 105 */
+	.long SYMBOL_NAME(sys_newstat)
+	.long SYMBOL_NAME(sys_newlstat)
+	.long SYMBOL_NAME(sys_newfstat)
+	.long SYMBOL_NAME(sys_uname)
+	.long SYMBOL_NAME(sys_iopl)		/* 110 */
+	.long SYMBOL_NAME(sys_vhangup)
+	.long SYMBOL_NAME(sys_idle)
+	.long SYMBOL_NAME(sys_vm86)
+	.long SYMBOL_NAME(sys_wait4)
+	.long SYMBOL_NAME(sys_swapoff)		/* 115 */
+	.long SYMBOL_NAME(sys_sysinfo)
+	.long SYMBOL_NAME(sys_ipc)
+	.long SYMBOL_NAME(sys_fsync)
+	.long SYMBOL_NAME(sys_sigreturn)
+	.long SYMBOL_NAME(sys_clone)		/* 120 */
+	.long SYMBOL_NAME(sys_setdomainname)
+	.long SYMBOL_NAME(sys_newuname)
+	.long SYMBOL_NAME(sys_modify_ldt)
+	.long SYMBOL_NAME(sys_adjtimex)
+	.long SYMBOL_NAME(sys_mprotect)		/* 125 */
+	.long SYMBOL_NAME(sys_sigprocmask)
+	.long SYMBOL_NAME(sys_create_module)
+	.long SYMBOL_NAME(sys_init_module)
+	.long SYMBOL_NAME(sys_delete_module)
+	.long SYMBOL_NAME(sys_get_kernel_syms)	/* 130 */
+	.long SYMBOL_NAME(sys_quotactl)
+	.long SYMBOL_NAME(sys_getpgid)
+	.long SYMBOL_NAME(sys_fchdir)
+	.long SYMBOL_NAME(sys_bdflush)
+	.long SYMBOL_NAME(sys_sysfs)		/* 135 */
+	.long SYMBOL_NAME(sys_personality)
+	.long 0					/* for afs_syscall */
+	.long SYMBOL_NAME(sys_setfsuid)
+	.long SYMBOL_NAME(sys_setfsgid)
+	.long SYMBOL_NAME(sys_llseek)		/* 140 */
+	.long SYMBOL_NAME(sys_getdents)
+	.long SYMBOL_NAME(sys_select)
+	.long SYMBOL_NAME(sys_flock)
 	.space (NR_syscalls-143)*4

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this