mirror of
https://github.com/openbsd/src.git
synced 2024-12-21 23:18:00 -08:00
Pass BUS_DMA_64BIT to bus_dmamem_alloc(). On amd64, this allows use of
memory past 4GB, potentially freeing up some low memory for more important uses. ok dlg@
This commit is contained in:
parent
ff6a185afe
commit
dd0896fb3b
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: if_mcx.c,v 1.117 2024/10/23 01:47:47 jsg Exp $ */
|
||||
/* $OpenBSD: if_mcx.c,v 1.118 2024/12/20 03:31:09 jmatthew Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
|
||||
@ -8278,7 +8278,7 @@ mcx_dmamem_alloc(struct mcx_softc *sc, struct mcx_dmamem *mxm,
|
||||
return (1);
|
||||
if (bus_dmamem_alloc(sc->sc_dmat, mxm->mxm_size,
|
||||
align, 0, &mxm->mxm_seg, 1, &mxm->mxm_nsegs,
|
||||
BUS_DMA_WAITOK | BUS_DMA_ZERO) != 0)
|
||||
BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_64BIT) != 0)
|
||||
goto destroy;
|
||||
if (bus_dmamem_map(sc->sc_dmat, &mxm->mxm_seg, mxm->mxm_nsegs,
|
||||
mxm->mxm_size, &mxm->mxm_kva, BUS_DMA_WAITOK) != 0)
|
||||
@ -8326,7 +8326,8 @@ mcx_hwmem_alloc(struct mcx_softc *sc, struct mcx_hwmem *mhm, unsigned int pages)
|
||||
seglen = sizeof(*segs) * pages;
|
||||
|
||||
if (bus_dmamem_alloc(sc->sc_dmat, len, MCX_PAGE_SIZE, 0,
|
||||
segs, pages, &mhm->mhm_seg_count, BUS_DMA_NOWAIT) != 0)
|
||||
segs, pages, &mhm->mhm_seg_count,
|
||||
BUS_DMA_NOWAIT|BUS_DMA_64BIT) != 0)
|
||||
goto free_segs;
|
||||
|
||||
if (mhm->mhm_seg_count < pages) {
|
||||
@ -8349,7 +8350,7 @@ mcx_hwmem_alloc(struct mcx_softc *sc, struct mcx_hwmem *mhm, unsigned int pages)
|
||||
mhm->mhm_segs = segs;
|
||||
|
||||
if (bus_dmamap_create(sc->sc_dmat, len, pages, MCX_PAGE_SIZE,
|
||||
MCX_PAGE_SIZE, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW /*|BUS_DMA_64BIT*/,
|
||||
MCX_PAGE_SIZE, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW|BUS_DMA_64BIT,
|
||||
&mhm->mhm_map) != 0)
|
||||
goto free_dmamem;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user