diff --git a/arch/arm/include/tls.h b/arch/arm/include/tls.h deleted file mode 100644 index f6dc4de29d..0000000000 --- a/arch/arm/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/arm/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_ARM_INCLUDE_TLS_H -#define __ARCH_ARM_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_ARM_INCLUDE_TLS_H */ diff --git a/arch/avr/include/tls.h b/arch/avr/include/tls.h deleted file mode 100644 index 3b1c0a0740..0000000000 --- a/arch/avr/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/avr/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_AVR_INCLUDE_TLS_H -#define __ARCH_AVR_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_AVR_INCLUDE_TLS_H */ diff --git a/arch/hc/include/tls.h b/arch/hc/include/tls.h deleted file mode 100644 index f9ea66c0b6..0000000000 --- a/arch/hc/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/hc/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_HC_INCLUDE_TLS_H -#define __ARCH_HC_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_HC_INCLUDE_TLS_H */ diff --git a/arch/mips/include/tls.h b/arch/mips/include/tls.h deleted file mode 100644 index 986e12a530..0000000000 --- a/arch/mips/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/mips/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_MIPS_INCLUDE_TLS_H -#define __ARCH_MIPS_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_MIPS_INCLUDE_TLS_H */ diff --git a/arch/misoc/include/tls.h b/arch/misoc/include/tls.h deleted file mode 100644 index 8b138a6d70..0000000000 --- a/arch/misoc/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/misoc/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_MISOC_INCLUDE_TLS_H -#define __ARCH_MISOC_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_MISOC_INCLUDE_TLS_H */ diff --git a/arch/or1k/include/tls.h b/arch/or1k/include/tls.h deleted file mode 100644 index bb9785bc1f..0000000000 --- a/arch/or1k/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/or1k/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_OR1K_INCLUDE_TLS_H -#define __ARCH_OR1K_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_OR1K_INCLUDE_TLS_H */ diff --git a/arch/renesas/include/tls.h b/arch/renesas/include/tls.h deleted file mode 100644 index ecd74baba3..0000000000 --- a/arch/renesas/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/renesas/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_RENESAS_INCLUDE_TLS_H -#define __ARCH_RENESAS_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_RENESAS_INCLUDE_TLS_H */ diff --git a/arch/risc-v/include/tls.h b/arch/risc-v/include/tls.h deleted file mode 100644 index ba0a09afeb..0000000000 --- a/arch/risc-v/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/risc-v/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_RISCV_INCLUDE_TLS_H -#define __ARCH_RISCV_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_RISCV_INCLUDE_TLS_H */ diff --git a/arch/sim/include/tls.h b/arch/sim/include/tls.h deleted file mode 100644 index 7e9f2c4ffb..0000000000 --- a/arch/sim/include/tls.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - * arch/sim/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_SIM_INCLUDE_TLS_H -#define __ARCH_SIM_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - return TLS_INFO(up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_SIM_INCLUDE_TLS_H */ diff --git a/arch/x86/include/tls.h b/arch/x86/include/tls.h deleted file mode 100644 index 0298349cd1..0000000000 --- a/arch/x86/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/x86/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_X86_INCLUDE_TLS_H -#define __ARCH_X86_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_X86_INCLUDE_TLS_H */ diff --git a/arch/x86_64/include/tls.h b/arch/x86_64/include/tls.h deleted file mode 100644 index 8e6f0c1771..0000000000 --- a/arch/x86_64/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/x86_64/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_X86_64_INCLUDE_TLS_H -#define __ARCH_X86_64_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline FAR struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_X86_64_INCLUDE_TLS_H */ diff --git a/arch/xtensa/include/tls.h b/arch/xtensa/include/tls.h deleted file mode 100644 index dd18ee8cab..0000000000 --- a/arch/xtensa/include/tls.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * arch/xtensa/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_XTENSA_INCLUDE_TLS_H -#define __ARCH_XTENSA_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -static inline struct tls_info_s *up_tls_info(void) -{ - DEBUGASSERT(!up_interrupt_context()); - return TLS_INFO((uintptr_t)up_getsp()); -} -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_XTENSA_INCLUDE_TLS_H */ diff --git a/arch/z16/include/tls.h b/arch/z16/include/tls.h deleted file mode 100644 index be7de1dc9e..0000000000 --- a/arch/z16/include/tls.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - * arch/z16/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_Z16_INCLUDE_TLS_H -#define __ARCH_Z16_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -# error "Aligned TLS not supported" -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_Z16_INCLUDE_TLS_H */ diff --git a/arch/z80/include/tls.h b/arch/z80/include/tls.h deleted file mode 100644 index 436976ddde..0000000000 --- a/arch/z80/include/tls.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - * arch/z80/include/tls.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_Z80_INCLUDE_TLS_H -#define __ARCH_Z80_INCLUDE_TLS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_tls_info - * - * Description: - * Return the TLS information structure for the currently executing thread. - * When TLS is enabled, up_createstack() will align allocated stacks to - * the TLS_STACK_ALIGN value. An instance of the following structure will - * be implicitly positioned at the "lower" end of the stack. Assuming a - * "push down" stack, this is at the "far" end of the stack (and can be - * clobbered if the stack overflows). - * - * If an MCU has a "push up" then that TLS structure will lie at the top - * of the stack and stack allocation and initialization logic must take - * care to preserve this structure content. - * - * The stack memory is fully accessible to user mode threads. - * - * Input Parameters: - * None - * - * Returned Value: - * A pointer to TLS info structure at the beginning of the STACK memory - * allocation. This is essentially an application of the TLS_INFO(sp) - * macro and has a platform dependency only in the manner in which the - * stack pointer (sp) is obtained and interpreted. - * - ****************************************************************************/ - -#ifdef CONFIG_TLS_ALIGNED -# error "Aligned TLS not supported" -#else -# define up_tls_info() tls_get_info() -#endif - -#endif /* __ARCH_Z80_INCLUDE_TLS_H */ diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 3f96120996..12779c6061 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -1791,10 +1791,18 @@ int up_timer_start(FAR const struct timespec *ts); /* struct tls_info_s; * FAR struct tls_info_s *up_tls_info(void); * - * The actual declaration or definition is provided in arch/tls.h. The - * actual implementation may be a MACRO or an inline function. + * The actual definition is provided in arch/arch.h as a macro. The default + * implementation provided here assume the arch has a "push down" stack. */ +#ifndef up_tls_info +# ifdef CONFIG_TLS_ALIGNED +# define up_tls_info() TLS_INFO((uintptr_t)up_getsp()) +# else +# define up_tls_info() tls_get_info() +# endif +#endif + /**************************************************************************** * Multiple CPU support ****************************************************************************/ diff --git a/include/nuttx/tls.h b/include/nuttx/tls.h index be7cf9ce22..88ab9bf647 100644 --- a/include/nuttx/tls.h +++ b/include/nuttx/tls.h @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/libs/libc/errno/lib_errno.c b/libs/libc/errno/lib_errno.c index 101f5dd02e..cfd06bc2b7 100644 --- a/libs/libc/errno/lib_errno.c +++ b/libs/libc/errno/lib_errno.c @@ -27,7 +27,7 @@ #include #include -#include +#include /**************************************************************************** * Private Data diff --git a/libs/libc/pthread/pthread_cleanup.c b/libs/libc/pthread/pthread_cleanup.c index 540a986e4c..8d4ba7f5aa 100644 --- a/libs/libc/pthread/pthread_cleanup.c +++ b/libs/libc/pthread/pthread_cleanup.c @@ -32,7 +32,6 @@ #include #include #include -#include #ifdef CONFIG_PTHREAD_CLEANUP diff --git a/libs/libc/tls/task_getinfo.c b/libs/libc/tls/task_getinfo.c index 5163a43f54..6ac43eadef 100644 --- a/libs/libc/tls/task_getinfo.c +++ b/libs/libc/tls/task_getinfo.c @@ -26,7 +26,6 @@ #include #include -#include /**************************************************************************** * Public Functions diff --git a/libs/libc/tls/tls_destruct.c b/libs/libc/tls/tls_destruct.c index c63f05d2c9..28011acdba 100644 --- a/libs/libc/tls/tls_destruct.c +++ b/libs/libc/tls/tls_destruct.c @@ -29,7 +29,6 @@ #include #include -#include #if CONFIG_TLS_NELEM > 0 diff --git a/libs/libc/tls/tls_getinfo.c b/libs/libc/tls/tls_getinfo.c index 84e8f8f7ad..7425956733 100644 --- a/libs/libc/tls/tls_getinfo.c +++ b/libs/libc/tls/tls_getinfo.c @@ -29,7 +29,6 @@ #include #include -#include #ifndef CONFIG_TLS_ALIGNED diff --git a/libs/libc/tls/tls_getvalue.c b/libs/libc/tls/tls_getvalue.c index 84148961d8..2ebf649e84 100644 --- a/libs/libc/tls/tls_getvalue.c +++ b/libs/libc/tls/tls_getvalue.c @@ -29,7 +29,6 @@ #include #include -#include #if CONFIG_TLS_NELEM > 0 diff --git a/libs/libc/tls/tls_setvalue.c b/libs/libc/tls/tls_setvalue.c index 84cbf93bd5..a4f56adb30 100644 --- a/libs/libc/tls/tls_setvalue.c +++ b/libs/libc/tls/tls_setvalue.c @@ -29,7 +29,6 @@ #include #include -#include #if CONFIG_TLS_NELEM > 0