Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:12

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSImplApplConfig
0007  *
0008  * @brief This header file evaluates configuration options related to the POSIX
0009  *   initialization thread configuration.
0010  *
0011  * This header file defines _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA for use by
0012  * other configuration header files.
0013  */
0014 
0015 /*
0016  * Copyright (C) 2020 embedded brains GmbH & Co. KG
0017  *
0018  * Redistribution and use in source and binary forms, with or without
0019  * modification, are permitted provided that the following conditions
0020  * are met:
0021  * 1. Redistributions of source code must retain the above copyright
0022  *    notice, this list of conditions and the following disclaimer.
0023  * 2. Redistributions in binary form must reproduce the above copyright
0024  *    notice, this list of conditions and the following disclaimer in the
0025  *    documentation and/or other materials provided with the distribution.
0026  *
0027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0028  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0029  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0030  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0031  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0032  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0033  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0035  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0036  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0037  * POSSIBILITY OF SUCH DAMAGE.
0038  */
0039 
0040 #ifndef _RTEMS_CONFDEFS_INITTHREAD_H
0041 #define _RTEMS_CONFDEFS_INITTHREAD_H
0042 
0043 #ifndef __CONFIGURATION_TEMPLATE_h
0044 #error "Do not include this file directly, use <rtems/confdefs.h> instead"
0045 #endif
0046 
0047 #ifdef CONFIGURE_INIT
0048 
0049 #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
0050 
0051 #include <rtems/confdefs/percpu.h>
0052 #include <rtems/posix/pthread.h>
0053 #include <rtems/sysinit.h>
0054 
0055 #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
0056   #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init
0057 #endif
0058 
0059 #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
0060   #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
0061     CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
0062 #endif
0063 
0064 #if CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
0065   > CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
0066   #define _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA \
0067     ( CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \
0068       CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE )
0069 #endif
0070 
0071 #ifdef __cplusplus
0072 extern "C" {
0073 #endif
0074 
0075 const posix_initialization_threads_table _POSIX_Threads_User_thread_table = {
0076   CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
0077   CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
0078 };
0079 
0080 RTEMS_SYSINIT_ITEM(
0081   _POSIX_Threads_Initialize_user_thread,
0082   RTEMS_SYSINIT_POSIX_USER_THREADS,
0083   RTEMS_SYSINIT_ORDER_MIDDLE
0084 );
0085 
0086 #ifdef __cplusplus
0087 }
0088 #endif
0089 
0090 #endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
0091 
0092 #ifndef _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA
0093   #define _CONFIGURE_POSIX_INIT_THREAD_STACK_EXTRA 0
0094 #endif
0095 
0096 #endif /* CONFIGURE_INIT */
0097 
0098 #endif /* _RTEMS_CONFDEFS_INITTHREAD_H */