Beispiel #1
0
static u32 omap_uart_read(struct vmm_chardev *cdev, 
			  u8 *dest, u32 len, bool sleep)
{
	u32 i;
	struct omap_uart_port *port;

	if (!(cdev && dest && cdev->priv)) {
		return 0;
	}

	port = cdev->priv;

	if (sleep) {
		for (i = 0; i < len; i++) {
			dest[i] = omap_uart_getc_sleepable(port);
		}
	} else {
		for(i = 0; i < len; i++) {
			if (!omap_uart_lowlevel_can_getc(port->base, port->reg_align)) {
				break;
			}
			dest[i] = omap_uart_lowlevel_getc(port->base, port->reg_align);
		}
	}

	return i;
}
Beispiel #2
0
static int omap_defterm_getc(u8 *ch)
{
	if (!omap_uart_lowlevel_can_getc(omap_defterm_base, 2)) {
		return VMM_EFAIL;
	}
	*ch = omap_uart_lowlevel_getc(omap_defterm_base, 2);
	return VMM_OK;
}
Beispiel #3
0
u8 omap_uart_lowlevel_getc(virtual_addr_t base, u32 reg_align)
{
	while (!omap_uart_lowlevel_can_getc(base, reg_align));

	return (omap_serial_in(UART_RBR));
}