Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/asm Define page_to_ph...



details:   https://anonhg.NetBSD.org/src/rev/b5ac58003961
branches:  riastradh-drm2
changeset: 788508:b5ac58003961
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 15:35:06 2013 +0000

description:
Define page_to_phys in Linux <asm/io.h>.

diffstat:

 sys/external/bsd/drm2/include/asm/io.h |  20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diffs (39 lines):

diff -r 3dcea549ee8e -r b5ac58003961 sys/external/bsd/drm2/include/asm/io.h
--- a/sys/external/bsd/drm2/include/asm/io.h    Sun Sep 08 15:34:36 2013 +0000
+++ b/sys/external/bsd/drm2/include/asm/io.h    Sun Sep 08 15:35:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.h,v 1.1.2.3 2013/07/24 03:44:10 riastradh Exp $     */
+/*     $NetBSD: io.h,v 1.1.2.4 2013/09/08 15:35:06 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,6 +32,12 @@
 #ifndef _ASM_IO_H_
 #define _ASM_IO_H_
 
+#include <sys/bus.h>
+
+#include <uvm/uvm_page.h>
+
+#include <linux/mm_types.h>
+
 /*
  * XXX This is bollocks, and is wrong on various architectures (should
  * work for x86; who knows what else), but bus_space_barrier won't work
@@ -43,4 +49,16 @@
 #define        memcpy_toio     memcpy
 #define        memset_io       memset
 
+/*
+ * XXX Not sure why this is here, but so it is in Linux...  Also, not
+ * sure what the right type is: Linux uses dma_addr_t, but I don't
+ * think bus_addr_t is right here -- paddr_t sounds more appropriate.
+ */
+
+static inline bus_addr_t
+page_to_phys(struct page *page)
+{
+       return VM_PAGE_TO_PHYS(&page->p_vmp);
+}
+
 #endif  /* _ASM_IO_H_ */



Home | Main Index | Thread Index | Old Index