diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/kernel.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kernel.c b/src/kernel.c index f1150be..a9a2d11 100644 --- a/src/kernel.c +++ b/src/kernel.c | |||
| @@ -2,6 +2,12 @@ | |||
| 2 | #include <raspi.h> | 2 | #include <raspi.h> |
| 3 | #include <uart.h> | 3 | #include <uart.h> |
| 4 | 4 | ||
| 5 | static void halt() { | ||
| 6 | while (1) { | ||
| 7 | asm volatile("wfi"); // Wait for interrupt. Core enters low-power state. | ||
| 8 | } | ||
| 9 | } | ||
| 10 | |||
| 5 | void main() { | 11 | void main() { |
| 6 | const int raspi = raspi_init(); | 12 | const int raspi = raspi_init(); |
| 7 | mmio_init(raspi); | 13 | mmio_init(raspi); |
| @@ -9,6 +15,6 @@ void main() { | |||
| 9 | 15 | ||
| 10 | uart_print("Hello world!\n"); | 16 | uart_print("Hello world!\n"); |
| 11 | 17 | ||
| 12 | while (1); | 18 | halt(); |
| 13 | } | 19 | } |
| 14 | 20 | ||
