static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max)
{
    VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev);
    int n = 0;
    while ((n < max) && (dev->out != dev->in)) {
        buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE];
    qemu_chr_fe_accept_input(&dev->chardev);
    return n;
static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max)
{
    VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev);
    int n = 0;
    while ((n < max) && (dev->out != dev->in)) {
        buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE];
    qemu_chr_fe_accept_input(&dev->chardev);
    return n;
static int FUNC_0(VIOsPAPRDevice *VAR_0, uint8_t *VAR_1, int VAR_2)
{
    VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(VAR_0);
    int VAR_3 = 0;
    while ((VAR_3 < VAR_2) && (dev->out != dev->in)) {
        VAR_1[VAR_3++] = dev->VAR_1[dev->out++ % VTERM_BUFSIZE];
    qemu_chr_fe_accept_input(&dev->chardev);
    return VAR_3;
static int FUNC_0(VIOsPAPRDevice *VAR_0, uint8_t *VAR_1, int VAR_2)
{ VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(VAR_0); int VAR_3 = 0; while ((VAR_3 < VAR_2) && (dev->out != dev->in)) { VAR_1[VAR_3++] = dev->VAR_1[dev->out++ % VTERM_BUFSIZE]; qemu_chr_fe_accept_input(&dev->chardev); return VAR_3;