summaryrefslogtreecommitdiffstats
path: root/lib/libc/alpha/net
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-02-18 20:35:27 +0000
committermike <mike@FreeBSD.org>2002-02-18 20:35:27 +0000
commitbcee06d42c20a8ea0e6c6ffb8924e16e7e793c0f (patch)
tree970c36894ee638248ec810bd7570ac8aabb5eaf5 /lib/libc/alpha/net
parentf2e166dc7a7880a8564c2a7cb8ca2b94566d8d6b (diff)
downloadFreeBSD-src-bcee06d42c20a8ea0e6c6ffb8924e16e7e793c0f.zip
FreeBSD-src-bcee06d42c20a8ea0e6c6ffb8924e16e7e793c0f.tar.gz
o Move NTOHL() and associated macros into <sys/param.h>. 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 <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. 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 <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
Diffstat (limited to 'lib/libc/alpha/net')
-rw-r--r--lib/libc/alpha/net/byte_swap_2.S7
-rw-r--r--lib/libc/alpha/net/byte_swap_4.S7
-rw-r--r--lib/libc/alpha/net/htonl.S5
-rw-r--r--lib/libc/alpha/net/htons.S5
-rw-r--r--lib/libc/alpha/net/ntohl.S5
-rw-r--r--lib/libc/alpha/net/ntohs.S5
6 files changed, 26 insertions, 8 deletions
diff --git a/lib/libc/alpha/net/byte_swap_2.S b/lib/libc/alpha/net/byte_swap_2.S
index fab3c58..ebcbeda 100644
--- a/lib/libc/alpha/net/byte_swap_2.S
+++ b/lib/libc/alpha/net/byte_swap_2.S
@@ -25,12 +25,14 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * $FreeBSD$
*/
#include <machine/asm.h>
-#ifndef NAME
-#define NAME byte_swap_2
+#if !defined(ALIAS) || !defined(NAME)
+#error ALIAS or NAME not defined
#endif
/*
@@ -38,6 +40,7 @@
*
* Argument is an unsigned 2-byte integer (u_int16_t).
*/
+XLEAF(ALIAS, 1)
LEAF(NAME, 1) /* a0 contains 0x0123 */
extbl a0, 0, t0 /* t0 = 0x 23 */
extbl a0, 1, t1 /* t1 = 0x 01 */
diff --git a/lib/libc/alpha/net/byte_swap_4.S b/lib/libc/alpha/net/byte_swap_4.S
index 8dbb83c..ddfd1e9 100644
--- a/lib/libc/alpha/net/byte_swap_4.S
+++ b/lib/libc/alpha/net/byte_swap_4.S
@@ -25,12 +25,14 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * $FreeBSD$
*/
#include <machine/asm.h>
-#ifndef NAME
-#define NAME byte_swap_4
+#if !defined(ALIAS) || !defined(NAME)
+#error ALIAS or NAME not defined
#endif
/*
@@ -38,6 +40,7 @@
*
* Argument is an unsigned 4-byte integer (u_int32_t).
*/
+XLEAF(ALIAS, 1)
LEAF(NAME, 1) /* a0 contains 0x01234567 */
extbl a0, 0, t0 /* t0 = 0x 67 */
extbl a0, 1, t1 /* t1 = 0x 45 */
diff --git a/lib/libc/alpha/net/htonl.S b/lib/libc/alpha/net/htonl.S
index bacab1e..90d9441 100644
--- a/lib/libc/alpha/net/htonl.S
+++ b/lib/libc/alpha/net/htonl.S
@@ -25,8 +25,11 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * $FreeBSD$
*/
-#define NAME htonl
+#define ALIAS htonl
+#define NAME __htonl
#include "byte_swap_4.S"
diff --git a/lib/libc/alpha/net/htons.S b/lib/libc/alpha/net/htons.S
index fb08222..405d537 100644
--- a/lib/libc/alpha/net/htons.S
+++ b/lib/libc/alpha/net/htons.S
@@ -25,8 +25,11 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * $FreeBSD$
*/
-#define NAME htons
+#define ALIAS htons
+#define NAME __htons
#include "byte_swap_2.S"
diff --git a/lib/libc/alpha/net/ntohl.S b/lib/libc/alpha/net/ntohl.S
index b571647..54ea68d 100644
--- a/lib/libc/alpha/net/ntohl.S
+++ b/lib/libc/alpha/net/ntohl.S
@@ -25,8 +25,11 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * $FreeBSD$
*/
-#define NAME ntohl
+#define ALIAS ntohl
+#define NAME __ntohl
#include "byte_swap_4.S"
diff --git a/lib/libc/alpha/net/ntohs.S b/lib/libc/alpha/net/ntohs.S
index 6db9961..f841a7a8 100644
--- a/lib/libc/alpha/net/ntohs.S
+++ b/lib/libc/alpha/net/ntohs.S
@@ -25,8 +25,11 @@
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
+ *
+ * $FreeBSD$
*/
-#define NAME ntohs
+#define ALIAS ntohs
+#define NAME __ntohs
#include "byte_swap_2.S"
OpenPOWER on IntegriCloud