iommu.c (7483d45f0aee3afc0646d185cabd4af9f6cab58c) iommu.c (77ca23323594589ac8cba1c8d59bfe7e85d3cb8b)
1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
8 *

--- 105 unchanged lines hidden (view full) ---

114 return bus->iommu_ops != NULL;
115}
116EXPORT_SYMBOL_GPL(iommu_present);
117
118/**
119 * iommu_set_fault_handler() - set a fault handler for an iommu domain
120 * @domain: iommu domain
121 * @handler: fault handler
1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
8 *

--- 105 unchanged lines hidden (view full) ---

114 return bus->iommu_ops != NULL;
115}
116EXPORT_SYMBOL_GPL(iommu_present);
117
118/**
119 * iommu_set_fault_handler() - set a fault handler for an iommu domain
120 * @domain: iommu domain
121 * @handler: fault handler
122 * @token: user data, will be passed back to the fault handler
122 *
123 * This function should be used by IOMMU users which want to be notified
124 * whenever an IOMMU fault happens.
125 *
126 * The fault handler itself should return 0 on success, and an appropriate
127 * error code otherwise.
128 */
129void iommu_set_fault_handler(struct iommu_domain *domain,
123 *
124 * This function should be used by IOMMU users which want to be notified
125 * whenever an IOMMU fault happens.
126 *
127 * The fault handler itself should return 0 on success, and an appropriate
128 * error code otherwise.
129 */
130void iommu_set_fault_handler(struct iommu_domain *domain,
130 iommu_fault_handler_t handler)
131 iommu_fault_handler_t handler,
132 void *token)
131{
132 BUG_ON(!domain);
133
134 domain->handler = handler;
133{
134 BUG_ON(!domain);
135
136 domain->handler = handler;
137 domain->handler_token = token;
135}
136EXPORT_SYMBOL_GPL(iommu_set_fault_handler);
137
138struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
139{
140 struct iommu_domain *domain;
141 int ret;
142

--- 201 unchanged lines hidden ---
138}
139EXPORT_SYMBOL_GPL(iommu_set_fault_handler);
140
141struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
142{
143 struct iommu_domain *domain;
144 int ret;
145

--- 201 unchanged lines hidden ---