Module Name: src Committed By: riastradh Date: Sun Sep 8 15:35:06 UTC 2013
Modified Files: src/sys/external/bsd/drm2/include/asm [riastradh-drm2]: io.h Log Message: Define page_to_phys in Linux <asm/io.h>. To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/external/bsd/drm2/include/asm/io.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/external/bsd/drm2/include/asm/io.h diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.1.2.3 src/sys/external/bsd/drm2/include/asm/io.h:1.1.2.4 --- src/sys/external/bsd/drm2/include/asm/io.h:1.1.2.3 Wed Jul 24 03:44:10 2013 +++ src/sys/external/bsd/drm2/include/asm/io.h Sun Sep 8 15:35:06 2013 @@ -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_ */