Xtensa port: Fixed scheduling bug caused to missing Endianess related macros.

XCC does neither define __BYTE_ORDER__ nor __ORDER_LITTLE/BIG_ENDIAN__ macros.
This resulted in field preempt of thread.base not correctly built from other
union fields prio and sched_locked, which caused wrong scheduling.

Change-Id: I8566ef4a5cf555906c012c4adc488f9afb26c053
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
This commit is contained in:
Mazen NEIFER 2017-02-08 16:26:32 +01:00 committed by Andrew Boie
commit 0cfeb626c0

View file

@ -24,6 +24,16 @@ extern "C" {
#include <stdint.h>
#include <sw_isr_table.h>
#include <arch/xtensa/xtensa_irq.h>
#include <xtensa/config/core.h>
/*
* XCC does not define the following macros with the expected names, but the
* file machine/endian.h from XT_LIB defines similar ones. Thus we include it
* and define the missing macros ourselves.
*/
#define __BYTE_ORDER__ XCHAL_MEMORY_ORDER
#define __ORDER_BIG_ENDIAN__ XTHAL_BIGENDIAN
#define __ORDER_LITTLE_ENDIAN__ XTHAL_LITTLEENDIAN
#define STACK_ALIGN 16
#define OCTET_TO_SIZEOFUNIT(X) (X)