diff options
Diffstat (limited to 'src/neboot-cpu-api.c')
| -rw-r--r-- | src/neboot-cpu-api.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/neboot-cpu-api.c b/src/neboot-cpu-api.c new file mode 100644 index 0000000..2491f15 --- /dev/null +++ b/src/neboot-cpu-api.c @@ -0,0 +1,20 @@ +/* ------------------------------------------- + + Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include <lib/boot.h> + +/// @brief Restarts the computer. +/// @param none. +void cb_restart_machine(void) { +#ifdef __COMPILE_RISCV__ + volatile uint32_t* brd_pwr = (volatile uint32_t*) 0x100000; + *brd_pwr = 0x7777; // send reboot signal from DMA. + + while (1) { + asm volatile("wfi"); + } +#endif +} |
