Rtos code cntains bug possible incompatability with I2C
Fork of mbed-rtos by
Diff: rtx/TARGET_CORTEX_M/rt_CMSIS.c
- Revision:
- 53:c35dab33c427
- Parent:
- 49:77c8e4604045
- Child:
- 59:28712e303960
diff -r 02f5cf381388 -r c35dab33c427 rtx/TARGET_CORTEX_M/rt_CMSIS.c --- a/rtx/TARGET_CORTEX_M/rt_CMSIS.c Fri Nov 21 09:45:08 2014 +0000 +++ b/rtx/TARGET_CORTEX_M/rt_CMSIS.c Wed Nov 26 08:00:25 2014 +0000 @@ -265,30 +265,24 @@ #define __NO_RETURN __noreturn -#define RET_osEvent "=r"(ret.status), "=r"(ret.value), "=r"(ret.def) -#define RET_osCallback "=r"(ret.fp), "=r"(ret.arg) - #define osEvent_type osEvent #define osEvent_ret_status ret #define osEvent_ret_value ret #define osEvent_ret_msg ret #define osEvent_ret_mail ret -#define osCallback_type uint64_t -#define osCallback_ret ((uint64_t)ret.fp | ((uint64_t)ret.arg)<<32) +#define osCallback_type osCallback +#define osCallback_ret ret + +#define RET_osEvent osEvent +#define RET_osCallback osCallback #define SVC_Setup(f) \ - __asm( \ + __asm( \ "mov r12,%0\n" \ :: "r"(&f): "r12" \ ); -#define SVC_Ret3() \ - __asm( \ - "ldr r0,[sp,#0]\n" \ - "ldr r1,[sp,#4]\n" \ - "ldr r2,[sp,#8]\n" \ - ); #define SVC_0_1(f,t,...) \ t f (void); \ @@ -330,46 +324,9 @@ return _##f(a1,a2,a3,a4); \ } -#define SVC_1_2(f,t,t1,rr) \ -uint64_t f (t1 a1); \ -_Pragma("swi_number=0") __swi uint64_t _##f (t1 a1); \ -static inline t __##f (t1 a1) { \ - t ret; \ - SVC_Setup(f); \ - _##f(a1); \ - __asm("" : rr : :); \ - return ret; \ -} - -#define SVC_1_3(f,t,t1,rr) \ -t f (t1 a1); \ -void f##_ (t1 a1) { \ - f(a1); \ - SVC_Ret3(); \ -} \ -_Pragma("swi_number=0") __swi void _##f (t1 a1); \ -static inline t __##f (t1 a1) { \ - t ret; \ - SVC_Setup(f##_); \ - _##f(a1); \ - __asm("" : rr : :); \ - return ret; \ -} - -#define SVC_2_3(f,t,t1,t2,rr) \ -t f (t1 a1, t2 a2); \ -void f##_ (t1 a1, t2 a2) { \ - f(a1,a2); \ - SVC_Ret3(); \ -} \ -_Pragma("swi_number=0") __swi void _##f (t1 a1, t2 a2); \ -static inline t __##f (t1 a1, t2 a2) { \ - t ret; \ - SVC_Setup(f##_); \ - _##f(a1,a2); \ - __asm("" : rr : :); \ - return ret; \ -} +#define SVC_1_2 SVC_1_1 +#define SVC_1_3 SVC_1_1 +#define SVC_2_3 SVC_2_1 #endif