summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-03-05 16:51:18 +0000
committerkettenis <kettenis@openbsd.org>2017-03-05 16:51:18 +0000
commit5eb6947c1e393f0ea4ee67a51e679b664e2519d3 (patch)
treee9f688ba734970125e8300ee021447979e8f090a
parentCorrectly convert an SSLv2 challenge into an SSLv3/TLS client random by (diff)
downloadwireguard-openbsd-5eb6947c1e393f0ea4ee67a51e679b664e2519d3.tar.xz
wireguard-openbsd-5eb6947c1e393f0ea4ee67a51e679b664e2519d3.zip
The current code in exuartcnputc() that tries to make sure the character
written is actually transmitted doesn't seem to work. Instead, wait until there is room in the TX FIFO before writing the character. This works only in FIFO mode, but that's how u-boot configures the chip. ok patrick@
-rw-r--r--sys/arch/armv7/exynos/exuart.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/arch/armv7/exynos/exuart.c b/sys/arch/armv7/exynos/exuart.c
index 81453164748..2a4077edb9f 100644
--- a/sys/arch/armv7/exynos/exuart.c
+++ b/sys/arch/armv7/exynos/exuart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exuart.c,v 1.7 2016/08/21 06:36:23 jsg Exp $ */
+/* $OpenBSD: exuart.c,v 1.8 2017/03/05 16:51:18 kettenis Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@motorola.com>
*
@@ -883,12 +883,10 @@ exuartcnputc(dev_t dev, int c)
{
int s;
s = splhigh();
- bus_space_write_1(exuartconsiot, exuartconsioh, EXUART_UTXH, (uint8_t)c);
- while((bus_space_read_2(exuartconsiot, exuartconsioh, EXUART_UTRSTAT) &
- EXUART_UTRSTAT_TXBEMPTY) != 0 &&
- (bus_space_read_2(exuartconsiot, exuartconsioh, EXUART_UFSTAT) &
- (EXUART_UFSTAT_TX_FIFO_CNT_MASK|EXUART_UFSTAT_TX_FIFO_FULL)) != 0)
+ while (bus_space_read_4(exuartconsiot, exuartconsioh, EXUART_UFSTAT) &
+ EXUART_UFSTAT_TX_FIFO_FULL)
;
+ bus_space_write_1(exuartconsiot, exuartconsioh, EXUART_UTXH, c);
splx(s);
}