From owner-freebsd-hackers@FreeBSD.ORG Sat May 1 22:26:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E49B16A4CE for ; Sat, 1 May 2004 22:26:15 -0700 (PDT) Received: from hotmail.com (bay2-dav71.bay2.hotmail.com [65.54.246.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F3AA43D53 for ; Sat, 1 May 2004 22:26:15 -0700 (PDT) (envelope-from dsnofe@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 1 May 2004 22:26:15 -0700 Received: from 61.147.224.213 by bay2-dav71.bay2.hotmail.com with DAV; Sun, 02 May 2004 05:26:14 +0000 X-Originating-IP: [61.147.224.213] X-Originating-Email: [dsnofe@hotmail.com] X-Sender: dsnofe@hotmail.com Date: Sun, 02 May 2004 13:26:13 +0800 From: Deng XueFeng To: freebsd-hackers@freebsd.org Message-Id: <20040502132115.C583.DSNOFE@hotmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------_4094854BC580036F4F88_MULTIPART_MIXED_" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.09.01 [CN] X-OriginalArrivalTime: 02 May 2004 05:26:15.0119 (UTC) FILETIME=[FD059DF0:01C43005] Subject: Is this LOST?? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2004 05:26:15 -0000 --------_4094854BC580036F4F88_MULTIPART_MIXED_ Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I found the htonl implemention in libc for i386 is not sync with the kern. sys use bswap for swaping the int. but libc still use xchg. IS THIS LOST? Here is the patches. ----------------------------CUT HERE------------------------ --- /usr/src/lib/libc/i386/net/htonl.S.orig Sun May 2 12:13:13 2004 +++ /usr/src/lib/libc/i386/net/htonl.S Sun May 2 12:22:02 2004 @@ -46,7 +46,5 @@ .set CNAME(htonl),CNAME(__htonl) ENTRY(__htonl) movl 4(%esp),%eax - xchgb %al,%ah - roll $16,%eax - xchgb %al,%ah + bswap %eax ret -----------------------------END HERE---------------------- ----------------------------CUT HERE------------------------ --- /usr/src/lib/libc/i386/net/ntohl.S.orig Sun May 2 12:13:21 2004 +++ /usr/src/lib/libc/i386/net/ntohl.S Sun May 2 12:19:16 2004 @@ -46,7 +46,5 @@ .set CNAME(ntohl),CNAME(__ntohl) ENTRY(__ntohl) movl 4(%esp),%eax - xchgb %al,%ah - roll $16,%eax - xchgb %al,%ah + bswap %eax ret -----------------------------END HERE---------------------- Sincerely, Deng XueFeng --------_4094854BC580036F4F88_MULTIPART_MIXED_ Content-Type: application/octet-stream; name="htonl.S.diff" Content-Disposition: attachment; filename="htonl.S.diff" Content-Transfer-Encoding: base64 LS0tIC91c3Ivc3JjL2xpYi9saWJjL2kzODYvbmV0L2h0b25sLlMub3JpZwlTdW4gTWF5ICAyIDEy OjEzOjEzIDIwMDQKKysrIC91c3Ivc3JjL2xpYi9saWJjL2kzODYvbmV0L2h0b25sLlMJU3VuIE1h eSAgMiAxMjoyMjowMiAyMDA0CkBAIC00Niw3ICs0Niw1IEBACiAgICAgICAgIC5zZXQgQ05BTUUo aHRvbmwpLENOQU1FKF9faHRvbmwpCiBFTlRSWShfX2h0b25sKQogCW1vdmwJNCglZXNwKSwlZWF4 Ci0JeGNoZ2IJJWFsLCVhaAotCXJvbGwJJDE2LCVlYXgKLQl4Y2hnYgklYWwsJWFoCisJYnN3YXAg ICAlZWF4CiAJcmV0Cg== --------_4094854BC580036F4F88_MULTIPART_MIXED_ Content-Type: application/octet-stream; name="ntohl.S.diff" Content-Disposition: attachment; filename="ntohl.S.diff" Content-Transfer-Encoding: base64 LS0tIC91c3Ivc3JjL2xpYi9saWJjL2kzODYvbmV0L250b2hsLlMub3JpZwlTdW4gTWF5ICAyIDEy OjEzOjIxIDIwMDQKKysrIC91c3Ivc3JjL2xpYi9saWJjL2kzODYvbmV0L250b2hsLlMJU3VuIE1h eSAgMiAxMjoxOToxNiAyMDA0CkBAIC00Niw3ICs0Niw1IEBACiAgICAgICAgIC5zZXQgQ05BTUUo bnRvaGwpLENOQU1FKF9fbnRvaGwpCiBFTlRSWShfX250b2hsKQogCW1vdmwJNCglZXNwKSwlZWF4 Ci0JeGNoZ2IJJWFsLCVhaAotCXJvbGwJJDE2LCVlYXgKLQl4Y2hnYgklYWwsJWFoCisJYnN3YXAJ JWVheAogCXJldAo= --------_4094854BC580036F4F88_MULTIPART_MIXED_--