Lines Matching refs:psd
35 pty_server_dev_t* psd = psd_from_ps(ps); in psd_recv() local
37 bool was_empty = pty_fifo_is_empty(&psd->fifo); in psd_recv()
38 *actual = pty_fifo_write(&psd->fifo, data, len, false); in psd_recv()
51 pty_server_dev_t* psd = ctx; in psd_read() local
55 mtx_lock(&psd->srv.lock); in psd_read()
56 bool was_full = pty_fifo_is_full(&psd->fifo); in psd_read()
57 size_t length = pty_fifo_read(&psd->fifo, buf, count); in psd_read()
58 if (pty_fifo_is_empty(&psd->fifo)) { in psd_read()
59 if (list_is_empty(&psd->srv.clients)) { in psd_read()
62 device_state_clr(psd->srv.zxdev, DEV_STATE_READABLE); in psd_read()
66 pty_server_resume_locked(&psd->srv); in psd_read()
68 mtx_unlock(&psd->srv.lock); in psd_read()
83 pty_server_dev_t* psd = ctx; in psd_write() local
87 if ((status = pty_server_send(&psd->srv, buf, count, false, &length)) < 0) { in psd_write()
98 pty_server_dev_t* psd = ctx; in psd_ioctl() local
106 pty_server_set_window_size(&psd->srv, wsz->width, wsz->height); in psd_ioctl()
131 pty_server_dev_t* psd; in ptmx_open() local
132 if ((psd = calloc(1, sizeof(pty_server_dev_t))) == NULL) { in ptmx_open()
136 pty_server_init(&psd->srv); in ptmx_open()
137 psd->srv.recv = psd_recv; in ptmx_open()
138 mtx_init(&psd->lock, mtx_plain); in ptmx_open()
139 psd->fifo.head = 0; in ptmx_open()
140 psd->fifo.tail = 0; in ptmx_open()
145 .ctx = psd, in ptmx_open()
152 if ((status = device_add(pty_root, &args, &psd->srv.zxdev)) < 0) { in ptmx_open()
153 free(psd); in ptmx_open()
157 *out = psd->srv.zxdev; in ptmx_open()