rtx_evflags.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /*
  2. * Copyright (c) 2013-2021 Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * -----------------------------------------------------------------------------
  19. *
  20. * Project: CMSIS-RTOS RTX
  21. * Title: Event Flags functions
  22. *
  23. * -----------------------------------------------------------------------------
  24. */
  25. #include "rtx_lib.h"
  26. // OS Runtime Object Memory Usage
  27. #ifdef RTX_OBJ_MEM_USAGE
  28. osRtxObjectMemUsage_t osRtxEventFlagsMemUsage \
  29. __attribute__((section(".data.os.evflags.obj"))) =
  30. { 0U, 0U, 0U };
  31. #endif
  32. // ==== Helper functions ====
  33. /// Set Event Flags.
  34. /// \param[in] ef event flags object.
  35. /// \param[in] flags specifies the flags to set.
  36. /// \return event flags after setting.
  37. static uint32_t EventFlagsSet (os_event_flags_t *ef, uint32_t flags) {
  38. #if (EXCLUSIVE_ACCESS == 0)
  39. uint32_t primask = __get_PRIMASK();
  40. #endif
  41. uint32_t event_flags;
  42. #if (EXCLUSIVE_ACCESS == 0)
  43. __disable_irq();
  44. ef->event_flags |= flags;
  45. event_flags = ef->event_flags;
  46. if (primask == 0U) {
  47. __enable_irq();
  48. }
  49. #else
  50. event_flags = atomic_set32(&ef->event_flags, flags);
  51. #endif
  52. return event_flags;
  53. }
  54. /// Clear Event Flags.
  55. /// \param[in] ef event flags object.
  56. /// \param[in] flags specifies the flags to clear.
  57. /// \return event flags before clearing.
  58. static uint32_t EventFlagsClear (os_event_flags_t *ef, uint32_t flags) {
  59. #if (EXCLUSIVE_ACCESS == 0)
  60. uint32_t primask = __get_PRIMASK();
  61. #endif
  62. uint32_t event_flags;
  63. #if (EXCLUSIVE_ACCESS == 0)
  64. __disable_irq();
  65. event_flags = ef->event_flags;
  66. ef->event_flags &= ~flags;
  67. if (primask == 0U) {
  68. __enable_irq();
  69. }
  70. #else
  71. event_flags = atomic_clr32(&ef->event_flags, flags);
  72. #endif
  73. return event_flags;
  74. }
  75. /// Check Event Flags.
  76. /// \param[in] ef event flags object.
  77. /// \param[in] flags specifies the flags to check.
  78. /// \param[in] options specifies flags options (osFlagsXxxx).
  79. /// \return event flags before clearing or 0 if specified flags have not been set.
  80. static uint32_t EventFlagsCheck (os_event_flags_t *ef, uint32_t flags, uint32_t options) {
  81. #if (EXCLUSIVE_ACCESS == 0)
  82. uint32_t primask;
  83. #endif
  84. uint32_t event_flags;
  85. if ((options & osFlagsNoClear) == 0U) {
  86. #if (EXCLUSIVE_ACCESS == 0)
  87. primask = __get_PRIMASK();
  88. __disable_irq();
  89. event_flags = ef->event_flags;
  90. if ((((options & osFlagsWaitAll) != 0U) && ((event_flags & flags) != flags)) ||
  91. (((options & osFlagsWaitAll) == 0U) && ((event_flags & flags) == 0U))) {
  92. event_flags = 0U;
  93. } else {
  94. ef->event_flags &= ~flags;
  95. }
  96. if (primask == 0U) {
  97. __enable_irq();
  98. }
  99. #else
  100. if ((options & osFlagsWaitAll) != 0U) {
  101. event_flags = atomic_chk32_all(&ef->event_flags, flags);
  102. } else {
  103. event_flags = atomic_chk32_any(&ef->event_flags, flags);
  104. }
  105. #endif
  106. } else {
  107. event_flags = ef->event_flags;
  108. if ((((options & osFlagsWaitAll) != 0U) && ((event_flags & flags) != flags)) ||
  109. (((options & osFlagsWaitAll) == 0U) && ((event_flags & flags) == 0U))) {
  110. event_flags = 0U;
  111. }
  112. }
  113. return event_flags;
  114. }
  115. // ==== Post ISR processing ====
  116. /// Event Flags post ISR processing.
  117. /// \param[in] ef event flags object.
  118. static void osRtxEventFlagsPostProcess (os_event_flags_t *ef) {
  119. os_thread_t *thread;
  120. os_thread_t *thread_next;
  121. uint32_t event_flags;
  122. // Check if Threads are waiting for Event Flags
  123. thread = ef->thread_list;
  124. while (thread != NULL) {
  125. thread_next = thread->thread_next;
  126. event_flags = EventFlagsCheck(ef, thread->wait_flags, thread->flags_options);
  127. if (event_flags != 0U) {
  128. osRtxThreadListRemove(thread);
  129. osRtxThreadWaitExit(thread, event_flags, FALSE);
  130. EvrRtxEventFlagsWaitCompleted(ef, thread->wait_flags, thread->flags_options, event_flags);
  131. }
  132. thread = thread_next;
  133. }
  134. }
  135. // ==== Service Calls ====
  136. /// Create and Initialize an Event Flags object.
  137. /// \note API identical to osEventFlagsNew
  138. static osEventFlagsId_t svcRtxEventFlagsNew (const osEventFlagsAttr_t *attr) {
  139. os_event_flags_t *ef;
  140. uint8_t flags;
  141. const char *name;
  142. // Process attributes
  143. if (attr != NULL) {
  144. name = attr->name;
  145. //lint -e{9079} "conversion from pointer to void to pointer to other type" [MISRA Note 6]
  146. ef = attr->cb_mem;
  147. if (ef != NULL) {
  148. //lint -e(923) -e(9078) "cast from pointer to unsigned int" [MISRA Note 7]
  149. if ((((uint32_t)ef & 3U) != 0U) || (attr->cb_size < sizeof(os_event_flags_t))) {
  150. EvrRtxEventFlagsError(NULL, osRtxErrorInvalidControlBlock);
  151. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  152. return NULL;
  153. }
  154. } else {
  155. if (attr->cb_size != 0U) {
  156. EvrRtxEventFlagsError(NULL, osRtxErrorInvalidControlBlock);
  157. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  158. return NULL;
  159. }
  160. }
  161. } else {
  162. name = NULL;
  163. ef = NULL;
  164. }
  165. // Allocate object memory if not provided
  166. if (ef == NULL) {
  167. if (osRtxInfo.mpi.event_flags != NULL) {
  168. //lint -e{9079} "conversion from pointer to void to pointer to other type" [MISRA Note 5]
  169. ef = osRtxMemoryPoolAlloc(osRtxInfo.mpi.event_flags);
  170. } else {
  171. //lint -e{9079} "conversion from pointer to void to pointer to other type" [MISRA Note 5]
  172. ef = osRtxMemoryAlloc(osRtxInfo.mem.common, sizeof(os_event_flags_t), 1U);
  173. }
  174. #ifdef RTX_OBJ_MEM_USAGE
  175. if (ef != NULL) {
  176. uint32_t used;
  177. osRtxEventFlagsMemUsage.cnt_alloc++;
  178. used = osRtxEventFlagsMemUsage.cnt_alloc - osRtxEventFlagsMemUsage.cnt_free;
  179. if (osRtxEventFlagsMemUsage.max_used < used) {
  180. osRtxEventFlagsMemUsage.max_used = used;
  181. }
  182. }
  183. #endif
  184. flags = osRtxFlagSystemObject;
  185. } else {
  186. flags = 0U;
  187. }
  188. if (ef != NULL) {
  189. // Initialize control block
  190. ef->id = osRtxIdEventFlags;
  191. ef->flags = flags;
  192. ef->name = name;
  193. ef->thread_list = NULL;
  194. ef->event_flags = 0U;
  195. // Register post ISR processing function
  196. osRtxInfo.post_process.event_flags = osRtxEventFlagsPostProcess;
  197. EvrRtxEventFlagsCreated(ef, ef->name);
  198. } else {
  199. EvrRtxEventFlagsError(NULL, (int32_t)osErrorNoMemory);
  200. }
  201. return ef;
  202. }
  203. /// Get name of an Event Flags object.
  204. /// \note API identical to osEventFlagsGetName
  205. static const char *svcRtxEventFlagsGetName (osEventFlagsId_t ef_id) {
  206. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  207. // Check parameters
  208. if ((ef == NULL) || (ef->id != osRtxIdEventFlags)) {
  209. EvrRtxEventFlagsGetName(ef, NULL);
  210. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  211. return NULL;
  212. }
  213. EvrRtxEventFlagsGetName(ef, ef->name);
  214. return ef->name;
  215. }
  216. /// Set the specified Event Flags.
  217. /// \note API identical to osEventFlagsSet
  218. static uint32_t svcRtxEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) {
  219. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  220. os_thread_t *thread;
  221. os_thread_t *thread_next;
  222. uint32_t event_flags;
  223. uint32_t event_flags0;
  224. // Check parameters
  225. if ((ef == NULL) || (ef->id != osRtxIdEventFlags) ||
  226. ((flags & ~(((uint32_t)1U << osRtxEventFlagsLimit) - 1U)) != 0U)) {
  227. EvrRtxEventFlagsError(ef, (int32_t)osErrorParameter);
  228. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  229. return ((uint32_t)osErrorParameter);
  230. }
  231. // Set Event Flags
  232. event_flags = EventFlagsSet(ef, flags);
  233. // Check if Threads are waiting for Event Flags
  234. thread = ef->thread_list;
  235. while (thread != NULL) {
  236. thread_next = thread->thread_next;
  237. event_flags0 = EventFlagsCheck(ef, thread->wait_flags, thread->flags_options);
  238. if (event_flags0 != 0U) {
  239. if ((thread->flags_options & osFlagsNoClear) == 0U) {
  240. event_flags = event_flags0 & ~thread->wait_flags;
  241. } else {
  242. event_flags = event_flags0;
  243. }
  244. osRtxThreadListRemove(thread);
  245. osRtxThreadWaitExit(thread, event_flags0, FALSE);
  246. EvrRtxEventFlagsWaitCompleted(ef, thread->wait_flags, thread->flags_options, event_flags0);
  247. }
  248. thread = thread_next;
  249. }
  250. osRtxThreadDispatch(NULL);
  251. EvrRtxEventFlagsSetDone(ef, event_flags);
  252. return event_flags;
  253. }
  254. /// Clear the specified Event Flags.
  255. /// \note API identical to osEventFlagsClear
  256. static uint32_t svcRtxEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags) {
  257. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  258. uint32_t event_flags;
  259. // Check parameters
  260. if ((ef == NULL) || (ef->id != osRtxIdEventFlags) ||
  261. ((flags & ~(((uint32_t)1U << osRtxEventFlagsLimit) - 1U)) != 0U)) {
  262. EvrRtxEventFlagsError(ef, (int32_t)osErrorParameter);
  263. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  264. return ((uint32_t)osErrorParameter);
  265. }
  266. // Clear Event Flags
  267. event_flags = EventFlagsClear(ef, flags);
  268. EvrRtxEventFlagsClearDone(ef, event_flags);
  269. return event_flags;
  270. }
  271. /// Get the current Event Flags.
  272. /// \note API identical to osEventFlagsGet
  273. static uint32_t svcRtxEventFlagsGet (osEventFlagsId_t ef_id) {
  274. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  275. // Check parameters
  276. if ((ef == NULL) || (ef->id != osRtxIdEventFlags)) {
  277. EvrRtxEventFlagsGet(ef, 0U);
  278. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  279. return 0U;
  280. }
  281. EvrRtxEventFlagsGet(ef, ef->event_flags);
  282. return ef->event_flags;
  283. }
  284. /// Wait for one or more Event Flags to become signaled.
  285. /// \note API identical to osEventFlagsWait
  286. static uint32_t svcRtxEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout) {
  287. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  288. os_thread_t *thread;
  289. uint32_t event_flags;
  290. // Check parameters
  291. if ((ef == NULL) || (ef->id != osRtxIdEventFlags) ||
  292. ((flags & ~(((uint32_t)1U << osRtxEventFlagsLimit) - 1U)) != 0U)) {
  293. EvrRtxEventFlagsError(ef, (int32_t)osErrorParameter);
  294. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  295. return ((uint32_t)osErrorParameter);
  296. }
  297. // Check Event Flags
  298. event_flags = EventFlagsCheck(ef, flags, options);
  299. if (event_flags != 0U) {
  300. EvrRtxEventFlagsWaitCompleted(ef, flags, options, event_flags);
  301. } else {
  302. // Check if timeout is specified
  303. if (timeout != 0U) {
  304. EvrRtxEventFlagsWaitPending(ef, flags, options, timeout);
  305. // Suspend current Thread
  306. if (osRtxThreadWaitEnter(osRtxThreadWaitingEventFlags, timeout)) {
  307. thread = osRtxThreadGetRunning();
  308. osRtxThreadListPut(osRtxObject(ef), thread);
  309. // Store waiting flags and options
  310. thread->wait_flags = flags;
  311. thread->flags_options = (uint8_t)options;
  312. } else {
  313. EvrRtxEventFlagsWaitTimeout(ef);
  314. }
  315. event_flags = (uint32_t)osErrorTimeout;
  316. } else {
  317. EvrRtxEventFlagsWaitNotCompleted(ef, flags, options);
  318. event_flags = (uint32_t)osErrorResource;
  319. }
  320. }
  321. return event_flags;
  322. }
  323. /// Delete an Event Flags object.
  324. /// \note API identical to osEventFlagsDelete
  325. static osStatus_t svcRtxEventFlagsDelete (osEventFlagsId_t ef_id) {
  326. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  327. os_thread_t *thread;
  328. // Check parameters
  329. if ((ef == NULL) || (ef->id != osRtxIdEventFlags)) {
  330. EvrRtxEventFlagsError(ef, (int32_t)osErrorParameter);
  331. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  332. return osErrorParameter;
  333. }
  334. // Unblock waiting threads
  335. if (ef->thread_list != NULL) {
  336. do {
  337. thread = osRtxThreadListGet(osRtxObject(ef));
  338. osRtxThreadWaitExit(thread, (uint32_t)osErrorResource, FALSE);
  339. } while (ef->thread_list != NULL);
  340. osRtxThreadDispatch(NULL);
  341. }
  342. // Mark object as invalid
  343. ef->id = osRtxIdInvalid;
  344. // Free object memory
  345. if ((ef->flags & osRtxFlagSystemObject) != 0U) {
  346. if (osRtxInfo.mpi.event_flags != NULL) {
  347. (void)osRtxMemoryPoolFree(osRtxInfo.mpi.event_flags, ef);
  348. } else {
  349. (void)osRtxMemoryFree(osRtxInfo.mem.common, ef);
  350. }
  351. #ifdef RTX_OBJ_MEM_USAGE
  352. osRtxEventFlagsMemUsage.cnt_free++;
  353. #endif
  354. }
  355. EvrRtxEventFlagsDestroyed(ef);
  356. return osOK;
  357. }
  358. // Service Calls definitions
  359. //lint ++flb "Library Begin" [MISRA Note 11]
  360. SVC0_1(EventFlagsNew, osEventFlagsId_t, const osEventFlagsAttr_t *)
  361. SVC0_1(EventFlagsGetName, const char *, osEventFlagsId_t)
  362. SVC0_2(EventFlagsSet, uint32_t, osEventFlagsId_t, uint32_t)
  363. SVC0_2(EventFlagsClear, uint32_t, osEventFlagsId_t, uint32_t)
  364. SVC0_1(EventFlagsGet, uint32_t, osEventFlagsId_t)
  365. SVC0_4(EventFlagsWait, uint32_t, osEventFlagsId_t, uint32_t, uint32_t, uint32_t)
  366. SVC0_1(EventFlagsDelete, osStatus_t, osEventFlagsId_t)
  367. //lint --flb "Library End"
  368. // ==== ISR Calls ====
  369. /// Set the specified Event Flags.
  370. /// \note API identical to osEventFlagsSet
  371. __STATIC_INLINE
  372. uint32_t isrRtxEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) {
  373. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  374. uint32_t event_flags;
  375. // Check parameters
  376. if ((ef == NULL) || (ef->id != osRtxIdEventFlags) ||
  377. ((flags & ~(((uint32_t)1U << osRtxEventFlagsLimit) - 1U)) != 0U)) {
  378. EvrRtxEventFlagsError(ef, (int32_t)osErrorParameter);
  379. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  380. return ((uint32_t)osErrorParameter);
  381. }
  382. // Set Event Flags
  383. event_flags = EventFlagsSet(ef, flags);
  384. // Register post ISR processing
  385. osRtxPostProcess(osRtxObject(ef));
  386. EvrRtxEventFlagsSetDone(ef, event_flags);
  387. return event_flags;
  388. }
  389. /// Wait for one or more Event Flags to become signaled.
  390. /// \note API identical to osEventFlagsWait
  391. __STATIC_INLINE
  392. uint32_t isrRtxEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout) {
  393. os_event_flags_t *ef = osRtxEventFlagsId(ef_id);
  394. uint32_t event_flags;
  395. // Check parameters
  396. if ((ef == NULL) || (ef->id != osRtxIdEventFlags) || (timeout != 0U) ||
  397. ((flags & ~(((uint32_t)1U << osRtxEventFlagsLimit) - 1U)) != 0U)) {
  398. EvrRtxEventFlagsError(ef, (int32_t)osErrorParameter);
  399. //lint -e{904} "Return statement before end of function" [MISRA Note 1]
  400. return ((uint32_t)osErrorParameter);
  401. }
  402. // Check Event Flags
  403. event_flags = EventFlagsCheck(ef, flags, options);
  404. if (event_flags != 0U) {
  405. EvrRtxEventFlagsWaitCompleted(ef, flags, options, event_flags);
  406. } else {
  407. EvrRtxEventFlagsWaitNotCompleted(ef, flags, options);
  408. event_flags = (uint32_t)osErrorResource;
  409. }
  410. return event_flags;
  411. }
  412. // ==== Public API ====
  413. /// Create and Initialize an Event Flags object.
  414. osEventFlagsId_t osEventFlagsNew (const osEventFlagsAttr_t *attr) {
  415. osEventFlagsId_t ef_id;
  416. EvrRtxEventFlagsNew(attr);
  417. if (IsException() || IsIrqMasked()) {
  418. EvrRtxEventFlagsError(NULL, (int32_t)osErrorISR);
  419. ef_id = NULL;
  420. } else {
  421. ef_id = __svcEventFlagsNew(attr);
  422. }
  423. return ef_id;
  424. }
  425. /// Get name of an Event Flags object.
  426. const char *osEventFlagsGetName (osEventFlagsId_t ef_id) {
  427. const char *name;
  428. if (IsException() || IsIrqMasked()) {
  429. EvrRtxEventFlagsGetName(ef_id, NULL);
  430. name = NULL;
  431. } else {
  432. name = __svcEventFlagsGetName(ef_id);
  433. }
  434. return name;
  435. }
  436. /// Set the specified Event Flags.
  437. uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) {
  438. uint32_t event_flags;
  439. EvrRtxEventFlagsSet(ef_id, flags);
  440. if (IsException() || IsIrqMasked()) {
  441. event_flags = isrRtxEventFlagsSet(ef_id, flags);
  442. } else {
  443. event_flags = __svcEventFlagsSet(ef_id, flags);
  444. }
  445. return event_flags;
  446. }
  447. /// Clear the specified Event Flags.
  448. uint32_t osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags) {
  449. uint32_t event_flags;
  450. EvrRtxEventFlagsClear(ef_id, flags);
  451. if (IsException() || IsIrqMasked()) {
  452. event_flags = svcRtxEventFlagsClear(ef_id, flags);
  453. } else {
  454. event_flags = __svcEventFlagsClear(ef_id, flags);
  455. }
  456. return event_flags;
  457. }
  458. /// Get the current Event Flags.
  459. uint32_t osEventFlagsGet (osEventFlagsId_t ef_id) {
  460. uint32_t event_flags;
  461. if (IsException() || IsIrqMasked()) {
  462. event_flags = svcRtxEventFlagsGet(ef_id);
  463. } else {
  464. event_flags = __svcEventFlagsGet(ef_id);
  465. }
  466. return event_flags;
  467. }
  468. /// Wait for one or more Event Flags to become signaled.
  469. uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout) {
  470. uint32_t event_flags;
  471. EvrRtxEventFlagsWait(ef_id, flags, options, timeout);
  472. if (IsException() || IsIrqMasked()) {
  473. event_flags = isrRtxEventFlagsWait(ef_id, flags, options, timeout);
  474. } else {
  475. event_flags = __svcEventFlagsWait(ef_id, flags, options, timeout);
  476. }
  477. return event_flags;
  478. }
  479. /// Delete an Event Flags object.
  480. osStatus_t osEventFlagsDelete (osEventFlagsId_t ef_id) {
  481. osStatus_t status;
  482. EvrRtxEventFlagsDelete(ef_id);
  483. if (IsException() || IsIrqMasked()) {
  484. EvrRtxEventFlagsError(ef_id, (int32_t)osErrorISR);
  485. status = osErrorISR;
  486. } else {
  487. status = __svcEventFlagsDelete(ef_id);
  488. }
  489. return status;
  490. }