Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys After much consideration, rename bus_space_physlo...
details: https://anonhg.NetBSD.org/src/rev/9ffad6c92cc3
branches: uebayasi-xip
changeset: 751751:9ffad6c92cc3
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Mon Jul 26 10:11:38 2010 +0000
description:
After much consideration, rename bus_space_physload_direct(9) back to
bus_space_physload_device(9).
The latter registers a segment as "device pages". "Device pages" are
managed, but not used for general purpose memory. Most typically XIP
pages.
diffstat:
sys/arch/arm/imx/imx31_space.c | 16 ++++++++--------
sys/arch/arm/include/bus.h | 26 +++++++++++++-------------
sys/dev/flash.c | 8 ++++----
sys/sys/bus_proto.h | 8 +++++++-
sys/uvm/uvm_extern.h | 6 +++---
sys/uvm/uvm_page.c | 21 ++++++++++++---------
6 files changed, 47 insertions(+), 38 deletions(-)
diffs (239 lines):
diff -r bbdacd1036fa -r 9ffad6c92cc3 sys/arch/arm/imx/imx31_space.c
--- a/sys/arch/arm/imx/imx31_space.c Sat Jul 24 08:22:14 2010 +0000
+++ b/sys/arch/arm/imx/imx31_space.c Mon Jul 26 10:11:38 2010 +0000
@@ -1,7 +1,7 @@
-/* $Id: imx31_space.c,v 1.3.2.3 2010/05/31 13:26:36 uebayasi Exp $ */
+/* $Id: imx31_space.c,v 1.3.2.4 2010/07/26 10:11:38 uebayasi Exp $ */
/* derived from: */
-/* $NetBSD: imx31_space.c,v 1.3.2.3 2010/05/31 13:26:36 uebayasi Exp $ */
+/* $NetBSD: imx31_space.c,v 1.3.2.4 2010/07/26 10:11:38 uebayasi Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -166,8 +166,8 @@
/* physload */
imx31_bs_physload,
imx31_bs_physunload,
- imx31_bs_physload_direct,
- imx31_bs_physunload_direct,
+ imx31_bs_physload_device,
+ imx31_bs_physunload_device,
};
int
@@ -302,18 +302,18 @@
}
void *
-imx31_bs_physload_direct(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
+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);
- return uvm_page_physload_direct(start, end, start, end, prot, flags);
+ return uvm_page_physload_device(start, end, start, end, prot, flags);
}
void
-imx31_bs_physunload_direct(void *t, void *phys)
+imx31_bs_physunload_device(void *t, void *phys)
{
- uvm_page_physunload_direct(phys);
+ uvm_page_physunload_device(phys);
}
diff -r bbdacd1036fa -r 9ffad6c92cc3 sys/arch/arm/include/bus.h
--- a/sys/arch/arm/include/bus.h Sat Jul 24 08:22:14 2010 +0000
+++ b/sys/arch/arm/include/bus.h Mon Jul 26 10:11:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.h,v 1.20.2.2 2010/05/31 13:26:36 uebayasi Exp $ */
+/* $NetBSD: bus.h,v 1.20.2.3 2010/07/26 10:11:38 uebayasi Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -276,9 +276,9 @@
void * (*bs_physload)(void *, bus_addr_t, bus_size_t,
int, int);
void (*bs_physunload)(void *, void *);
- void * (*bs_physload_direct)(void *, bus_addr_t, bus_size_t,
+ void * (*bs_physload_device)(void *, bus_addr_t, bus_size_t,
int, int);
- void (*bs_physunload_direct)(void *, void *);
+ void (*bs_physunload_device)(void *, void *);
#endif
};
@@ -705,11 +705,11 @@
bus_addr_t addr, bus_size_t size, int prot, int flags);
#define bs_physunload_proto(f) \
void __bs_c(f,_bs_physunload)(void *t, void *phys)
-#define bs_physload_direct_proto(f) \
-void * __bs_c(f,_bs_physload_direct)(void *t, \
+#define bs_physload_device_proto(f) \
+void * __bs_c(f,_bs_physload_device)(void *t, \
bus_addr_t addr, bus_size_t size, int prot, int flags);
-#define bs_physunload_direct_proto(f) \
-void __bs_c(f,_bs_physunload_direct)(void *t, void *phys)
+#define bs_physunload_device_proto(f) \
+void __bs_c(f,_bs_physunload_device)(void *t, void *phys)
#endif
#define bs_protos(f) \
@@ -759,8 +759,8 @@
bs_c_8_proto(f); \
bs_physload_proto(f); \
bs_physunload_proto(f); \
-bs_physload_direct_proto(f); \
-bs_physunload_direct_proto(f);
+bs_physload_device_proto(f); \
+bs_physunload_device_proto(f);
#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
@@ -771,10 +771,10 @@
(*(t)->bs_physload)((t)->bs_cookie, (a), (s), (p), (f))
#define bus_space_physunload(t, p) \
(*(t)->bs_physunload)((t)->bs_cookie, (p))
-#define bus_space_physload_direct(t, a, s, p, f) \
- (*(t)->bs_physload_direct)((t)->bs_cookie, (a), (s), (p), (f))
-#define bus_space_physunload_direct(t, p) \
- (*(t)->bs_physunload_direct)((t)->bs_cookie, (p))
+#define bus_space_physload_device(t, a, s, p, f) \
+ (*(t)->bs_physload_device)((t)->bs_cookie, (a), (s), (p), (f))
+#define bus_space_physunload_device(t, p) \
+ (*(t)->bs_physunload_device)((t)->bs_cookie, (p))
/* Bus Space DMA macros */
diff -r bbdacd1036fa -r 9ffad6c92cc3 sys/dev/flash.c
--- a/sys/dev/flash.c Sat Jul 24 08:22:14 2010 +0000
+++ b/sys/dev/flash.c Mon Jul 26 10:11:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $Id: flash.c,v 1.1.2.9 2010/05/31 13:26:37 uebayasi Exp $ */
+/* $Id: flash.c,v 1.1.2.10 2010/07/26 10:11:38 uebayasi Exp $ */
/*-
* Copyright (c) 2010 Tsubai Masanari. All rights reserved.
@@ -238,10 +238,10 @@
#ifdef XIP
#ifndef __BUS_SPACE_HAS_PHYSLOAD
-#error bus_space_physload_direct(9) must be supported to use XIP!
+#error bus_space_physload_device(9) must be supported to use XIP!
#else
- sc->sc_phys = bus_space_physload_direct(sc->sc_iot, sc->sc_addr, sc->sc_size,
- PROT_READ | PROT_WRITE, 0);
+ sc->sc_phys = bus_space_physload_device(sc->sc_iot, sc->sc_addr, sc->sc_size,
+ PROT_READ, 0);
#endif
#endif
diff -r bbdacd1036fa -r 9ffad6c92cc3 sys/sys/bus_proto.h
--- a/sys/sys/bus_proto.h Sat Jul 24 08:22:14 2010 +0000
+++ b/sys/sys/bus_proto.h Mon Jul 26 10:11:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_proto.h,v 1.3.2.1 2010/04/30 14:44:32 uebayasi Exp $ */
+/* $NetBSD: bus_proto.h,v 1.3.2.2 2010/07/26 10:11:38 uebayasi Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2001, 2007 The NetBSD Foundation, Inc.
@@ -103,6 +103,12 @@
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);
+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);
+void bus_space_physunload_device(bus_space_tag_t, void *);
/*
* bus_space(9) accessors
diff -r bbdacd1036fa -r 9ffad6c92cc3 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h Sat Jul 24 08:22:14 2010 +0000
+++ b/sys/uvm/uvm_extern.h Mon Jul 26 10:11:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_extern.h,v 1.161.2.7 2010/05/31 13:26:38 uebayasi Exp $ */
+/* $NetBSD: uvm_extern.h,v 1.161.2.8 2010/07/26 10:11:39 uebayasi Exp $ */
/*
*
@@ -721,9 +721,9 @@
void *uvm_page_physload(paddr_t, paddr_t,
paddr_t, paddr_t, int);
void uvm_page_physunload(void *);
-void *uvm_page_physload_direct(paddr_t, paddr_t,
+void *uvm_page_physload_device(paddr_t, paddr_t,
paddr_t, paddr_t, int, int);
-void uvm_page_physunload_direct(void *);
+void uvm_page_physunload_device(void *);
void uvm_setpagesize(void);
/* uvm_pager.c */
diff -r bbdacd1036fa -r 9ffad6c92cc3 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c Sat Jul 24 08:22:14 2010 +0000
+++ b/sys/uvm/uvm_page.c Mon Jul 26 10:11:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.c,v 1.153.2.49 2010/07/24 08:22:14 uebayasi Exp $ */
+/* $NetBSD: uvm_page.c,v 1.153.2.50 2010/07/26 10:11:39 uebayasi Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.49 2010/07/24 08:22:14 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.50 2010/07/26 10:11:39 uebayasi Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -832,7 +832,7 @@
#ifdef XIP
void *
-uvm_page_physload_direct(paddr_t start, paddr_t end, paddr_t avail_start,
+uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
paddr_t avail_end, int prot, int flags)
{
struct vm_physseg *seg;
@@ -846,10 +846,11 @@
seg->flags = flags; /* XXXUEBS BUS_SPACE_MAP_* */
/*
- * XIP page metadata initialization
- * - Only "phys_addr" and "vm_page_md" (== "PV" management) are used.
- * - No "pageq" operation is done.
- * - XIP pages are read-only (for now).
+ * Managed device page metadata initialization
+ * - Pages are not used for general purpose memory.
+ * - Pages are not put in free lists.
+ * - Pages are not paged out ("fixed").
+ * - No "pageq" operation is done.
*/
seg->pgs = kmem_zalloc(sizeof(struct vm_page) * (end - start),
KM_SLEEP);
@@ -863,7 +864,9 @@
paddr_t paddr = (start + i) << PAGE_SHIFT;
pg->phys_addr = paddr;
- pg->flags |= PG_FAKE | PG_RDONLY | PG_CLEAN;
+ pg->flags |= PG_FAKE | PG_CLEAN;
+ if (prot == PROT_READ)
+ pg->flags |= PG_RDONLY;
pg->pqflags = PQ_FIXED;
#ifdef __HAVE_VM_PAGE_MD
VM_MDPAGE_INIT(&pg->mdpage, paddr);
@@ -875,7 +878,7 @@
}
void
-uvm_page_physunload_direct(void *cookie)
+uvm_page_physunload_device(void *cookie)
{
struct vm_physseg *seg = cookie;
Home |
Main Index |
Thread Index |
Old Index