From eb14fc2b2ea49aa8a7b4f464de9360a129845b73 Mon Sep 17 00:00:00 2001 From: Hesham ALMatary Date: Mon, 15 Sep 2014 17:33:28 -0500 Subject: OpenRISC: Account for red-zone (fixup printf bug). This patch allocate a space in the stack to account for red-zone that gcc may utilize for the use of leaf functions. Care must be taken to handle this red-zone from many places: 1- Upon creation of a new thread stack. 2- Once an interrupt entred. Also moving the enable-thread-dispach() and increment ISR level before checking if dispatch needed was required. The previous modifications solved the printf bug which disabled ticker to output strings after context switches that arise from Thread_Delay_ended. --- c/src/lib/libbsp/or1k/or1ksim/start/start.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c/src/lib/libbsp/or1k/or1ksim') diff --git a/c/src/lib/libbsp/or1k/or1ksim/start/start.S b/c/src/lib/libbsp/or1k/or1ksim/start/start.S index 6942b5217f..4d911d4a41 100644 --- a/c/src/lib/libbsp/or1k/or1ksim/start/start.S +++ b/c/src/lib/libbsp/or1k/or1ksim/start/start.S @@ -16,7 +16,7 @@ */ #define EXCEPTION_SETUP(vector) \ l.nop ;\ - l.addi r1, r1, -4 ;\ + l.addi r1, r1, -200 ;\ l.sw 0(r1), r3; \ l.addi r3, r0, vector; \ l.j _ISR_Handler; \ -- cgit v1.2.3