Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jun 2015 17:39:25 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284159 - head/sys/amd64/linux
Message-ID:  <201506081739.t58HdP8h039891@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Mon Jun  8 17:39:25 2015
New Revision: 284159
URL: https://svnweb.freebsd.org/changeset/base/284159

Log:
  Futex is an aligned 32-bit integer. Use the proper instruction and
  operand when dereferencing futex pointer.

Modified:
  head/sys/amd64/linux/linux_support.s

Modified: head/sys/amd64/linux/linux_support.s
==============================================================================
--- head/sys/amd64/linux/linux_support.s	Mon Jun  8 16:24:43 2015	(r284158)
+++ head/sys/amd64/linux/linux_support.s	Mon Jun  8 17:39:25 2015	(r284159)
@@ -45,9 +45,9 @@ ENTRY(futex_xchgl)
 	movq	$VM_MAXUSER_ADDRESS-4,%rax
 	cmpq	%rax,%rsi
 	ja	futex_fault
-	xchgq	%rdi,(%rsi)
-	movq	%rdi,(%rdx)
-	xorq	%rax,%rax
+	xchgl	%edi,(%rsi)
+	movl	%edi,(%rdx)
+	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%r8)
 	ret
 
@@ -60,9 +60,9 @@ ENTRY(futex_addl)
 #ifdef SMP
 	lock
 #endif
-	xaddq	%rdi,(%rsi)
-	movq	%rdi,(%rdx)
-	xorq	%rax,%rax
+	xaddl	%edi,(%rsi)
+	movl	%edi,(%rdx)
+	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%r8)
 	ret
 
@@ -72,16 +72,16 @@ ENTRY(futex_orl)
 	movq	$VM_MAXUSER_ADDRESS-4,%rax
 	cmpq	%rax,%rsi
 	ja	futex_fault
-	movq	(%rsi),%rax
-1:	movq	%rax,%rcx
-	orq	%rdi,%rcx
+	movl	(%rsi),%eax
+1:	movl	%eax,%ecx
+	orl	%edi,%ecx
 #ifdef SMP
 	lock
 #endif
-	cmpxchgq %rcx,(%rsi)
+	cmpxchgl %ecx,(%rsi)
 	jnz	1b
-	movq	%rax,(%rdx)
-	xorq	%rax,%rax
+	movl	%eax,(%rdx)
+	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%r8)
 	ret
 
@@ -91,16 +91,16 @@ ENTRY(futex_andl)
 	movq	$VM_MAXUSER_ADDRESS-4,%rax
 	cmpq	%rax,%rsi
 	ja	futex_fault
-	movq	(%rsi),%rax
-1:	movq	%rax,%rcx
-	andq	%rdi,%rcx
+	movl	(%rsi),%eax
+1:	movl	%eax,%ecx
+	andl	%edi,%ecx
 #ifdef SMP
 	lock
 #endif
-	cmpxchgq %rcx,(%rsi)
+	cmpxchgl %ecx,(%rsi)
 	jnz	1b
-	movq	%rax,(%rdx)
-	xorq	%rax,%rax
+	movl	%eax,(%rdx)
+	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%r8)
 	ret
 
@@ -110,15 +110,15 @@ ENTRY(futex_xorl)
 	movq	$VM_MAXUSER_ADDRESS-4,%rax
 	cmpq	%rax,%rsi
 	ja	futex_fault
-	movq	(%rsi),%rax
-1:	movq	%rax,%rcx
-	xorq	%rdi,%rcx
+	movl	(%rsi),%eax
+1:	movl	%eax,%ecx
+	xorl	%edi,%ecx
 #ifdef SMP
 	lock
 #endif
-	cmpxchgq %rcx,(%rsi)
+	cmpxchgl %ecx,(%rsi)
 	jnz	1b
-	movq	%rax,(%rdx)
-	xorq	%rax,%rax
+	movl	%eax,(%rdx)
+	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%r8)
 	ret



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