From bcee06d42c20a8ea0e6c6ffb8924e16e7e793c0f Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 18 Feb 2002 20:35:27 +0000 Subject: o Move NTOHL() and associated macros into . These are deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's . Approved by: jake o Clean up files. o Remove unused __uint16_swap_uint32() from i386's . o Remove prototypes for non-existent bswapXX() functions. o Include in to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, , and . o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from . o Add missing includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm --- lib/libc/amd64/net/htonl.S | 4 +++- lib/libc/amd64/net/htons.S | 4 +++- lib/libc/amd64/net/ntohl.S | 4 +++- lib/libc/amd64/net/ntohs.S | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/libc/amd64/net') diff --git a/lib/libc/amd64/net/htonl.S b/lib/libc/amd64/net/htonl.S index af3354f..6658b69 100644 --- a/lib/libc/amd64/net/htonl.S +++ b/lib/libc/amd64/net/htonl.S @@ -43,7 +43,9 @@ #include -ENTRY(htonl) + .weak CNAME(htonl) + .set CNAME(htonl),CNAME(__htonl) +ENTRY(__htonl) movl 4(%esp),%eax xchgb %al,%ah roll $16,%eax diff --git a/lib/libc/amd64/net/htons.S b/lib/libc/amd64/net/htons.S index c78b108..c354eaa 100644 --- a/lib/libc/amd64/net/htons.S +++ b/lib/libc/amd64/net/htons.S @@ -43,7 +43,9 @@ #include -ENTRY(htons) + .weak CNAME(htons) + .set CNAME(htons),CNAME(__htons) +ENTRY(__htons) movzwl 4(%esp),%eax xchgb %al,%ah ret diff --git a/lib/libc/amd64/net/ntohl.S b/lib/libc/amd64/net/ntohl.S index 3a2c202..46ff54e 100644 --- a/lib/libc/amd64/net/ntohl.S +++ b/lib/libc/amd64/net/ntohl.S @@ -43,7 +43,9 @@ #include -ENTRY(ntohl) + .weak CNAME(ntohl) + .set CNAME(ntohl),CNAME(__ntohl) +ENTRY(__ntohl) movl 4(%esp),%eax xchgb %al,%ah roll $16,%eax diff --git a/lib/libc/amd64/net/ntohs.S b/lib/libc/amd64/net/ntohs.S index 110faf7..3f0a36a 100644 --- a/lib/libc/amd64/net/ntohs.S +++ b/lib/libc/amd64/net/ntohs.S @@ -43,7 +43,9 @@ #include -ENTRY(ntohs) + .weak CNAME(ntohs) + .set CNAME(ntohs),CNAME(__ntohs) +ENTRY(__ntohs) movzwl 4(%esp),%eax xchgb %al,%ah ret -- cgit v1.1