signal.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2017/10/5 Bernard the first version
  9. * 2018/09/17 Jesven fix: in _signal_deliver RT_THREAD_STAT_MASK to RT_THREAD_STAT_SIGNAL_MASK
  10. * 2018/11/22 Jesven in smp version rt_hw_context_switch_to add a param
  11. */
  12. #include <stdint.h>
  13. #include <string.h>
  14. #include <rthw.h>
  15. #include <rtthread.h>
  16. #ifdef RT_USING_SIGNALS
  17. #ifndef RT_SIG_INFO_MAX
  18. #ifdef ARCH_CPU_64BIT
  19. #define RT_SIG_INFO_MAX 64
  20. #else
  21. #define RT_SIG_INFO_MAX 32
  22. #endif /* ARCH_CPU_64BIT */
  23. #endif /* RT_SIG_INFO_MAX */
  24. #define DBG_TAG "SIGN"
  25. #define DBG_LVL DBG_WARNING
  26. #include <rtdbg.h>
  27. #ifdef RT_USING_MUSLLIBC
  28. #define sig_mask(sig_no) (1u << (sig_no - 1))
  29. #else
  30. #define sig_mask(sig_no) (1u << sig_no)
  31. #endif
  32. #define sig_valid(sig_no) (sig_no >= 0 && sig_no < RT_SIG_MAX)
  33. static struct rt_spinlock _thread_signal_lock = RT_SPINLOCK_INIT;
  34. struct siginfo_node
  35. {
  36. siginfo_t si;
  37. struct rt_slist_node list;
  38. };
  39. static struct rt_mempool *_siginfo_pool;
  40. static void _signal_deliver(rt_thread_t tid);
  41. void rt_thread_handle_sig(rt_bool_t clean_state);
  42. static void _signal_default_handler(int signo)
  43. {
  44. RT_UNUSED(signo);
  45. LOG_I("handled signo[%d] with default action.", signo);
  46. return ;
  47. }
  48. static void _signal_entry(void *parameter)
  49. {
  50. RT_UNUSED(parameter);
  51. rt_thread_t tid = rt_thread_self();
  52. /* handle signal */
  53. rt_thread_handle_sig(RT_FALSE);
  54. #ifdef RT_USING_SMP
  55. #else
  56. /* return to thread */
  57. tid->sp = tid->sig_ret;
  58. tid->sig_ret = RT_NULL;
  59. #endif /* RT_USING_SMP */
  60. LOG_D("switch back to: 0x%08x\n", tid->sp);
  61. RT_SCHED_CTX(tid).stat &= ~RT_THREAD_STAT_SIGNAL;
  62. #ifdef RT_USING_SMP
  63. rt_hw_context_switch_to((rt_uintptr_t)&parameter, tid);
  64. #else
  65. rt_hw_context_switch_to((rt_uintptr_t)&(tid->sp));
  66. #endif /* RT_USING_SMP */
  67. }
  68. /*
  69. * To deliver a signal to thread, there are cases:
  70. * 1. When thread is suspended, function resumes thread and
  71. * set signal stat;
  72. * 2. When thread is ready:
  73. * - If function delivers a signal to self thread, just handle
  74. * it.
  75. * - If function delivers a signal to another ready thread, OS
  76. * should build a slice context to handle it.
  77. */
  78. static void _signal_deliver(rt_thread_t tid)
  79. {
  80. rt_base_t level;
  81. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  82. /* thread is not interested in pended signals */
  83. if (!(tid->sig_pending & tid->sig_mask))
  84. {
  85. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  86. return;
  87. }
  88. if ((RT_SCHED_CTX(tid).stat & RT_THREAD_SUSPEND_MASK) == RT_THREAD_SUSPEND_MASK)
  89. {
  90. /* resume thread to handle signal */
  91. #ifdef RT_USING_SMART
  92. rt_thread_wakeup(tid);
  93. #else
  94. rt_thread_resume(tid);
  95. #endif
  96. /* add signal state */
  97. RT_SCHED_CTX(tid).stat |= (RT_THREAD_STAT_SIGNAL | RT_THREAD_STAT_SIGNAL_PENDING);
  98. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  99. /* re-schedule */
  100. rt_schedule();
  101. }
  102. else
  103. {
  104. if (tid == rt_thread_self())
  105. {
  106. /* add signal state */
  107. RT_SCHED_CTX(tid).stat |= RT_THREAD_STAT_SIGNAL;
  108. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  109. /* do signal action in self thread context */
  110. if (rt_interrupt_get_nest() == 0)
  111. {
  112. rt_thread_handle_sig(RT_TRUE);
  113. }
  114. }
  115. else if (!((RT_SCHED_CTX(tid).stat & RT_THREAD_STAT_SIGNAL_MASK) & RT_THREAD_STAT_SIGNAL))
  116. {
  117. /* add signal state */
  118. RT_SCHED_CTX(tid).stat |= (RT_THREAD_STAT_SIGNAL | RT_THREAD_STAT_SIGNAL_PENDING);
  119. #ifdef RT_USING_SMP
  120. {
  121. int cpu_id;
  122. cpu_id = RT_SCHED_CTX(tid).oncpu;
  123. if ((cpu_id != RT_CPU_DETACHED) && (cpu_id != rt_cpu_get_id()))
  124. {
  125. rt_uint32_t cpu_mask;
  126. cpu_mask = RT_CPU_MASK ^ (1 << cpu_id);
  127. rt_hw_ipi_send(RT_SCHEDULE_IPI, cpu_mask);
  128. }
  129. }
  130. #else
  131. /* point to the signal handle entry */
  132. RT_SCHED_CTX(tid).stat &= ~RT_THREAD_STAT_SIGNAL_PENDING;
  133. tid->sig_ret = tid->sp;
  134. tid->sp = rt_hw_stack_init((void *)_signal_entry, RT_NULL,
  135. (void *)((char *)tid->sig_ret - 32), RT_NULL);
  136. #endif /* RT_USING_SMP */
  137. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  138. LOG_D("signal stack pointer @ 0x%08x", tid->sp);
  139. /* re-schedule */
  140. rt_schedule();
  141. }
  142. else
  143. {
  144. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  145. }
  146. }
  147. }
  148. #ifdef RT_USING_SMP
  149. void *rt_signal_check(void* context)
  150. {
  151. rt_sched_lock_level_t level;
  152. int cpu_id;
  153. struct rt_cpu* pcpu;
  154. struct rt_thread *current_thread;
  155. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  156. cpu_id = rt_cpu_get_id();
  157. pcpu = rt_cpu_index(cpu_id);
  158. current_thread = pcpu->current_thread;
  159. if (pcpu->irq_nest)
  160. {
  161. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  162. return context;
  163. }
  164. if (current_thread->cpus_lock_nest == 1)
  165. {
  166. if (RT_SCHED_CTX(current_thread).stat & RT_THREAD_STAT_SIGNAL_PENDING)
  167. {
  168. void *sig_context;
  169. RT_SCHED_CTX(current_thread).stat &= ~RT_THREAD_STAT_SIGNAL_PENDING;
  170. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  171. sig_context = rt_hw_stack_init((void *)_signal_entry, context,
  172. (void*)((char*)context - 32), RT_NULL);
  173. return sig_context;
  174. }
  175. }
  176. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  177. return context;
  178. }
  179. #endif /* RT_USING_SMP */
  180. /**
  181. * @brief This function will install a processing function to a specific
  182. * signal and return the old processing function of this signal.
  183. *
  184. * @note This function needs to be used in conjunction with the
  185. * rt_signal_unmask() function to make the signal effective.
  186. *
  187. * @see rt_signal_unmask()
  188. *
  189. * @param signo is a specific signal value (range: 0 ~ RT_SIG_MAX).
  190. *
  191. * @param handler is sets the processing of signal value.
  192. *
  193. * @return Return the old processing function of this signal. ONLY When the
  194. * return value is SIG_ERR, the operation is failed.
  195. */
  196. rt_sighandler_t rt_signal_install(int signo, rt_sighandler_t handler)
  197. {
  198. rt_base_t level;
  199. rt_sighandler_t old = RT_NULL;
  200. rt_thread_t tid = rt_thread_self();
  201. if (!sig_valid(signo)) return SIG_ERR;
  202. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  203. if (tid->sig_vectors == RT_NULL)
  204. {
  205. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  206. rt_thread_alloc_sig(tid);
  207. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  208. }
  209. if (tid->sig_vectors)
  210. {
  211. old = tid->sig_vectors[signo];
  212. if (handler == SIG_IGN) tid->sig_vectors[signo] = RT_NULL;
  213. else if (handler == SIG_DFL) tid->sig_vectors[signo] = _signal_default_handler;
  214. else tid->sig_vectors[signo] = handler;
  215. }
  216. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  217. return old;
  218. }
  219. /**
  220. * @brief This function will block the specified signal.
  221. *
  222. * @note This function will block the specified signal, even if the
  223. * rt_thread_kill() function is called to send this signal to
  224. * the current thread, it will no longer take effect.
  225. *
  226. * @see rt_thread_kill()
  227. *
  228. * @param signo is a specific signal value (range: 0 ~ RT_SIG_MAX).
  229. */
  230. void rt_signal_mask(int signo)
  231. {
  232. rt_base_t level;
  233. rt_thread_t tid = rt_thread_self();
  234. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  235. tid->sig_mask &= ~sig_mask(signo);
  236. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  237. }
  238. /**
  239. * @brief This function will unblock the specified signal.
  240. *
  241. * @note This function will unblock the specified signal. After calling
  242. * the rt_thread_kill() function to send this signal to the current
  243. * thread, it will take effect.
  244. *
  245. * @see rt_thread_kill()
  246. *
  247. * @param signo is a specific signal value (range: 0 ~ RT_SIG_MAX).
  248. */
  249. void rt_signal_unmask(int signo)
  250. {
  251. rt_base_t level;
  252. rt_thread_t tid = rt_thread_self();
  253. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  254. tid->sig_mask |= sig_mask(signo);
  255. /* let thread handle pended signals */
  256. if (tid->sig_mask & tid->sig_pending)
  257. {
  258. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  259. _signal_deliver(tid);
  260. }
  261. else
  262. {
  263. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  264. }
  265. }
  266. /**
  267. * @brief This function will wait for the arrival of the set signal. If it does not wait for this signal, the thread will be
  268. * suspended until it waits for this signal or the waiting time exceeds the specified timeout: timeout.
  269. *
  270. * @param set is the set of signal values to be waited for. Use the function
  271. * sigaddset() to add the signal.
  272. *
  273. * @param si is a pointer to the received signal info. If you don't care about this value, you can use RT_NULL to set.
  274. *
  275. * @param timeout is a timeout period (unit: an OS tick).
  276. *
  277. * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
  278. * If the return value is any other values, it means that the signal wait failed.
  279. */
  280. int rt_signal_wait(const rt_sigset_t *set, rt_siginfo_t *si, rt_int32_t timeout)
  281. {
  282. int ret = RT_EOK;
  283. rt_base_t level;
  284. rt_thread_t tid = rt_thread_self();
  285. struct siginfo_node *si_node = RT_NULL, *si_prev = RT_NULL;
  286. /* current context checking */
  287. RT_DEBUG_IN_THREAD_CONTEXT;
  288. /* parameters check */
  289. if (set == NULL || *set == 0 || si == NULL )
  290. {
  291. ret = -RT_EINVAL;
  292. goto __done_return;
  293. }
  294. /* clear siginfo to avoid unknown value */
  295. memset(si, 0x0, sizeof(rt_siginfo_t));
  296. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  297. /* already pending */
  298. if (tid->sig_pending & *set) goto __done;
  299. if (timeout == 0)
  300. {
  301. ret = -RT_ETIMEOUT;
  302. goto __done_int;
  303. }
  304. /* suspend self thread */
  305. rt_thread_suspend_with_flag(tid, RT_UNINTERRUPTIBLE);
  306. /* set thread stat as waiting for signal */
  307. RT_SCHED_CTX(tid).stat |= RT_THREAD_STAT_SIGNAL_WAIT;
  308. /* start timeout timer */
  309. if (timeout != RT_WAITING_FOREVER)
  310. {
  311. /* reset the timeout of thread timer and start it */
  312. rt_timer_control(&(tid->thread_timer),
  313. RT_TIMER_CTRL_SET_TIME,
  314. &timeout);
  315. rt_timer_start(&(tid->thread_timer));
  316. }
  317. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  318. /* do thread scheduling */
  319. rt_schedule();
  320. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  321. /* remove signal waiting flag */
  322. RT_SCHED_CTX(tid).stat &= ~RT_THREAD_STAT_SIGNAL_WAIT;
  323. /* check errno of thread */
  324. if (tid->error == -RT_ETIMEOUT)
  325. {
  326. tid->error = RT_EOK;
  327. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  328. /* timer timeout */
  329. ret = -RT_ETIMEOUT;
  330. goto __done_return;
  331. }
  332. __done:
  333. /* to get the first matched pending signals */
  334. si_node = (struct siginfo_node *)tid->si_list;
  335. while (si_node)
  336. {
  337. int signo;
  338. signo = si_node->si.si_signo;
  339. if (sig_mask(signo) & *set)
  340. {
  341. *si = si_node->si;
  342. LOG_D("sigwait: %d sig raised!", signo);
  343. if (si_prev) si_prev->list.next = si_node->list.next;
  344. else
  345. {
  346. struct siginfo_node *node_next;
  347. if (si_node->list.next)
  348. {
  349. node_next = (void *)rt_slist_entry(si_node->list.next, struct siginfo_node, list);
  350. tid->si_list = node_next;
  351. }
  352. else
  353. {
  354. tid->si_list = RT_NULL;
  355. }
  356. }
  357. /* clear pending */
  358. tid->sig_pending &= ~sig_mask(signo);
  359. rt_mp_free(si_node);
  360. break;
  361. }
  362. si_prev = si_node;
  363. if (si_node->list.next)
  364. {
  365. si_node = (void *)rt_slist_entry(si_node->list.next, struct siginfo_node, list);
  366. }
  367. else
  368. {
  369. si_node = RT_NULL;
  370. }
  371. }
  372. __done_int:
  373. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  374. __done_return:
  375. return ret;
  376. }
  377. void rt_thread_handle_sig(rt_bool_t clean_state)
  378. {
  379. rt_base_t level;
  380. rt_thread_t tid = rt_thread_self();
  381. struct siginfo_node *si_node;
  382. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  383. if (tid->sig_pending & tid->sig_mask)
  384. {
  385. /* if thread is not waiting for signal */
  386. if (!(RT_SCHED_CTX(tid).stat & RT_THREAD_STAT_SIGNAL_WAIT))
  387. {
  388. while (tid->sig_pending & tid->sig_mask)
  389. {
  390. int signo, error;
  391. rt_sighandler_t handler;
  392. si_node = (struct siginfo_node *)tid->si_list;
  393. if (!si_node) break;
  394. /* remove this sig info node from list */
  395. if (si_node->list.next == RT_NULL)
  396. tid->si_list = RT_NULL;
  397. else
  398. tid->si_list = (void *)rt_slist_entry(si_node->list.next, struct siginfo_node, list);
  399. signo = si_node->si.si_signo;
  400. handler = tid->sig_vectors[signo];
  401. tid->sig_pending &= ~sig_mask(signo);
  402. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  403. LOG_D("handle signal: %d, handler 0x%08x", signo, handler);
  404. if (handler) handler(signo);
  405. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  406. error = -RT_EINTR;
  407. rt_mp_free(si_node); /* release this siginfo node */
  408. /* set errno in thread tcb */
  409. tid->error = error;
  410. }
  411. /* whether clean signal status */
  412. if (clean_state == RT_TRUE)
  413. {
  414. RT_SCHED_CTX(tid).stat &= ~RT_THREAD_STAT_SIGNAL;
  415. }
  416. else
  417. {
  418. return;
  419. }
  420. }
  421. }
  422. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  423. }
  424. void rt_thread_alloc_sig(rt_thread_t tid)
  425. {
  426. int index;
  427. rt_bool_t need_free = RT_FALSE;
  428. rt_base_t level;
  429. rt_sighandler_t *vectors;
  430. vectors = (rt_sighandler_t *)RT_KERNEL_MALLOC(sizeof(rt_sighandler_t) * RT_SIG_MAX);
  431. RT_ASSERT(vectors != RT_NULL);
  432. for (index = 0; index < RT_SIG_MAX; index ++)
  433. {
  434. vectors[index] = _signal_default_handler;
  435. }
  436. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  437. if (tid->sig_vectors == RT_NULL)
  438. {
  439. tid->sig_vectors = vectors;
  440. }
  441. else
  442. {
  443. need_free = RT_TRUE;
  444. }
  445. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  446. if (need_free)
  447. {
  448. rt_free(vectors);
  449. }
  450. }
  451. void rt_thread_free_sig(rt_thread_t tid)
  452. {
  453. rt_base_t level;
  454. struct siginfo_node *si_node;
  455. rt_sighandler_t *sig_vectors;
  456. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  457. si_node = (struct siginfo_node *)tid->si_list;
  458. tid->si_list = RT_NULL;
  459. sig_vectors = tid->sig_vectors;
  460. tid->sig_vectors = RT_NULL;
  461. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  462. if (si_node)
  463. {
  464. struct rt_slist_node *node;
  465. struct rt_slist_node *node_to_free;
  466. LOG_D("free signal info list");
  467. node = &(si_node->list);
  468. do
  469. {
  470. node_to_free = node;
  471. node = node->next;
  472. si_node = rt_slist_entry(node_to_free, struct siginfo_node, list);
  473. rt_mp_free(si_node);
  474. } while (node);
  475. }
  476. if (sig_vectors)
  477. {
  478. RT_KERNEL_FREE(sig_vectors);
  479. }
  480. }
  481. /**
  482. * @brief This function can be used to send any signal to any thread.
  483. *
  484. * @param tid is a pointer to the thread that receives the signal.
  485. *
  486. * @param sig is a specific signal value (range: 0 ~ RT_SIG_MAX).
  487. *
  488. * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
  489. * If the return value is any other values, it means that the signal send failed.
  490. */
  491. int rt_thread_kill(rt_thread_t tid, int sig)
  492. {
  493. siginfo_t si;
  494. rt_base_t level;
  495. struct siginfo_node *si_node;
  496. RT_ASSERT(tid != RT_NULL);
  497. if (!sig_valid(sig)) return -RT_EINVAL;
  498. LOG_I("send signal: %d", sig);
  499. si.si_signo = sig;
  500. si.si_code = SI_USER;
  501. si.si_value.sival_ptr = RT_NULL;
  502. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  503. if (tid->sig_pending & sig_mask(sig))
  504. {
  505. /* whether already emits this signal? */
  506. struct rt_slist_node *node;
  507. struct siginfo_node *entry;
  508. si_node = (struct siginfo_node *)tid->si_list;
  509. if (si_node)
  510. node = (struct rt_slist_node *)&si_node->list;
  511. else
  512. node = RT_NULL;
  513. /* update sig info */
  514. for (; (node) != RT_NULL; node = node->next)
  515. {
  516. entry = rt_slist_entry(node, struct siginfo_node, list);
  517. if (entry->si.si_signo == sig)
  518. {
  519. memcpy(&(entry->si), &si, sizeof(siginfo_t));
  520. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  521. return 0;
  522. }
  523. }
  524. }
  525. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  526. si_node = (struct siginfo_node *) rt_mp_alloc(_siginfo_pool, 0);
  527. if (si_node)
  528. {
  529. rt_slist_init(&(si_node->list));
  530. memcpy(&(si_node->si), &si, sizeof(siginfo_t));
  531. level = rt_spin_lock_irqsave(&_thread_signal_lock);
  532. if (tid->si_list)
  533. {
  534. struct siginfo_node *si_list;
  535. si_list = (struct siginfo_node *)tid->si_list;
  536. rt_slist_append(&(si_list->list), &(si_node->list));
  537. }
  538. else
  539. {
  540. tid->si_list = si_node;
  541. }
  542. /* a new signal */
  543. tid->sig_pending |= sig_mask(sig);
  544. rt_spin_unlock_irqrestore(&_thread_signal_lock, level);
  545. }
  546. else
  547. {
  548. LOG_E("The allocation of signal info node failed.");
  549. return -RT_EEMPTY;
  550. }
  551. /* deliver signal to this thread */
  552. _signal_deliver(tid);
  553. return RT_EOK;
  554. }
  555. int rt_system_signal_init(void)
  556. {
  557. _siginfo_pool = rt_mp_create("signal", RT_SIG_INFO_MAX, sizeof(struct siginfo_node));
  558. if (_siginfo_pool == RT_NULL)
  559. {
  560. LOG_E("create memory pool for signal info failed.");
  561. RT_ASSERT(0);
  562. }
  563. return 0;
  564. }
  565. #endif /* RT_USING_SIGNALS */