diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-02 09:48:06 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-02 09:48:06 +0200 |
| commit | b86c34ad45c2a066a9ca86a86b2c49d30697c671 (patch) | |
| tree | cdf6c3f1c6479e4efd7b6f3597619c3e7b57fcd9 /src/rv64 | |
| parent | c78e5763d8f5e471d043e6ed2752e245dbcaf047 (diff) | |
arm64: fix: a fully arm64 firmware + important fixes and patches.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/rv64')
| -rw-r--r-- | src/rv64/rv64-uart.c | 7 |
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; |
