Date: Sat, 13 Jun 2009 14:00:10 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194111 - head/sys/i386/include Message-ID: <200906131400.n5DE0BLu015822@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sat Jun 13 14:00:10 2009 New Revision: 194111 URL: http://svn.freebsd.org/changeset/base/194111 Log: Clobber "cc" instead of using volatile; remove obsolete register keyword. Submitted by: Christoph Mallon Modified: head/sys/i386/include/in_cksum.h Modified: head/sys/i386/include/in_cksum.h ============================================================================== --- head/sys/i386/include/in_cksum.h Sat Jun 13 13:56:06 2009 (r194110) +++ head/sys/i386/include/in_cksum.h Sat Jun 13 14:00:10 2009 (r194111) @@ -57,9 +57,9 @@ static __inline u_int in_cksum_hdr(const struct ip *ip) { - register u_int sum = 0; + u_int sum = 0; - __asm __volatile ( + __asm( "addl %1, %0\n" "adcl %2, %0\n" "adcl %3, %0\n" @@ -72,6 +72,7 @@ in_cksum_hdr(const struct ip *ip) "g" (((const u_int32_t *)ip)[2]), "g" (((const u_int32_t *)ip)[3]), "g" (((const u_int32_t *)ip)[4]) + : "cc" ); sum = (sum & 0xffff) + (sum >> 16); if (sum > 0xffff) @@ -91,12 +92,12 @@ in_cksum_update(struct ip *ip) static __inline u_short in_addword(u_short sum, u_short b) { - /* __volatile is necessary because the condition codes are used. */ - __asm __volatile ( + __asm( "addw %1, %0\n" "adcw $0, %0" : "+r" (sum) - : "r" (b) + : "g" (b) + : "cc" ); return (sum); } @@ -104,14 +105,14 @@ in_addword(u_short sum, u_short b) static __inline u_short in_pseudo(u_int sum, u_int b, u_int c) { - /* __volatile is necessary because the condition codes are used. */ - __asm __volatile ( + __asm( "addl %1, %0\n" "adcl %2, %0\n" "adcl $0, %0" : "+r" (sum) : "g" (b), "g" (c) + : "cc" ); sum = (sum & 0xffff) + (sum >> 16); if (sum > 0xffff)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906131400.n5DE0BLu015822>