Is this LOST??
From: Deng XueFeng (dsnofe_at_hotmail.com)
Date: 05/02/04
- Previous message: Stefan Bethke: "Re: kmem_malloc crashes running FreeBSD 5.2.1-RELEASE-p5"
- Next in thread: John Baldwin: "Re: Is this LOST??"
- Reply: John Baldwin: "Re: Is this LOST??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 02 May 2004 13:26:13 +0800 To: freebsd-hackers@freebsd.org
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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- application/octet-stream attachment: htonl.S.diff
- application/octet-stream attachment: ntohl.S.diff
- Previous message: Stefan Bethke: "Re: kmem_malloc crashes running FreeBSD 5.2.1-RELEASE-p5"
- Next in thread: John Baldwin: "Re: Is this LOST??"
- Reply: John Baldwin: "Re: Is this LOST??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|