projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add pocketbus protocol.
[bertos.git]
/
cpu
/
attr.h
diff --git
a/cpu/attr.h
b/cpu/attr.h
index 891f00fdbfe013104ec4297d8dbb2496661a3a91..302b38c987089043a0ac7b2f8deabb6342b4f4bd 100644
(file)
--- a/
cpu/attr.h
+++ b/
cpu/attr.h
@@
-102,14
+102,23
@@
#define CPU_SAVED_REGS_CNT 9
#define CPU_STACK_GROWS_UPWARD 0
#define CPU_SP_ON_EMPTY_SLOT 0
#define CPU_SAVED_REGS_CNT 9
#define CPU_STACK_GROWS_UPWARD 0
#define CPU_SP_ON_EMPTY_SLOT 0
- #warning Find a way to detect endianess at runtime
- #define CPU_BYTE_ORDER CPU_LITTLE_ENDIAN
#define CPU_HARVARD 0
#ifdef __IAR_SYSTEMS_ICC__
#define CPU_HARVARD 0
#ifdef __IAR_SYSTEMS_ICC__
- #define NOP __no_operation()
+ #warning Check CPU_BYTE_ORDER
+ #define CPU_BYTE_ORDER (__BIG_ENDIAN__ ? CPU_BIG_ENDIAN : CPU_LITTLE_ENDIAN)
+
+ #define NOP __no_operation()
#else /* !__IAR_SYSTEMS_ICC__ */
#else /* !__IAR_SYSTEMS_ICC__ */
- #define NOP asm volatile ("mov r0,r0" ::)
+ #if defined(__ARMEB__)
+ #define CPU_BYTE_ORDER CPU_BIG_ENDIAN
+ #elif defined(__ARMEL__)
+ #define CPU_BYTE_ORDER CPU_LITTLE_ENDIAN
+ #else
+ #error Unable to detect ARM endianness!
+ #endif
+
+ #define NOP asm volatile ("mov r0,r0" ::)
/**
* Initialization value for registers in stack frame.
/**
* Initialization value for registers in stack frame.
@@
-258,8
+267,8
@@
} while (0)
/*
} while (0)
/*
- * If the kernel is in idle-spinning, the processor execute:
- *
+ * If the kernel is in idle-spinning, the processor execute
s
:
+ *
* IRQ_ENABLE;
* CPU_IDLE;
* IRQ_DISABLE;
* IRQ_ENABLE;
* CPU_IDLE;
* IRQ_DISABLE;