summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/pci/tsp_bus_mem.c
diff options
context:
space:
mode:
authormjacob <mjacob@cvs.openbsd.org>2001-04-14 22:19:57 +0000
committermjacob <mjacob@cvs.openbsd.org>2001-04-14 22:19:57 +0000
commit9cc5307d8f414ec5278f413692ef9f99f89cffe5 (patch)
treedc089d2866da2cf19badcda5d4c7d41212c50555 /sys/arch/alpha/pci/tsp_bus_mem.c
parentb4f48c5c46b00b070d43b8c99ff49b2207203289 (diff)
Pick up some more NetBSD-isms (tsp_bus_mem_init2).
Diffstat (limited to 'sys/arch/alpha/pci/tsp_bus_mem.c')
-rw-r--r--sys/arch/alpha/pci/tsp_bus_mem.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/sys/arch/alpha/pci/tsp_bus_mem.c b/sys/arch/alpha/pci/tsp_bus_mem.c
index 20624843add..98a20a9c7a2 100644
--- a/sys/arch/alpha/pci/tsp_bus_mem.c
+++ b/sys/arch/alpha/pci/tsp_bus_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsp_bus_mem.c,v 1.1 2000/11/16 04:50:18 ericj Exp $ */
+/* $OpenBSD: tsp_bus_mem.c,v 1.2 2001/04/14 22:19:56 mjacob Exp $ */
/* $NetBSD: tsp_bus_mem.c,v 1.4 2000/06/26 19:46:25 thorpej Exp $ */
/*-
@@ -64,3 +64,34 @@
__asm(".arch ev6");
#include <alpha/pci/pci_bwx_bus_mem_chipdep.c>
+
+void
+tsp_bus_mem_init2(void *v)
+{
+ struct tsp_config *pcp = v;
+ struct ts_pchip *pccsr = pcp->pc_csr;
+ int i, error;
+
+ /*
+ * Allocate the DMA windows out of the extent map.
+ */
+ for (i = 0; i < 4; i++) {
+ alpha_mb();
+ if ((pccsr->tsp_wsba[i].tsg_r & WSBA_ENA) == 0) {
+ /* Window not in use. */
+ continue;
+ }
+
+ error = extent_alloc_region(CHIP_MEM_EXTENT(v),
+ WSBA_ADDR(pccsr->tsp_wsba[i].tsg_r),
+ WSM_LEN(pccsr->tsp_wsm[i].tsg_r),
+ EX_NOWAIT | (CHIP_EX_MALLOC_SAFE(v) ? EX_MALLOCOK : 0));
+ if (error) {
+ printf("WARNING: unable to reserve DMA window "
+ "0x%lx - 0x%lx\n",
+ WSBA_ADDR(pccsr->tsp_wsba[i].tsg_r),
+ WSBA_ADDR(pccsr->tsp_wsba[i].tsg_r) +
+ (WSM_LEN(pccsr->tsp_wsm[i].tsg_r) - 1));
+ }
+ }
+}