summaryrefslogtreecommitdiffhomepage
path: root/src/arm64
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm64')
-rw-r--r--src/arm64/arm64-30pin.c4
-rw-r--r--src/arm64/arm64-err.c18
-rw-r--r--src/arm64/arm64-uart.c46
-rw-r--r--src/arm64/ci.make4
-rw-r--r--src/arm64/makefile4
5 files changed, 32 insertions, 44 deletions
diff --git a/src/arm64/arm64-30pin.c b/src/arm64/arm64-30pin.c
index f347f0d..eb89c67 100644
--- a/src/arm64/arm64-30pin.c
+++ b/src/arm64/arm64-30pin.c
@@ -1,10 +1,10 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
------------------------------------------- */
-#include <lib/partition-map.h>
#include <lib/30pin.h>
+#include <lib/partition-map.h>
extern size_t cb_read_30pin(voidptr_t blob, size_t* size, size_t* start_lba);
diff --git a/src/arm64/arm64-err.c b/src/arm64/arm64-err.c
index 052b302..c734ada 100644
--- a/src/arm64/arm64-err.c
+++ b/src/arm64/arm64-err.c
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
------------------------------------------- */
@@ -10,14 +10,12 @@
/// @brief Goes into a panic state.
/// @param reason why?
-void cb_panic(const char* reason)
-{
- cb_put_string("panic: ");
- cb_put_string(reason);
- cb_put_char('\n');
+void cb_panic(const char* reason) {
+ cb_put_string("panic: ");
+ cb_put_string(reason);
+ cb_put_char('\n');
- while (yes)
- {
- asm volatile("hlt #0");
- }
+ while (yes) {
+ asm volatile("hlt #0");
+ }
}
diff --git a/src/arm64/arm64-uart.c b/src/arm64/arm64-uart.c
index 7455626..4723204 100644
--- a/src/arm64/arm64-uart.c
+++ b/src/arm64/arm64-uart.c
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
------------------------------------------- */
@@ -9,47 +9,37 @@
/// BUGS: 0
-#define ARM64_MMIO_REG(addr) (*(volatile uint32_t*)(cb_uart_ptr + addr))
+#define ARM64_MMIO_REG(addr) (*(volatile uint32_t*) (cb_uart_ptr + addr))
/* this file handles the UART */
-static uint32_t* cb_uart_ptr = (uint32_t*)CB_UART_BASE;
-
-// we need that one, to avoid sending mutliple chars to UART.
-static boolean cb_locked_put_char = no;
+static uint32_t* cb_uart_ptr = (uint32_t*) NB_UART_BASE;
/// @brief Retrieve character from cb_uart_ptr
-utf_char_t cb_get_char(void)
-{
- while ((ARM64_MMIO_REG(0x018) & (1 << 4)))
- {
- }
+utf_char_t cb_get_char(void) {
+ while ((ARM64_MMIO_REG(0x018) & (1 << 4))) {
+ }
- return (utf_char_t)ARM64_MMIO_REG(0x0) & 0xFF;
+ return (utf_char_t) ARM64_MMIO_REG(0x0) & 0xFF;
}
-void cb_put_char(utf_char_t ch)
-{
- while ((ARM64_MMIO_REG(0x018) & (1 << 5)))
- {
- }
+void cb_put_char(utf_char_t ch) {
+ while ((ARM64_MMIO_REG(0x018) & (1 << 5))) {
+ }
- ARM64_MMIO_REG(0x0) = ch;
+ ARM64_MMIO_REG(0x0) = ch;
}
/// @brief UART put string
/// @param text the input text.
-size_t cb_put_string(const char* text)
-{
- if (text == nil)
- return 0;
+size_t cb_put_string(const char* text) {
+ if (text == nil) return 0;
- size_t i = 0;
+ size_t i = 0;
- for (; i < strlen(text); i++)
- {
- cb_put_char(text[i]);
- }
+ for (; i < strlen(text); i++) {
+ cb_put_char(text[i]);
+ }
- return i;
+ return i;
}
diff --git a/src/arm64/ci.make b/src/arm64/ci.make
index 07f1746..2b0fed2 100644
--- a/src/arm64/ci.make
+++ b/src/arm64/ci.make
@@ -1,7 +1,7 @@
#
# ========================================================
#
- # CoreBoot
+ # NeBoot
# Date Added: 08/11/2023
# Copyright 2024, Amlal El Mahrouss, all rights reserved.
#
@@ -34,7 +34,7 @@ WAIT=sleep 1
.PHONY: all
all: firmware-link
- @echo "[CoreBoot] build done."
+ @echo "[NeBoot] build done."
.PHONY: firmware-link
firmware-link: firmware-compile
diff --git a/src/arm64/makefile b/src/arm64/makefile
index 8d05e8b..a85553b 100644
--- a/src/arm64/makefile
+++ b/src/arm64/makefile
@@ -1,7 +1,7 @@
#
# ========================================================
#
- # CoreBoot
+ # NeBoot
# Date Added: 08/11/2023
# Copyright 2024, Amlal El Mahrouss, all rights reserved.
#
@@ -34,7 +34,7 @@ WAIT=sleep 1
.PHONY: all
all: firmware-link
- @echo "[CoreBoot] build done."
+ @echo "[NeBoot] build done."
.PHONY: firmware-link
firmware-link: firmware-compile