Ticket #1924: config-cvs.patch
File config-cvs.patch, 26.8 KB (added by Sebastian Huber, on 10/26/11 at 10:02:43) |
---|
-
cpukit/sapi/include/rtems/config.h
RCS file: /usr1/CVS/rtems/cpukit/sapi/include/rtems/config.h,v retrieving revision 1.56 diff -u -r1.56 config.h
104 104 */ 105 105 uintptr_t work_space_size; 106 106 107 /** This field specifies the size in bytes of the RTEMS thread stack space. 108 */ 109 uintptr_t stack_space_size; 110 107 111 /** This field specifies the maximum number of dynamically installed 108 112 * used extensions. 109 113 */ … … 196 200 #define rtems_configuration_get_work_space_start() \ 197 201 (Configuration.work_space_start) 198 202 203 #define rtems_configuration_set_work_space_start( _start ) \ 204 do { Configuration.work_space_start = (_start); } while (0) 205 199 206 #define rtems_configuration_get_work_space_size() \ 200 (Configuration.work_space_size) 207 (Configuration.work_space_size + Configuration.stack_space_size) 208 209 #define rtems_configuration_set_work_space_size( _size ) \ 210 do { \ 211 Configuration.work_space_size = (_size); \ 212 Configuration.stack_space_size = 0; \ 213 } while (0) 201 214 202 215 #define rtems_configuration_get_maximum_extensions() \ 203 216 (Configuration.maximum_extensions) -
cpukit/sapi/include/confdefs.h
RCS file: /usr1/CVS/rtems/cpukit/sapi/include/confdefs.h,v retrieving revision 1.173 diff -u -r1.173 confdefs.h
764 764 #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE 765 765 #endif 766 766 767 #define CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE \ 768 (2 * CONFIGURE_MINIMUM_TASK_STACK_SIZE) 769 767 770 /** 768 771 * @brief Idle task stack size configuration 769 772 * … … 777 780 #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE 778 781 #endif 779 782 #endif 783 #if CONFIGURE_IDLE_TASK_STACK_SIZE < CONFIGURE_MINIMUM_TASK_STACK_SIZE 784 #error "CONFIGURE_IDLE_TASK_STACK_SIZE less than CONFIGURE_MINIMUM_TASK_STACK_SIZE" 785 #endif 780 786 781 787 /** 782 788 * @brief Interrupt stack size configuration … … 1241 1247 #define CONFIGURE_LIBBLOCK_SEMAPHORES 0 1242 1248 #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ 1243 1249 1250 #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 1251 #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 1252 #endif 1253 1244 1254 #if defined(RTEMS_MULTIPROCESSING) 1245 1255 /* 1246 1256 * Default Multiprocessing Configuration Table. The defaults are … … 1273 1283 #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ 1274 1284 _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) ) 1275 1285 1276 #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK1277 #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 01278 #endif1279 1280 1286 #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER 1281 1287 #include <mpci.h> 1282 1288 #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table … … 1521 1527 1522 1528 #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ 1523 1529 _Configure_From_workspace( \ 1524 CONFIGURE_MINIMUM_TASK_STACK_SIZE + \1525 1530 sizeof (POSIX_API_Control) + \ 1526 1531 (sizeof (void *) * (CONFIGURE_MAXIMUM_POSIX_KEYS)) \ 1527 1532 ) … … 1639 1644 1640 1645 #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 1641 1646 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ 1642 (CONFIGURE_MINIMUM_TASK_STACK_SIZE * 2)1647 CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE 1643 1648 #endif 1644 1649 1645 1650 #ifdef CONFIGURE_INIT … … 1685 1690 CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ 1686 1691 CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ 1687 1692 CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ 1688 CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ 1689 (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ 1693 CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) \ 1690 1694 ) 1691 1695 #else 1692 1696 … … 1728 1732 #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 1729 1733 #endif 1730 1734 1731 /**1732 * Ada tasks are allocated twice the minimum stack space.1733 */1734 #define CONFIGURE_ADA_TASKS_STACK \1735 (CONFIGURE_MAXIMUM_ADA_TASKS * \1736 (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (6 * 1024)))1737 1738 1735 #else 1739 1736 #define CONFIGURE_GNAT_MUTEXES 0 1740 1737 #define CONFIGURE_MAXIMUM_ADA_TASKS 0 1741 1738 #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 1742 #define CONFIGURE_ADA_TASKS_STACK 01743 1739 #endif 1744 1740 1745 1741 #ifdef CONFIGURE_ENABLE_GO … … 1795 1791 #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0 1796 1792 #endif 1797 1793 1794 /** 1795 * This is so we can account for tasks with stacks greater than minimum 1796 * size. This is in bytes. 1797 */ 1798 #ifndef CONFIGURE_EXTRA_TASK_STACKS 1799 #define CONFIGURE_EXTRA_TASK_STACKS 0 1800 #endif 1798 1801 1799 1802 /* 1800 1803 * Calculate the RAM size based on the maximum number of objects configured. … … 1813 1816 ( \ 1814 1817 _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \ 1815 1818 (_Configure_Max_Objects(_tasks) * \ 1816 (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \ 1817 CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \ 1819 (CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \ 1818 1820 CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \ 1819 1821 CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ 1820 1822 CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER)) + \ … … 1833 1835 (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ 1834 1836 CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \ 1835 1837 CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ 1836 CONFIGURE_MEMORY_FOR_TASKS(1, 1) + \ 1837 CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \ 1838 CONFIGURE_MEMORY_FOR_TASKS(1, 1) \ 1838 1839 ) 1839 1840 #else 1840 1841 #define CONFIGURE_MEMORY_FOR_MP 0 1841 1842 #endif 1842 1843 1843 1844 /** 1844 * This is so we can account for tasks with stacks greater than minimum1845 * size. This is in bytes.1846 */1847 #ifndef CONFIGURE_EXTRA_TASK_STACKS1848 #define CONFIGURE_EXTRA_TASK_STACKS 01849 #endif1850 1851 /**1852 1845 * The following macro is used to calculate the memory allocated by RTEMS 1853 1846 * for the message buffers associated with a particular message queue. 1854 1847 * There is a fixed amount of overhead per message. … … 1915 1908 _Configure_Object_RAM(1, sizeof(API_Mutex_Control)) 1916 1909 1917 1910 /** 1918 * This defines the formula used to compute the amount of memory1919 * reserved for IDLE task control structures and stacks.1920 */1921 #define CONFIGURE_IDLE_TASKS(_count) \1922 (CONFIGURE_MEMORY_FOR_TASKS(_count, 0) + \1923 _count * _Configure_From_workspace( \1924 (CONFIGURE_IDLE_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)))1925 1926 /**1927 1911 * This calculates the amount of memory reserved for the IDLE tasks. 1928 1912 * In an SMP system, each CPU core has its own idle task. 1929 1913 */ 1930 1914 #if defined(RTEMS_SMP) 1931 #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ 1932 CONFIGURE_IDLE_TASKS(CONFIGURE_SMP_MAXIMUM_PROCESSORS) 1915 #define CONFIGURE_IDLE_TASKS_COUNT CONFIGURE_SMP_MAXIMUM_PROCESSORS 1933 1916 #else 1934 #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ 1935 CONFIGURE_IDLE_TASKS(1) 1917 #define CONFIGURE_IDLE_TASKS_COUNT 1 1936 1918 #endif 1937 1919 1938 1920 /** 1921 * This defines the formula used to compute the amount of memory 1922 * reserved for IDLE task control structures. 1923 */ 1924 #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ 1925 CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_IDLE_TASKS_COUNT, 0) 1926 1927 /** 1939 1928 * This macro accounts for general RTEMS system overhead. 1940 1929 */ 1941 1930 #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ … … 1946 1935 CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ 1947 1936 ) 1948 1937 1949 /*1950 * Now account for any extra memory that initialization tasks or threads1951 * may have requested.1952 */1953 1954 /**1955 * This accounts for any extra memory required by the Classic API1956 * Initialization Task.1957 */1958 #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)1959 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \1960 (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)1961 #else1962 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 01963 #endif1964 1965 /**1966 * This accounts for any extra memory required by the POSIX API1967 * Initialization Thread.1968 */1969 #if defined(RTEMS_POSIX_API) && \1970 (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)1971 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \1972 (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)1973 #else1974 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 01975 #endif1976 1977 /**1978 * This macro provides a summation of the various initialization task1979 * and thread stack requirements.1980 */1981 #define CONFIGURE_INITIALIZATION_THREADS_STACKS \1982 (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \1983 CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART)1984 1985 1938 /** 1986 1939 * This macro provides a summation of the various task and thread 1987 1940 * requirements. … … 2030 1983 #define CONFIGURE_MEMORY_FOR_SMP 0 2031 1984 #endif 2032 1985 2033 #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT)2034 /**2035 * This is a debug mechanism, so if you need to, the executable will2036 * have a structure with various partial values. Add to this as you2037 * need to. Viewing this structure in gdb combined with dumping2038 * the Configuration structures generated should help a lot in tracing2039 * down errors and analyzing where over and under allocations are.2040 */2041 typedef struct {2042 uint32_t SYSTEM_OVERHEAD;2043 uint32_t STATIC_EXTENSIONS;2044 uint32_t INITIALIZATION_THREADS_STACKS;2045 2046 uint32_t PER_INTEGER_TASK;2047 uint32_t FP_OVERHEAD;2048 uint32_t CLASSIC;2049 uint32_t POSIX;2050 2051 /* System overhead pieces */2052 uint32_t INTERRUPT_VECTOR_TABLE;2053 uint32_t INTERRUPT_STACK_MEMORY;2054 uint32_t MEMORY_FOR_IDLE_TASK;2055 uint32_t MEMORY_FOR_SCHEDULER;2056 uint32_t MEMORY_PER_TASK_FOR_SCHEDULER;2057 2058 /* Classic API Pieces */2059 uint32_t CLASSIC_TASKS;2060 uint32_t TASK_VARIABLES;2061 uint32_t TIMERS;2062 uint32_t SEMAPHORES;2063 uint32_t MESSAGE_QUEUES;2064 uint32_t PARTITIONS;2065 uint32_t REGIONS;2066 uint32_t PORTS;2067 uint32_t PERIODS;2068 uint32_t BARRIERS;2069 uint32_t USER_EXTENSIONS;2070 #ifdef RTEMS_POSIX_API2071 /* POSIX API Pieces */2072 uint32_t POSIX_MUTEXES;2073 uint32_t POSIX_CONDITION_VARIABLES;2074 uint32_t POSIX_KEYS;2075 uint32_t POSIX_TIMERS;2076 uint32_t POSIX_QUEUED_SIGNALS;2077 uint32_t POSIX_MESSAGE_QUEUES;2078 uint32_t POSIX_SEMAPHORES;2079 uint32_t POSIX_BARRIERS;2080 uint32_t POSIX_SPINLOCKS;2081 uint32_t POSIX_RWLOCKS;2082 #endif2083 } Configuration_Debug_t;2084 2085 Configuration_Debug_t Configuration_Memory_Debug = {2086 /* General Information */2087 CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD,2088 CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS,2089 CONFIGURE_INITIALIZATION_THREADS_STACKS,2090 CONFIGURE_MEMORY_FOR_TASKS(1, 0),2091 CONFIGURE_MEMORY_FOR_TASKS(0, 1),2092 CONFIGURE_MEMORY_FOR_CLASSIC,2093 CONFIGURE_MEMORY_FOR_POSIX,2094 2095 /* System overhead pieces */2096 CONFIGURE_INTERRUPT_VECTOR_TABLE,2097 CONFIGURE_INTERRUPT_STACK_MEMORY,2098 CONFIGURE_MEMORY_FOR_IDLE_TASK,2099 CONFIGURE_MEMORY_FOR_SCHEDULER,2100 CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER,2101 2102 /* Classic API Pieces */2103 CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0),2104 CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES +2105 CONFIGURE_GOROUTINES_TASK_VARIABLES),2106 CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS),2107 CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES),2108 CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES),2109 CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS),2110 CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ),2111 CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS),2112 CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS),2113 CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS),2114 CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS),2115 2116 #ifdef RTEMS_POSIX_API2117 /* POSIX API Pieces */2118 CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES +2119 CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES),2120 CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(2121 CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +2122 CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES),2123 CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ),2124 CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(2125 CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ),2126 CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(2127 CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ),2128 CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ),2129 CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ),2130 CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ),2131 CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ),2132 CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ),2133 #endif2134 };2135 #endif2136 2137 1986 /** 2138 1987 * This calculates the memory required for the executive workspace. 2139 1988 */ … … 2145 1994 CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \ 2146 1995 CONFIGURE_MEMORY_FOR_CLASSIC + \ 2147 1996 CONFIGURE_MEMORY_FOR_POSIX + \ 2148 (CONFIGURE_MAXIMUM_POSIX_THREADS * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \2149 (CONFIGURE_MAXIMUM_GOROUTINES * CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \2150 CONFIGURE_INITIALIZATION_THREADS_STACKS + \2151 1997 CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ 2152 1998 CONFIGURE_MEMORY_FOR_MP + \ 2153 1999 CONFIGURE_MEMORY_FOR_SMP + \ 2154 2000 CONFIGURE_MESSAGE_BUFFER_MEMORY + \ 2155 (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ 2156 (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ 2001 (CONFIGURE_MEMORY_OVERHEAD * 1024) \ 2157 2002 ) & ~0x7) 2003 2004 /* 2005 * Now account for any extra memory that initialization tasks or threads 2006 * may have requested. 2007 */ 2008 2009 /** 2010 * This accounts for any extra memory required by the Classic API 2011 * Initialization Task. 2012 */ 2013 #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) 2014 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \ 2015 (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) 2016 #else 2017 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0 2018 #endif 2019 2020 /** 2021 * This accounts for any extra memory required by the POSIX API 2022 * Initialization Thread. 2023 */ 2024 #if defined(RTEMS_POSIX_API) && \ 2025 (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \ 2026 CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE) 2027 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ 2028 (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \ 2029 CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE) 2030 #else 2031 #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 2158 2032 #endif 2159 2033 2034 /** 2035 * This macro provides a summation of the various initialization task 2036 * and thread stack requirements. 2037 */ 2038 #define CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \ 2039 (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \ 2040 CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART) 2041 2042 #define CONFIGURE_IDLE_TASKS_STACK \ 2043 (CONFIGURE_IDLE_TASKS_COUNT * \ 2044 _Configure_From_workspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) ) 2045 2046 #define CONFIGURE_TASKS_STACK \ 2047 (_Configure_Max_Objects( CONFIGURE_MAXIMUM_TASKS ) * \ 2048 _Configure_From_workspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) ) 2049 2050 #define CONFIGURE_POSIX_THREADS_STACK \ 2051 (_Configure_Max_Objects( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \ 2052 _Configure_From_workspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) 2053 2054 #define CONFIGURE_GOROUTINES_STACK \ 2055 (_Configure_Max_Objects( CONFIGURE_MAXIMUM_GOROUTINES ) * \ 2056 _Configure_From_workspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) 2057 2058 #define CONFIGURE_ADA_TASKS_STACK \ 2059 (_Configure_Max_Objects( CONFIGURE_MAXIMUM_ADA_TASKS ) * \ 2060 _Configure_From_workspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) 2061 2062 #else /* CONFIGURE_EXECUTIVE_RAM_SIZE */ 2063 2064 #define CONFIGURE_IDLE_TASKS_STACK 0 2065 #define CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0 2066 #define CONFIGURE_TASKS_STACK 0 2067 #define CONFIGURE_POSIX_THREADS_STACK 0 2068 #define CONFIGURE_GOROUTINES_STACK 0 2069 #define CONFIGURE_ADA_TASKS_STACK 0 2070 2071 #if CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK != 0 2072 #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK" 2073 #endif 2074 2075 #if CONFIGURE_EXTRA_TASK_STACKS != 0 2076 #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS" 2077 #endif 2078 2079 #endif /* CONFIGURE_EXECUTIVE_RAM_SIZE */ 2080 2081 #define CONFIGURE_STACK_SPACE_SIZE \ 2082 ( \ 2083 CONFIGURE_IDLE_TASKS_STACK + \ 2084 CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \ 2085 CONFIGURE_TASKS_STACK + \ 2086 CONFIGURE_POSIX_THREADS_STACK + \ 2087 CONFIGURE_GOROUTINES_STACK + \ 2088 CONFIGURE_ADA_TASKS_STACK + \ 2089 CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \ 2090 CONFIGURE_EXTRA_TASK_STACKS \ 2091 ) 2092 2160 2093 #ifdef CONFIGURE_INIT 2161 2094 /** 2162 2095 * This is the Classic API Configuration Table. … … 2230 2163 rtems_configuration_table Configuration = { 2231 2164 NULL, /* filled in by BSP */ 2232 2165 CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ 2166 CONFIGURE_STACK_SPACE_SIZE, /* required stack space */ 2233 2167 CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ 2234 2168 CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ 2235 2169 CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ … … 2318 2252 ****************************************************************** 2319 2253 */ 2320 2254 2255 #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT) 2256 /** 2257 * This is a debug mechanism, so if you need to, the executable will 2258 * have a structure with various partial values. Add to this as you 2259 * need to. Viewing this structure in gdb combined with dumping 2260 * the Configuration structures generated should help a lot in tracing 2261 * down errors and analyzing where over and under allocations are. 2262 */ 2263 typedef struct { 2264 uint32_t SYSTEM_OVERHEAD; 2265 uint32_t STATIC_EXTENSIONS; 2266 uint32_t INITIALIZATION_THREADS_STACKS; 2267 2268 uint32_t PER_INTEGER_TASK; 2269 uint32_t FP_OVERHEAD; 2270 uint32_t CLASSIC; 2271 uint32_t POSIX; 2272 2273 /* System overhead pieces */ 2274 uint32_t INTERRUPT_VECTOR_TABLE; 2275 uint32_t INTERRUPT_STACK_MEMORY; 2276 uint32_t MEMORY_FOR_IDLE_TASK; 2277 uint32_t MEMORY_FOR_SCHEDULER; 2278 uint32_t MEMORY_PER_TASK_FOR_SCHEDULER; 2279 2280 /* Classic API Pieces */ 2281 uint32_t CLASSIC_TASKS; 2282 uint32_t TASK_VARIABLES; 2283 uint32_t TIMERS; 2284 uint32_t SEMAPHORES; 2285 uint32_t MESSAGE_QUEUES; 2286 uint32_t PARTITIONS; 2287 uint32_t REGIONS; 2288 uint32_t PORTS; 2289 uint32_t PERIODS; 2290 uint32_t BARRIERS; 2291 uint32_t USER_EXTENSIONS; 2292 2293 #ifdef RTEMS_POSIX_API 2294 /* POSIX API Pieces */ 2295 uint32_t POSIX_MUTEXES; 2296 uint32_t POSIX_CONDITION_VARIABLES; 2297 uint32_t POSIX_KEYS; 2298 uint32_t POSIX_TIMERS; 2299 uint32_t POSIX_QUEUED_SIGNALS; 2300 uint32_t POSIX_MESSAGE_QUEUES; 2301 uint32_t POSIX_SEMAPHORES; 2302 uint32_t POSIX_BARRIERS; 2303 uint32_t POSIX_SPINLOCKS; 2304 uint32_t POSIX_RWLOCKS; 2305 #endif 2306 2307 /* Stack space sizes */ 2308 uint32_t IDLE_TASKS_STACK; 2309 uint32_t INITIALIZATION_THREADS_EXTRA_STACKS; 2310 uint32_t TASKS_STACK; 2311 uint32_t POSIX_THREADS_STACK; 2312 uint32_t GOROUTINES_STACK; 2313 uint32_t ADA_TASKS_STACK; 2314 uint32_t EXTRA_MPCI_RECEIVE_SERVER_STACK; 2315 uint32_t EXTRA_TASK_STACKS; 2316 } Configuration_Debug_t; 2317 2318 Configuration_Debug_t Configuration_Memory_Debug = { 2319 /* General Information */ 2320 CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD, 2321 CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS, 2322 CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS, 2323 CONFIGURE_MEMORY_FOR_TASKS(1, 0), 2324 CONFIGURE_MEMORY_FOR_TASKS(0, 1), 2325 CONFIGURE_MEMORY_FOR_CLASSIC, 2326 CONFIGURE_MEMORY_FOR_POSIX, 2327 2328 /* System overhead pieces */ 2329 CONFIGURE_INTERRUPT_VECTOR_TABLE, 2330 CONFIGURE_INTERRUPT_STACK_MEMORY, 2331 CONFIGURE_MEMORY_FOR_IDLE_TASK, 2332 CONFIGURE_MEMORY_FOR_SCHEDULER, 2333 CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER, 2334 2335 /* Classic API Pieces */ 2336 CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), 2337 CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES + 2338 CONFIGURE_GOROUTINES_TASK_VARIABLES), 2339 CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), 2340 CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES), 2341 CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES), 2342 CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS), 2343 CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ), 2344 CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS), 2345 CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS), 2346 CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS), 2347 CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS), 2348 2349 #ifdef RTEMS_POSIX_API 2350 /* POSIX API Pieces */ 2351 CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + 2352 CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES), 2353 CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( 2354 CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + 2355 CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES), 2356 CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ), 2357 CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( 2358 CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), 2359 CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( 2360 CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), 2361 CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), 2362 CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), 2363 CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ), 2364 CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), 2365 CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), 2366 #endif 2367 2368 /* Stack space sizes */ 2369 CONFIGURE_IDLE_TASKS_STACK, 2370 CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS, 2371 CONFIGURE_TASKS_STACK, 2372 CONFIGURE_POSIX_THREADS_STACK, 2373 CONFIGURE_GOROUTINES_STACK, 2374 CONFIGURE_ADA_TASKS_STACK, 2375 CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, 2376 CONFIGURE_EXTRA_TASK_STACKS 2377 }; 2378 #endif 2379 2321 2380 /* 2322 2381 * Make sure a task/thread of some sort is configured. 2323 2382 * -
cpukit/score/src/wkspace.c
RCS file: /usr1/CVS/rtems/cpukit/score/src/wkspace.c,v retrieving revision 1.35 diff -u -r1.35 wkspace.c
33 33 void _Workspace_Handler_initialization(void) 34 34 { 35 35 uintptr_t memory_available = 0; 36 void *starting_address = Configuration.work_space_start;37 uintptr_t size = Configuration.work_space_size;36 void *starting_address = rtems_configuration_get_work_space_start(); 37 uintptr_t size = rtems_configuration_get_work_space_size(); 38 38 39 if ( Configuration.do_zero_of_workspace)39 if ( rtems_configuration_get_do_zero_of_workspace() ) 40 40 memset( starting_address, 0, size ); 41 41 42 42 memory_available = _Heap_Initialize( -
c/src/lib/libbsp/shared/bootcard.c
RCS file: /usr1/CVS/rtems/c/src/lib/libbsp/shared/bootcard.c,v retrieving revision 1.52 diff -u -r1.52 bootcard.c
121 121 void *heap_start = NULL; 122 122 uintptr_t heap_size = 0; 123 123 uintptr_t sbrk_amount = 0; 124 uint32_t status; 124 uintptr_t work_space_size = 0; 125 uint32_t status = 0; 125 126 126 127 /* 127 128 * Special case for PowerPC: The interrupt disable mask is stored in SPRG0. … … 158 159 */ 159 160 if ( rtems_malloc_sbrk_helpers ) { 160 161 sbrk_amount = bsp_sbrk_init(work_area_start, &work_area_size); 161 if ( work_area_size < Configuration.work_space_size && sbrk_amount > 0 ) { 162 work_space_size = rtems_configuration_get_work_space_size(); 163 if ( work_area_size < work_space_size && sbrk_amount > 0 ) { 162 164 /* Need to use sbrk right now */ 163 165 uintptr_t sbrk_now; 164 166 165 sbrk_now = ( Configuration.work_space_size - work_area_size) / sbrk_amount;167 sbrk_now = (work_space_size - work_area_size) / sbrk_amount; 166 168 sbrk( sbrk_now * sbrk_amount ); 167 169 } 168 170 } … … 171 173 printk("Configuration error!\n" 172 174 "Application was configured with CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK\n" 173 175 "but BSP was configured w/o sbrk support\n"); 174 bsp_cleanup(1); 175 return 1; 176 status = 1; 177 bsp_cleanup( status ); 178 return status; 176 179 } 177 180 #endif 178 181 … … 185 188 * 186 189 * NOTE: Use cast to (void *) and %p since these are uintptr_t types. 187 190 */ 188 if ( work_area_size <= Configuration.work_space_size ) { 191 work_space_size = rtems_configuration_get_work_space_size(); 192 if ( work_area_size <= work_space_size ) { 189 193 printk( 190 "bootcard: work space too big for work area: %p > %p\n",191 (void *) Configuration.work_space_size,194 "bootcard: work space too big for work area: %p >= %p\n", 195 (void *) work_space_size, 192 196 (void *) work_area_size 193 197 ); 194 bsp_cleanup(1); 195 return 1; 198 status = 1; 199 bsp_cleanup( status ); 200 return status; 196 201 } 197 202 198 203 if ( rtems_unified_work_area ) { 199 Configuration.work_space_start = work_area_start;200 Configuration.work_space_size = work_area_size;204 rtems_configuration_set_work_space_start( work_area_start ); 205 rtems_configuration_set_work_space_size( work_area_size ); 201 206 } else { 202 Configuration.work_space_start = work_area_start;207 rtems_configuration_set_work_space_start( work_area_start ); 203 208 } 204 209 205 210 #if (BSP_DIRTY_MEMORY == 1) -
testsuites/sptests/spfatal08/testcase.h
RCS file: /usr1/CVS/rtems/testsuites/sptests/spfatal08/testcase.h,v retrieving revision 1.6 diff -u -r1.6 testcase.h
41 41 42 42 void force_error() 43 43 { 44 Configuration.work_space_start = Workspace;45 Configuration.work_space_size = 256;44 rtems_configuration_set_work_space_start( Workspace ); 45 rtems_configuration_set_work_space_size( sizeof(Workspace) ); 46 46 47 47 rtems_initialize_data_structures();; 48 48 /* we will not run this far */ -
testsuites/sptests/spfatal12/testcase.h
RCS file: /usr1/CVS/rtems/testsuites/sptests/spfatal12/testcase.h,v retrieving revision 1.1 diff -u -r1.1 testcase.h
19 19 20 20 void force_error() 21 21 { 22 Configuration.work_space_size = sizeof(void *);22 rtems_configuration_set_work_space_size( sizeof(void *) ); 23 23 rtems_initialize_data_structures(); 24 24 25 25 /* we will not run this far */