svn commit: r217218 - in projects/ofed/head/sys: amd64/include conf i386/include net netinet vm

Jeff Roberson jeff at FreeBSD.org
Mon Jan 10 03:59:05 UTC 2011


Author: jeff
Date: Mon Jan 10 03:59:04 2011
New Revision: 217218
URL: http://svn.freebsd.org/changeset/base/217218

Log:
   - Eliminate extraneous diffs as found by an audit of diffs to current.
  
  Sponsored by:	Isilon Systems, iX Systems, and Panasas.

Modified:
  projects/ofed/head/sys/amd64/include/endian.h
  projects/ofed/head/sys/conf/kern.pre.mk
  projects/ofed/head/sys/i386/include/endian.h
  projects/ofed/head/sys/net/if_arp.h
  projects/ofed/head/sys/netinet/ip_var.h
  projects/ofed/head/sys/vm/vm_map.h

Modified: projects/ofed/head/sys/amd64/include/endian.h
==============================================================================
--- projects/ofed/head/sys/amd64/include/endian.h	Mon Jan 10 03:57:27 2011	(r217217)
+++ projects/ofed/head/sys/amd64/include/endian.h	Mon Jan 10 03:59:04 2011	(r217218)
@@ -74,14 +74,11 @@ __byte_swap_int_var(__uint32_t x)
 {
 	register __uint32_t _x;
 
-
 	_x = x;
 	__asm ("bswap %0" : "+r" (_x));
 	return (_x);
 }
 
-#if 1 /* def __OPTIMIZE__ */
-
 #define	__byte_swap_int_const(x) \
 	(__uint32_t)((((x) & 0xff000000) >> 24) | \
 	 (((x) & 0x00ff0000) >>  8) | \
@@ -90,12 +87,6 @@ __byte_swap_int_var(__uint32_t x)
 #define	__bswap32(x)	(__builtin_constant_p(x) ? \
 	__byte_swap_int_const(x) : __byte_swap_int_var(x))
 
-#else	/* __OPTIMIZE__ */
-
-#define	__bswap32(x)	__byte_swap_int_var(x)
-
-#endif	/* __OPTIMIZE__ */
-
 static __inline __uint64_t
 __byte_swap_long_var(__uint64_t x)
 {
@@ -106,8 +97,6 @@ __byte_swap_long_var(__uint64_t x)
 	return (_x);
 }
 
-#if 1 /* def __OPTIMIZE__ */
-
 #define	__byte_swap_long_const(x) \
 	(__uint64_t)((((__uint64_t)x >> 56) |		\
 	 (((__uint64_t)x >> 40) & 0xff00) |		\
@@ -121,12 +110,6 @@ __byte_swap_long_var(__uint64_t x)
 #define	__bswap64(x)	(__builtin_constant_p(x) ? \
 	__byte_swap_long_const(x) : __byte_swap_long_var(x))
 
-#else	/* __OPTIMIZE__ */
-
-#define	__bswap64(x)	__byte_swap_long_var(x)
-
-#endif	/* __OPTIMIZE__ */
-
 #define	__byte_swap_short_const(_x)	(__uint16_t)((_x) << 8 | (_x) >> 8)
 
 static __inline __uint16_t

Modified: projects/ofed/head/sys/conf/kern.pre.mk
==============================================================================
--- projects/ofed/head/sys/conf/kern.pre.mk	Mon Jan 10 03:57:27 2011	(r217217)
+++ projects/ofed/head/sys/conf/kern.pre.mk	Mon Jan 10 03:59:04 2011	(r217218)
@@ -30,10 +30,10 @@ COPTFLAGS?=	-O
 _MINUS_O=	-O
 CTFFLAGS+=	-g
 . else
-_MINUS_O=	-O
+_MINUS_O=	-O2
 . endif
 . if ${MACHINE_CPUARCH} == "amd64"
-COPTFLAGS?=-O -frename-registers -pipe
+COPTFLAGS?=-O2 -frename-registers -pipe
 . else
 COPTFLAGS?=${_MINUS_O} -pipe
 . endif

Modified: projects/ofed/head/sys/i386/include/endian.h
==============================================================================
--- projects/ofed/head/sys/i386/include/endian.h	Mon Jan 10 03:57:27 2011	(r217217)
+++ projects/ofed/head/sys/i386/include/endian.h	Mon Jan 10 03:59:04 2011	(r217218)
@@ -69,50 +69,47 @@ extern "C" {
 
 #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P)
 
-#define __byte_swap_int_var(x) \
-__extension__ ({ register __uint32_t __X = (x); \
-   __asm ("bswap %0" : "+r" (__X)); \
-   __X; })
+static __inline __uint32_t
+__byte_swap_int_var(__uint32_t x)
+{
+	register __uint32_t _x;
 
-#ifdef __OPTIMIZE__
+	_x = x;
+	__asm ("bswap %0" : "+r" (_x));
+	return (_x);
+}
 
 #define	__byte_swap_int_const(x) \
-	((((x) & 0xff000000) >> 24) | \
+	(__uint32_t)((((x) & 0xff000000) >> 24) | \
 	 (((x) & 0x00ff0000) >>  8) | \
 	 (((x) & 0x0000ff00) <<  8) | \
 	 (((x) & 0x000000ff) << 24))
-#define	__byte_swap_int(x) (__builtin_constant_p(x) ? \
+#define	__bswap32(x)	(__builtin_constant_p(x) ? \
 	__byte_swap_int_const(x) : __byte_swap_int_var(x))
 
-#else	/* __OPTIMIZE__ */
-
-#define	__byte_swap_int(x) __byte_swap_int_var(x)
+#define	__byte_swap_64_const(x) \
+	(__uint64_t)((((__uint64_t)x >> 56) |		\
+	 (((__uint64_t)x >> 40) & 0xff00) |		\
+	 (((__uint64_t)x >> 24) & 0xff0000) |		\
+	 (((__uint64_t)x >> 8) & 0xff000000) |		\
+	 (((__uint64_t)x << 8) & (0xfful << 32)) |	\
+	 (((__uint64_t)x << 24) & (0xfful << 40)) |	\
+	 (((__uint64_t)x << 40) & (0xfful << 48)) |	\
+	 (((__uint64_t)x << 56))))
 
-#endif	/* __OPTIMIZE__ */
+#define	__bswap64(x)	__byte_swap_64_const(x) 
 
-static __inline __uint64_t
-__bswap64(__uint64_t _x)
-{
-
-	return ((_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)));
-}
-
-static __inline __uint32_t
-__bswap32(__uint32_t _x)
-{
-
-	return (__byte_swap_int(_x));
-}
+#define	__byte_swap_short_const(_x)	(__uint16_t)((_x) << 8 | (_x) >> 8)
 
 static __inline __uint16_t
-__bswap16(__uint16_t _x)
+__byte_swap_short_var(__uint16_t x)
 {
-	return (_x << 8 | _x >> 8);
+	return __byte_swap_short_const(x);
 }
 
+#define	__bswap16(x)	(__builtin_constant_p(x) ? \
+	__byte_swap_short_const(x) : __byte_swap_short_var(x))
+
 #define	__htonl(x)	__bswap32(x)
 #define	__htons(x)	__bswap16(x)
 #define	__ntohl(x)	__bswap32(x)

Modified: projects/ofed/head/sys/net/if_arp.h
==============================================================================
--- projects/ofed/head/sys/net/if_arp.h	Mon Jan 10 03:57:27 2011	(r217217)
+++ projects/ofed/head/sys/net/if_arp.h	Mon Jan 10 03:59:04 2011	(r217218)
@@ -50,7 +50,7 @@ struct	arphdr {
 #define ARPHRD_ARCNET	7	/* arcnet hardware format */
 #define ARPHRD_FRELAY 	15	/* frame relay hardware format */
 #define ARPHRD_IEEE1394	24	/* firewire hardware format */
-#define	ARPHRD_INFINIBAND 32	/* infiniband hardware format */
+#define ARPHRD_INFINIBAND 32	/* infiniband hardware format */
 	u_short	ar_pro;		/* format of protocol address */
 	u_char	ar_hln;		/* length of hardware address */
 	u_char	ar_pln;		/* length of protocol address */

Modified: projects/ofed/head/sys/netinet/ip_var.h
==============================================================================
--- projects/ofed/head/sys/netinet/ip_var.h	Mon Jan 10 03:57:27 2011	(r217217)
+++ projects/ofed/head/sys/netinet/ip_var.h	Mon Jan 10 03:59:04 2011	(r217218)
@@ -307,7 +307,8 @@ extern int	(*ip_dn_io_ptr)(struct mbuf *
 
 VNET_DECLARE(int, ip_do_randomid);
 #define	V_ip_do_randomid	VNET(ip_do_randomid)
-#define	ip_newid()	ip_randomid()
+#define	ip_newid()	((V_ip_do_randomid != 0) ? ip_randomid() : \
+			    htons(V_ip_id++))
 
 #endif /* _KERNEL */
 

Modified: projects/ofed/head/sys/vm/vm_map.h
==============================================================================
--- projects/ofed/head/sys/vm/vm_map.h	Mon Jan 10 03:57:27 2011	(r217217)
+++ projects/ofed/head/sys/vm/vm_map.h	Mon Jan 10 03:59:04 2011	(r217218)
@@ -346,7 +346,7 @@ long vmspace_wired_count(struct vmspace 
 #define VM_MAP_WIRE_NOHOLES	0	/* region must not have holes */
 #define VM_MAP_WIRE_HOLESOK	2	/* region may have holes */
 
-#define	VM_MAP_WIRE_WRITE	4	/* Validate writable. */
+#define VM_MAP_WIRE_WRITE	4	/* Validate writable. */
 
 #ifdef _KERNEL
 boolean_t vm_map_check_protection (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t);


More information about the svn-src-projects mailing list