Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jan 2009 11:37:21 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187948 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/linux32 compat/ndis i386/i386 i386/include i386/linux i386/svr4
Message-ID:  <200901311137.n0VBbLxt023254@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: obrien
Date: Sat Jan 31 11:37:21 2009
New Revision: 187948
URL: http://svn.freebsd.org/changeset/base/187948

Log:
  Change some movl's to mov's.  Newer GAS no longer accept 'movl' instructions
  for moving between a segment register and a 32-bit memory location.
  
  Looked at by:	jhb

Modified:
  head/sys/amd64/amd64/cpu_switch.S
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/ia32/ia32_sigtramp.S
  head/sys/amd64/include/cpufunc.h
  head/sys/amd64/linux32/linux32_locore.s
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/compat/ndis/winx32_wrap.S
  head/sys/i386/i386/locore.s
  head/sys/i386/i386/swtch.s
  head/sys/i386/include/cpufunc.h
  head/sys/i386/linux/linux_locore.s
  head/sys/i386/svr4/svr4_locore.s

Modified: head/sys/amd64/amd64/cpu_switch.S
==============================================================================
--- head/sys/amd64/amd64/cpu_switch.S	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/amd64/amd64/cpu_switch.S	Sat Jan 31 11:37:21 2009	(r187948)
@@ -260,12 +260,12 @@ do_kthread:
 	jmp	do_tss
 
 store_seg:
-	movl	%gs,PCB_GS(%r8)
+	mov	%gs,PCB_GS(%r8)
 	testl	$PCB_GS32BIT,PCB_FLAGS(%r8)
 	jnz	2f
-1:	movl	%ds,PCB_DS(%r8)
-	movl	%es,PCB_ES(%r8)
-	movl	%fs,PCB_FS(%r8)
+1:	mov	%ds,PCB_DS(%r8)
+	mov	%es,PCB_ES(%r8)
+	mov	%fs,PCB_FS(%r8)
 	jmp	done_store_seg
 2:	movq	PCPU(GS32P),%rax
 	movq	(%rax),%rax
@@ -277,11 +277,11 @@ load_seg:
 	jnz	2f
 1:	movl	$MSR_GSBASE,%ecx
 	rdmsr
-	movl	PCB_GS(%r8),%gs
+	mov	PCB_GS(%r8),%gs
 	wrmsr
-	movl	PCB_DS(%r8),%ds
-	movl	PCB_ES(%r8),%es
-	movl	PCB_FS(%r8),%fs
+	mov	PCB_DS(%r8),%ds
+	mov	PCB_ES(%r8),%es
+	mov	PCB_FS(%r8),%fs
 	jmp	restore_fsbase
 	/* Restore userland %gs while preserving kernel gsbase */
 2:	movq	PCPU(GS32P),%rax

Modified: head/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- head/sys/amd64/ia32/ia32_signal.c	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/amd64/ia32/ia32_signal.c	Sat Jan 31 11:37:21 2009	(r187948)
@@ -328,8 +328,8 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi
 	sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0;
 	sf.sf_uc.uc_mcontext.mc_gs = rgs();
 	sf.sf_uc.uc_mcontext.mc_fs = rfs();
-	__asm __volatile("movl %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
-	__asm __volatile("movl %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
+	__asm __volatile("mov %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
+	__asm __volatile("mov %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
 	sf.sf_uc.uc_mcontext.mc_edi = regs->tf_rdi;
 	sf.sf_uc.uc_mcontext.mc_esi = regs->tf_rsi;
 	sf.sf_uc.uc_mcontext.mc_ebp = regs->tf_rbp;
@@ -443,8 +443,8 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *
 	sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0;
 	sf.sf_uc.uc_mcontext.mc_gs = rgs();
 	sf.sf_uc.uc_mcontext.mc_fs = rfs();
-	__asm __volatile("movl %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
-	__asm __volatile("movl %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
+	__asm __volatile("mov %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
+	__asm __volatile("mov %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
 	sf.sf_uc.uc_mcontext.mc_edi = regs->tf_rdi;
 	sf.sf_uc.uc_mcontext.mc_esi = regs->tf_rsi;
 	sf.sf_uc.uc_mcontext.mc_ebp = regs->tf_rbp;

Modified: head/sys/amd64/ia32/ia32_sigtramp.S
==============================================================================
--- head/sys/amd64/ia32/ia32_sigtramp.S	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/amd64/ia32/ia32_sigtramp.S	Sat Jan 31 11:37:21 2009	(r187948)
@@ -45,8 +45,8 @@ ia32_sigcode:
 	calll	*IA32_SIGF_HANDLER(%esp)
 	leal	IA32_SIGF_UC(%esp),%eax	/* get ucontext */
 	pushl	%eax
-	movl	IA32_UC_ES(%eax),%es	/* restore %es */
-	movl	IA32_UC_DS(%eax),%ds	/* restore %ds */
+	mov	IA32_UC_ES(%eax),%es	/* restore %es */
+	mov	IA32_UC_DS(%eax),%ds	/* restore %ds */
 	movl	$SYS_sigreturn,%eax
 	pushl	%eax			/* junk to fake return addr. */
 	int	$0x80			/* enter kernel with args */
@@ -60,8 +60,8 @@ freebsd4_ia32_sigcode:
 	calll	*IA32_SIGF_HANDLER(%esp)
 	leal	IA32_SIGF_UC4(%esp),%eax/* get ucontext */
 	pushl	%eax
-	movl	IA32_UC4_ES(%eax),%es	/* restore %es */
-	movl	IA32_UC4_DS(%eax),%ds	/* restore %ds */
+	mov	IA32_UC4_ES(%eax),%es	/* restore %es */
+	mov	IA32_UC4_DS(%eax),%ds	/* restore %ds */
 	movl	$344,%eax		/* 4.x SYS_sigreturn */
 	pushl	%eax			/* junk to fake return addr. */
 	int	$0x80			/* enter kernel with args */

Modified: head/sys/amd64/include/cpufunc.h
==============================================================================
--- head/sys/amd64/include/cpufunc.h	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/amd64/include/cpufunc.h	Sat Jan 31 11:37:21 2009	(r187948)
@@ -482,7 +482,7 @@ static __inline u_int
 rfs(void)
 {
 	u_int sel;
-	__asm __volatile("movl %%fs,%0" : "=rm" (sel));
+	__asm __volatile("mov %%fs,%0" : "=rm" (sel));
 	return (sel);
 }
 
@@ -490,7 +490,7 @@ static __inline u_int
 rgs(void)
 {
 	u_int sel;
-	__asm __volatile("movl %%gs,%0" : "=rm" (sel));
+	__asm __volatile("mov %%gs,%0" : "=rm" (sel));
 	return (sel);
 }
 
@@ -498,20 +498,20 @@ static __inline u_int
 rss(void)
 {
 	u_int sel;
-	__asm __volatile("movl %%ss,%0" : "=rm" (sel));
+	__asm __volatile("mov %%ss,%0" : "=rm" (sel));
 	return (sel);
 }
 
 static __inline void
 load_ds(u_int sel)
 {
-	__asm __volatile("movl %0,%%ds" : : "rm" (sel));
+	__asm __volatile("mov %0,%%ds" : : "rm" (sel));
 }
 
 static __inline void
 load_es(u_int sel)
 {
-	__asm __volatile("movl %0,%%es" : : "rm" (sel));
+	__asm __volatile("mov %0,%%es" : : "rm" (sel));
 }
 
 static inline void
@@ -539,7 +539,7 @@ load_fs(u_int sel)
 
 	/* Preserve the fsbase value across the selector load */
 	fsbase = MSR_FSBASE;
-        __asm __volatile("rdmsr; movl %0,%%fs; wrmsr"
+        __asm __volatile("rdmsr; mov %0,%%fs; wrmsr"
             : : "rm" (sel), "c" (fsbase) : "eax", "edx");
 }
 
@@ -557,7 +557,7 @@ load_gs(u_int sel)
 	 * being trashed happens to be the kernel gsbase at the time.
 	 */
 	gsbase = MSR_GSBASE;
-        __asm __volatile("pushfq; cli; rdmsr; movl %0,%%gs; wrmsr; popfq"
+        __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq"
             : : "rm" (sel), "c" (gsbase) : "eax", "edx");
 }
 #else
@@ -565,13 +565,13 @@ load_gs(u_int sel)
 static __inline void
 load_fs(u_int sel)
 {
-	__asm __volatile("movl %0,%%fs" : : "rm" (sel));
+	__asm __volatile("mov %0,%%fs" : : "rm" (sel));
 }
 
 static __inline void
 load_gs(u_int sel)
 {
-	__asm __volatile("movl %0,%%gs" : : "rm" (sel));
+	__asm __volatile("mov %0,%%gs" : : "rm" (sel));
 }
 #endif
 

Modified: head/sys/amd64/linux32/linux32_locore.s
==============================================================================
--- head/sys/amd64/linux32/linux32_locore.s	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/amd64/linux32/linux32_locore.s	Sat Jan 31 11:37:21 2009	(r187948)
@@ -11,8 +11,8 @@
 NON_GPROF_ENTRY(linux_sigcode)
 	call	*LINUX_SIGF_HANDLER(%esp)
 	leal	LINUX_SIGF_SC(%esp),%ebx	/* linux scp */
-	movl	LINUX_SC_ES(%ebx),%es
-	movl	LINUX_SC_DS(%ebx),%ds
+	mov	LINUX_SC_ES(%ebx),%es
+	mov	LINUX_SC_DS(%ebx),%ds
 	movl	%esp, %ebx			/* pass sigframe */
 	push	%eax				/* fake ret addr */
 	movl	$LINUX_SYS_linux_sigreturn,%eax	/* linux_sigreturn() */
@@ -24,8 +24,8 @@ linux_rt_sigcode:
 	call	*LINUX_RT_SIGF_HANDLER(%esp)
 	leal	LINUX_RT_SIGF_UC(%esp),%ebx	/* linux ucp */
 	leal	LINUX_RT_SIGF_SC(%ebx),%ecx	/* linux sigcontext */
-	movl	LINUX_SC_ES(%ecx),%es
-	movl	LINUX_SC_DS(%ecx),%ds
+	mov	LINUX_SC_ES(%ecx),%es
+	mov	LINUX_SC_DS(%ecx),%ds
 	push	%eax				/* fake ret addr */
 	movl	$LINUX_SYS_linux_rt_sigreturn,%eax   /* linux_rt_sigreturn() */
 	int	$0x80				/* enter kernel with args */

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Sat Jan 31 11:37:21 2009	(r187948)
@@ -351,9 +351,9 @@ linux_rt_sendsig(sig_t catcher, ksiginfo
 	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__bits[0];
         frame.sf_sc.uc_mcontext.sc_gs     = rgs();
         frame.sf_sc.uc_mcontext.sc_fs     = rfs();
-        __asm __volatile("movl %%es,%0" :
+        __asm __volatile("mov %%es,%0" :
 	    "=rm" (frame.sf_sc.uc_mcontext.sc_es));
-        __asm __volatile("movl %%ds,%0" :
+        __asm __volatile("mov %%ds,%0" :
 	    "=rm" (frame.sf_sc.uc_mcontext.sc_ds));
 	frame.sf_sc.uc_mcontext.sc_edi    = regs->tf_rdi;
 	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_rsi;
@@ -485,8 +485,8 @@ linux_sendsig(sig_t catcher, ksiginfo_t 
 	frame.sf_sc.sc_mask   = lmask.__bits[0];
         frame.sf_sc.sc_gs     = rgs();
         frame.sf_sc.sc_fs     = rfs();
-        __asm __volatile("movl %%es,%0" : "=rm" (frame.sf_sc.sc_es));
-        __asm __volatile("movl %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
+        __asm __volatile("mov %%es,%0" : "=rm" (frame.sf_sc.sc_es));
+        __asm __volatile("mov %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
 	frame.sf_sc.sc_edi    = regs->tf_rdi;
 	frame.sf_sc.sc_esi    = regs->tf_rsi;
 	frame.sf_sc.sc_ebp    = regs->tf_rbp;

Modified: head/sys/compat/ndis/winx32_wrap.S
==============================================================================
--- head/sys/compat/ndis/winx32_wrap.S	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/compat/ndis/winx32_wrap.S	Sat Jan 31 11:37:21 2009	(r187948)
@@ -369,7 +369,7 @@ ENTRY(x86_getfs)
 	ret
 
 ENTRY(x86_setfs)
-	movl	4(%esp),%fs
+	mov	4(%esp),%fs
 	ret
 
 ENTRY(x86_gettid)

Modified: head/sys/i386/i386/locore.s
==============================================================================
--- head/sys/i386/i386/locore.s	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/i386/i386/locore.s	Sat Jan 31 11:37:21 2009	(r187948)
@@ -338,7 +338,7 @@ NON_GPROF_ENTRY(sigcode)
 	pushl	%eax
 	testl	$PSL_VM,UC_EFLAGS(%eax)
 	jne	1f
-	movl	UC_GS(%eax),%gs		/* restore %gs */
+	mov	UC_GS(%eax),%gs		/* restore %gs */
 1:
 	movl	$SYS_sigreturn,%eax
 	pushl	%eax			/* junk to fake return addr. */
@@ -355,7 +355,7 @@ freebsd4_sigcode:
 	pushl	%eax
 	testl	$PSL_VM,UC4_EFLAGS(%eax)
 	jne	1f
-	movl	UC4_GS(%eax),%gs	/* restore %gs */
+	mov	UC4_GS(%eax),%gs	/* restore %gs */
 1:
 	movl	$344,%eax		/* 4.x SYS_sigreturn */
 	pushl	%eax			/* junk to fake return addr. */
@@ -373,7 +373,7 @@ osigcode:
 	pushl	%eax
 	testl	$PSL_VM,SC_PS(%eax)
 	jne	9f
-	movl	SC_GS(%eax),%gs		/* restore %gs */
+	mov	SC_GS(%eax),%gs		/* restore %gs */
 9:
 	movl	$103,%eax		/* 3.x SYS_sigreturn */
 	pushl	%eax			/* junk to fake return addr. */

Modified: head/sys/i386/i386/swtch.s
==============================================================================
--- head/sys/i386/i386/swtch.s	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/i386/i386/swtch.s	Sat Jan 31 11:37:21 2009	(r187948)
@@ -130,7 +130,7 @@ ENTRY(cpu_switch)
 	movl	%ebp,PCB_EBP(%edx)
 	movl	%esi,PCB_ESI(%edx)
 	movl	%edi,PCB_EDI(%edx)
-	movl	%gs,PCB_GS(%edx)
+	mov	%gs,PCB_GS(%edx)
 	pushfl					/* PSL */
 	popl	PCB_PSL(%edx)
 	/* Test if debug registers should be saved. */
@@ -313,7 +313,7 @@ sw1:
 	/* This must be done after loading the user LDT. */
 	.globl	cpu_switch_load_gs
 cpu_switch_load_gs:
-	movl	PCB_GS(%edx),%gs
+	mov	PCB_GS(%edx),%gs
 
 	/* Test if debug registers should be restored. */
 	testl	$PCB_DBREGS,PCB_FLAGS(%edx)
@@ -383,7 +383,7 @@ ENTRY(savectx)
 	movl	%ebp,PCB_EBP(%ecx)
 	movl	%esi,PCB_ESI(%ecx)
 	movl	%edi,PCB_EDI(%ecx)
-	movl	%gs,PCB_GS(%ecx)
+	mov	%gs,PCB_GS(%ecx)
 	pushfl
 	popl	PCB_PSL(%ecx)
 

Modified: head/sys/i386/include/cpufunc.h
==============================================================================
--- head/sys/i386/include/cpufunc.h	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/i386/include/cpufunc.h	Sat Jan 31 11:37:21 2009	(r187948)
@@ -497,7 +497,7 @@ static __inline u_int
 rfs(void)
 {
 	u_int sel;
-	__asm __volatile("movl %%fs,%0" : "=rm" (sel));
+	__asm __volatile("mov %%fs,%0" : "=rm" (sel));
 	return (sel);
 }
 
@@ -513,7 +513,7 @@ static __inline u_int
 rgs(void)
 {
 	u_int sel;
-	__asm __volatile("movl %%gs,%0" : "=rm" (sel));
+	__asm __volatile("mov %%gs,%0" : "=rm" (sel));
 	return (sel);
 }
 
@@ -537,7 +537,7 @@ static __inline u_int
 rss(void)
 {
 	u_int sel;
-	__asm __volatile("movl %%ss,%0" : "=rm" (sel));
+	__asm __volatile("mov %%ss,%0" : "=rm" (sel));
 	return (sel);
 }
 
@@ -552,13 +552,13 @@ rtr(void)
 static __inline void
 load_fs(u_int sel)
 {
-	__asm __volatile("movl %0,%%fs" : : "rm" (sel));
+	__asm __volatile("mov %0,%%fs" : : "rm" (sel));
 }
 
 static __inline void
 load_gs(u_int sel)
 {
-	__asm __volatile("movl %0,%%gs" : : "rm" (sel));
+	__asm __volatile("mov %0,%%gs" : : "rm" (sel));
 }
 
 static __inline void

Modified: head/sys/i386/linux/linux_locore.s
==============================================================================
--- head/sys/i386/linux/linux_locore.s	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/i386/linux/linux_locore.s	Sat Jan 31 11:37:21 2009	(r187948)
@@ -8,7 +8,7 @@
 NON_GPROF_ENTRY(linux_sigcode)
 	call	*LINUX_SIGF_HANDLER(%esp)
 	leal	LINUX_SIGF_SC(%esp),%ebx	/* linux scp */
-	movl	LINUX_SC_GS(%ebx),%gs
+	mov	LINUX_SC_GS(%ebx),%gs
 	movl	%esp, %ebx			/* pass sigframe */
 	push	%eax				/* fake ret addr */
 	movl	$LINUX_SYS_linux_sigreturn,%eax	/* linux_sigreturn() */
@@ -20,7 +20,7 @@ linux_rt_sigcode:
 	call	*LINUX_RT_SIGF_HANDLER(%esp)
 	leal	LINUX_RT_SIGF_UC(%esp),%ebx	/* linux ucp */
 	leal	LINUX_RT_SIGF_SC(%ebx),%ecx	/* linux sigcontext */
-	movl	LINUX_SC_GS(%ecx),%gs
+	mov	LINUX_SC_GS(%ecx),%gs
 	push	%eax				/* fake ret addr */
 	movl	$LINUX_SYS_linux_rt_sigreturn,%eax   /* linux_rt_sigreturn() */
 	int	$0x80				/* enter kernel with args */

Modified: head/sys/i386/svr4/svr4_locore.s
==============================================================================
--- head/sys/i386/svr4/svr4_locore.s	Sat Jan 31 11:19:20 2009	(r187947)
+++ head/sys/i386/svr4/svr4_locore.s	Sat Jan 31 11:37:21 2009	(r187948)
@@ -14,7 +14,7 @@ NON_GPROF_ENTRY(svr4_sigcode)
 	testl	$PSL_VM,SVR4_UC_EFLAGS(%eax)
 	jnz	1f
 #endif
-	movl	SVR4_UC_GS(%eax),%gs
+	mov	SVR4_UC_GS(%eax),%gs
 1:	pushl	%eax			# pointer to ucontext
 	pushl	$1			# set context
 	movl	$svr4_sys_context,%eax



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901311137.n0VBbLxt023254>