diff --git a/kernel/arch/arm/raspi2/start.s b/kernel/arch/arm/raspi2/start.s index 8774e52..79b4c2e 100644 --- a/kernel/arch/arm/raspi2/start.s +++ b/kernel/arch/arm/raspi2/start.s @@ -7,6 +7,12 @@ .section .text.boot _start: CPSID aif //Disable interrupts + //check if current cpu is cpu0 +1: + mrc p15, 0, r0, c0, c0, 5; + ands r0, #3 + wfine + bne 1b ldr sp, =svc_stack push {r0,r1,r2} //set other stacks diff --git a/kernel/hw/raspi2/serial/serial.cpp b/kernel/hw/raspi2/serial/serial.cpp index 19c007c..6d3761e 100644 --- a/kernel/hw/raspi2/serial/serial.cpp +++ b/kernel/hw/raspi2/serial/serial.cpp @@ -34,7 +34,7 @@ auto Serial::serial_puti(int i) -> void { char buf[65]; char *ptr=buf+63; ptr[1]=0; - char *chars = "0123456789"; + const char *chars = "0123456789"; do { *(ptr--) = chars[i%10]; i/=10; diff --git a/kernel/hw/raspi2/uart/uart.cpp b/kernel/hw/raspi2/uart/uart.cpp index dae6e8f..053e5ad 100644 --- a/kernel/hw/raspi2/uart/uart.cpp +++ b/kernel/hw/raspi2/uart/uart.cpp @@ -1,7 +1,6 @@ #include "uart.hpp" -static volatile uint32_t x; -auto delay = [&x](uint32_t count) { - for(x=0;x