Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Apr 2007 09:26:48 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 118906 for review
Message-ID:  <200704280926.l3S9Qm3P066935@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=118906

Change 118906 by rdivacky@rdivacky_witten on 2007/04/28 09:25:56

	Implement amd64 part of the futex support. Futex.c at 2.6 still does not
	work.
	
	Guided by: kib
	Tested by: Scot Hetzel

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/linux32/linux32_support.s#2 edit

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/linux32/linux32_support.s#2 (text+ko) ====

@@ -29,7 +29,7 @@
  * $FreeBSD$
  */
 
-#include "linux_assym.h"                        /* system definitions */
+#include "linux32_assym.h"                        /* system definitions */
 #include <machine/asmacros.h>                   /* miscellaneous asm macros */
 
 #include "assym.s"
@@ -51,11 +51,12 @@
 	cmpq	%rax,%rsi
 	ja	futex_fault
 
+	movl	(%rsi),%eax
+	movl	%eax,(%rdx)
 #ifdef SMP
 	lock
 #endif
 	xchgl	%edi,(%rsi)
-	movl	%edi,(%rdx)
 	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%rcx)
 	ret
@@ -68,11 +69,66 @@
 	cmpq	%rax,%rsi
 	ja	futex_fault
 
+	movl	(%rsi),%eax
+	movl	%eax,(%rdx)
 #ifdef SMP
 	lock
 #endif
 	xaddl	%edi,(%rsi)
-	movl	%edi,(%rdx)
+	xorl	%eax,%eax
+	movq	%rax,PCB_ONFAULT(%rcx)
+	ret
+
+ENTRY(futex_orl)
+	movq	PCPU(CURPCB),%rcx
+	movq	$futex_fault,PCB_ONFAULT(%rcx)
+
+	movq	$VM_MAXUSER_ADDRESS-4,%rax
+	cmpq	%rax,%rsi
+	ja	futex_fault
+
+	movl	(%rsi),%eax
+	movl	%eax,(%rdx)
+#ifdef SMP
+	lock
+#endif
+	orl	%edi,(%rsi)
+	xorl	%eax,%eax
+	movq	%rax,PCB_ONFAULT(%rcx)
+	ret
+
+ENTRY(futex_andl)
+	movq	PCPU(CURPCB),%rcx
+	movq	$futex_fault,PCB_ONFAULT(%rcx)
+
+	movq	$VM_MAXUSER_ADDRESS-4,%rax
+	cmpq	%rax,%rsi
+	ja	futex_fault
+
+	movl	(%rsi),%eax
+	movl	%eax,(%rdx)
+#ifdef SMP
+	lock
+#endif
+	andl	%edi,(%rsi)
+	xorl	%eax,%eax
+	movq	%rax,PCB_ONFAULT(%rcx)
+	ret
+
+ENTRY(futex_xorl)
+	movq	PCPU(CURPCB),%rcx
+	movq	$futex_fault,PCB_ONFAULT(%rcx)
+
+	movq	$VM_MAXUSER_ADDRESS-4,%rax
+	cmpq	%rax,%rsi
+	ja	futex_fault
+
+	movl	(%rsi),%eax
+	movl	%eax,(%rdx)
+#ifdef SMP
+	lock
+#endif
+	xorl	%edi,(%rsi)
 	xorl	%eax,%eax
 	movq	%rax,PCB_ONFAULT(%rcx)
 	ret



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