May 2017
Beginner to intermediate
470 pages
10h 49m
English
Since QEMU pipe is used as a channel to emulate many goldfish devices, we can review one of the major functions, goldfish_pipe_read_write, to understand data transmission between guest and host:
static ssize_t goldfish_pipe_read_write(struct file *filp, char __user *buffer, size_t bufflen, int is_write) { ... /* Now, try to transfer the bytes in the current page */ spin_lock_irqsave(&dev->lock, irq_flags); if (access_with_param(dev, is_write ? CMD_WRITE_BUFFER : CMD_READ_BUFFER, xaddr, avail, pipe, &status)) { writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL); #ifdef CONFIG_64BIT writel((u32)((u64)pipe >> 32), dev->base + PIPE_REG_CHANNEL_HIGH); #endif writel(avail, dev->base + PIPE_REG_SIZE); writel(xaddr, dev->base ...Read now
Unlock full access