#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/miscdevice.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/acpi.h>
#include <linux/bug.h>
#include "goldfish_pipe_qemu.h"
enum { … };
enum { … };
struct goldfish_pipe_dev;
struct goldfish_pipe_command { … };
struct signalled_pipe_buffer { … };
struct open_command_param { … };
struct goldfish_pipe_dev_buffers { … };
struct goldfish_pipe { … };
struct goldfish_pipe_dev { … };
static int goldfish_pipe_cmd_locked(struct goldfish_pipe *pipe,
enum PipeCmdCode cmd)
{ … }
static int goldfish_pipe_cmd(struct goldfish_pipe *pipe, enum PipeCmdCode cmd)
{ … }
static int goldfish_pipe_error_convert(int status)
{ … }
static int goldfish_pin_pages(unsigned long first_page,
unsigned long last_page,
unsigned int last_page_size,
int is_write,
struct page *pages[MAX_BUFFERS_PER_COMMAND],
unsigned int *iter_last_page_size)
{ … }
static void populate_rw_params(struct page **pages,
int pages_count,
unsigned long address,
unsigned long address_end,
unsigned long first_page,
unsigned long last_page,
unsigned int iter_last_page_size,
int is_write,
struct goldfish_pipe_command *command)
{ … }
static int transfer_max_buffers(struct goldfish_pipe *pipe,
unsigned long address,
unsigned long address_end,
int is_write,
unsigned long last_page,
unsigned int last_page_size,
s32 *consumed_size,
int *status)
{ … }
static int wait_for_host_signal(struct goldfish_pipe *pipe, int is_write)
{ … }
static ssize_t goldfish_pipe_read_write(struct file *filp,
char __user *buffer,
size_t bufflen,
int is_write)
{ … }
static ssize_t goldfish_pipe_read(struct file *filp, char __user *buffer,
size_t bufflen, loff_t *ppos)
{ … }
static ssize_t goldfish_pipe_write(struct file *filp,
const char __user *buffer, size_t bufflen,
loff_t *ppos)
{ … }
static __poll_t goldfish_pipe_poll(struct file *filp, poll_table *wait)
{ … }
static void signalled_pipes_add_locked(struct goldfish_pipe_dev *dev,
u32 id, u32 flags)
{ … }
static void signalled_pipes_remove_locked(struct goldfish_pipe_dev *dev,
struct goldfish_pipe *pipe)
{ … }
static struct goldfish_pipe *signalled_pipes_pop_front(
struct goldfish_pipe_dev *dev, int *wakes)
{ … }
static irqreturn_t goldfish_interrupt_task(int irq, void *dev_addr)
{ … }
static void goldfish_pipe_device_deinit(struct platform_device *pdev,
struct goldfish_pipe_dev *dev);
static irqreturn_t goldfish_pipe_interrupt(int irq, void *dev_id)
{ … }
static int get_free_pipe_id_locked(struct goldfish_pipe_dev *dev)
{ … }
static struct goldfish_pipe_dev *to_goldfish_pipe_dev(struct file *file)
{ … }
static int goldfish_pipe_open(struct inode *inode, struct file *file)
{ … }
static int goldfish_pipe_release(struct inode *inode, struct file *filp)
{ … }
static const struct file_operations goldfish_pipe_fops = …;
static void init_miscdevice(struct miscdevice *miscdev)
{ … }
static void write_pa_addr(void *addr, void __iomem *portl, void __iomem *porth)
{ … }
static int goldfish_pipe_device_init(struct platform_device *pdev,
struct goldfish_pipe_dev *dev)
{ … }
static void goldfish_pipe_device_deinit(struct platform_device *pdev,
struct goldfish_pipe_dev *dev)
{ … }
static int goldfish_pipe_probe(struct platform_device *pdev)
{ … }
static void goldfish_pipe_remove(struct platform_device *pdev)
{ … }
static const struct acpi_device_id goldfish_pipe_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, goldfish_pipe_acpi_match);
static const struct of_device_id goldfish_pipe_of_match[] = …;
MODULE_DEVICE_TABLE(of, goldfish_pipe_of_match);
static struct platform_driver goldfish_pipe_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;