diff -r bef360142b62 linux-2.6-xen-sparse/arch/ia64/kernel/setup.c --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Mon Aug 14 22:25:36 2006 -0600 @@ -565,7 +565,9 @@ setup_arch (char **cmdline_p) platform_setup(cmdline_p); paging_init(); +#ifdef CONFIG_XEN contiguous_bitmap_init(max_pfn); +#endif } /* diff -r bef360142b62 linux-2.6-xen-sparse/include/asm-ia64/agp.h --- a/linux-2.6-xen-sparse/include/asm-ia64/agp.h Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/agp.h Mon Aug 14 22:25:36 2006 -0600 @@ -19,10 +19,21 @@ #define flush_agp_cache() mb() /* Convert a physical address to an address suitable for the GART. */ +#ifndef CONFIG_XEN +#define phys_to_gart(x) (x) +#define gart_to_phys(x) (x) +#else #define phys_to_gart(x) phys_to_machine_for_dma(x) #define gart_to_phys(x) machine_to_phys_for_dma(x) +#endif /* GATT allocation. Returns/accepts GATT kernel virtual address. */ +#ifndef CONFIG_XEN +#define alloc_gatt_pages(order) \ + ((char *)__get_free_pages(GFP_KERNEL, (order))) +#define free_gatt_pages(table, order) \ + free_pages((unsigned long)(table), (order)) +#else #include static inline char* alloc_gatt_pages(unsigned int order) @@ -46,5 +57,6 @@ free_gatt_pages(void* table, unsigned in xen_destroy_contiguous_region((unsigned long)table, order); free_pages((unsigned long)table, order); } +#endif /* CONFIG_XEN */ #endif /* _ASM_IA64_AGP_H */ diff -r bef360142b62 linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h --- a/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h Mon Aug 14 22:25:36 2006 -0600 @@ -7,11 +7,28 @@ */ #include #include +#ifdef CONFIG_XEN /* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */ #include /* Needed for arch/i386/kernel/swiotlb.c */ #include +#endif +#ifndef CONFIG_XEN +#define dma_alloc_coherent platform_dma_alloc_coherent +#define dma_alloc_noncoherent platform_dma_alloc_coherent /* coherent mem. is cheap */ +#define dma_free_coherent platform_dma_free_coherent +#define dma_free_noncoherent platform_dma_free_coherent +#define dma_map_single platform_dma_map_single +#define dma_map_sg platform_dma_map_sg +#define dma_unmap_single platform_dma_unmap_single +#define dma_unmap_sg platform_dma_unmap_sg +#define dma_sync_single_for_cpu platform_dma_sync_single_for_cpu +#define dma_sync_sg_for_cpu platform_dma_sync_sg_for_cpu +#define dma_sync_single_for_device platform_dma_sync_single_for_device +#define dma_sync_sg_for_device platform_dma_sync_sg_for_device +#define dma_mapping_error platform_dma_mapping_error +#else int dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction direction); void dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, @@ -50,6 +67,7 @@ dma_sync_sg_for_device(struct device *de swiotlb_sync_sg_for_device(dev,sg,nelems,direction); flush_write_buffers(); } +#endif #define dma_map_page(dev, pg, off, size, dir) \ dma_map_single(dev, page_address(pg) + (off), (size), (dir)) @@ -91,6 +109,7 @@ dma_cache_sync (void *vaddr, size_t size #define dma_is_consistent(dma_handle) (1) /* all we do is coherent memory... */ +#ifdef CONFIG_XEN /* arch/i386/kernel/swiotlb.o requires */ void contiguous_bitmap_init(unsigned long end_pfn); @@ -111,5 +130,6 @@ range_straddles_page_boundary(void *p, s return (((((unsigned long)p & ~PAGE_MASK) + size) > PAGE_SIZE) && !test_bit(__pa(p) >> PAGE_SHIFT, contiguous_bitmap)); } +#endif #endif /* _ASM_IA64_DMA_MAPPING_H */ diff -r bef360142b62 linux-2.6-xen-sparse/include/asm-ia64/io.h --- a/linux-2.6-xen-sparse/include/asm-ia64/io.h Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/io.h Mon Aug 14 22:25:36 2006 -0600 @@ -97,6 +97,11 @@ extern int valid_mmap_phys_addr_range (u * The following two macros are deprecated and scheduled for removal. * Please use the PCI-DMA interface defined in instead. */ +#ifndef CONFIG_XEN +#define bus_to_virt phys_to_virt +#define virt_to_bus virt_to_phys +#define page_to_bus page_to_phys +#else #define bus_to_virt(bus) \ phys_to_virt(machine_to_phys_for_dma(bus)) #define virt_to_bus(virt) \ @@ -124,6 +129,7 @@ extern int valid_mmap_phys_addr_range (u (((bvec_to_bus((vec1)) + (vec1)->bv_len) == bvec_to_bus((vec2))) && \ ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) == \ bvec_to_pseudophys((vec2)))) +#endif /* CONFIG_XEN */ # endif /* KERNEL */ diff -r bef360142b62 linux-2.6-xen-sparse/include/asm-ia64/machvec.h --- a/linux-2.6-xen-sparse/include/asm-ia64/machvec.h Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/machvec.h Mon Aug 14 22:25:36 2006 -0600 @@ -247,6 +247,7 @@ extern void machvec_init (const char *na # error Unknown configuration. Update asm-ia64/machvec.h. # endif /* CONFIG_IA64_GENERIC */ +#ifdef CONFIG_XEN # define platform_dma_map_sg dma_map_sg # define platform_dma_unmap_sg dma_unmap_sg # define platform_dma_mapping_error dma_mapping_error @@ -259,6 +260,7 @@ extern void machvec_init (const char *na dma_sync_single_for_cpu # define platform_dma_sync_single_for_device \ dma_sync_single_for_device +#endif /* * Declare default routines which aren't declared anywhere else: diff -r bef360142b62 linux-2.6-xen-sparse/include/asm-ia64/page.h --- a/linux-2.6-xen-sparse/include/asm-ia64/page.h Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h Mon Aug 14 22:25:36 2006 -0600 @@ -117,6 +117,9 @@ extern unsigned long max_low_pfn; # define pfn_to_page(pfn) (vmem_map + (pfn)) #endif +#ifndef CONFIG_XEN +#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) +#endif #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) diff -r bef360142b62 linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h --- a/linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h Mon Aug 14 22:25:36 2006 -0600 @@ -126,7 +126,11 @@ static inline void static inline void pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) { +#ifndef CONFIG_XEN + pmd_val(*pmd_entry) = page_to_phys(pte); +#else pmd_val(*pmd_entry) = page_to_pseudophys(pte); +#endif } static inline void