summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-09-07 18:02:31 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-09-07 18:02:31 +0200
commit9aabc831fad9e3b83180aa3fa01c8ee09cf0f14a (patch)
tree3f4e558bda2b9feb933662549bac2be48a11300d /src
parentefe0d71bd816f57d6d3338f04348c07dd8aade46 (diff)
feat: update reset function inside `cpu-api.c`, wip xcoff api.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/neboot-cpu-api.c4
-rw-r--r--src/neboot-start.c5
-rw-r--r--src/ppc64/ppc64-uart.c3
-rw-r--r--src/rv64/rv64-uart.c3
4 files changed, 11 insertions, 4 deletions
diff --git a/src/neboot-cpu-api.c b/src/neboot-cpu-api.c
index 2491f15..4617343 100644
--- a/src/neboot-cpu-api.c
+++ b/src/neboot-cpu-api.c
@@ -16,5 +16,9 @@ void cb_restart_machine(void) {
while (1) {
asm volatile("wfi");
}
+#else
+ /// @todo add your reset vector here.
+ while (1)
+ ;
#endif
}
diff --git a/src/neboot-start.c b/src/neboot-start.c
index b72793e..29a3389 100644
--- a/src/neboot-start.c
+++ b/src/neboot-start.c
@@ -113,7 +113,8 @@ void cb_start_exec(void) {
} else {
cb_put_string("CB> Trying EPM partition...\r\n");
- part_block_t* blk = cb_parse_partition_block_at((voidptr_t) NB_FLASH_BASE_ADDR, EPM_PART_BLK_SZ, 0);
+ part_block_t* blk =
+ cb_parse_partition_block_at((voidptr_t) NB_FLASH_BASE_ADDR, EPM_PART_BLK_SZ, 0);
if (blk) {
cb_pci_append_tree("@stage2-epm", (cb_pci_num_t) blk, sizeof(part_block_t) * blk->num_blocks);
@@ -144,7 +145,7 @@ void cb_start_exec(void) {
}
/// end of TODO
-
+
while (yes) {
if (__cb_hart_counter == 0) {
cb_restart_machine();
diff --git a/src/ppc64/ppc64-uart.c b/src/ppc64/ppc64-uart.c
index a26a806..9830342 100644
--- a/src/ppc64/ppc64-uart.c
+++ b/src/ppc64/ppc64-uart.c
@@ -20,7 +20,8 @@ volatile ascii_char_t* const UART0DR = (ascii_char_t*) NB_NS16550_COM1;
/// @param
/// @return
utf_char_t cb_get_char(void) {
- while (!(*(((volatile uint8_t*) UART0DR) + 0x05) & 0x01));
+ while (!(*(((volatile uint8_t*) UART0DR) + 0x05) & 0x01))
+ ;
return (utf_char_t) *UART0DR;
}
diff --git a/src/rv64/rv64-uart.c b/src/rv64/rv64-uart.c
index 0fb8ab4..22b0793 100644
--- a/src/rv64/rv64-uart.c
+++ b/src/rv64/rv64-uart.c
@@ -16,7 +16,8 @@ static uint8_t* cb_uart_ptr = (uint8_t*) NB_UART_BASE;
utf_char_t cb_get_char(void) {
uintptr_t ptr = NB_UART_BASE;
- while (!(*(((volatile uint8_t*) ptr) + 0x05) & 0x01));
+ while (!(*(((volatile uint8_t*) ptr) + 0x05) & 0x01))
+ ;
return (utf_char_t) *cb_uart_ptr;
}