Date: Fri, 27 Apr 2007 19:49:26 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 118888 for review Message-ID: <200704271949.l3RJnQl4065220@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=118888 Change 118888 by rdivacky@rdivacky_witten on 2007/04/27 19:49:22 Working WAKEUP_OP operation: o I moved the futex asm stuff into $ARCH diretory to linux[32]_support.s o I changed the asm code to copyout oldval correctly Glitches: amd64 is not implemented, i386 version manually includes assym.s to let the module build succeed and it needs fixing (to be able to really include assym.s) Affected files ... .. //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/amd64/support.S#2 edit .. //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/linux32/linux32_support.s#1 add .. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/linux/linux_futex.c#2 edit .. //depot/projects/soc2007/rdivacky/linux_futex/sys/i386/linux/linux_support.s#1 add .. //depot/projects/soc2007/rdivacky/linux_futex/sys/modules/linux/Makefile#2 edit Differences ... ==== //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/amd64/support.S#2 (text+ko) ==== ==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/linux/linux_futex.c#2 (text+ko) ==== @@ -90,13 +90,13 @@ static int futex_sleep(struct futex *, struct thread *, unsigned long); static int futex_wake(struct futex *, int, struct futex *, int); static int futex_atomic_op(struct thread *td, int encoded_op, caddr_t uaddr); -static int futex_orl(int oparg, caddr_t uaddr, int *oldval); -static int futex_andl(int oparg, caddr_t uaddr, int *oldval); -static int futex_xorl(int oparg, caddr_t uaddr, int *oldval); /* support.s */ int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); int futex_addl(int oparg, caddr_t uaddr, int *oldval); +int futex_orl(int oparg, caddr_t uaddr, int *oldval); +int futex_andl(int oparg, caddr_t uaddr, int *oldval); +int futex_xorl(int oparg, caddr_t uaddr, int *oldval); int linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) @@ -509,42 +509,3 @@ return (ret); } - -static int -futex_orl(int oparg, caddr_t uaddr, int *oldval) -{ - uint32_t ua, ua_old; - - for (;;) { - ua = ua_old = fuword32(uaddr); - ua |= oparg; - if (casuword32((void *)uaddr, ua_old, ua) == ua_old) - return ua_old; - } -} - -static int -futex_andl(int oparg, caddr_t uaddr, int *oldval) -{ - uint32_t ua, ua_old; - - for (;;) { - ua = ua_old = fuword32(uaddr); - ua &= oparg; - if (casuword32((void *)uaddr, ua_old, ua) == ua_old) - return ua_old; - } -} - -static int -futex_xorl(int oparg, caddr_t uaddr, int *oldval) -{ - uint32_t ua, ua_old; - - for (;;) { - ua = ua_old = fuword32(uaddr); - ua ^= oparg; - if (casuword32((void *)uaddr, ua_old, ua) == ua_old) - return ua_old; - } -} ==== //depot/projects/soc2007/rdivacky/linux_futex/sys/modules/linux/Makefile#2 (text+ko) ==== @@ -15,7 +15,7 @@ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ opt_inet6.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \ device_if.h bus_if.h -OBJS= linux${SFX}_locore.o +OBJS= linux${SFX}_locore.o linux${SFX}_support.o .if ${MACHINE_ARCH} == "i386" SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h @@ -41,6 +41,10 @@ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} +linux${SFX}_support.o: linux${SFX}_support.s + ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} + linux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704271949.l3RJnQl4065220>