From fb8ccc7840cc85bb62ed5dcb68e11b2684bcf593 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Thu, 17 Nov 2011 22:56:40 +0000 Subject: [PATCH] Fix compilation on ILP32. --- sys/dev/sfxge/sfxge_dma.c | 4 ++-- sys/dev/sfxge/sfxge_intr.c | 2 +- sys/dev/sfxge/sfxge_tx.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/sfxge/sfxge_dma.c b/sys/dev/sfxge/sfxge_dma.c index d69d4e26968b..076c7c68a9ad 100644 --- a/sys/dev/sfxge/sfxge_dma.c +++ b/sys/dev/sfxge/sfxge_dma.c @@ -134,8 +134,8 @@ sfxge_dma_alloc(struct sfxge_softc *sc, bus_size_t len, efsys_mem_t *esmp) /* Create the child DMA tag. */ if (bus_dma_tag_create(sc->parent_dma_tag, PAGE_SIZE, 0, - 0x3FFFFFFFFFFFULL, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, - NULL, NULL, &esmp->esm_tag) != 0) { + MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, + NULL, len, 1, len, 0, NULL, NULL, &esmp->esm_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); return (ENOMEM); } diff --git a/sys/dev/sfxge/sfxge_intr.c b/sys/dev/sfxge/sfxge_intr.c index 5cf13628efe3..ddc1b4c92707 100644 --- a/sys/dev/sfxge/sfxge_intr.c +++ b/sys/dev/sfxge/sfxge_intr.c @@ -146,7 +146,7 @@ sfxge_intr_message(void *arg) do { mask = intr->mask; - } while (atomic_cmpset_long(&intr->mask, mask, + } while (atomic_cmpset_ptr(&intr->mask, mask, mask | (1 << index)) == 0); return; diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 5f0aeceb3df3..801787a7add3 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -135,7 +135,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq *txq) /* Acquire the put list. */ putp = &stdp->std_put; - put = atomic_readandclear_long(putp); + put = atomic_readandclear_ptr(putp); mbuf = (void *)put; if (mbuf == NULL) @@ -484,7 +484,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, struct mbuf *mbuf, int locked) return ENOBUFS; mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; - } while (atomic_cmpset_long(putp, old, new) == 0); + } while (atomic_cmpset_ptr(putp, old, new) == 0); } return (0); @@ -1323,9 +1323,9 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index, &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ - if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, 0x3FFFFFFFFFFFULL, - BUS_SPACE_MAXADDR, NULL, NULL, 0x11000, - SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, + if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, + MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, + NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, &txq->packet_dma_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); rc = ENOMEM;