From 270f4932565eb3fe074cacc8c55c41103fa0a371 Mon Sep 17 00:00:00 2001 From: Morten Delenk Date: Sun, 25 Mar 2018 09:43:01 +0100 Subject: [PATCH] fix: made raspi2 compile --- kernel/arch/arm/raspi2/start.s | 6 ++++++ kernel/hw/raspi2/serial/serial.cpp | 2 +- kernel/hw/raspi2/uart/uart.cpp | 5 ++--- 3 files changed, 9 insertions(+), 4 deletions(-) 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