Author: np
Date: Fri Jan 16 01:32:40 2015
New Revision: 277226
URL: https://svnweb.freebsd.org/changeset/base/277226

Log:
  Allow cxgbe(4) to be built on i386.  Driver attach will succeed only on a 
subset
  of i386 systems.

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_mp_ring.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c        Fri Jan 16 01:28:28 2015        
(r277225)
+++ head/sys/dev/cxgbe/t4_main.c        Fri Jan 16 01:32:40 2015        
(r277226)
@@ -668,6 +668,14 @@ t4_attach(device_t dev)
                goto done;
        }
 
+#if defined(__i386__)
+       if ((cpu_feature & CPUID_CX8) == 0) {
+               device_printf(dev, "64 bit atomics not available.\n");
+               rc = ENOTSUP;
+               goto done;
+       }
+#endif
+
        /* Prepare the firmware for operation */
        rc = prep_firmware(sc);
        if (rc != 0)

Modified: head/sys/dev/cxgbe/t4_mp_ring.c
==============================================================================
--- head/sys/dev/cxgbe/t4_mp_ring.c     Fri Jan 16 01:28:28 2015        
(r277225)
+++ head/sys/dev/cxgbe/t4_mp_ring.c     Fri Jan 16 01:32:40 2015        
(r277226)
@@ -38,6 +38,11 @@ __FBSDID("$FreeBSD$");
 
 #include "t4_mp_ring.h"
 
+#if defined(__i386__)
+#define atomic_cmpset_acq_64 atomic_cmpset_64
+#define atomic_cmpset_rel_64 atomic_cmpset_64
+#endif
+
 union ring_state {
        struct {
                uint16_t pidx_head;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to