Exemplo n.º 1
0
static int samsung_defterm_getc(u8 *ch)
{
	if (!samsung_lowlevel_can_getc(samsung_defterm_base)) {
		return VMM_EFAIL;
	}
	*ch = samsung_lowlevel_getc(samsung_defterm_base);
	return VMM_OK;
}
Exemplo n.º 2
0
u8 samsung_lowlevel_getc(virtual_addr_t base)
{
    u8 data;

    /* Wait until there is data in the FIFO */
    while (!samsung_lowlevel_can_getc(base)) ;

    data = vmm_in_8((void *)(base + S3C2410_URXH));

    return data;
}
Exemplo n.º 3
0
static vmm_irq_return_t samsung_irq_handler(int irq_no, void *dev)
{
    u16 data;
    struct samsung_port *port = (struct samsung_port *)dev;

    /* Get masked interrupt status */
    data = vmm_in_le16((void *)(port->base + S3C64XX_UINTP));

    /* handle RX FIFO not empty */
    if (data & S3C64XX_UINTM_RXD_MSK) {
        /* Mask RX interrupts till RX FIFO is empty */
        while (samsung_lowlevel_can_getc(port->base)) {
            u8 ch = samsung_lowlevel_getc(port->base);
            serial_rx(port->p, &ch, 1);
        }
    }

    /* Clear all interrupts */
    vmm_out_le16((void *)(port->base + S3C64XX_UINTP), data);

    return VMM_IRQ_HANDLED;
}