テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8468a4403fea 1 #ifndef NRF_SVC__
jksoft 0:8468a4403fea 2 #define NRF_SVC__
jksoft 0:8468a4403fea 3
jksoft 0:8468a4403fea 4 #ifdef SVCALL_AS_NORMAL_FUNCTION
jksoft 0:8468a4403fea 5 #define SVCALL(number, return_type, signature) return_type signature
jksoft 0:8468a4403fea 6 #else
jksoft 0:8468a4403fea 7
jksoft 0:8468a4403fea 8 #ifndef SVCALL
jksoft 0:8468a4403fea 9 #if defined (__CC_ARM)
jksoft 0:8468a4403fea 10 #define SVCALL(number, return_type, signature) return_type __svc(number) signature
jksoft 0:8468a4403fea 11 #elif defined (__GNUC__)
jksoft 0:8468a4403fea 12 #define SVCALL(number, return_type, signature) \
jksoft 0:8468a4403fea 13 _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
jksoft 0:8468a4403fea 14 _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \
jksoft 0:8468a4403fea 15 __attribute__((naked)) static return_type signature \
jksoft 0:8468a4403fea 16 { \
jksoft 0:8468a4403fea 17 __asm( \
jksoft 0:8468a4403fea 18 "svc %0\n" \
jksoft 0:8468a4403fea 19 "bx r14" : : "I" ((uint32_t)number) : "r0" \
jksoft 0:8468a4403fea 20 ); \
jksoft 0:8468a4403fea 21 }
jksoft 0:8468a4403fea 22 #elif defined (__ICCARM__)
jksoft 0:8468a4403fea 23 #define PRAGMA(x) _Pragma(#x)
jksoft 0:8468a4403fea 24 #define SVCALL(number, return_type, signature) \
jksoft 0:8468a4403fea 25 PRAGMA(swi_number = number) \
jksoft 0:8468a4403fea 26 __swi return_type signature;
jksoft 0:8468a4403fea 27 #else
jksoft 0:8468a4403fea 28 #define SVCALL(number, return_type, signature) return_type signature
jksoft 0:8468a4403fea 29 #endif
jksoft 0:8468a4403fea 30 #endif // SVCALL
jksoft 0:8468a4403fea 31
jksoft 0:8468a4403fea 32 #endif // SVCALL_AS_NORMAL_FUNCTION
jksoft 0:8468a4403fea 33 #endif // NRF_SVC__