Remove remaining big-endian cruft.
We'd removed most of it already, but a few bits and pieces were still lying
around.
Change-Id: I572a23eb15b9670d8d0f95586eca99ab0bdb4a1b
Test: mm.
diff --git a/libc/arch-arm/include/machine/elf_machdep.h b/libc/arch-arm/include/machine/elf_machdep.h
index 40e0a5a..3496b28 100644
--- a/libc/arch-arm/include/machine/elf_machdep.h
+++ b/libc/arch-arm/include/machine/elf_machdep.h
@@ -3,11 +3,7 @@
#ifndef _ARM_ELF_MACHDEP_H_
#define _ARM_ELF_MACHDEP_H_
-#if defined(__ARMEB__)
-#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
-#else
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
-#endif
#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
#define ELF64_MACHDEP_ID_CASES \
diff --git a/libc/arch-mips/include/machine/asm.h b/libc/arch-mips/include/machine/asm.h
index cdc7914..74412c1 100644
--- a/libc/arch-mips/include/machine/asm.h
+++ b/libc/arch-mips/include/machine/asm.h
@@ -53,13 +53,9 @@
ABICALLS
#endif
-#if !defined(__MIPSEL__) && !defined(__MIPSEB__)
-#error "__MIPSEL__ or __MIPSEB__ must be defined"
-#endif
/*
* Define how to access unaligned data word
*/
-#if defined(__MIPSEL__)
#define LWLO lwl
#define LWHI lwr
#define SWLO swl
@@ -68,17 +64,6 @@
#define LDHI ldr
#define SDLO sdl
#define SDHI sdr
-#endif
-#if defined(__MIPSEB__)
-#define LWLO lwr
-#define LWHI lwl
-#define SWLO swr
-#define SWHI swl
-#define LDLO ldr
-#define LDHI ldl
-#define SDLO sdr
-#define SDHI sdl
-#endif
/*
* Define programming environment for ABI.
diff --git a/libc/arch-mips/include/machine/elf_machdep.h b/libc/arch-mips/include/machine/elf_machdep.h
index 516a44f..b6117f2 100644
--- a/libc/arch-mips/include/machine/elf_machdep.h
+++ b/libc/arch-mips/include/machine/elf_machdep.h
@@ -151,14 +151,7 @@
#define EF_MIPS_ABI_EABI32 0x00003000
#define EF_MIPS_ABI_EABI64 0x00004000
-#if defined(__MIPSEB__)
-#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
-#define ELF64_MACHDEP_ENDIANNESS ELFDATA2MSB
-#elif defined(__MIPSEL__)
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
#define ELF64_MACHDEP_ENDIANNESS ELFDATA2LSB
-#elif !defined(HAVE_NBTOOL_CONFIG_H)
-#error neither __MIPSEL__ nor __MIPSEB__ are defined.
-#endif
#endif /* _MIPS_ELF_MACHDEP_H_ */
diff --git a/libc/include/arpa/nameser_compat.h b/libc/include/arpa/nameser_compat.h
index 6868876..e4e9335 100644
--- a/libc/include/arpa/nameser_compat.h
+++ b/libc/include/arpa/nameser_compat.h
@@ -54,21 +54,6 @@
typedef struct {
unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /* response flag */
- unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritive answer */
- unsigned tc: 1; /* truncated message */
- unsigned rd: 1; /* recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /* recursion available */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /* authentic data from named */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned rcode :4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */
@@ -81,7 +66,6 @@
unsigned ad: 1; /* authentic data from named */
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
unsigned ra :1; /* recursion available */
-#endif
/* remaining bytes */
unsigned qdcount :16; /* number of question entries */
unsigned ancount :16; /* number of answer entries */
diff --git a/libc/include/netinet/icmp6.h b/libc/include/netinet/icmp6.h
index eca7b45..43ec521 100644
--- a/libc/include/netinet/icmp6.h
+++ b/libc/include/netinet/icmp6.h
@@ -245,17 +245,9 @@
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
-#if BYTE_ORDER == BIG_ENDIAN
-#define ND_NA_FLAG_ROUTER 0x80000000
-#define ND_NA_FLAG_SOLICITED 0x40000000
-#define ND_NA_FLAG_OVERRIDE 0x20000000
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
#define ND_NA_FLAG_ROUTER 0x80
#define ND_NA_FLAG_SOLICITED 0x40
#define ND_NA_FLAG_OVERRIDE 0x20
-#endif
-#endif
struct nd_redirect { /* redirect */
struct icmp6_hdr nd_rd_hdr;
@@ -384,40 +376,17 @@
#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
-#if BYTE_ORDER == BIG_ENDIAN
-#define NI_SUPTYPE_FLAG_COMPRESS 0x1
-#define NI_FQDN_FLAG_VALIDTTL 0x1
-#elif BYTE_ORDER == LITTLE_ENDIAN
#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
#define NI_FQDN_FLAG_VALIDTTL 0x0100
-#endif
#ifdef NAME_LOOKUPS_04
-#if BYTE_ORDER == BIG_ENDIAN
-#define NI_NODEADDR_FLAG_LINKLOCAL 0x1
-#define NI_NODEADDR_FLAG_SITELOCAL 0x2
-#define NI_NODEADDR_FLAG_GLOBAL 0x4
-#define NI_NODEADDR_FLAG_ALL 0x8
-#define NI_NODEADDR_FLAG_TRUNCATE 0x10
-#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */
-#elif BYTE_ORDER == LITTLE_ENDIAN
#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100
#define NI_NODEADDR_FLAG_SITELOCAL 0x0200
#define NI_NODEADDR_FLAG_GLOBAL 0x0400
#define NI_NODEADDR_FLAG_ALL 0x0800
#define NI_NODEADDR_FLAG_TRUNCATE 0x1000
#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */
-#endif
#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
-#if BYTE_ORDER == BIG_ENDIAN
-#define NI_NODEADDR_FLAG_TRUNCATE 0x1
-#define NI_NODEADDR_FLAG_ALL 0x2
-#define NI_NODEADDR_FLAG_COMPAT 0x4
-#define NI_NODEADDR_FLAG_LINKLOCAL 0x8
-#define NI_NODEADDR_FLAG_SITELOCAL 0x10
-#define NI_NODEADDR_FLAG_GLOBAL 0x20
-#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */
-#elif BYTE_ORDER == LITTLE_ENDIAN
#define NI_NODEADDR_FLAG_TRUNCATE 0x0100
#define NI_NODEADDR_FLAG_ALL 0x0200
#define NI_NODEADDR_FLAG_COMPAT 0x0400
@@ -426,7 +395,6 @@
#define NI_NODEADDR_FLAG_GLOBAL 0x2000
#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
#endif
-#endif
struct ni_reply_fqdn {
u_int32_t ni_fqdn_ttl; /* TTL */
@@ -485,13 +453,8 @@
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
-#if BYTE_ORDER == BIG_ENDIAN
-#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
-#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
-#elif BYTE_ORDER == LITTLE_ENDIAN
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
-#endif
struct rr_result { /* router renumbering result message */
u_int16_t rrr_flags;
@@ -500,13 +463,8 @@
u_int32_t rrr_ifid;
struct in6_addr rrr_prefix;
} __packed;
-#if BYTE_ORDER == BIG_ENDIAN
-#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
-#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
-#elif BYTE_ORDER == LITTLE_ENDIAN
#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
-#endif
/*
* icmp6 filter structures.
diff --git a/libc/include/netinet/ip.h b/libc/include/netinet/ip.h
index 629ed77..4821933 100644
--- a/libc/include/netinet/ip.h
+++ b/libc/include/netinet/ip.h
@@ -53,14 +53,8 @@
* Structure of an internet header, naked of options.
*/
struct ip {
-#if BYTE_ORDER == LITTLE_ENDIAN
u_int32_t ip_hl:4, /* header length */
ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_int32_t ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
u_int8_t ip_tos; /* type of service */
u_int16_t ip_len; /* total length */
u_int16_t ip_id; /* identification */
@@ -149,14 +143,8 @@
u_int8_t ipt_code; /* IPOPT_TS */
u_int8_t ipt_len; /* size of structure (variable) */
u_int8_t ipt_ptr; /* index of current entry */
-#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int32_t ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */
-#endif
-#if _BYTE_ORDER == _BIG_ENDIAN
- u_int32_t ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
union ipt_timestamp {
n_time ipt_time[1];
struct ipt_ta {
diff --git a/libc/include/netinet/ip6.h b/libc/include/netinet/ip6.h
index fcfd5d6..b4f6ce6 100644
--- a/libc/include/netinet/ip6.h
+++ b/libc/include/netinet/ip6.h
@@ -99,15 +99,9 @@
#define IPV6_VERSION 0x60
#define IPV6_VERSION_MASK 0xf0
-#if BYTE_ORDER == BIG_ENDIAN
-#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
-#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */
#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */
-#endif /* LITTLE_ENDIAN */
-#endif
+
#if 1
/* ECN bits proposed by Sally Floyd */
#define IP6TOS_CE 0x01 /* congestion experienced */
@@ -200,17 +194,9 @@
u_int8_t ip6or_value[2];
} __packed;
/* Router alert values (in network byte order) */
-#if BYTE_ORDER == BIG_ENDIAN
-#define IP6_ALERT_MLD 0x0000
-#define IP6_ALERT_RSVP 0x0001
-#define IP6_ALERT_AN 0x0002
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
#define IP6_ALERT_MLD 0x0000
#define IP6_ALERT_RSVP 0x0100
#define IP6_ALERT_AN 0x0200
-#endif /* LITTLE_ENDIAN */
-#endif
/* Routing header */
struct ip6_rthdr {
@@ -238,15 +224,9 @@
u_int32_t ip6f_ident; /* identification */
} __packed;
-#if BYTE_ORDER == BIG_ENDIAN
-#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
-#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
-#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
-#endif /* BYTE_ORDER == LITTLE_ENDIAN */
/*
* Internet implementation parameters.