Module Name:    src
Committed By:   uebayasi
Date:           Wed Jul 28 04:16:13 UTC 2010

Modified Files:
        src/sys/arch/arm/imx [uebayasi-xip]: imx31_space.c
        src/sys/arch/arm/include [uebayasi-xip]: bus.h
        src/sys/sys [uebayasi-xip]: bus_proto.h

Log Message:
Correct bus_space_physload(9) arguments to take "int freelist".

A possible use case of bus_space_physload(9) would be some high-performance
device with huge local memory, like InfiniBand HCA.  We can register
its local memory using bus_space_physload(..., VM_FREELIST_INFINIBAND0),
then later map it to userspace via cdev_mmap(9) -> bus_dmamem_mmap(9).

(bus_dma(9) needs changes too, of course.)


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.4 -r1.3.2.5 src/sys/arch/arm/imx/imx31_space.c
cvs rdiff -u -r1.20.2.3 -r1.20.2.4 src/sys/arch/arm/include/bus.h
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/sys/sys/bus_proto.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx31_space.c
diff -u src/sys/arch/arm/imx/imx31_space.c:1.3.2.4 src/sys/arch/arm/imx/imx31_space.c:1.3.2.5
--- src/sys/arch/arm/imx/imx31_space.c:1.3.2.4	Mon Jul 26 10:11:38 2010
+++ src/sys/arch/arm/imx/imx31_space.c	Wed Jul 28 04:16:12 2010
@@ -1,7 +1,7 @@
-/* $Id: imx31_space.c,v 1.3.2.4 2010/07/26 10:11:38 uebayasi Exp $ */
+/* $Id: imx31_space.c,v 1.3.2.5 2010/07/28 04:16:12 uebayasi Exp $ */
 
 /* derived from: */
-/*	$NetBSD: imx31_space.c,v 1.3.2.4 2010/07/26 10:11:38 uebayasi Exp $ */
+/*	$NetBSD: imx31_space.c,v 1.3.2.5 2010/07/28 04:16:12 uebayasi Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -285,13 +285,12 @@
 /* XXX generic */
 
 void *
-imx31_bs_physload(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
+imx31_bs_physload(void *t, bus_addr_t addr, bus_size_t size, int freelist)
 {
-	/* XXX */
-	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
-	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
+	const paddr_t start = imx31_bs_mmap(t, addr, 0, VM_PROT_ALL, 0);
+	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, VM_PROT_ALL, 0);
 
-	return uvm_page_physload(start, end, start, end, 0/* XXX freelist */);
+	return uvm_page_physload(start, end, start, end, freelist);
 }
 
 void
@@ -304,7 +303,6 @@
 void *
 imx31_bs_physload_device(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
 {
-	/* XXX */
 	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
 	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
 

Index: src/sys/arch/arm/include/bus.h
diff -u src/sys/arch/arm/include/bus.h:1.20.2.3 src/sys/arch/arm/include/bus.h:1.20.2.4
--- src/sys/arch/arm/include/bus.h:1.20.2.3	Mon Jul 26 10:11:38 2010
+++ src/sys/arch/arm/include/bus.h	Wed Jul 28 04:16:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.20.2.3 2010/07/26 10:11:38 uebayasi Exp $	*/
+/*	$NetBSD: bus.h,v 1.20.2.4 2010/07/28 04:16:13 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -274,7 +274,7 @@
 
 #ifdef __BUS_SPACE_HAS_PHYSLOAD_METHODS
 	void *		(*bs_physload)(void *, bus_addr_t, bus_size_t,
-			    int, int);
+			    int);
 	void		(*bs_physunload)(void *, void *);
 	void *		(*bs_physload_device)(void *, bus_addr_t, bus_size_t,
 			    int, int);
@@ -702,7 +702,7 @@
 #ifdef __BUS_SPACE_HAS_PHYSLOAD_METHODS
 #define bs_physload_proto(f)						\
 void *	__bs_c(f,_bs_physload)(void *t,					\
-	    bus_addr_t addr, bus_size_t size, int prot, int flags);
+	    bus_addr_t addr, bus_size_t size, int freelist);
 #define bs_physunload_proto(f)						\
 void	__bs_c(f,_bs_physunload)(void *t, void *phys)
 #define bs_physload_device_proto(f)					\
@@ -768,7 +768,7 @@
  * Load bus space as a physical segment for managed access.
  */
 #define bus_space_physload(t, a, s, p, f)				\
-	(*(t)->bs_physload)((t)->bs_cookie, (a), (s), (p), (f))
+	(*(t)->bs_physload)((t)->bs_cookie, (a), (s), (l))
 #define bus_space_physunload(t, p)					\
 	(*(t)->bs_physunload)((t)->bs_cookie, (p))
 #define bus_space_physload_device(t, a, s, p, f)			\

Index: src/sys/sys/bus_proto.h
diff -u src/sys/sys/bus_proto.h:1.3.2.2 src/sys/sys/bus_proto.h:1.3.2.3
--- src/sys/sys/bus_proto.h:1.3.2.2	Mon Jul 26 10:11:38 2010
+++ src/sys/sys/bus_proto.h	Wed Jul 28 04:16:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_proto.h,v 1.3.2.2 2010/07/26 10:11:38 uebayasi Exp $	*/
+/*	$NetBSD: bus_proto.h,v 1.3.2.3 2010/07/28 04:16:12 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001, 2007 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
 void	bus_space_barrier(bus_space_tag_t tag, bus_space_handle_t bsh,
 			  bus_size_t offset, bus_size_t len, int flags);
 void	*bus_space_physload(bus_space_tag_t, bus_addr_t, bus_size_t,
-			    int, int);
+			    int);
 void	bus_space_physunload(bus_space_tag_t, void *);
 void	*bus_space_physload_device(bus_space_tag_t, bus_addr_t, bus_size_t,
 			    int, int);

Reply via email to