iodev, exception: Remove gratuitous UART usage

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-09-19 22:33:20 +09:00
parent 6c070fa224
commit ffacef41ee
2 changed files with 9 additions and 9 deletions

View file

@ -241,7 +241,7 @@ void exc_sync(u64 *regs)
}
} else {
if (!(exc_guard & GUARD_SILENT))
uart_puts("Exception: SYNC");
printf("Exception: SYNC\n");
}
sysop("isb");
@ -312,37 +312,37 @@ void exc_fiq(u64 *regs)
u64 reg = mrs(CNTP_CTL_EL0);
if (reg == 0x5) {
uart_puts(" PHYS timer IRQ, masking");
printf(" PHYS timer IRQ, masking\n");
msr(CNTP_CTL_EL0, 7L);
}
reg = mrs(CNTV_CTL_EL0);
if (reg == 0x5) {
uart_puts(" VIRT timer IRQ, masking");
printf(" VIRT timer IRQ, masking\n");
msr(CNTV_CTL_EL0, 7L);
}
if (in_el2()) {
reg = mrs(CNTP_CTL_EL02);
if (reg == 0x5) {
uart_puts(" PHYS EL02 timer IRQ, masking");
printf(" PHYS EL02 timer IRQ, masking\n");
msr(CNTP_CTL_EL02, 7L);
}
reg = mrs(CNTV_CTL_EL02);
if (reg == 0x5) {
uart_puts(" VIRT EL02 timer IRQ, masking");
printf(" VIRT EL02 timer IRQ, masking\n");
msr(CNTV_CTL_EL02, 7L);
}
}
reg = mrs(SYS_IMP_APL_PMCR0);
if ((reg & (PMCR0_IMODE_MASK | PMCR0_IACT)) == (PMCR0_IMODE_FIQ | PMCR0_IACT)) {
uart_puts(" PMC IRQ, masking");
printf(" PMC IRQ, masking\n");
reg_clr(SYS_IMP_APL_PMCR0, PMCR0_IACT | PMCR0_IMODE_MASK);
}
reg = mrs(SYS_IMP_APL_UPMCR0);
if ((reg & UPMCR0_IMODE_MASK) == UPMCR0_IMODE_FIQ && (mrs(SYS_IMP_APL_UPMSR) & UPMSR_IACT)) {
uart_puts(" UPMC IRQ, masking");
printf(" UPMC IRQ, masking\n");
reg_clr(SYS_IMP_APL_UPMCR0, UPMCR0_IMODE_MASK);
}

View file

@ -88,7 +88,7 @@ void iodev_console_write(const void *buf, size_t length)
bool do_lock = mmu_active();
if (!do_lock && !is_primary_core()) {
if (length) {
if (length && iodevs[IODEV_UART]->usage & USAGE_CONSOLE) {
iodev_write(IODEV_UART, "*", 1);
iodev_write(IODEV_UART, buf, length);
}
@ -99,7 +99,7 @@ void iodev_console_write(const void *buf, size_t length)
spin_lock(&console_lock);
if (in_iodev) {
if (length) {
if (length && iodevs[IODEV_UART]->usage & USAGE_CONSOLE) {
iodev_write(IODEV_UART, "*", 1);
iodev_write(IODEV_UART, buf, length);
}