mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 22:24:09 +08:00
0a0c3b5a24
This device extends the uio_pdrv_genirq driver to provide limited dynamic memory allocation for UIO devices. This allows UIO devices to use CMA and IOMMU allocated memory regions. This driver is based on the uio_pdrv_genirq driver and provides the same generic interrupt handling capabilities. Like uio_prdv_genirq, a fixed number of memory regions, defined in the platform device's .resources field are exported to userpace. This driver adds the ability to export additional regions whose number and size are known at boot time, but whose memory is not allocated until the uio device file is opened for the first time. When the device file is closed, the allocated memory block is freed. Physical (DMA) addresses for the dynamic regions are provided to the userspace via /sys/class/uio/uioX/maps/mapY/addr in the same way as static addresses are when the uio device file is open, when no processes are holding the device file open, the address returned to userspace is DMA_ERROR_CODE. Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: "Hans J. Koch" <hjk@hansjkoch.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 lines
800 B
C
27 lines
800 B
C
/*
|
|
* include/linux/platform_data/uio_dmem_genirq.h
|
|
*
|
|
* Copyright (C) 2012 Damian Hobson-Garcia
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation version 2.
|
|
*
|
|
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
|
|
* kind, whether express or implied; without even the implied warranty
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef _UIO_DMEM_GENIRQ_H
|
|
#define _UIO_DMEM_GENIRQ_H
|
|
|
|
#include <linux/uio_driver.h>
|
|
|
|
struct uio_dmem_genirq_pdata {
|
|
struct uio_info uioinfo;
|
|
unsigned int *dynamic_region_sizes;
|
|
unsigned int num_dynamic_regions;
|
|
};
|
|
#endif /* _UIO_DMEM_GENIRQ_H */
|