lkml.org 
[lkml]   [2008]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/9] x86/iommu: change PCI-NOMMU to use dma_ops register interface
    Date
    Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
    ---
    arch/x86/kernel/pci-nommu.c | 12 ++++++++++++
    1 files changed, 12 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c
    index 1c1c98a..0cbecb9 100644
    --- a/arch/x86/kernel/pci-nommu.c
    +++ b/arch/x86/kernel/pci-nommu.c
    @@ -115,16 +115,28 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr,
    free_pages((unsigned long)vaddr, get_order(size));
    }

    +static int nommu_device_supported(struct device *dev)
    +{
    + return 1;
    +}
    +
    struct dma_mapping_ops nommu_dma_ops = {
    .alloc_coherent = nommu_alloc_coherent,
    .free_coherent = nommu_free_coherent,
    .map_single = nommu_map_single,
    .map_sg = nommu_map_sg,
    + .device_supported = nommu_device_supported,
    .is_phys = 1,
    };

    void __init no_iommu_init(void)
    {
    + /*
    + * we always want nommu to be the last fallback if no
    + * other dma_ops implementation feels responsible
    + */
    + x86_register_dma_ops(&nommu_dma_ops, DMA_OPS_TYPE_SOFT);
    +
    if (dma_ops)
    return;

    --
    1.5.6.4



    \
     
     \ /
      Last update: 2008-09-22 20:25    [W:2.126 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site