From owner-svn-src-projects@FreeBSD.ORG Thu Jun 25 12:21:49 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3FF9106566C; Thu, 25 Jun 2009 12:21:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B81CE8FC0C; Thu, 25 Jun 2009 12:21:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PCLn3g050880; Thu, 25 Jun 2009 12:21:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5PCLnTN050878; Thu, 25 Jun 2009 12:21:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906251221.n5PCLnTN050878@svn.freebsd.org> From: Ed Schouten Date: Thu, 25 Jun 2009 12:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194952 - projects/clangbsd/sys/dev/cas X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 12:21:50 -0000 Author: ed Date: Thu Jun 25 12:21:49 2009 New Revision: 194952 URL: http://svn.freebsd.org/changeset/base/194952 Log: Make the cas(4) driver build with Clang. We shouldn't use the preprocessor while inside function-like macro invocations. I'll discuss it with Marius one of these days. Modified: projects/clangbsd/sys/dev/cas/if_cas.c Modified: projects/clangbsd/sys/dev/cas/if_cas.c ============================================================================== --- projects/clangbsd/sys/dev/cas/if_cas.c Thu Jun 25 11:52:33 2009 (r194951) +++ projects/clangbsd/sys/dev/cas/if_cas.c Thu Jun 25 12:21:49 2009 (r194952) @@ -1674,14 +1674,17 @@ cas_rint(struct cas_softc *sc) refcount_acquire(&rxds->rxds_refcount); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); +#if __FreeBSD_version < 800016 MEXTADD(m, (caddr_t)rxds->rxds_buf + off * 256 + ETHER_ALIGN, len, cas_free, -#if __FreeBSD_version < 800016 rxds, + M_RDONLY, EXT_NET_DRV); #else + MEXTADD(m, (caddr_t)rxds->rxds_buf + + off * 256 + ETHER_ALIGN, len, cas_free, sc, (void *)(uintptr_t)idx, -#endif M_RDONLY, EXT_NET_DRV); +#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1719,14 +1722,17 @@ cas_rint(struct cas_softc *sc) m->m_len = min(CAS_PAGE_SIZE - off, len); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); +#if __FreeBSD_version < 800016 MEXTADD(m, (caddr_t)rxds->rxds_buf + off, m->m_len, cas_free, -#if __FreeBSD_version < 800016 rxds, + M_RDONLY, EXT_NET_DRV); #else + MEXTADD(m, (caddr_t)rxds->rxds_buf + off, + m->m_len, cas_free, sc, (void *)(uintptr_t)idx, -#endif M_RDONLY, EXT_NET_DRV); +#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1753,14 +1759,17 @@ cas_rint(struct cas_softc *sc) bus_dmamap_sync(sc->sc_rdmatag, rxds2->rxds_dmamap, BUS_DMASYNC_POSTREAD); +#if __FreeBSD_version < 800016 MEXTADD(m2, (caddr_t)rxds2->rxds_buf, m2->m_len, cas_free, -#if __FreeBSD_version < 800016 rxds2, + M_RDONLY, EXT_NET_DRV); #else + MEXTADD(m2, (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, sc, (void *)(uintptr_t)idx2, -#endif M_RDONLY, EXT_NET_DRV); +#endif if ((m2->m_flags & M_EXT) == 0) { m_freem(m2); m2 = NULL;