summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2003-03-29 03:03:42 +0000
committerobrien <obrien@FreeBSD.org>2003-03-29 03:03:42 +0000
commit2b9574f51ace85f5825f1dc84d6c2189fab33ae8 (patch)
treed940959e4a1f3097c823263734d747f27ade892f
parent44afb4dc11869b17f8419db67d2a03a30f557026 (diff)
downloadFreeBSD-src-2b9574f51ace85f5825f1dc84d6c2189fab33ae8.zip
FreeBSD-src-2b9574f51ace85f5825f1dc84d6c2189fab33ae8.tar.gz
Back out the totally unapproved backout of my commits.
-rw-r--r--usr.bin/elf2aout/Makefile1
-rw-r--r--usr.bin/elf2aout/elf2aout.c2
-rw-r--r--usr.sbin/crunch/crunchide/endian.h57
-rw-r--r--usr.sbin/crunch/crunchide/exec_elf32.c2
4 files changed, 2 insertions, 60 deletions
diff --git a/usr.bin/elf2aout/Makefile b/usr.bin/elf2aout/Makefile
index f64004e..24f73f8 100644
--- a/usr.bin/elf2aout/Makefile
+++ b/usr.bin/elf2aout/Makefile
@@ -4,6 +4,5 @@ PROG= elf2aout
NOMAN=
NO_WERROR?=
WARNS?= 5
-CFLAGS+= -I${.CURDIR}/../../usr.sbin/crunch/crunchide
.include <bsd.prog.mk>
diff --git a/usr.bin/elf2aout/elf2aout.c b/usr.bin/elf2aout/elf2aout.c
index a9e1a01..3abf818 100644
--- a/usr.bin/elf2aout/elf2aout.c
+++ b/usr.bin/elf2aout/elf2aout.c
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/elf64.h>
+#include <sys/endian.h>
#include <sys/mman.h>
#include <sys/stat.h>
@@ -37,7 +38,6 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
-#include "endian.h"
#define xe16toh(x) ((data == ELFDATA2MSB) ? be16toh(x) : le16toh(x))
#define xe32toh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x))
#define xe64toh(x) ((data == ELFDATA2MSB) ? be64toh(x) : le64toh(x))
diff --git a/usr.sbin/crunch/crunchide/endian.h b/usr.sbin/crunch/crunchide/endian.h
deleted file mode 100644
index 2234f78..0000000
--- a/usr.sbin/crunch/crunchide/endian.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $FreeBSD$
- */
-
-#include <sys/param.h>
-
-#if __FreeBSD_version >= 500034
-#include <sys/endian.h>
-#else
-#include <machine/endian.h>
-
-#define bswap16(x) (uint16_t) \
- ((x >> 8) | (x << 8))
-
-#define bswap32(x) (uint32_t) \
- ((x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24))
-
-#define bswap64(x) (uint64_t) \
- ((x >> 56) | ((x >> 40) & 0xff00) | ((x >> 24) & 0xff0000) | \
- ((x >> 8) & 0xff000000) | ((x << 8) & ((uint64_t)0xff << 32)) | \
- ((x << 24) & ((uint64_t)0xff << 40)) | \
- ((x << 40) & ((uint64_t)0xff << 48)) | ((x << 56)))
-
-/*
- * Host to big endian, host to little endian, big endian to host, and little
- * endian to host byte order functions as detailed in byteorder(9).
- */
-#if _BYTE_ORDER == _LITTLE_ENDIAN
-#define htobe16(x) bswap16((uint16_t)(x))
-#define htobe32(x) bswap32((uint32_t)(x))
-#define htobe64(x) bswap64((uint64_t)(x))
-#define htole16(x) ((uint16_t)(x))
-#define htole32(x) ((uint32_t)(x))
-#define htole64(x) ((uint64_t)(x))
-
-#define be16toh(x) bswap16((uint16_t)(x))
-#define be32toh(x) bswap32((uint32_t)(x))
-#define be64toh(x) bswap64((uint64_t)(x))
-#define le16toh(x) ((uint16_t)(x))
-#define le32toh(x) ((uint32_t)(x))
-#define le64toh(x) ((uint64_t)(x))
-#else /* _BYTE_ORDER != _LITTLE_ENDIAN */
-#define htobe16(x) ((uint16_t)(x))
-#define htobe32(x) ((uint32_t)(x))
-#define htobe64(x) ((uint64_t)(x))
-#define htole16(x) bswap16((uint16_t)(x))
-#define htole32(x) bswap32((uint32_t)(x))
-#define htole64(x) bswap64((uint64_t)(x))
-
-#define be16toh(x) ((uint16_t)(x))
-#define be32toh(x) ((uint32_t)(x))
-#define be64toh(x) ((uint64_t)(x))
-#define le16toh(x) bswap16((uint16_t)(x))
-#define le32toh(x) bswap32((uint32_t)(x))
-#define le64toh(x) bswap64((uint64_t)(x))
-#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */
-#endif
diff --git a/usr.sbin/crunch/crunchide/exec_elf32.c b/usr.sbin/crunch/crunchide/exec_elf32.c
index aa3b86d..f74bd54 100644
--- a/usr.sbin/crunch/crunchide/exec_elf32.c
+++ b/usr.sbin/crunch/crunchide/exec_elf32.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#endif
#include <sys/types.h>
+#include <sys/endian.h>
#include <sys/stat.h>
#include <errno.h>
@@ -49,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
-#include "endian.h"
#include "extern.h"
#if (defined(NLIST_ELF32) && (ELFSIZE == 32)) || \
OpenPOWER on IntegriCloud