diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-04-04 21:20:41 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-04-04 21:20:41 +0000 |
commit | 847f0d652dcf6c9019be074ee1f04b6ed4ff788a (patch) | |
tree | 477cef55159c6b92d441b89938f28d87e5b6c5e3 /sys/arch/alpha/pci | |
parent | 6e1fce54ffe410977ee0c4d562ab9a698eb55496 (diff) |
Add a `prefetch threshold' member to the bus_dma_tag_t, so that
eventually we can determine whether or not to allocate a spill
page on a per-mapping basis.
From NetBSD
ok martin@
Diffstat (limited to 'sys/arch/alpha/pci')
-rw-r--r-- | sys/arch/alpha/pci/apecs_dma.c | 6 | ||||
-rw-r--r-- | sys/arch/alpha/pci/cia_dma.c | 6 | ||||
-rw-r--r-- | sys/arch/alpha/pci/lca_dma.c | 9 | ||||
-rw-r--r-- | sys/arch/alpha/pci/tsp_dma.c | 9 |
4 files changed, 26 insertions, 4 deletions
diff --git a/sys/arch/alpha/pci/apecs_dma.c b/sys/arch/alpha/pci/apecs_dma.c index a4ba8c61253..979081ea0e9 100644 --- a/sys/arch/alpha/pci/apecs_dma.c +++ b/sys/arch/alpha/pci/apecs_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apecs_dma.c,v 1.4 2006/03/20 01:00:58 martin Exp $ */ +/* $OpenBSD: apecs_dma.c,v 1.5 2006/04/04 21:20:40 brad Exp $ */ /* $NetBSD: apecs_dma.c,v 1.13 2000/06/29 08:58:45 mrg Exp $ */ /*- @@ -87,6 +87,9 @@ void apecs_bus_dmamap_unload_sgmap(bus_dma_tag_t, bus_dmamap_t); #define APECS_SGMAP_MAPPED_BASE (8*1024*1024) #define APECS_SGMAP_MAPPED_SIZE (8*1024*1024) +/* APECS has a 256-byte out-bound DMA prefetch threshold. */ +#define APECS_SGMAP_PFTHRESH 256 + /* * Macro to flush APECS scatter/gather TLB. */ @@ -140,6 +143,7 @@ apecs_dma_init(acp) t->_next_window = NULL; t->_boundary = 0; t->_sgmap = &acp->ac_sgmap; + t->_pfthresh = APECS_SGMAP_PFTHRESH; t->_get_tag = apecs_dma_get_tag; t->_dmamap_create = alpha_sgmap_dmamap_create; t->_dmamap_destroy = alpha_sgmap_dmamap_destroy; diff --git a/sys/arch/alpha/pci/cia_dma.c b/sys/arch/alpha/pci/cia_dma.c index 37394c9e799..5cc6c2a3fb4 100644 --- a/sys/arch/alpha/pci/cia_dma.c +++ b/sys/arch/alpha/pci/cia_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cia_dma.c,v 1.6 2006/03/20 01:00:58 martin Exp $ */ +/* $OpenBSD: cia_dma.c,v 1.7 2006/04/04 21:20:40 brad Exp $ */ /* $NetBSD: cia_dma.c,v 1.16 2000/06/29 08:58:46 mrg Exp $ */ /*- @@ -90,6 +90,9 @@ void cia_bus_dmamap_unload_sgmap(bus_dma_tag_t, bus_dmamap_t); #define CIA_SGMAP_MAPPED_BASE (8*1024*1024) #define CIA_SGMAP_MAPPED_SIZE (8*1024*1024) +/* ALCOR/ALGOR2/PYXIS have a 256-byte out-bound DMA prefetch threshold. */ +#define CIA_SGMAP_PFTHRESH 256 + void cia_tlb_invalidate(void); void cia_broken_pyxis_tlb_invalidate(void); @@ -144,6 +147,7 @@ cia_dma_init(ccp) t->_next_window = NULL; t->_boundary = 0; t->_sgmap = &ccp->cc_sgmap; + t->_pfthresh = CIA_SGMAP_PFTHRESH; t->_get_tag = cia_dma_get_tag; t->_dmamap_create = alpha_sgmap_dmamap_create; t->_dmamap_destroy = alpha_sgmap_dmamap_destroy; diff --git a/sys/arch/alpha/pci/lca_dma.c b/sys/arch/alpha/pci/lca_dma.c index a6c4f293f4c..8655bc90210 100644 --- a/sys/arch/alpha/pci/lca_dma.c +++ b/sys/arch/alpha/pci/lca_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lca_dma.c,v 1.6 2006/03/20 01:00:58 martin Exp $ */ +/* $OpenBSD: lca_dma.c,v 1.7 2006/04/04 21:20:40 brad Exp $ */ /* $NetBSD: lca_dma.c,v 1.13 2000/06/29 08:58:47 mrg Exp $ */ /*- @@ -88,6 +88,12 @@ void lca_bus_dmamap_unload_sgmap(bus_dma_tag_t, bus_dmamap_t); #define LCA_SGMAP_MAPPED_SIZE (8*1024*1024) /* + * The LCA doesn't have a DMA prefetch threshold. However, it is known + * to lose if we don't allocate a spill page. So initialize it to 256. + */ +#define LCA_SGMAP_PFTHRESH 256 + +/* * Macro to flush LCA scatter/gather TLB. */ #define LCA_TLB_INVALIDATE() \ @@ -139,6 +145,7 @@ lca_dma_init(lcp) t->_next_window = NULL; t->_boundary = 0; t->_sgmap = &lcp->lc_sgmap; + t->_pfthresh = LCA_SGMAP_PFTHRESH; t->_get_tag = lca_dma_get_tag; t->_dmamap_create = alpha_sgmap_dmamap_create; diff --git a/sys/arch/alpha/pci/tsp_dma.c b/sys/arch/alpha/pci/tsp_dma.c index 339daaf9648..ef8fb593a68 100644 --- a/sys/arch/alpha/pci/tsp_dma.c +++ b/sys/arch/alpha/pci/tsp_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tsp_dma.c,v 1.4 2006/03/20 01:00:58 martin Exp $ */ +/* $OpenBSD: tsp_dma.c,v 1.5 2006/04/04 21:20:40 brad Exp $ */ /* $NetBSD: tsp_dma.c,v 1.1 1999/06/29 06:46:47 ross Exp $ */ /*- @@ -111,6 +111,12 @@ void tsp_bus_dmamap_unload_sgmap(bus_dma_tag_t, bus_dmamap_t); void tsp_tlb_invalidate(struct tsp_config *); +/* + * XXX Need to figure out what this is, if any. Initialize it to + * XXX something that should be safe. + */ +#define TSP_SGMAP_PFTHRESH 256 + void tsp_dma_init(pcp) struct tsp_config *pcp; @@ -179,6 +185,7 @@ tsp_dma_init(pcp) t->_next_window = NULL; t->_boundary = 0; t->_sgmap = &pcp->pc_sgmap; + t->_pfthresh = TSP_SGMAP_PFTHRESH; t->_get_tag = tsp_dma_get_tag; t->_dmamap_create = alpha_sgmap_dmamap_create; t->_dmamap_destroy = alpha_sgmap_dmamap_destroy; |