PERFORCE change 118906 for review
Roman Divacky
rdivacky at FreeBSD.org
Sat Apr 28 09:26:50 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=118906
Change 118906 by rdivacky at 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
More information about the p4-projects
mailing list