/* Push buffered characters whether they were just recently buffered or waiting on a blocked hypervisor. Call this function with hp->lock held.  */
static int hvc_push(struct hvc_struct *hp)
/* Push buffered characters whether they were just recently buffered or waiting on a blocked hypervisor. Call this function with hp->lock held.  */
static int hvc_push(struct hvc_struct *hp)
{
	int n;
	n = hp->ops->put_chars(hp->vtermno, hp->outbuf, hp->n_outbuf);
	if (n <= 0) {
		if (n == 0) {
			hp->do_wakeup = 1;
			return 0;
		}
		hp->n_outbuf = 0;
	} else
		hp->n_outbuf -= n;
	if (hp->n_outbuf > 0)
		memmove(hp->outbuf, hp->outbuf + n, hp->n_outbuf);
	else
		hp->do_wakeup = 1;
	return n;
}