summaryrefslogtreecommitdiffhomepage
path: root/src/rv64
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-04-02 09:52:34 +0200
committerGitHub <noreply@github.com>2025-04-02 09:52:34 +0200
commitf42ce43556475acb576fa926f685128d1dccf64b (patch)
treefe73e12f9b1bbee1c561a52a78a262bc60c90792 /src/rv64
parentc78e5763d8f5e471d043e6ed2752e245dbcaf047 (diff)
parent74f329a38884e3d3468ad6abad43a4fbd7afa970 (diff)
Merge pull request #1 from amlel-el-mahrouss/dev
arm64: fix: a fully arm64 firmware + important fixes and patches.
Diffstat (limited to 'src/rv64')
-rw-r--r--src/rv64/rv64-uart.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rv64/rv64-uart.c b/src/rv64/rv64-uart.c
index 73964ef..0bc6517 100644
--- a/src/rv64/rv64-uart.c
+++ b/src/rv64/rv64-uart.c
@@ -16,6 +16,7 @@ static uint8_t* cb_uart_ptr = (uint8_t*)CB_UART_BASE;
utf_char_t cb_get_char(void)
{
uintptr_t ptr = CB_UART_BASE;
+
while (!(*(((volatile uint8_t*)ptr) + 0x05) & 0x01))
;
@@ -27,8 +28,14 @@ static boolean cb_locked_put_char = no;
void cb_put_char(utf_char_t ch)
{
+ int32_t timeout = 0;
+
while (cb_locked_put_char)
{
+ ++timeout;
+
+ if (timeout > 1000000)
+ break;
}
cb_locked_put_char = yes;