From 9aabc831fad9e3b83180aa3fa01c8ee09cf0f14a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 7 Sep 2025 18:02:31 +0200 Subject: feat: update reset function inside `cpu-api.c`, wip xcoff api. Signed-off-by: Amlal El Mahrouss --- src/neboot-cpu-api.c | 4 ++++ src/neboot-start.c | 5 +++-- src/ppc64/ppc64-uart.c | 3 ++- src/rv64/rv64-uart.c | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3