Release 4.14 arch/um/drivers/xterm_kern.c
/*
* Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/irqreturn.h>
#include <asm/irq.h>
#include <irq_kern.h>
#include <os.h>
struct xterm_wait {
struct completion ready;
int fd;
int pid;
int new_fd;
};
static irqreturn_t xterm_interrupt(int irq, void *data)
{
struct xterm_wait *xterm = data;
int fd;
fd = os_rcv_fd(xterm->fd, &xterm->pid);
if (fd == -EAGAIN)
return IRQ_NONE;
xterm->new_fd = fd;
complete(&xterm->ready);
return IRQ_HANDLED;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 57 | 89.06% | 4 | 80.00% |
Paolo 'Blaisorblade' Giarrusso | 7 | 10.94% | 1 | 20.00% |
Total | 64 | 100.00% | 5 | 100.00% |
int xterm_fd(int socket, int *pid_out)
{
struct xterm_wait *data;
int err, ret;
data = kmalloc(sizeof(*data), GFP_KERNEL);
if (data == NULL) {
printk(KERN_ERR "xterm_fd : failed to allocate xterm_wait\n");
return -ENOMEM;
}
/* This is a locked semaphore... */
*data = ((struct xterm_wait) { .fd = socket,
.pid = -1,
.new_fd = -1 });
init_completion(&data->ready);
err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt,
IRQF_SHARED, "xterm", data);
if (err) {
printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
"err = %d\n", err);
ret = err;
goto out;
}
/* ... so here we wait for an xterm interrupt.
*
* XXX Note, if the xterm doesn't work for some reason (eg. DISPLAY
* isn't set) this will hang... */
wait_for_completion(&data->ready);
um_free_irq(XTERM_IRQ, data);
ret = data->new_fd;
*pid_out = data->pid;
out:
kfree(data);
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 158 | 92.94% | 4 | 50.00% |
Paolo 'Blaisorblade' Giarrusso | 8 | 4.71% | 1 | 12.50% |
Chris Wedgwood | 2 | 1.18% | 1 | 12.50% |
Thomas Gleixner | 1 | 0.59% | 1 | 12.50% |
Richard Weinberger | 1 | 0.59% | 1 | 12.50% |
Total | 170 | 100.00% | 8 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 246 | 90.77% | 6 | 54.55% |
Paolo 'Blaisorblade' Giarrusso | 19 | 7.01% | 1 | 9.09% |
Al Viro | 2 | 0.74% | 1 | 9.09% |
Chris Wedgwood | 2 | 0.74% | 1 | 9.09% |
Thomas Gleixner | 1 | 0.37% | 1 | 9.09% |
Richard Weinberger | 1 | 0.37% | 1 | 9.09% |
Total | 271 | 100.00% | 11 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.