static int pl011_getchar(struct serial_chip *chip) { vaddr_t base = chip_to_base(chip); while (!pl011_have_rx_data(chip)) ; return io_read32(base + UART_DR) & 0xff; }
static void main_fiq(void) { uint32_t iar; DMSG("enter"); iar = gic_read_iar(); while (pl011_have_rx_data(CONSOLE_UART_BASE)) { DMSG("cpu %zu: got 0x%x", get_core_pos(), pl011_getchar(CONSOLE_UART_BASE)); } gic_write_eoir(iar); DMSG("return"); }
int pl011_getchar(vaddr_t base) { while (!pl011_have_rx_data(base)) ; return read32(base + UART_DR) & 0xff; }