xiaoxiang781216 commented on a change in pull request #4935:
URL: https://github.com/apache/incubator-nuttx/pull/4935#discussion_r762564460
##########
File path: include/nuttx/arch.h
##########
@@ -2398,6 +2398,40 @@ int up_rtc_getdatetime_with_subseconds(FAR struct tm
*tp, FAR long *nsec);
int up_rtc_settime(FAR const struct timespec *tp);
#endif
+/****************************************************************************
+ * Name: up_tls_size
+ *
+ * Description:
+ * Get tls (tdata + tbss) section size
+ *
+ * Returned Value:
+ * Size of (tdata + tbss)
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_THREAD_LOCAL
+int up_tls_size(void);
+#else
+#define up_tls_size() 0
+#endif
+
+/****************************************************************************
+ * Name: up_tls_initialize
+ *
+ * Description:
+ * Initialize thread local region
+ *
+ * Input Parameters:
+ * tls_data - The memory region to initialize
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_THREAD_LOCAL
+void up_tls_initialize(FAR void *tls_data);
Review comment:
change "FAR void *tls_data" to "FAR struct tls_info_s *info"
##########
File path: include/nuttx/tls.h
##########
@@ -150,6 +150,7 @@ struct tls_info_s
#endif
int tl_errno; /* Per-thread error number */
+ uint8_t tl_data[0];
Review comment:
change 0 to 1 since C89 doesn't support zero length array.
##########
File path: include/nuttx/arch.h
##########
@@ -2398,6 +2398,40 @@ int up_rtc_getdatetime_with_subseconds(FAR struct tm
*tp, FAR long *nsec);
int up_rtc_settime(FAR const struct timespec *tp);
#endif
+/****************************************************************************
+ * Name: up_tls_size
Review comment:
Move after up_tls_info at line 1792
##########
File path: include/nuttx/arch.h
##########
@@ -2398,6 +2398,40 @@ int up_rtc_getdatetime_with_subseconds(FAR struct tm
*tp, FAR long *nsec);
int up_rtc_settime(FAR const struct timespec *tp);
#endif
+/****************************************************************************
+ * Name: up_tls_size
+ *
+ * Description:
+ * Get tls (tdata + tbss) section size
+ *
+ * Returned Value:
+ * Size of (tdata + tbss)
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_THREAD_LOCAL
+int up_tls_size(void);
Review comment:
Should we add sizeof(tls_info_s) to the return value?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]