2 * Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
3 * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp>
4 * VA Linux Systems Japan K.K.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef _ASM_I386_GNTTAB_DMA_H
22 #define _ASM_I386_GNTTAB_DMA_H
24 static inline int gnttab_dma_local_pfn(struct page *page)
26 /* Has it become a local MFN? */
27 return pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));
30 static inline maddr_t gnttab_dma_map_page(struct page *page)
32 __gnttab_dma_map_page(page);
33 return ((maddr_t)pfn_to_mfn(page_to_pfn(page)) << PAGE_SHIFT);
36 static inline void gnttab_dma_unmap_page(maddr_t maddr)
38 __gnttab_dma_unmap_page(virt_to_page(bus_to_virt(maddr)));
41 #endif /* _ASM_I386_GNTTAB_DMA_H */