From owner-p4-projects@FreeBSD.ORG Sat Apr 28 09:26:49 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ADDA316A402; Sat, 28 Apr 2007 09:26:49 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B9B716A400 for ; Sat, 28 Apr 2007 09:26:49 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 381BB13C48A for ; Sat, 28 Apr 2007 09:26:49 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3S9QmqH066938 for ; Sat, 28 Apr 2007 09:26:49 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3S9Qm3P066935 for perforce@freebsd.org; Sat, 28 Apr 2007 09:26:48 GMT (envelope-from rdivacky@FreeBSD.org) Date: Sat, 28 Apr 2007 09:26:48 GMT Message-Id: <200704280926.l3S9Qm3P066935@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 118906 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2007 09:26:50 -0000 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 /* 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