mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue Mar 18 12:30:07 2014 +0000
Revision:
123:8a356fb1000a
Parent:
targets/hal/TARGET_NORDIC/TARGET_NRF51822/Lib/s110_nrf51822_6.0.0/s110_nrf51822_6.0.0_API/include/nrf_svc.h@104:a6a92e2e5a92
Synchronized with git revision 3e40310534d854400e01b2e9612ef7edf44a2dc9

Full URL: https://github.com/mbedmicro/mbed/commit/3e40310534d854400e01b2e9612ef7edf44a2dc9/

Who changed what in which revision?

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