# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 29ef650eb22a697452d708be2d54c5e658a1921f
# Parent 92c62a897c82dad5bcee55b6f8327b5f2b55656a
[IA64] fix non-CONFIG_XEN sparse tree build
This patch fixes some over-zealous code removal with the P==M
cleanup. Some of the P==M code was shared with the bare metal kernel.
Also cleaned up a couple places we should have used CONFIG_XEN.
From: Juan Quintela <quintela@xxxxxxxxxx>
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c | 2 ++
linux-2.6-xen-sparse/include/asm-ia64/agp.h | 12 ++++++++++++
linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h | 20 ++++++++++++++++++++
linux-2.6-xen-sparse/include/asm-ia64/io.h | 6 ++++++
linux-2.6-xen-sparse/include/asm-ia64/machvec.h | 2 ++
linux-2.6-xen-sparse/include/asm-ia64/page.h | 3 +++
linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h | 4 ++++
7 files changed, 49 insertions(+)
diff -r 92c62a897c82 -r 29ef650eb22a
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Wed Aug 16 09:13:03
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Wed Aug 16 09:15:17
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 92c62a897c82 -r 29ef650eb22a linux-2.6-xen-sparse/include/asm-ia64/agp.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/agp.h Wed Aug 16 09:13:03
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/agp.h Wed Aug 16 09:15:17
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 <asm/hypervisor.h>
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 92c62a897c82 -r 29ef650eb22a
linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h Wed Aug 16
09:13:03 2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h Wed Aug 16
09:15:17 2006 -0600
@@ -7,11 +7,28 @@
*/
#include <linux/config.h>
#include <asm/machvec.h>
+#ifdef CONFIG_XEN
/* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */
#include <asm/hypervisor.h>
/* Needed for arch/i386/kernel/swiotlb.c */
#include <asm-i386/mach-xen/asm/swiotlb.h>
+#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 92c62a897c82 -r 29ef650eb22a linux-2.6-xen-sparse/include/asm-ia64/io.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/io.h Wed Aug 16 09:13:03
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/io.h Wed Aug 16 09:15:17
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 <asm/pci.h> 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 92c62a897c82 -r 29ef650eb22a
linux-2.6-xen-sparse/include/asm-ia64/machvec.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/machvec.h Wed Aug 16 09:13:03
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/machvec.h Wed Aug 16 09:15:17
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 92c62a897c82 -r 29ef650eb22a
linux-2.6-xen-sparse/include/asm-ia64/page.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/page.h Wed Aug 16 09:13:03
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h Wed Aug 16 09:15:17
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 92c62a897c82 -r 29ef650eb22a
linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h Wed Aug 16 09:13:03
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/pgalloc.h Wed Aug 16 09:15:17
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
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|