or1k: Use EXCEPTION_STACK_SIZE of 256bytes.

or1k defines a 128 byte "red zone" after the stack that can not be
touched by the exception handler.

We also need 128 bytes to store the 32 registers.
This commit is contained in:
Tim 'mithro' Ansell 2017-09-26 05:28:27 +10:00
parent 07a9df3586
commit b1b6a74170
1 changed files with 12 additions and 1 deletions

View File

@ -19,7 +19,18 @@
#include <spr-defs.h>
#define EXCEPTION_STACK_SIZE (4*32)
/*
* OR1K Architecture has a 128 byte "red zone" after the stack that can not be
* touched by exception handlers. GCC uses this red zone for locals and
* temps without needing to change the stack pointer.
*/
#define OR1K_RED_ZONE_SIZE 128
/*
* We need 4 bytes (32 bits) * 32 registers space on the stack to save all the
* registers.
*/
#define EXCEPTION_STACK_SIZE ((4*32) + OR1K_RED_ZONE_SIZE)
#define HANDLE_EXCEPTION ; \
l.addi r1, r1, -EXCEPTION_STACK_SIZE ; \