Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys Correct bus_space_physload(9) arguments to take "...
details: https://anonhg.NetBSD.org/src/rev/063cb63ae6c6
branches: uebayasi-xip
changeset: 751754:063cb63ae6c6
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Wed Jul 28 04:16:12 2010 +0000
description:
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.)
diffstat:
sys/arch/arm/imx/imx31_space.c | 14 ++++++--------
sys/arch/arm/include/bus.h | 8 ++++----
sys/sys/bus_proto.h | 4 ++--
3 files changed, 12 insertions(+), 14 deletions(-)
diffs (93 lines):
diff -r 769043057619 -r 063cb63ae6c6 sys/arch/arm/imx/imx31_space.c
--- a/sys/arch/arm/imx/imx31_space.c Tue Jul 27 01:47:43 2010 +0000
+++ b/sys/arch/arm/imx/imx31_space.c Wed Jul 28 04:16:12 2010 +0000
@@ -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);
diff -r 769043057619 -r 063cb63ae6c6 sys/arch/arm/include/bus.h
--- a/sys/arch/arm/include/bus.h Tue Jul 27 01:47:43 2010 +0000
+++ b/sys/arch/arm/include/bus.h Wed Jul 28 04:16:12 2010 +0000
@@ -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) \
diff -r 769043057619 -r 063cb63ae6c6 sys/sys/bus_proto.h
--- a/sys/sys/bus_proto.h Tue Jul 27 01:47:43 2010 +0000
+++ b/sys/sys/bus_proto.h Wed Jul 28 04:16:12 2010 +0000
@@ -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);
Home |
Main Index |
Thread Index |
Old Index