summaryrefslogtreecommitdiffstats
path: root/c_user/configuring_a_system.rst
blob: 9c36b2dee6f006bce0f205b32168ce22edfcc5df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
.. comment SPDX-License-Identifier: CC-BY-SA-4.0

.. COMMENT: COPYRIGHT (c) 1988-2008.
.. COMMENT: On-Line Applications Research Corporation (OAR).
.. COMMENT: All rights reserved.

.. _Configuring a System:

Configuring a System
####################

.. index:: configuring a system

Introduction
============

RTEMS must be configured for an application.  This configuration encompasses a
variety of information including the length of each clock tick, the maximum
number of each information RTEMS object that can be created, the application
initialization tasks, the task scheduling algorithm to be used, and the device
drivers in the application.

Although this information is contained in data structures that are used by
RTEMS at system initialization time, the data structures themselves should only
rarely to be generated by hand. RTEMS provides a set of macros system which
provides a simple standard mechanism to automate the generation of these
structures.

.. index:: confdefs.h
.. index:: confdefs.h
.. index:: <rtems/confdefs.h>
.. index:: <rtems/confdefs.h>

The RTEMS header file ``<rtems/confdefs.h>`` is at the core of the automatic
generation of system configuration. It is based on the idea of setting macros
which define configuration parameters of interest to the application and
defaulting or calculating all others. This variety of macros can automatically
produce all of the configuration data required for an RTEMS application.

.. sidebar: Trivia:

  The term ``confdefs`` is shorthand for a *Configuration Defaults*.

As a general rule, application developers only specify values for the
configuration parameters of interest to them. They define what resources or
features they require. In most cases, when a parameter is not specified, it
defaults to zero (0) instances, a standards compliant value, or disabled as
appropriate. For example, by default there will be 256 task priority levels but
this can be lowered by the application. This number of priority levels is
required to be compliant with the RTEID/ORKID standards upon which the Classic
API is based. There are similar cases where the default is selected to be
compliant with with the POSIX standard.

For each configuration parameter in the configuration tables, the macro
corresponding to that field is discussed. The RTEMS Maintainers expect that all
systems can be easily configured using the ``<rtems/confdefs.h>`` mechanism and
that using this mechanism will avoid internal RTEMS configuration changes
impacting applications.

.. COMMENT: === Philosophy ===

Default Value Selection Philosophy
==================================

The user should be aware that the defaults are intentionally set as low as
possible.  By default, no application resources are configured.  The
``<rtems/confdefs.h>`` file ensures that at least one application task or
thread is configured and that at least one of the initialization task/thread
tables is configured.

.. COMMENT: === Sizing the RTEMS Workspace ===

.. _Sizing the RTEMS Workspace:

Sizing the RTEMS Workspace
==========================

The RTEMS Workspace is a user-specified block of memory reserved for use by
RTEMS.  The application should NOT modify this memory.  This area consists
primarily of the RTEMS data structures whose exact size depends upon the values
specified in the Configuration Table.  In addition, task stacks and floating
point context areas are dynamically allocated from the RTEMS Workspace.

The ``<rtems/confdefs.h>`` mechanism calculates the size of the RTEMS Workspace
automatically.  It assumes that all tasks are floating point and that all will
be allocated the minimum stack space.  This calculation includes the amount of
memory that will be allocated for internal use by RTEMS. The automatic
calculation may underestimate the workspace size truly needed by the
application, in which case one can use the ``CONFIGURE_MEMORY_OVERHEAD`` macro
to add a value to the estimate. See :ref:`Specify Memory Overhead` for more
details.

The memory area for the RTEMS Workspace is determined by the BSP.  In case the
RTEMS Workspace is too large for the available memory, then a fatal run-time
error occurs and the system terminates.

The file ``<rtems/confdefs.h>`` will calculate the value of the
``work_space_size`` parameter of the Configuration Table. There are many
parameters the application developer can specify to help ``<rtems/confdefs.h>``
in its calculations.  Correctly specifying the application requirements via
parameters such as ``CONFIGURE_EXTRA_TASK_STACKS`` and
``CONFIGURE_MAXIMUM_TASKS`` is critical for production software.

For each class of objects, the allocation can operate in one of two ways.  The
default way has an ceiling on the maximum number of object instances which can
concurrently exist in the system. Memory for all instances of that object class
is reserved at system initialization.  The second way allocates memory for an
initial number of objects and increases the current allocation by a fixed
increment when required. Both ways allocate space from inside the RTEMS
Workspace.

See :ref:`Unlimited Objects` for more details about the second way, which
allows for dynamic allocation of objects and therefore does not provide
determinism.  This mode is useful mostly for when the number of objects cannot
be determined ahead of time or when porting software for which you do not know
the object requirements.

The space needed for stacks and for RTEMS objects will vary from one version of
RTEMS and from one target processor to another.  Therefore it is safest to use
``<rtems/confdefs.h>`` and specify your application's requirements in terms of
the numbers of objects and multiples of ``RTEMS_MINIMUM_STACK_SIZE``, as far as
is possible. The automatic estimates of space required will in general change
when:

- a configuration parameter is changed,

- task or interrupt stack sizes change,

- the floating point attribute of a task changes,

- task floating point attribute is altered,

- RTEMS is upgraded, or

- the target processor is changed.

Failure to provide enough space in the RTEMS Workspace may result in fatal
run-time errors terminating the system.

.. COMMENT: === Potential Issues ===

Potential Issues with RTEMS Workspace Size Estimation
=====================================================

The ``<rtems/confdefs.h>`` file estimates the amount of memory required for the
RTEMS Workspace.  This estimate is only as accurate as the information given to
``<rtems/confdefs.h>`` and may be either too high or too low for a variety of
reasons.  Some of the reasons that ``<rtems/confdefs.h>`` may reserve too much
memory for RTEMS are:

- All tasks/threads are assumed to be floating point.

Conversely, there are many more reasons that the resource estimate could be too
low:

- Task/thread stacks greater than minimum size must be accounted for explicitly
  by developer.

- Memory for messages is not included.

- Device driver requirements are not included.

- Network stack requirements are not included.

- Requirements for add-on libraries are not included.

In general, ``<rtems/confdefs.h>`` is very accurate when given enough
information.  However, it is quite easy to use a library and forget to account
for its resources.

.. COMMENT: === Format to be followed for making changes in this file ===

Format to be followed for making changes in this file
=====================================================

*MACRO NAME:*:
  Should be alphanumeric. Can have '_' (underscore).

*DATA TYPE:*
  Please refer to all existing formats.

*RANGE:*
  The range depends on the Data Type of the macro.

  - If the data type is of type task priority, then its value should be an
    integer in the range of 1 to 255.

  - If the data type is an integer, then it can have numbers, characters (in
    case the value is defined using another macro) and arithmetic operations
    (+, -, \*, /).

  - If the data type is a function pointer the first character should be an
    alphabet or an underscore. The rest of the string can be alphanumeric.

  - If the data type is RTEMS Attributes or RTEMS Mode then the string should
    be alphanumeric.

  - If the data type is RTEMS NAME then the value should be an integer>=0 or
    RTEMS_BUILD_NAME( 'U', 'I', '1', ' ' )

*DEFAULT VALUE:*
  The default value should be in the following formats- Please note that the
  '.' (full stop) is necessary.

  - In case the value is not defined then: This is not defined by default.

  - If we know the default value then: The default value is XXX.

  - If the default value is BSP Specific then: This option is BSP specific.

*DESCRIPTION:*
  The description of the macro. (No specific format)

*NOTES:*
  Any further notes. (No specific format)

.. COMMENT: === Configuration Example ===

Configuration Example
=====================

In the following example, the configuration information for a system with a
single message queue, four (4) tasks, and a timeslice of fifty (50)
milliseconds is as follows:

.. code-block:: c

    #include <bsp.h>
    #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    #define CONFIGURE_MICROSECONDS_PER_TICK   1000 /* 1 millisecond */
    #define CONFIGURE_TICKS_PER_TIMESLICE       50 /* 50 milliseconds */
    #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    #define CONFIGURE_MAXIMUM_TASKS 4
    #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
    #define CONFIGURE_MESSAGE_BUFFER_MEMORY \
               CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(20, sizeof(struct USER_MESSAGE))
    #define CONFIGURE_INIT
    #include <rtems/confdefs.h>

In this example, only a few configuration parameters are specified. The impact
of these are as follows:

- The example specified ``CONFIGURE_RTEMS_INIT_TASK_TABLE`` but did not specify
  any additional parameters. This results in a configuration of an application
  which will begin execution of a single initialization task named ``Init``
  which is non-preemptible and at priority one (1).

- By specifying ``CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER``, this application
  is configured to have a clock tick device driver. Without a clock tick device
  driver, RTEMS has no way to know that time is passing and will be unable to
  support delays and wall time. Further configuration details about time are
  provided. Per ``CONFIGURE_MICROSECONDS_PER_TICK`` and
  ``CONFIGURE_TICKS_PER_TIMESLICE``, the user specified they wanted a clock
  tick to occur each millisecond, and that the length of a timeslice would be
  fifty (50) milliseconds.

- By specifying ``CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER``, the application
  will include a console device driver. Although the console device driver may
  support a combination of multiple serial ports and display and keyboard
  combinations, it is only required to provide a single device named
  ``/dev/console``. This device will be used for Standard Input, Output and
  Error I/O Streams. Thus when ``CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER``
  is specified, implicitly three (3) file descriptors are reserved for the
  Standard I/O Streams and those file descriptors are associated with
  ``/dev/console`` during initialization. All console devices are expected to
  support the POSIX*termios* interface.

- The example above specifies via ``CONFIGURE_MAXIMUM_TASKS`` that the
  application requires a maximum of four (4) simultaneously existing Classic
  API tasks. Similarly, by specifying ``CONFIGURE_MAXIMUM_MESSAGE_QUEUES``,
  there may be a maximum of only one (1) concurrently existent Classic API
  message queues.

- The most surprising configuration parameter in this example is the use of
  ``CONFIGURE_MESSAGE_BUFFER_MEMORY``. Message buffer memory is allocated from
  the RTEMS Workspace and must be accounted for. In this example, the single
  message queue will have up to twenty (20) messages of type ``struct
  USER_MESSAGE``.

- The ``CONFIGURE_INIT`` constant must be defined in order to make
  ``<rtems/confdefs.h>`` instantiate the configuration data structures.  This
  can only be defined in one source file per application that includes
  ``<rtems/confdefs.h>`` or the symbol table will be instantiated multiple
  times and linking errors produced.

This example illustrates that parameters have default values. Among other
things, the application implicitly used the following defaults:

- All unspecified types of communications and synchronization objects in the
  Classic and POSIX Threads API have maximums of zero (0).

- The filesystem will be the default filesystem which is the In-Memory File
  System (IMFS).

- The application will have the default number of priority levels.

- The minimum task stack size will be that recommended by RTEMS for the target
  architecture.

.. COMMENT: === Unlimited Objects ===

.. _Unlimited Objects:

Unlimited Objects
-----------------

In real-time embedded systems the RAM is normally a limited, critical resource
and dynamic allocation is avoided as much as possible to ensure predictable,
deterministic execution times. For such cases, see :ref:`Sizing the RTEMS
Workspace` for an overview of how to tune the size of the workspace.
Frequently when users are porting software to RTEMS the precise resource
requirements of the software is unknown. In these situations users do not need
to control the size of the workspace very tightly because they just want to get
the new software to run; later they can tune the workspace size as needed.

The following API-independent object classes can be configured in unlimited
mode:

- POSIX Keys

- POSIX Key Value Pairs

The following object classes in the Classic API can be configured in unlimited
mode:

- Tasks

- Timers

- Semaphores

- Message Queues

- Periods

- Barriers

- Partitions

- Regions

- Ports

Additionally, the following object classes from the POSIX API can be configured
in unlimited mode:

- Threads

- Mutexes

- Condition Variables

- Timers

- Message Queues

- Message Queue Descriptors

- Semaphores

- Barriers

- Read/Write Locks

- Spinlocks

The following object classes can *not* be configured in unlimited mode:

- Drivers

- File Descriptors

- User Extensions

- POSIX Queued Signals

Due to the memory requirements of unlimited objects it is strongly recommended
to use them only in combination with the unified work areas. See :ref:`Separate
or Unified Work Areas` for more information on unified work areas.

The following example demonstrates how the two simple configuration defines for
unlimited objects and unified works areas can replace many seperate
configuration defines for supported object classes:

.. code-block:: c

    #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    #define CONFIGURE_UNIFIED_WORK_AREAS
    #define CONFIGURE_UNLIMITED_OBJECTS
    #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    #define CONFIGURE_INIT
    #include <rtems/confdefs.h>

Users are cautioned that using unlimited objects is not recommended for
production software unless the dynamic growth is absolutely required. It is
generally considered a safer embedded systems programming practice to know the
system limits rather than experience an out of memory error at an arbitrary and
largely unpredictable time in the field.

.. COMMENT: === Per Object Class Unlimited Object Instances ===

.. _Per Object Class Unlimited Object Instances:

Per Object Class Unlimited Object Instances
-------------------------------------------
.. index:: rtems_resource_unlimited

When the number of objects is not known ahead of time, RTEMS provides an
auto-extending mode that can be enabled individually for each object type by
using the macro ``rtems_resource_unlimited``. This takes a value as a
parameter, and is used to set the object maximum number field in an API
Configuration table. The value is an allocation unit size. When RTEMS is
required to grow the object table it is grown by this size. The kernel will
return the object memory back to the RTEMS Workspace when an object is
destroyed. The kernel will only return an allocated block of objects to the
RTEMS Workspace if at least half the allocation size of free objects remain
allocated. RTEMS always keeps one allocation block of objects allocated. Here
is an example of using ``rtems_resource_unlimited``:

.. code-block:: c

    #define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(5)

.. index:: rtems_resource_is_unlimited
.. index:: rtems_resource_maximum_per_allocation

Object maximum specifications can be evaluated with the
``rtems_resource_is_unlimited`` and``rtems_resource_maximum_per_allocation``
macros.

.. COMMENT: === Unlimited Object Instances ===

.. _Unlimited Object Instances:

Unlimited Object Instances
--------------------------

To ease the burden of developers who are porting new software RTEMS also
provides the capability to make all object classes listed above operate in
unlimited mode in a simple manner. The application developer is only
responsible for enabling unlimited objects and specifying the allocation size.

.. COMMENT: === CONFIGURE_UNLIMITED_OBJECTS ===

.. _Enable Unlimited Object Instances:

Enable Unlimited Object Instances
---------------------------------
.. index:: CONFIGURE_UNLIMITED_OBJECTS

*CONSTANT:*
    ``CONFIGURE_UNLIMITED_OBJECTS``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_UNLIMITED_OBJECTS`` enables ``rtems_resource_unlimited`` mode for
Classic API and POSIX API objects that do not already have a specific maximum
limit defined.

**NOTES:**

When using unlimited objects, it is common practice to also specify
``CONFIGURE_UNIFIED_WORK_AREAS`` so the system operates with a single pool of
memory for both RTEMS and application memory allocations.

.. COMMENT: === CONFIGURE_UNLIMITED_ALLOCATION_SIZE ===

.. _Specify Unlimited Objects Allocation Size:

Specify Unlimited Objects Allocation Size
-----------------------------------------

*CONSTANT:*
    ``CONFIGURE_UNLIMITED_ALLOCATION_SIZE``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:* If not defined and ``CONFIGURE_UNLIMITED_OBJECTS`` is defined,
    the default value is eight (8).

**DESCRIPTION:**

``CONFIGURE_UNLIMITED_ALLOCATION_SIZE`` provides an allocation size to use for
``rtems_resource_unlimited`` when using ``CONFIGURE_UNLIMITED_OBJECTS``.

**NOTES:**

By allowing users to declare all resources as being unlimited the user can
avoid identifying and limiting the resources
used. ``CONFIGURE_UNLIMITED_OBJECTS`` does not support varying the allocation
sizes for different objects; users who want that much control can define the
``rtems_resource_unlimited`` macros themselves.

.. code-block:: c

    #define CONFIGURE_UNLIMITED_OBJECTS
    #define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 5

.. COMMENT: === Classic API Configuration ===

Classic API Configuration
=========================

This section defines the Classic API related system configuration parameters
supported by ``<rtems/confdefs.h>``.

.. COMMENT: === CONFIGURE_MAXIMUM_TASKS ===

.. _Specify Maximum Classic API Tasks:

Specify Maximum Classic API Tasks
---------------------------------
.. index:: CONFIGURE_MAXIMUM_TASKS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_TASKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_TASKS`` is the maximum number of Classic API Tasks that can
be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

The calculations for the required memory in the RTEMS Workspace for tasks
assume that each task has a minimum stack size and has floating point support
enabled.  The configuration parameter ``CONFIGURE_EXTRA_TASK_STACKS`` is used
to specify task stack requirements *ABOVE* the minimum size required.  See
:ref:`Reserve Task/Thread Stack Memory Above Minimum` for more information
about ``CONFIGURE_EXTRA_TASK_STACKS``.

The maximum number of POSIX threads is specified by
``CONFIGURE_MAXIMUM_POSIX_THREADS``.

.. COMMENT: XXX - Add xref to CONFIGURE_MAXIMUM_POSIX_THREADS.

A future enhancement to ``<rtems/confdefs.h>`` could be to eliminate the
assumption that all tasks have floating point enabled. This would require the
addition of a new configuration parameter to specify the number of tasks which
enable floating point support.

.. COMMENT: === CONFIGURE_MAXIMUM_TIMERS ===

.. _Specify Maximum Classic API Timers:

Specify Maximum Classic API Timers
----------------------------------
.. index:: CONFIGURE_MAXIMUM_TIMERS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_TIMERS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_TIMERS`` is the maximum number of Classic API Timers that
can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_SEMAPHORES ===

.. _Specify Maximum Classic API Semaphores:

Specify Maximum Classic API Semaphores
--------------------------------------
.. index:: CONFIGURE_MAXIMUM_SEMAPHORES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_SEMAPHORES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_SEMAPHORES`` is the maximum number of Classic API
Semaphores that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_MRSP_SEMAPHORES ===

.. _Specify Maximum Classic API Semaphores usable with MrsP:

Specify Maximum Classic API Semaphores usable with MrsP
-------------------------------------------------------
.. index:: CONFIGURE_MAXIMUM_MRSP_SEMAPHORES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_MRSP_SEMAPHORES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_MRSP_SEMAPHORES`` is the maximum number of Classic API
Semaphores using the Multiprocessor Resource Sharing Protocol (MrsP) that can
be concurrently active.

**NOTES:**

This configuration option is only used on SMP configurations.  On uni-processor
configurations the Priority Ceiling Protocol is used for MrsP semaphores and
thus no extra memory is necessary.

.. COMMENT: === CONFIGURE_MAXIMUM_MESSAGE_QUEUES ===

.. _Specify Maximum Classic API Message Queues:

Specify Maximum Classic API Message Queues
------------------------------------------
.. index:: CONFIGURE_MAXIMUM_MESSAGE_QUEUES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_MESSAGE_QUEUES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_MESSAGE_QUEUES`` is the maximum number of Classic API
Message Queues that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_BARRIERS ===

.. _Specify Maximum Classic API Barriers:

Specify Maximum Classic API Barriers
------------------------------------
.. index:: CONFIGURE_MAXIMUM_BARRIERS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_BARRIERS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_BARRIERS`` is the maximum number of Classic API Barriers
that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_PERIODS ===

.. _Specify Maximum Classic API Periods:

Specify Maximum Classic API Periods
-----------------------------------
.. index:: CONFIGURE_MAXIMUM_PERIODS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_PERIODS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_PERIODS`` is the maximum number of Classic API Periods that
can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_PARTITIONS ===

.. _Specify Maximum Classic API Partitions:

Specify Maximum Classic API Partitions
--------------------------------------
.. index:: CONFIGURE_MAXIMUM_PARTITIONS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_PARTITIONS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_PARTITIONS`` is the maximum number of Classic API
Partitions that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_REGIONS ===

.. _Specify Maximum Classic API Regions:

Specify Maximum Classic API Regions
-----------------------------------
.. index:: CONFIGURE_MAXIMUM_REGIONS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_REGIONS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_REGIONS`` is the maximum number of Classic API Regions that
can be concurrently active.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_MAXIMUM_PORTS ===

.. _Specify Maximum Classic API Ports:

Specify Maximum Classic API Ports
---------------------------------
.. index:: CONFIGURE_MAXIMUM_PORTS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_PORTS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_PORTS`` is the maximum number of Classic API Ports that can
be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_USER_EXTENSIONS ===

.. _Specify Maximum Classic API User Extensions:

Specify Maximum Classic API User Extensions
-------------------------------------------
.. index:: CONFIGURE_MAXIMUM_USER_EXTENSIONS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_USER_EXTENSIONS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_USER_EXTENSIONS`` is the maximum number of Classic API User
Extensions that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === Classic API Initialization Task Configuration ===

Classic API Initialization Tasks Table Configuration
====================================================

The ``<rtems/confdefs.h>`` configuration system can automatically generate an
Initialization Tasks Table named ``Initialization_tasks`` with a single entry.
The following parameters control the generation of that table.

.. COMMENT: === CONFIGURE_RTEMS_INIT_TASKS_TABLE ===

.. _Instantiate Classic API Initialization Task Table:

Instantiate Classic API Initialization Task Table
-------------------------------------------------
.. index:: CONFIGURE_RTEMS_INIT_TASKS_TABLE

*CONSTANT:*
    ``CONFIGURE_RTEMS_INIT_TASKS_TABLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_RTEMS_INIT_TASKS_TABLE`` is defined if the user wishes to use a
Classic RTEMS API Initialization Task Table. The table built by
``<rtems/confdefs.h>`` specifies the parameters for a single task. This is
sufficient for applications which initialization the system from a single task.

By default, this field is not defined as the user MUST select their own API for
initialization tasks.

**NOTES:**

The application may choose to use the initialization tasks or threads table
from another API.

A compile time error will be generated if the user does not configure any
initialization tasks or threads.

.. COMMENT: === CONFIGURE_INIT_TASK_ENTRY_POINT ===

.. _Specifying Classic API Initialization Task Entry Point:

Specifying Classic API Initialization Task Entry Point
------------------------------------------------------
.. index:: CONFIGURE_INIT_TASK_ENTRY_POINT

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_ENTRY_POINT``

*DATA TYPE:*
    Task entry function pointer (``rtems_task_entry``).

*RANGE:*
    Valid task entry function pointer.

*DEFAULT VALUE:*
    The default value is ``Init``.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_ENTRY_POINT`` is the entry point (a.k.a. function name)
of the single initialization task defined by the Classic API Initialization
Tasks Table.

**NOTES:**

The user must implement the function ``Init`` or the function name provided in
this configuration parameter.

.. COMMENT: === CONFIGURE_INIT_TASK_NAME ===

.. _Specifying Classic API Initialization Task Name:

Specifying Classic API Initialization Task Name
-----------------------------------------------
.. index:: CONFIGURE_INIT_TASK_NAME

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_NAME``

*DATA TYPE:*
    RTEMS Name (``rtems_name``).

*RANGE:*
    Any value.

*DEFAULT VALUE:*
    The default value is ``rtems_build_name( 'U', 'I', '1', ' ' )``.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_NAME`` is the name of the single initialization task
defined by the Classic API Initialization Tasks Table.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_INIT_TASK_STACK_SIZE ===

.. _Specifying Classic API Initialization Task Stack Size:

Specifying Classic API Initialization Task Stack Size
-----------------------------------------------------
.. index:: CONFIGURE_INIT_TASK_STACK_SIZE

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is RTEMS_MINIMUM_STACK_SIZE.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_STACK_SIZE`` is the stack size of the single
initialization task defined by the Classic API Initialization Tasks Table.

**NOTES:**

If the stack size specified is greater than the configured minimum, it must be
accounted for in ``CONFIGURE_EXTRA_TASK_STACKS``.  See :ref:`Reserve
Task/Thread Stack Memory Above Minimum` for more information about
``CONFIGURE_EXTRA_TASK_STACKS``.

.. COMMENT: === CONFIGURE_INIT_TASK_PRIORITY ===

.. _Specifying Classic API Initialization Task Priority:

Specifying Classic API Initialization Task Priority
---------------------------------------------------
.. index:: CONFIGURE_INIT_TASK_PRIORITY

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_PRIORITY``

*DATA TYPE:*
    RTEMS Task Priority (``rtems_task_priority``).

*RANGE:*
    One (1) to CONFIGURE_MAXIMUM_PRIORITY.

*DEFAULT VALUE:*
    The default value is 1, which is the highest priority in the
    Classic API.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_PRIORITY`` is the initial priority of the single
initialization task defined by the Classic API Initialization Tasks Table.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_INIT_TASK_ATTRIBUTES ===

.. _Specifying Classic API Initialization Task Attributes:

Specifying Classic API Initialization Task Attributes
-----------------------------------------------------
.. index:: CONFIGURE_INIT_TASK_ATTRIBUTES

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_ATTRIBUTES``

*DATA TYPE:*
    RTEMS Attributes (``rtems_attribute``).

*RANGE:*
    Valid task attribute sets.

*DEFAULT VALUE:*
    The default value is ``RTEMS_DEFAULT_ATTRIBUTES``.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_ATTRIBUTES`` is the task attributes of the single
initialization task defined by the Classic API Initialization Tasks Table.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_INIT_TASK_INITIAL_MODES ===

.. _Specifying Classic API Initialization Task Modes:

Specifying Classic API Initialization Task Modes
------------------------------------------------
.. index:: CONFIGURE_INIT_TASK_INITIAL_MODES

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_INITIAL_MODES``

*DATA TYPE:*
    RTEMS Mode (``rtems_mode``).

*RANGE:*
    Valid task mode sets.

*DEFAULT VALUE:*
    The default value is ``RTEMS_NO_PREEMPT``.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_INITIAL_MODES`` is the initial execution mode of the
single initialization task defined by the Classic API Initialization Tasks
Table.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_INIT_TASK_ARGUMENTS ===

.. _Specifying Classic API Initialization Task Arguments:

Specifying Classic API Initialization Task Arguments
----------------------------------------------------
.. index:: CONFIGURE_INIT_TASK_ARGUMENTS

*CONSTANT:*
    ``CONFIGURE_INIT_TASK_ARGUMENTS``

*DATA TYPE:*
    RTEMS Task Argument (``rtems_task_argument``).

*RANGE:*
    Complete range of the type.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_INIT_TASK_ARGUMENTS`` is the task argument of the single
initialization task defined by the Classic API Initialization Tasks Table.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_HAS_OWN_INIT_TASK_TABLE ===

.. _Not Using Generated Initialization Tasks Table:

Not Using Generated Initialization Tasks Table
----------------------------------------------
.. index:: CONFIGURE_HAS_OWN_INIT_TASK_TABLE

*CONSTANT:*
    ``CONFIGURE_HAS_OWN_INIT_TASK_TABLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_HAS_OWN_INIT_TASK_TABLE`` is defined if the user wishes to define
their own Classic API Initialization Tasks Table.  This table should be named
``Initialization_tasks``.

**NOTES:**

This is a seldom used configuration parameter. The most likely use case is when
an application desires to have more than one initialization task.

.. COMMENT: === POSIX API Configuration ===

POSIX API Configuration
=======================

The parameters in this section are used to configure resources for the RTEMS
POSIX API.  They are only relevant if the POSIX API is enabled at configure
time using the ``--enable-posix`` option.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_THREADS ===

.. _Specify Maximum POSIX API Threads:

Specify Maximum POSIX API Threads
---------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_THREADS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_THREADS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_THREADS`` is the maximum number of POSIX API
Threads that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

This calculations for the required memory in the RTEMS Workspace for threads
assume that each thread has a minimum stack size and has floating point support
enabled.  The configuration parameter ``CONFIGURE_EXTRA_TASK_STACKS`` is used
to specify thread stack requirements *ABOVE* the minimum size required.  See
:ref:`Reserve Task/Thread Stack Memory Above Minimum` for more information
about ``CONFIGURE_EXTRA_TASK_STACKS``.

The maximum number of Classic API Tasks is specified by
``CONFIGURE_MAXIMUM_TASKS``.

All POSIX threads have floating point enabled.

.. COMMENT: XXX - Add xref to CONFIGURE_MAXIMUM_TASKS.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_MUTEXES ===

.. _Specify Maximum POSIX API Mutexes:

Specify Maximum POSIX API Mutexes
---------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_MUTEXES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_MUTEXES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_MUTEXES`` is the maximum number of POSIX API Mutexes
that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ===

.. _Specify Maximum POSIX API Condition Variables:

Specify Maximum POSIX API Condition Variables
---------------------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES`` is the maximum number of POSIX
API Condition Variables that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_KEYS ===

.. _Specify Maximum POSIX API Keys:

Specify Maximum POSIX API Keys
------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_KEYS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_KEYS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_KEYS`` is the maximum number of POSIX API Keys that
can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: XXX - Key pairs

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_TIMERS ===

.. _Specify Maximum POSIX API Timers:

Specify Maximum POSIX API Timers
--------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_TIMERS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_TIMERS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_TIMERS`` is the maximum number of POSIX API Timers
that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ===

.. _Specify Maximum POSIX API Queued Signals:

Specify Maximum POSIX API Queued Signals
----------------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS`` is the maximum number of POSIX API
Queued Signals that can be concurrently active.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ===

.. _Specify Maximum POSIX API Message Queues:

Specify Maximum POSIX API Message Queues
----------------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES`` is the maximum number of POSIX API
Message Queues that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: XXX - memory for buffers note

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS ===

.. _Specify Maximum POSIX API Message Queue Descriptors:

Specify Maximum POSIX API Message Queue Descriptors
---------------------------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    greater than or equal to ``CONFIGURE_MAXIMUM_POSIX_MESSAGES_QUEUES``

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS`` is the maximum number of
POSIX API Message Queue Descriptors that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

``CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS`` should be greater than or
equal to ``CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES``.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ===

.. _Specify Maximum POSIX API Semaphores:

Specify Maximum POSIX API Semaphores
------------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_SEMAPHORES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_SEMAPHORES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_SEMAPHORES`` is the maximum number of POSIX API
Semaphores that can be concurrently active.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_BARRIERS ===

.. _Specify Maximum POSIX API Barriers:

Specify Maximum POSIX API Barriers
----------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_BARRIERS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_BARRIERS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_BARRIERS`` is the maximum number of POSIX API
Barriers that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ===

.. _Specify Maximum POSIX API Spinlocks:

Specify Maximum POSIX API Spinlocks
-----------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_SPINLOCKS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_SPINLOCKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_SPINLOCKS`` is the maximum number of POSIX API
Spinlocks that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === CONFIGURE_MAXIMUM_POSIX_RWLOCKS ===

.. _Specify Maximum POSIX API Read/Write Locks:

Specify Maximum POSIX API Read/Write Locks
------------------------------------------
.. index:: CONFIGURE_MAXIMUM_POSIX_RWLOCKS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_POSIX_RWLOCKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_POSIX_RWLOCKS`` is the maximum number of POSIX API
Read/Write Locks that can be concurrently active.

**NOTES:**

This object class can be configured in unlimited allocation mode.

.. COMMENT: === POSIX Initialization Threads Table Configuration ===

POSIX Initialization Threads Table Configuration
================================================

The ``<rtems/confdefs.h>`` configuration system can automatically generate a
POSIX Initialization Threads Table named ``POSIX_Initialization_threads`` with
a single entry.  The following parameters control the generation of that table.

.. COMMENT: === CONFIGURE_POSIX_INIT_THREAD_TABLE ===

.. _Instantiate POSIX API Initialization Thread Table:

Instantiate POSIX API Initialization Thread Table
-------------------------------------------------
.. index:: CONFIGURE_POSIX_INIT_THREAD_TABLE

*CONSTANT:*
    .. index:: CONFIGURE_POSIX_INIT_THREAD_TABLE

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This field is not defined by default, as the user MUST select their own API
    for initialization tasks.

**DESCRIPTION:**

``CONFIGURE_POSIX_INIT_THREAD_TABLE`` is defined if the user wishes to use a
POSIX API Initialization Threads Table.  The table built by
``<rtems/confdefs.h>`` specifies the parameters for a single thread. This is
sufficient for applications which initialization the system from a single task.

By default, this field is not defined as the user MUST select their own API for
initialization tasks.

**NOTES:**

The application may choose to use the initialization tasks or threads table
from another API.

A compile time error will be generated if the user does not configure any
initialization tasks or threads.

.. COMMENT: === CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT ===

.. _Specifying POSIX API Initialization Thread Entry Point:

Specifying POSIX API Initialization Thread Entry Point
------------------------------------------------------
.. index:: CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT

*CONSTANT:*
    ``CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT``

*DATA TYPE:*
    POSIX thread function pointer (``void *(*entry_point)(void *)``).

*RANGE:*
    Undefined or a valid POSIX thread function pointer.

*DEFAULT VALUE:*
    The default value is ``POSIX_Init``.

**DESCRIPTION:**

``CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT`` is the entry point (a.k.a. function
name) of the single initialization thread defined by the POSIX API
Initialization Threads Table.

**NOTES:**

The user must implement the function ``POSIX_Init`` or the function name
provided in this configuration parameter.

.. COMMENT: === CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE ===

.. _Specifying POSIX API Initialization Thread Stack Size:

Specifying POSIX API Initialization Thread Stack Size
-----------------------------------------------------
.. index:: CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE

*CONSTANT:*
    ``CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 2 \* RTEMS_MINIMUM_STACK_SIZE.

**DESCRIPTION:**

``CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE`` is the stack size of the single
initialization thread defined by the POSIX API Initialization Threads Table.

**NOTES:**

If the stack size specified is greater than the configured minimum, it must be
accounted for in ``CONFIGURE_EXTRA_TASK_STACKS``.  See :ref:`Reserve
Task/Thread Stack Memory Above Minimum` for more information about
``CONFIGURE_EXTRA_TASK_STACKS``.

.. COMMENT: === CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE ===

.. _Not Using Generated POSIX Initialization Threads Table:

Not Using Generated POSIX Initialization Threads Table
------------------------------------------------------
.. index:: CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE

*CONSTANT:*
    ``CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE`` is defined if the user wishes to
define their own POSIX API Initialization Threads Table.  This table should be
named ``POSIX_Initialization_threads``.

**NOTES:**

This is a seldom used configuration parameter. The most likely use case is when
an application desires to have more than one initialization task.

.. COMMENT: === Basic System Information ===

Basic System Information
========================

This section defines the general system configuration parameters supported by
``<rtems/confdefs.h>``.

.. COMMENT: === CONFIGURE_UNIFIED_WORK_AREAS ===

.. _Separate or Unified Work Areas:

Separate or Unified Work Areas
------------------------------
.. index:: CONFIGURE_UNIFIED_WORK_AREAS
.. index:: unified work areas
.. index:: separate work areas
.. index:: RTEMS Workspace
.. index:: C Program Heap

*CONSTANT:*
    ``CONFIGURE_UNIFIED_WORK_AREAS``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default, which specifies that the C Program Heap and
    the RTEMS Workspace will be separate.

**DESCRIPTION:**

When defined, the C Program Heap and the RTEMS Workspace will be one pool of
memory.

When not defined, there will be separate memory pools for the RTEMS Workspace
and C Program Heap.

**NOTES:**

Having separate pools does have some advantages in the event a task blows a
stack or writes outside its memory area. However, in low memory systems the
overhead of the two pools plus the potential for unused memory in either pool
is very undesirable.

In high memory environments, this is desirable when you want to use the RTEMS
"unlimited" objects option.  You will be able to create objects until you run
out of all available memory rather then just until you run out of RTEMS
Workspace.

.. COMMENT: === CONFIGURE_MICROSECONDS_PER_TICK ===

.. _Length of Each Clock Tick:

Length of Each Clock Tick
-------------------------
.. index:: CONFIGURE_MICROSECONDS_PER_TICK
.. index:: tick quantum

*CONSTANT:*
    ``CONFIGURE_MICROSECONDS_PER_TICK``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    This is not defined by default. When not defined, the clock tick quantum is
    configured to be 10,000 microseconds which is ten (10) milliseconds.

**DESCRIPTION:**

This constant is  used to specify the length of time between clock ticks.

When the clock tick quantum value is too low, the system will spend so much
time processing clock ticks that it does not have processing time available to
perform application work. In this case, the system will become unresponsive.

The lowest practical time quantum varies widely based upon the speed of the
target hardware and the architectural overhead associated with interrupts. In
general terms, you do not want to configure it lower than is needed for the
application.

The clock tick quantum should be selected such that it all blocking and delay
times in the application are evenly divisible by it. Otherwise, rounding errors
will be introduced which may negatively impact the application.

**NOTES:**

This configuration parameter has no impact if the Clock Tick Device driver is
not configured.

There may be BSP specific limits on the resolution or maximum value of a clock
tick quantum.

.. COMMENT: === CONFIGURE_TICKS_PER_TIMESLICE ===

.. _Specifying Timeslicing Quantum:

Specifying Timeslicing Quantum
------------------------------
.. index:: CONFIGURE_TICKS_PER_TIMESLICE
.. index:: ticks per timeslice

*CONSTANT:*
    ``CONFIGURE_TICKS_PER_TIMESLICE``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 50.

**DESCRIPTION:**

This configuration parameter specifies the length of the timeslice quantum in
ticks for each task.

**NOTES:**

This configuration parameter has no impact if the Clock Tick Device driver is
not configured.

.. COMMENT: === CONFIGURE_MAXIMUM_PRIORITY ===

.. _Specifying the Number of Thread Priority Levels:

Specifying the Number of Thread Priority Levels
-----------------------------------------------
.. index:: CONFIGURE_MAXIMUM_PRIORITY
.. index:: maximum priority
.. index:: number of priority levels

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_PRIORITY``

*DATA TYPE:*
    Unsigned integer (``uint8_t``).

*RANGE:*
    Valid values for this configuration parameter must be one (1) less than
    than a power of two (2) between 4 and 256 inclusively.  In other words,
    valid values are 3, 7, 31, 63, 127, and 255.

*DEFAULT VALUE:*
    The default value is 255, because RTEMS must support 256 priority levels to
    be compliant with various standards. These priorities range from zero (0)
    to 255.

**DESCRIPTION:**

This configuration parameter specified the maximum numeric priority of any task
in the system and one less that the number of priority levels in the system.

Reducing the number of priorities in the system reduces the amount of memory
allocated from the RTEMS Workspace.

**NOTES:**

The numerically greatest priority is the logically lowest priority in the
system and will thus be used by the IDLE task.

Priority zero (0) is reserved for internal use by RTEMS and is not available to
applications.

With some schedulers, reducing the number of priorities can reduce the amount
of memory used by the scheduler. For example, the Deterministic Priority
Scheduler (DPS) used by default uses three pointers of storage per priority
level. Reducing the number of priorities from 256 levels to sixteen (16) can
reduce memory usage by about three (3) kilobytes.

.. COMMENT: === CONFIGURE_MINIMUM_TASK_STACK_SIZE ===

.. _Specifying the Minimum Task Size:

Specifying the Minimum Task Size
--------------------------------
.. index:: CONFIGURE_MINIMUM_TASK_STACK_SIZE
.. index:: minimum task stack size

*CONSTANT:*
    ``CONFIGURE_MINIMUM_TASK_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    This is not defined by default, which sets the executive to the recommended
    minimum stack size for this processor.

**DESCRIPTION:**

The configuration parameter is set to the number of bytes the application wants
the minimum stack size to be for every task or thread in the system.

Adjusting this parameter should be done with caution. Examining the actual
usage using the Stack Checker Usage Reporting facility is recommended.

**NOTES:**

This parameter can be used to lower the minimum from that recommended. This can
be used in low memory systems to reduce memory consumption for stacks. However,
this must be done with caution as it could increase the possibility of a blown
task stack.

This parameter can be used to increase the minimum from that recommended. This
can be used in higher memory systems to reduce the risk of stack overflow
without performing analysis on actual consumption.

.. COMMENT: === CONFIGURE_INTERRUPT_STACK_SIZE ===

.. _Configuring the Size of the Interrupt Stack:

Configuring the Size of the Interrupt Stack
-------------------------------------------
.. index:: CONFIGURE_INTERRUPT_STACK_SIZE
.. index:: interrupt stack size

*CONSTANT:*
    ``CONFIGURE_INTERRUPT_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is CONFIGURE_MINIMUM_TASK_STACK_SIZE, which is the
    minimum interrupt stack size.

**DESCRIPTION:**

``CONFIGURE_INTERRUPT_STACK_SIZE`` is set to the size of the interrupt stack.
The interrupt stack size is often set by the BSP but since this memory may be
allocated from the RTEMS Workspace, it must be accounted for.

**NOTES:**

In some BSPs, changing this constant does NOT change the size of the interrupt
stack, only the amount of memory reserved for it.

Patches which result in this constant only being used in memory calculations
when the interrupt stack is intended to be allocated from the RTEMS Workspace
would be welcomed by the RTEMS Project.

.. COMMENT: === CONFIGURE_EXTRA_TASK_STACKS ===

.. _Reserve Task/Thread Stack Memory Above Minimum:

Reserve Task/Thread Stack Memory Above Minimum
----------------------------------------------
.. index:: CONFIGURE_EXTRA_TASK_STACKS
.. index:: memory for task tasks

*CONSTANT:*
    ``CONFIGURE_EXTRA_TASK_STACKS``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

This configuration parameter is set to the number of bytes the applications
wishes to add to the task stack requirements calculated by
``<rtems/confdefs.h>``.

**NOTES:**

This parameter is very important.  If the application creates tasks with stacks
larger then the minimum, then that memory is NOT accounted for by
``<rtems/confdefs.h>``.

.. COMMENT: === CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY ===

.. _Automatically Zeroing the RTEMS Workspace and C Program Heap:

Automatically Zeroing the RTEMS Workspace and C Program Heap
------------------------------------------------------------
.. index:: CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
.. index:: clear C Program Heap
.. index:: clear RTEMS Workspace
.. index:: zero C Program Heap
.. index:: zero RTEMS Workspace

*CONSTANT:*
    ``CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default, unless overridden by the BSP.  The default
    is *NOT* to zero out the RTEMS Workspace or C Program Heap.

**DESCRIPTION:**

This macro indicates whether RTEMS should zero the RTEMS Workspace and C
Program Heap as part of its initialization.  If defined, the memory regions are
zeroed.  Otherwise, they are not.

**NOTES:**

Zeroing memory can add significantly to system boot time. It is not necessary
for RTEMS but is often assumed by support libraries.

.. COMMENT: === CONFIGURE_STACK_CHECKER_ENABLED ===

.. _Enable The Task Stack Usage Checker:

Enable The Task Stack Usage Checker
-----------------------------------
.. index:: CONFIGURE_STACK_CHECKER_ENABLED

*CONSTANT:*
    ``CONFIGURE_STACK_CHECKER_ENABLED``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default, and thus stack checking is disabled.

**DESCRIPTION:**

This configuration parameter is defined when the application wishes to enable
run-time stack bounds checking.

**NOTES:**

In 4.9 and older, this configuration parameter was named ``STACK_CHECKER_ON``.

This increases the time required to create tasks as well as adding overhead to
each context switch.

.. COMMENT: === CONFIGURE_INITIAL_EXTENSIONS ===

.. _Specify Application Specific User Extensions:

Specify Application Specific User Extensions
--------------------------------------------
.. index:: CONFIGURE_INITIAL_EXTENSIONS

*CONSTANT:*
    ``CONFIGURE_INITIAL_EXTENSIONS``

*DATA TYPE:*
    List of user extension initializers (``rtems_extensions_table``).

*RANGE:*
    Undefined or a list of one or more user extensions.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

If ``CONFIGURE_INITIAL_EXTENSIONS`` is defined by the application, then this
application specific set of initial extensions will be placed in the initial
extension table.

**NOTES:**

None.

.. COMMENT: === Custom Stack Allocator ===

Configuring Custom Task Stack Allocation
========================================

RTEMS allows the application or BSP to define its own allocation and
deallocation methods for task stacks. This can be used to place task stacks in
special areas of memory or to utilize a Memory Management Unit so that stack
overflows are detected in hardware.

.. COMMENT: === CONFIGURE_TASK_STACK_ALLOCATOR_INIT ===

.. _Custom Task Stack Allocator Initialization:

Custom Task Stack Allocator Initialization
------------------------------------------
.. index:: CONFIGURE_TASK_STACK_ALLOCATOR_INIT

*CONSTANT:*
    ``CONFIGURE_TASK_STACK_ALLOCATOR_INIT``

*DATA TYPE:*
    Function pointer.

*RANGE:*
    Undefined, NULL or valid function pointer.

*DEFAULT VALUE:*
    The default value is NULL, which indicates that task stacks will be
    allocated from the RTEMS Workspace.

**DESCRIPTION:**

``CONFIGURE_TASK_STACK_ALLOCATOR_INIT`` configures the initialization method
for an application or BSP specific task stack allocation implementation.

**NOTES:**

A correctly configured system must configure the following to be consistent:

- ``CONFIGURE_TASK_STACK_ALLOCATOR_INIT``

- ``CONFIGURE_TASK_STACK_ALLOCATOR``

- ``CONFIGURE_TASK_STACK_DEALLOCATOR``

.. COMMENT: === CONFIGURE_TASK_STACK_ALLOCATOR ===

.. _Custom Task Stack Allocator:

Custom Task Stack Allocator
---------------------------
.. index:: CONFIGURE_TASK_STACK_ALLOCATOR

.. index:: task stack allocator

*CONSTANT:*
    ``CONFIGURE_TASK_STACK_ALLOCATOR``

*DATA TYPE:*
    Function pointer.

*RANGE:*
    Undefined or valid function pointer.

*DEFAULT VALUE:*
    The default value is ``_Workspace_Allocate``, which indicates that task
    stacks will be allocated from the RTEMS Workspace.

**DESCRIPTION:**

``CONFIGURE_TASK_STACK_ALLOCATOR`` may point to a user provided routine to
allocate task stacks.

**NOTES:**

A correctly configured system must configure the following to be consistent:

- ``CONFIGURE_TASK_STACK_ALLOCATOR_INIT``

- ``CONFIGURE_TASK_STACK_ALLOCATOR``

- ``CONFIGURE_TASK_STACK_DEALLOCATOR``

.. COMMENT: === CONFIGURE_TASK_STACK_DEALLOCATOR ===

.. _Custom Task Stack Deallocator:

Custom Task Stack Deallocator
-----------------------------
.. index:: CONFIGURE_TASK_STACK_DEALLOCATOR
.. index:: task stack deallocator

*CONSTANT:*
    ``CONFIGURE_TASK_STACK_DEALLOCATOR``

*DATA TYPE:*
    Function pointer.

*RANGE:*
    Undefined or valid function pointer.

*DEFAULT VALUE:*
    The default value is ``_Workspace_Free``, which indicates that task stacks
    will be allocated from the RTEMS Workspace.

**DESCRIPTION:**

``CONFIGURE_TASK_STACK_DEALLOCATOR`` may point to a user provided routine to
free task stacks.

**NOTES:**

A correctly configured system must configure the following to be consistent:

- ``CONFIGURE_TASK_STACK_ALLOCATOR_INIT``

- ``CONFIGURE_TASK_STACK_ALLOCATOR``

- ``CONFIGURE_TASK_STACK_DEALLOCATOR``

.. COMMENT: === Classic API Message Buffers ===

Configuring Memory for Classic API Message Buffers
==================================================

This section describes the configuration parameters related to specifying the
amount of memory reserved for Classic API Message Buffers.

.. COMMENT: === CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE ===

.. _Calculate Memory for a Single Classic Message API Message Queue:

Calculate Memory for a Single Classic Message API Message Queue
---------------------------------------------------------------
.. index:: CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE
.. index:: memory for a single message queue's buffers

*CONSTANT:*
    ``CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per)``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is None.

**DESCRIPTION:**

This is a helper macro which is used to assist in computing the total amount of
memory required for message buffers.  Each message queue will have its own
configuration with maximum message size and maximum number of pending messages.

The interface for this macro is as follows:

.. code-block:: c

    CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per)

Where ``max_messages`` is the maximum number of pending messages and
``size_per`` is the size in bytes of the user message.

**NOTES:**

This macro is only used in support of ``CONFIGURE_MESSAGE_BUFFER_MEMORY``.

.. COMMENT: === CONFIGURE_MESSAGE_BUFFER_MEMORY ===

.. _Reserve Memory for All Classic Message API Message Queues:

Reserve Memory for All Classic Message API Message Queues
---------------------------------------------------------
.. index:: CONFIGURE_MESSAGE_BUFFER_MEMORY
.. index:: configure message queue buffer memory

*CONSTANT:*
    ``CONFIGURE_MESSAGE_BUFFER_MEMORY``

*DATA TYPE:*
    integer summation macro

*RANGE:*
    undefined (zero) or calculation resulting in a positive integer

*DEFAULT VALUE:*
    This is not defined by default, and zero (0) memory is reserved.

**DESCRIPTION:**

This macro is set to the number of bytes the application requires to be
reserved for pending Classic API Message Queue buffers.

**NOTES:**

The following illustrates how the help macro
``CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE`` can be used to assist in calculating
the message buffer memory required.  In this example, there are two message
queues used in this application.  The first message queue has maximum of 24
pending messages with the message structure defined by the type
``one_message_type``.  The other message queue has maximum of 500 pending
messages with the message structure defined by the type ``other_message_type``.

.. code-block:: c

    #define CONFIGURE_MESSAGE_BUFFER_MEMORY \
                (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
                     24, sizeof(one_message_type) \
                 ) + \
                 CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
                     500, sizeof(other_message_type) \
                 )

.. COMMENT: === Seldom Used Configuration Parameters ===

Seldom Used Configuration Parameters
====================================

This section describes configuration parameters supported by
``<rtems/confdefs.h>`` which are seldom used by applications. These parameters
tend to be oriented to debugging system configurations and providing
work-arounds when the memory estimated by ``<rtems/confdefs.h>`` is incorrect.

.. COMMENT: === CONFIGURE_MEMORY_OVERHEAD ===

.. _Specify Memory Overhead:

Specify Memory Overhead
-----------------------
.. index:: CONFIGURE_MEMORY_OVERHEAD

*CONSTANT:*
    ``CONFIGURE_MEMORY_OVERHEAD``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

Thie parameter is set to the number of kilobytes the application wishes to add
to the requirements calculated by ``<rtems/confdefs.h>``.

**NOTES:**

This configuration parameter should only be used when it is suspected that a
bug in ``<rtems/confdefs.h>`` has resulted in an underestimation.  Typically
the memory allocation will be too low when an application does not account for
all message queue buffers or task stacks.

.. COMMENT: === CONFIGURE_HAS_OWN_CONFIGURATION_TABLE ===

.. _Do Not Generate Configuration Information:

Do Not Generate Configuration Information
-----------------------------------------
.. index:: CONFIGURE_HAS_OWN_CONFIGURATION_TABLE

*CONSTANT:*
    ``CONFIGURE_HAS_OWN_CONFIGURATION_TABLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

This configuration parameter should only be defined if the application is
providing their own complete set of configuration tables.

**NOTES:**

None.

.. COMMENT: === C Library Support Configuration ===

C Library Support Configuration
===============================

This section defines the file system and IO library related configuration
parameters supported by ``<rtems/confdefs.h>``.

.. COMMENT: === CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS ===

.. _Specify Maximum Number of File Descriptors:

Specify Maximum Number of File Descriptors
------------------------------------------
.. index:: CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
.. index:: maximum file descriptors

*CONSTANT:*
    ``CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    If ``CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER`` is defined, then the
    default value is 3, otherwise the default value is 0.  Three file
    descriptors allows RTEMS to support standard input, output, and error I/O
    streams on ``/dev/console``.

**DESCRIPTION:**

This configuration parameter is set to the maximum number of file like objects
that can be concurrently open.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_TERMIOS_DISABLED ===

.. _Disable POSIX Termios Support:

Disable POSIX Termios Support
-----------------------------
.. index:: CONFIGURE_TERMIOS_DISABLED

*CONSTANT:*
    ``CONFIGURE_TERMIOS_DISABLED``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default, and resources are reserved for the termios
    functionality.

**DESCRIPTION:**

This configuration parameter is defined if the software implementing POSIX
termios functionality is not going to be used by this application.

**NOTES:**

The termios support library should not be included in an application executable
unless it is directly referenced by the application or a device driver.

.. COMMENT: === CONFIGURE_NUMBER_OF_TERMIOS_PORTS ===

.. _Specify Maximum Termios Ports:

Specify Maximum Termios Ports
-----------------------------
.. index:: CONFIGURE_NUMBER_OF_TERMIOS_PORTS

*CONSTANT:*
    ``CONFIGURE_NUMBER_OF_TERMIOS_PORTS``

*DATA TYPE:*
    Unsigned integer.

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 1, so a console port can be used.

**DESCRIPTION:**

This configuration parameter is set to the number of ports using the termios
functionality.  Each concurrently active termios port requires resources.

**NOTES:**

If the application will be using serial ports including, but not limited to,
the Console Device (e.g. ``CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER``), then
it is highly likely that this configuration parameter should NOT be is defined.

.. COMMENT: === File System Configuration Parameters ===

File System Configuration Parameters
====================================

This section defines File System related configuration parameters.

.. COMMENT: === CONFIGURE_HAS_OWN_MOUNT_TABLE ===

.. _Providing Application Specific Mount Table:

Providing Application Specific Mount Table
------------------------------------------
.. index:: CONFIGURE_HAS_OWN_MOUNT_TABLE

*CONSTANT:*
    ``CONFIGURE_HAS_OWN_MOUNT_TABLE``

*DATA TYPE:*
    Undefined or an array of type ``rtems_filesystem_mount_table_t``.

*RANGE:*
    Undefined or an array of type ``rtems_filesystem_mount_table_t``.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

This configuration parameter is defined when the application provides their own
filesystem mount table.  The mount table is an array of
``rtems_filesystem_mount_table_t`` entries pointed to by the global variable
``rtems_filesystem_mount_table``.  The number of entries in this table is in an
integer variable named ``rtems_filesystem_mount_table_t``.

.. COMMENT: XXX - is the variable name for the count right?

**NOTES:**

None.

.. COMMENT: XXX - Please provide an example

.. COMMENT: === CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM ===

.. _Configure devFS as Root File System:

Configure devFS as Root File System
-----------------------------------
.. index:: CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM

*CONSTANT:*
    ``CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default. If no other root file system configuration
    parameters are specified, the IMFS will be used as the root file system.

**DESCRIPTION:**

This configuration parameter is defined if the application wishes to use the
device-only filesytem as the root file system.

**NOTES:**

The device-only filesystem supports only device nodes and is smaller in
executable code size than the full IMFS and miniIMFS.

The devFS is comparable in functionality to the pseudo-filesystem name space
provided before RTEMS release 4.5.0.

.. COMMENT: === CONFIGURE_MAXIMUM_DEVICES ===

.. _Specifying Maximum Devices for devFS:

Specifying Maximum Devices for devFS
------------------------------------
.. index:: CONFIGURE_MAXIMUM_DEVICES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_DEVICES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    If ``BSP_MAXIMUM_DEVICES`` is defined, then the default value is
    ``BSP_MAXIMUM_DEVICES``, otherwise the default value is 4.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_DEVICES`` is defined to the number of individual devices
that may be registered in the device file system (devFS).

**NOTES:**

This option is specific to the device file system (devFS) and should not be
confused with the ``CONFIGURE_MAXIMUM_DRIVERS`` option.  This parameter only
impacts the devFS and thus is only used by ``<rtems/confdefs.h>`` when
``CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM`` is specified.

.. COMMENT: === CONFIGURE_APPLICATION_DISABLE_FILESYSTEM ===

.. _Disable File System Support:

Disable File System Support
---------------------------
.. index:: CONFIGURE_APPLICATION_DISABLE_FILESYSTEM

*CONSTANT:*
    ``CONFIGURE_APPLICATION_DISABLE_FILESYSTEM``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default. If no other root file system configuration
    parameters are specified, the IMFS will be used as the root file system.

**DESCRIPTION:**

This configuration parameter is defined if the application dose not intend to
use any kind of filesystem support. This include the device infrastructure
necessary to support ``printf()``.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM ===

.. _Use a Root IMFS with a Minimalistic Feature Set:

Use a Root IMFS with a Minimalistic Feature Set
-----------------------------------------------
.. index:: CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM

*CONSTANT:*
    ``CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the following configuration
options will be defined as well

- ``CONFIGURE_IMFS_DISABLE_CHMOD``,

- ``CONFIGURE_IMFS_DISABLE_CHOWN``,

- ``CONFIGURE_IMFS_DISABLE_UTIME``,

- ``CONFIGURE_IMFS_DISABLE_LINK``,

- ``CONFIGURE_IMFS_DISABLE_SYMLINK``,

- ``CONFIGURE_IMFS_DISABLE_READLINK``,

- ``CONFIGURE_IMFS_DISABLE_RENAME``, and

- ``CONFIGURE_IMFS_DISABLE_UNMOUNT``.

.. COMMENT: === CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK ===

.. _Specify Block Size for IMFS:

Specify Block Size for IMFS
---------------------------
.. index:: CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK

*CONSTANT:*
    ``CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Valid values for this configuration parameter are a power of two (2)
    between 16 and 512 inclusive.  In other words, valid values are 16, 32, 64,
    128, 256,and 512.

*DEFAULT VALUE:*
    The default IMFS block size is 128 bytes.

**DESCRIPTION:**

This configuration parameter specifies the block size for in-memory files
managed by the IMFS. The configured block size has two impacts. The first is
the average amount of unused memory in the last block of each file. For
example, when the block size is 512, on average one-half of the last block of
each file will remain unused and the memory is wasted. In contrast, when the
block size is 16, the average unused memory per file is only 8 bytes. However,
it requires more allocations for the same size file and thus more overhead per
block for the dynamic memory management.

Second, the block size has an impact on the maximum size file that can be
stored in the IMFS. With smaller block size, the maximum file size is
correspondingly smaller. The following shows the maximum file size possible
based on the configured block size:

- when the block size is 16 bytes, the maximum file size is 1,328 bytes.

- when the block size is 32 bytes, the maximum file size is 18,656 bytes.

- when the block size is 64 bytes, the maximum file size is 279,488 bytes.

- when the block size is 128 bytes, the maximum file size is 4,329,344 bytes.

- when the block size is 256 bytes, the maximum file size is 68,173,568 bytes.

- when the block size is 512 bytes, the maximum file size is 1,082,195,456
  bytes.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_CHOWN ===

.. _Disable Change Owner Support of Root IMFS:

Disable Change Owner Support of Root IMFS
-----------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_CHOWN

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_CHOWN``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to change the
owner is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_CHMOD ===

.. _Disable Change Mode Support of Root IMFS:

Disable Change Mode Support of Root IMFS
----------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_CHMOD

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_CHMOD``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to change the
mode is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_UTIME ===

.. _Disable Change Times Support of Root IMFS:

Disable Change Times Support of Root IMFS
-----------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_UTIME

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_UTIME``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to change times
is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_LINK ===

.. _Disable Create Hard Link Support of Root IMFS:

Disable Create Hard Link Support of Root IMFS
---------------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_LINK

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_LINK``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to create hard
links is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_SYMLINK ===

.. _Disable Create Symbolic Link Support of Root IMFS:

Disable Create Symbolic Link Support of Root IMFS
-------------------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_SYMLINK

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_SYMLINK``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to create
symbolic links is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_READLINK ===

.. _Disable Read Symbolic Link Support of Root IMFS:

Disable Read Symbolic Link Support of Root IMFS
-----------------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_READLINK

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_READLINK``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to read symbolic
links is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_RENAME ===

.. _Disable Rename Support of Root IMFS:

Disable Rename Support of Root IMFS
-----------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_RENAME

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_RENAME``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to rename nodes
is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_READDIR ===

.. _Disable Directory Read Support of Root IMFS:

Disable Directory Read Support of Root IMFS
-------------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_READDIR

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_READDIR``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to read a
directory is disabled in the root IMFS.  It is still possible to open nodes in
a directory.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_MOUNT ===

.. _Disable Mount Support of Root IMFS:

Disable Mount Support of Root IMFS
----------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_MOUNT

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_MOUNT``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to mount other
file systems is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_UNMOUNT ===

.. _Disable Unmount Support of Root IMFS:

Disable Unmount Support of Root IMFS
------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_UNMOUNT

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_UNMOUNT``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to unmount file
systems is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_MKNOD ===

.. _Disable Make Nodes Support of Root IMFS:

Disable Make Nodes Support of Root IMFS
---------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_MKNOD

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_MKNOD``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to make
directories, devices, regular files and FIFOs is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_MKNOD_FILE ===

.. _Disable Make Files Support of Root IMFS:

Disable Make Files Support of Root IMFS
---------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_MKNOD_FILE

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_MKNOD_FILE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to make regular
files is disabled in the root IMFS.

.. COMMENT: === CONFIGURE_IMFS_DISABLE_RMNOD ===

.. _Disable Remove Nodes Support of Root IMFS:

Disable Remove Nodes Support of Root IMFS
-----------------------------------------
.. index:: CONFIGURE_IMFS_DISABLE_RMNOD

*CONSTANT:*
    ``CONFIGURE_IMFS_DISABLE_RMNOD``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

In case this configuration option is defined, then the support to remove nodes
is disabled in the root IMFS.

.. COMMENT: === Block Device Cache Configuration ===

Block Device Cache Configuration
================================

This section defines Block Device Cache (bdbuf) related configuration
parameters.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_LIBBLOCK ===

.. _Enable Block Device Cache:

Enable Block Device Cache
-------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_LIBBLOCK

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_LIBBLOCK``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

Provides a Block Device Cache configuration.

**NOTES:**

Each option of the Block Device Cache configuration can be explicitly set by
the user with the configuration options below.  The Block Device Cache is used
for example by the RFS and DOSFS file systems.

.. COMMENT: === CONFIGURE_BDBUF_CACHE_MEMORY_SIZE ===

.. _Size of the Cache Memory:

Size of the Cache Memory
------------------------
.. index:: CONFIGURE_BDBUF_CACHE_MEMORY_SIZE

*CONSTANT:*
    ``CONFIGURE_BDBUF_CACHE_MEMORY_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 32768 bytes.

**DESCRIPTION:**

Size of the cache memory in bytes.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_BDBUF_BUFFER_MIN_SIZE ===

.. _Minimum Size of a Buffer:

Minimum Size of a Buffer
------------------------
.. index:: CONFIGURE_BDBUF_BUFFER_MIN_SIZE

*CONSTANT:*
    ``CONFIGURE_BDBUF_BUFFER_MIN_SIZE``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 512 bytes.

**DESCRIPTION:**

Defines the minimum size of a buffer in bytes.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_BDBUF_BUFFER_MAX_SIZE ===

.. _Maximum Size of a Buffer:

Maximum Size of a Buffer
------------------------
.. index:: CONFIGURE_BDBUF_BUFFER_MAX_SIZE

*CONSTANT:*
    ``CONFIGURE_BDBUF_BUFFER_MAX_SIZE``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    It must be positive and an integral multiple of the buffer minimum size.

*DEFAULT VALUE:*
    The default value is 4096 bytes.

**DESCRIPTION:**

Defines the maximum size of a buffer in bytes.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SWAPOUT_SWAP_PERIOD ===

.. _Swapout Task Swap Period:

Swapout Task Swap Period
------------------------
.. index:: CONFIGURE_SWAPOUT_SWAP_PERIOD

*CONSTANT:*
    ``CONFIGURE_SWAPOUT_SWAP_PERIOD``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 250 milliseconds.

**DESCRIPTION:**

Defines the swapout task swap period in milliseconds.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SWAPOUT_BLOCK_HOLD ===

.. _Swapout Task Maximum Block Hold Time:

Swapout Task Maximum Block Hold Time
------------------------------------
.. index:: CONFIGURE_SWAPOUT_BLOCK_HOLD

*CONSTANT:*
    ``CONFIGURE_SWAPOUT_BLOCK_HOLD``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 1000 milliseconds.

**DESCRIPTION:**

Defines the swapout task maximum block hold time in milliseconds.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SWAPOUT_TASK_PRIORITY ===

.. _Swapout Task Priority:

Swapout Task Priority
---------------------
.. index:: CONFIGURE_SWAPOUT_TASK_PRIORITY

*CONSTANT:*
    ``CONFIGURE_SWAPOUT_TASK_PRIORITY``

*DATA TYPE:*
    Task priority (``rtems_task_priority``).

*RANGE:*
    Valid task priority.

*DEFAULT VALUE:*
    The default value is 15.

**DESCRIPTION:**

Defines the swapout task priority.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS ===

.. _Maximum Blocks per Read-Ahead Request:

Maximum Blocks per Read-Ahead Request
-------------------------------------
.. index:: CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS

*CONSTANT:*
    ``CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

Defines the maximum blocks per read-ahead request.

**NOTES:**

A value of 0 disables the read-ahead task (default).  The read-ahead task will
issue speculative read transfers if a sequential access pattern is detected.
This can improve the performance on some systems.

.. COMMENT: === CONFIGURE_BDBUF_MAX_WRITE_BLOCKS ===

.. _Maximum Blocks per Write Request:

Maximum Blocks per Write Request
--------------------------------
.. index:: CONFIGURE_BDBUF_MAX_WRITE_BLOCKS

*CONSTANT:*
    ``CONFIGURE_BDBUF_MAX_WRITE_BLOCKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 16.

**DESCRIPTION:**

Defines the maximum blocks per write request.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_BDBUF_TASK_STACK_SIZE ===

.. _Task Stack Size of the Block Device Cache Tasks:

Task Stack Size of the Block Device Cache Tasks
-----------------------------------------------
.. index:: CONFIGURE_BDBUF_TASK_STACK_SIZE

*CONSTANT:*
    ``CONFIGURE_BDBUF_TASK_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is RTEMS_MINIMUM_STACK_SIZE.

**DESCRIPTION:**

Defines the task stack size of the Block Device Cache tasks in bytes.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY ===

.. _Read-Ahead Task Priority:

Read-Ahead Task Priority
------------------------
.. index:: CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY

*CONSTANT:*
    ``CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY``

*DATA TYPE:*
    Task priority (``rtems_task_priority``).

*RANGE:*
    Valid task priority.

*DEFAULT VALUE:*
    The default value is 15.

**DESCRIPTION:**

Defines the read-ahead task priority.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SWAPOUT_WORKER_TASKS ===

.. _Swapout Worker Task Count:

Swapout Worker Task Count
-------------------------
.. index:: CONFIGURE_SWAPOUT_WORKER_TASKS

*CONSTANT:*
    ``CONFIGURE_SWAPOUT_WORKER_TASKS``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

Defines the swapout worker task count.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY ===

.. _Swapout Worker Task Priority:

Swapout Worker Task Priority
----------------------------
.. index:: CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY

*CONSTANT:*
    ``CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY``

*DATA TYPE:*
    Task priority (``rtems_task_priority``).

*RANGE:*
    Valid task priority.

*DEFAULT VALUE:*
    The default value is 15.

**DESCRIPTION:**

Defines the swapout worker task priority.

**NOTES:**

None.

.. COMMENT: === BSP Specific Settings ===

BSP Specific Settings
=====================

This section describes BSP specific configuration settings used by
``<rtems/confdefs.h>``.  The BSP specific configuration settings are defined in
``<bsp.h>``.

.. COMMENT: === Disable BSP Settings ===

.. _Disable BSP Configuration Settings:

Disable BSP Configuration Settings
----------------------------------
.. index:: CONFIGURE_DISABLE_BSP_SETTINGS

*CONSTANT:*
    ``CONFIGURE_DISABLE_BSP_SETTINGS``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

All BSP specific configuration settings can be disabled by the application with
the ``CONFIGURE_DISABLE_BSP_SETTINGS`` option.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK ===

.. _Specify BSP Supports sbrk():

Specify BSP Supports sbrk()
---------------------------
.. index:: CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK

*CONSTANT:*
    ``CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

This configuration parameter is defined by a BSP to indicate that it does not
allocate all available memory to the C Program Heap used by the Malloc Family
of routines.

If defined, when ``malloc()`` is unable to allocate memory, it will call the
BSP supplied ``sbrk()`` to obtain more memory.

**NOTES:**

This parameter should not be defined by the application. Only the BSP knows how
it allocates memory to the C Program Heap.

.. COMMENT: === BSP_IDLE_TASK_BODY ===

.. _Specify BSP Specific Idle Task:

Specify BSP Specific Idle Task
------------------------------
.. index:: BSP_IDLE_TASK_BODY

*CONSTANT:*
    ``BSP_IDLE_TASK_BODY``

*DATA TYPE:*
    Function pointer.

*RANGE:*
    Undefined or valid function pointer.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

If ``BSP_IDLE_TASK_BODY`` is defined by the BSP and
``CONFIGURE_IDLE_TASK_BODY`` is not defined by the application, then this BSP
specific idle task body will be used.

**NOTES:**

As it has knowledge of the specific CPU model, system controller logic, and
peripheral buses, a BSP specific IDLE task may be capable of turning components
off to save power during extended periods of no task activity

.. COMMENT: === BSP_IDLE_TASK_STACK_SIZE ===

.. _Specify BSP Suggested Value for IDLE Task Stack Size:

Specify BSP Suggested Value for IDLE Task Stack Size
----------------------------------------------------
.. index:: BSP_IDLE_TASK_STACK_SIZE

*CONSTANT:*
    ``BSP_IDLE_TASK_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

If ``BSP_IDLE_TASK_STACK_SIZE`` is defined by the BSP and
``CONFIGURE_IDLE_TASK_STACK_SIZE`` is not defined by the application, then this
BSP suggested idle task stack size will be used.

**NOTES:**

The order of precedence for configuring the IDLE task stack size is:

- RTEMS default minimum stack size.

- If defined, then ``CONFIGURE_MINIMUM_TASK_STACK_SIZE``.

- If defined, then the BSP specific ``BSP_IDLE_TASK_SIZE``.

- If defined, then the application specified ``CONFIGURE_IDLE_TASK_SIZE``.

.. COMMENT: XXX - add cross references to other related values.

.. COMMENT: === BSP_INITIAL_EXTENSION ===

.. _Specify BSP Specific User Extensions:

Specify BSP Specific User Extensions
------------------------------------
.. index:: BSP_INITIAL_EXTENSION

*CONSTANT:*
    ``BSP_INITIAL_EXTENSION``

*DATA TYPE:*
    List of user extension initializers (``rtems_extensions_table``).

*RANGE:*
    Undefined or a list of user extension initializers.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

If ``BSP_INITIAL_EXTENSION`` is defined by the BSP, then this BSP specific
initial extension will be placed as the last entry in the initial extension
table.

**NOTES:**

None.

.. COMMENT: === BSP_INTERRUPT_STACK_SIZE ===

.. _Specifying BSP Specific Interrupt Stack Size:

Specifying BSP Specific Interrupt Stack Size
--------------------------------------------
.. index:: BSP_INTERRUPT_STACK_SIZE

*CONSTANT:*
    ``BSP_INTERRUPT_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

If ``BSP_INTERRUPT_STACK_SIZE`` is defined by the BSP and
``CONFIGURE_INTERRUPT_STACK_SIZE`` is not defined by the application, then this
BSP specific interrupt stack size will be used.

**NOTES:**

None.

.. COMMENT: === BSP_MAXIMUM_DEVICES ===

.. _Specifying BSP Specific Maximum Devices:

Specifying BSP Specific Maximum Devices
---------------------------------------
.. index:: BSP_MAXIMUM_DEVICES

*CONSTANT:*
    ``BSP_MAXIMUM_DEVICES``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

If ``BSP_MAXIMUM_DEVICES`` is defined by the BSP and
``CONFIGURE_MAXIMUM_DEVICES`` is not defined by the application, then this BSP
specific maximum device count will be used.

**NOTES:**

This option is specific to the device file system (devFS) and should not be
confused with the ``CONFIGURE_MAXIMUM_DRIVERS`` option.  This parameter only
impacts the devFS and thus is only used by ``<rtems/confdefs.h>`` when
``CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM`` is specified.

.. COMMENT: === BSP_ZERO_WORKSPACE_AUTOMATICALLY ===

.. _BSP Recommends RTEMS Workspace be Cleared:

BSP Recommends RTEMS Workspace be Cleared
-----------------------------------------
.. index:: BSP_ZERO_WORKSPACE_AUTOMATICALLY

*CONSTANT:*
    ``BSP_ZERO_WORKSPACE_AUTOMATICALLY``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

If ``BSP_ZERO_WORKSPACE_AUTOMATICALLY`` is defined by the BSP and
``CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY`` is not defined by the application,
then the workspace will be zeroed automatically.

**NOTES:**

Zeroing memory can add significantly to system boot time. It is not necessary
for RTEMS but is often assumed by support libraries.

.. COMMENT: === CONFIGURE_BSP_PREREQUISITE_DRIVERS ===

.. _Specify BSP Prerequisite Drivers:

Specify BSP Prerequisite Drivers
--------------------------------
.. index:: CONFIGURE_BSP_PREREQUISITE_DRIVERS

*CONSTANT:*
    ``CONFIGURE_BSP_PREREQUISITE_DRIVERS``

*DATA TYPE:*
    List of device driver initializers (``rtems_driver_address_table``).

*RANGE:*
    Undefined or array of device drivers.

*DEFAULT VALUE:*
    This option is BSP specific.

**DESCRIPTION:**

``CONFIGURE_BSP_PREREQUISITE_DRIVERS`` is defined if the BSP has device drivers
it needs to include in the Device Driver Table.  This should be defined to the
set of device driver entries that will be placed in the table at the *FRONT* of
the Device Driver Table and initialized before any other drivers *INCLUDING*
any application prerequisite drivers.

**NOTES:**

``CONFIGURE_BSP_PREREQUISITE_DRIVERS`` is typically used by BSPs to configure
common infrastructure such as bus controllers or probe for devices.

.. COMMENT: === Idle Task Configuration ===

Idle Task Configuration
=======================

This section defines the IDLE task related configuration parameters supported
by ``<rtems/confdefs.h>``.

.. COMMENT: === CONFIGURE_IDLE_TASK_BODY ===

.. _Specify Application Specific Idle Task Body:

Specify Application Specific Idle Task Body
-------------------------------------------
.. index:: CONFIGURE_IDLE_TASK_BODY

*CONSTANT:*
    ``CONFIGURE_IDLE_TASK_BODY``

*DATA TYPE:*
    Function pointer.

*RANGE:*
    Undefined or valid function pointer.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_IDLE_TASK_BODY`` is set to the function name corresponding to the
application specific IDLE thread body.  If not specified, the BSP or RTEMS
default IDLE thread body will be used.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_IDLE_TASK_STACK_SIZE ===

.. _Specify Idle Task Stack Size:

Specify Idle Task Stack Size
----------------------------
.. index:: CONFIGURE_IDLE_TASK_STACK_SIZE

*CONSTANT:*
    ``CONFIGURE_IDLE_TASK_STACK_SIZE``

*DATA TYPE:*
    Unsigned integer (``size_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    The default value is RTEMS_MINIMUM_STACK_SIZE.

**DESCRIPTION:**

``CONFIGURE_IDLE_TASK_STACK_SIZE`` is set to the
desired stack size for the IDLE task.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION ===

.. _Specify Idle Task Performs Application Initialization:

Specify Idle Task Performs Application Initialization
-----------------------------------------------------
.. index:: CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION

*CONSTANT:*
    ``CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default, the user is assumed
    to provide one or more initialization tasks.

**DESCRIPTION:**

``CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION`` is set to indicate that the
user has configured *NO* user initialization tasks or threads and that the user
provided IDLE task will perform application initialization and then transform
itself into an IDLE task.

**NOTES:**

If you use this option be careful, the user IDLE task *CANNOT* block at all
during the initialization sequence.  Further, once application initialization
is complete, it must make itself preemptible and enter an IDLE body loop.

The IDLE task must run at the lowest priority of all tasks in the system.

.. COMMENT: === Scheduler Algorithm Configuration ===

Scheduler Algorithm Configuration
=================================

This section defines the configuration parameters related to selecting a
scheduling algorithm for an application.  For the schedulers built into RTEMS,
the configuration is straightforward.  All that is required is to define the
configuration macro which specifies which scheduler you want for in your
application.  The currently available schedulers are:

The pluggable scheduler interface also enables the user to provide their own
scheduling algorithm.  If you choose to do this, you must define multiple
configuration macros.

.. COMMENT: === CONFIGURE_SCHEDULER_PRIORITY ===

.. _Use Deterministic Priority Scheduler:

Use Deterministic Priority Scheduler
------------------------------------
.. index:: CONFIGURE_SCHEDULER_PRIORITY

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_PRIORITY``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is defined by default.  This is the default scheduler and specifying
    this configuration parameter is redundant.

**DESCRIPTION:**

The Deterministic Priority Scheduler is the default scheduler in RTEMS for
uni-processor applications and is designed for predictable performance under
the highest loads.  It can block or unblock a thread in a constant amount of
time.  This scheduler requires a variable amount of memory based upon the
number of priorities configured in the system.

**NOTES:**

This scheduler may be explicitly selected by defining
``CONFIGURE_SCHEDULER_PRIORITY`` although this is equivalent to the default
behavior.

.. COMMENT: === CONFIGURE_SCHEDULER_SIMPLE ===

.. _Use Simple Priority Scheduler:

Use Simple Priority Scheduler
-----------------------------
.. index:: CONFIGURE_SCHEDULER_SIMPLE

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_SIMPLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

When defined, the Simple Priority Scheduler is used at the thread scheduling
algorithm. This is an alternative scheduler in RTEMS.  It is designed to
provide the same task scheduling behaviour as the Deterministic Priority
Scheduler while being simpler in implementation and uses less memory for data
management.  It maintains a single sorted list of all ready threads.  Thus
blocking or unblocking a thread is not a constant time operation with this
scheduler.

This scheduler may be explicitly selected by defining
``CONFIGURE_SCHEDULER_SIMPLE``.

**NOTES:**

This scheduler is appropriate for use in small systems where RAM is limited.

.. COMMENT: === CONFIGURE_SCHEDULER_EDF ===

.. _Use Earliest Deadline First Scheduler:

Use Earliest Deadline First Scheduler
-------------------------------------
.. index:: CONFIGURE_SCHEDULER_EDF

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_EDF``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

The Earliest Deadline First Scheduler (EDF) is an alternative scheduler in
RTEMS for uni-processor applications. The EDF schedules tasks with dynamic
priorities equal to deadlines. The deadlines are declared using only Rate
Monotonic manager which handles periodic behavior.  Period is always equal to
deadline. If a task does not have any deadline declared or the deadline is
cancelled, the task is considered a background task which is scheduled in case
no deadline-driven tasks are ready to run.  Moreover, multiple background tasks
are scheduled according their priority assigned upon initialization. All ready
tasks reside in a single ready queue.

This scheduler may be explicitly selected by defining
``CONFIGURE_SCHEDULER_EDF``.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SCHEDULER_CBS ===

.. _Use Constant Bandwidth Server Scheduler:

Use Constant Bandwidth Server Scheduler
---------------------------------------
.. index:: CONFIGURE_SCHEDULER_CBS

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_CBS``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

The Constant Bandwidth Server Scheduler (CBS) is an alternative scheduler in
RTEMS for uni-processor applications. The CBS is a budget aware extension of
EDF scheduler. The goal of this scheduler is to ensure temporal isolation of
tasks. The CBS is equipped with a set of additional rules and provides with an
extensive API.

This scheduler may be explicitly selected by defining
``CONFIGURE_SCHEDULER_CBS``.

.. COMMENT: XXX - add cross reference to API chapter

**NOTES:**

None.

.. COMMENT: === CONFIGURE_SCHEDULER_PRIORITY_SMP ===

.. _Use Deterministic Priority SMP Scheduler:

Use Deterministic Priority SMP Scheduler
----------------------------------------
.. index:: CONFIGURE_SCHEDULER_PRIORITY_SMP

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_PRIORITY_SMP``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

The Deterministic Priority SMP Scheduler is derived from the Deterministic
Priority Scheduler but is capable of scheduling threads across multiple
processors.

In a configuration with SMP enabled at configure time, it may be explicitly
selected by defining ``CONFIGURE_SCHEDULER_PRIORITY_SMP``.

**NOTES:**

This scheduler is only available when RTEMS is configured with SMP
support enabled.

This scheduler is currently the default in SMP configurations and is only
selected when ``CONFIGURE_SMP_APPLICATION`` is defined.

.. COMMENT: === CONFIGURE_SCHEDULER_SIMPLE_SMP ===

.. _Use Simple SMP Priority Scheduler:

Use Simple SMP Priority Scheduler
---------------------------------
.. index:: CONFIGURE_SCHEDULER_SIMPLE_SMP

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_SIMPLE_SMP``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

The Simple SMP Priority Scheduler is derived from the Simple Priority Scheduler
but is capable of scheduling threads across multiple processors.  It is
designed to provide the same task scheduling behaviour as the Deterministic
Priority Scheduler while distributing threads across multiple processors.
Being based upon the Simple Priority Scheduler, it also maintains a single
sorted list of all ready threads.  Thus blocking or unblocking a thread is not
a constant time operation with this scheduler.

In addition, when allocating threads to processors, the algorithm is not
constant time. This algorithm was not designed with efficiency as a primary
design goal.  Its primary design goal was to provide an SMP-aware scheduling
algorithm that is simple to understand.

In a configuration with SMP enabled at configure time, it may be explicitly
selected by defining ``CONFIGURE_SCHEDULER_SIMPLE_SMP``.

**NOTES:**

This scheduler is only available when RTEMS is configured with SMP support
enabled.

.. COMMENT: === Configuring a Scheduler Name ===

.. _Configuring a Scheduler Name:

Configuring a Scheduler Name
----------------------------
.. index:: CONFIGURE_SCHEDULER_NAME

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_NAME``

*DATA TYPE:*
    RTEMS Name (``rtems_name``).

*RANGE:*
    Any value.

*DEFAULT VALUE:*
    The default name is
      - ``"UCBS"`` for the Uni-Processor CBS scheduler,
      - ``"UEDF"`` for the Uni-Processor EDF scheduler,
      - ``"UPD "`` for the Uni-Processor Deterministic Priority scheduler,
      - ``"UPS "`` for the Uni-Processor Simple Priority scheduler,
      - ``"MPA "`` for the Multi-Processor Priority Affinity scheduler, and
      - ``"MPD "`` for the Multi-Processor Deterministic Priority scheduler, and
      - ``"MPS "`` for the Multi-Processor Simple Priority scheduler.

**DESCRIPTION:**

Schedulers can be identified via ``rtems_scheduler_ident``.  The name of the
scheduler is determined by the configuration.

**NOTES:**

None.

.. COMMENT: === Configuring a User Scheduler ===

.. _Configuring a User Provided Scheduler:

Configuring a User Provided Scheduler
-------------------------------------
.. index:: CONFIGURE_SCHEDULER_USER

*CONSTANT:*
    ``CONFIGURE_SCHEDULER_USER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

RTEMS allows the application to provide its own task/thread scheduling
algorithm. In order to do this, one must define ``CONFIGURE_SCHEDULER_USER`` to
indicate the application provides its own scheduling algorithm. If
``CONFIGURE_SCHEDULER_USER`` is defined then the following additional macros
must be defined:

- ``CONFIGURE_SCHEDULER_CONTEXT`` must be defined to a static definition of the
  scheduler context of the user scheduler.

- ``CONFIGURE_SCHEDULER_CONTROLS`` must be defined to a scheduler control
  initializer for the user scheduler.

- ``CONFIGURE_SCHEDULER_USER_PER_THREAD`` must be defined to the type of the
  per-thread information of the user scheduler.

**NOTES:**

At this time, the mechanics and requirements for writing a new scheduler are
evolving and not fully documented.  It is recommended that you look at the
existing Deterministic Priority Scheduler in
``cpukit/score/src/schedulerpriority*.c`` for guidance.  For guidance on the
configuration macros, please examine ``cpukit/sapi/include/confdefs.h`` for how
these are defined for the Deterministic Priority Scheduler.

.. COMMENT: === Configuring Clustered Schedulers ===

.. _Configuring Clustered Schedulers:

Configuring Clustered Schedulers
--------------------------------

Clustered scheduling helps to control the worst-case latencies in a
multi-processor system.  The goal is to reduce the amount of shared state in
the system and thus prevention of lock contention.  Modern multi-processor
systems tend to have several layers of data and instruction caches.  With
clustered scheduling it is possible to honour the cache topology of a system
and thus avoid expensive cache synchronization traffic.

We have clustered scheduling in case the set of processors of a system is
partitioned into non-empty pairwise-disjoint subsets.  These subsets are called
clusters.  Clusters with a cardinality of one are partitions.  Each cluster is
owned by exactly one scheduler instance.  In order to use clustered scheduling
the application designer has to answer two questions.

#. How is the set of processors partitioned into clusters?

#. Which scheduler is used for which cluster?

**CONFIGURATION:**

The schedulers in an SMP system are statically configured on RTEMS.  Firstly
the application must select which scheduling algorithms are available with the
following defines

- ``CONFIGURE_SCHEDULER_PRIORITY_SMP``,

- ``CONFIGURE_SCHEDULER_SIMPLE_SMP``, and

- ``CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP``.

This is necessary to calculate the per-thread overhead introduced by the
schedulers.  After these definitions the configuration file must ``#include
<rtems/scheduler.h>`` to have access to scheduler specific configuration
macros.  Each scheduler needs a context to store state information at run-time.
To provide a context for each scheduler is the next step.  Use the following
macros to create scheduler contexts

- ``RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(name, prio_count)``,

- ``RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(name)``, and

- ``RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP(name, prio_count)``.

The ``name`` parameter is used as part of a designator for a global variable,
so the usual C/C++ designator rules apply.  Additional parameters are scheduler
specific.  The schedulers are registered in the system via the scheduler table.
To create the scheduler table define ``CONFIGURE_SCHEDULER_CONTROLS`` to a list
of the following scheduler control initializers

- ``RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(name, obj_name)``,

- ``RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(name, obj_name)``, and

- ``RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(name, obj_name)``.

The ``name`` parameter must correspond to the parameter defining the scheduler
context.  The ``obj_name`` determines the scheduler object name and can be used
in ``rtems_scheduler_ident()`` to get the scheduler object identifier.

The last step is to define which processor uses which scheduler.  For this
purpose a scheduler assignment table must be defined.  The entry count of this
table must be equal to the configured maximum processors
(``CONFIGURE_SMP_MAXIMUM_PROCESSORS``).  A processor assignment to a scheduler
can be optional or mandatory.  The boot processor must have a scheduler
assigned.  In case the system needs more mandatory processors than available
then a fatal run-time error will occur.  To specify the scheduler assignments
define ``CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS`` to a list of
``RTEMS_SCHEDULER_ASSIGN(index, attr)`` and
``RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER`` macros.  The ``index`` parameter must
be a valid index into the scheduler table.  The ``attr`` parameter defines the
scheduler assignment attributes.  By default a scheduler assignment to a
processor is optional.  For the scheduler assignment attribute use one of the
mutually exclusive variants

- ``RTEMS_SCHEDULER_ASSIGN_DEFAULT``,

- ``RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY``, and

- ``RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL``.

**ERRORS:**

In case one of the scheduler indices in``CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS``
is invalid a link-time error will occur with an undefined reference to
``RTEMS_SCHEDULER_INVALID_INDEX``.

Some fatal errors may occur in case of scheduler configuration inconsistencies
or a lack of processors on the system.  The fatal source is
``RTEMS_FATAL_SOURCE_SMP``.  None of the errors is internal.

- ``SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER`` - the boot processor
  must have a scheduler assigned.

- ``SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT`` - there exists a mandatory
  processor beyond the range of physically or virtually available processors.
  The processor demand must be reduced for this system.

- ``SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED`` - the start of a mandatory
  processor failed during system initialization.  The system may not have this
  processor at all or it could be a problem with a boot loader for example.
  Check the ``CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS`` definition.

- ``SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR`` - it is not allowed
  to start multitasking on a processor with no scheduler assigned.

**EXAMPLE:**

The following example shows a scheduler configuration for a hypothetical
product using two chip variants.  One variant has four processors which is used
for the normal product line and another provides eight processors for the
high-performance product line.  The first processor performs hard-real time
control of actuators and sensors.  The second processor is not used by RTEMS at
all and runs a Linux instance to provide a graphical user interface.  The
additional processors are used for a worker thread pool to perform data
processing operations.

The processors managed by RTEMS use two Deterministic Priority scheduler
instances capable of dealing with 256 priority levels.  The scheduler with
index zero has the name ``"IO "``.  The scheduler with index one has the name
``"WORK"``.  The scheduler assignments of the first, third and fourth processor
are mandatory, so the system must have at least four processors, otherwise a
fatal run-time error will occur during system startup.  The processor
assignments for the fifth up to the eighth processor are optional so that the
same application can be used for the normal and high-performance product lines.
The second processor has no scheduler assigned and runs Linux.  A hypervisor
will ensure that the two systems cannot interfere in an undesirable way.

.. code-block:: c

    #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 8
    #define CONFIGURE_MAXIMUM_PRIORITY 255
    /* Make the scheduler algorithm available */
    #define CONFIGURE_SCHEDULER_PRIORITY_SMP
    #include <rtems/scheduler.h>
    /* Create contexts for the two scheduler instances */
    RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(io, CONFIGURE_MAXIMUM_PRIORITY + 1);
    RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(work, CONFIGURE_MAXIMUM_PRIORITY + 1);
    /* Define the scheduler table */
    #define CONFIGURE_SCHEDULER_CONTROLS \\
                RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
                    io, \
                    rtems_build_name('I', 'O', ' ', ' ') \
                ), \
                RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( \
                    work, \
                    rtems_build_name('W', 'O', 'R', 'K') \
                )
    /* Define the processor to scheduler assignments */
    #define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \
                RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
                RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER, \
                RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
                RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
                RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
                RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
                RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
                RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL)

.. COMMENT: === SMP Specific Configuration Parameters ===

SMP Specific Configuration Parameters
=====================================

When RTEMS is configured to support SMP target systems, there are other
configuration parameters which apply.

.. COMMENT: XXX - add -enable-smp

.. COMMENT: === CONFIGURE_SMP_APPLICATION ===

.. _Enable SMP Support for Applications:

Enable SMP Support for Applications
-----------------------------------
.. index:: CONFIGURE_SMP_APPLICATION

*CONSTANT:*
    ``CONFIGURE_SMP_APPLICATION``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_SMP_APPLICATION`` must be defined to enable SMP support for the
application.

**NOTES:**

This define may go away in the future in case all RTEMS components are SMP
ready.  This configuration define is ignored on uni-processor configurations.

.. COMMENT: === CONFIGURE_SMP_MAXIMUM_PROCESSORS ===

.. _Specify Maximum Processors in SMP System:

Specify Maximum Processors in SMP System
----------------------------------------
.. index:: CONFIGURE_SMP_MAXIMUM_PROCESSORS

*CONSTANT:*
    ``CONFIGURE_SMP_MAXIMUM_PROCESSORS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    The default value is 1, (if CONFIGURE_SMP_APPLICATION is defined).

**DESCRIPTION:**

``CONFIGURE_SMP_MAXIMUM_PROCESSORS`` must be set to the number of processors in
the SMP configuration.

**NOTES:**

If there are more processors available than configured, the rest will be
ignored.  This configuration define is ignored on uni-processor configurations.

.. COMMENT: === Device Driver Table ===

Device Driver Table
===================

This section defines the configuration parameters related to the automatic
generation of a Device Driver Table.  As ``<rtems/confdefs.h>`` only is aware
of a small set of standard device drivers, the generated Device Driver Table is
suitable for simple applications with no custom device drivers.

Note that network device drivers are not configured in the Device Driver Table.

.. COMMENT: === CONFIGURE_MAXIMUM_DRIVERS ===

.. _Specifying the Maximum Number of Device Drivers:

Specifying the Maximum Number of Device Drivers
-----------------------------------------------
.. index:: CONFIGURE_MAXIMUM_DRIVERS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_DRIVERS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    This is computed by default, and is set to the number of device drivers
    configured using the ``CONFIGURE_APPLICATIONS_NEEDS_XXX_DRIVER``
    configuration parameters.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_DRIVERS`` is defined as the number of device drivers per
node.

**NOTES:**

If the application will dynamically install device drivers, then this
configuration parameter must be larger than the number of statically configured
device drivers. Drivers configured using the
``CONFIGURE_APPLICATIONS_NEEDS_XXX_DRIVER`` configuration parameters are
statically installed.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER ===

.. _Enable Console Device Driver:

Enable Console Device Driver
----------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER`` is defined if the application
wishes to include the Console Device Driver.

**NOTES:**

This device driver is responsible for providing standard input and output using
*/dev/console*.

BSPs should be constructed in a manner that allows ``printk()`` to work
properly without the need for the console driver to be configured.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER ===

.. _Enable Clock Driver:

Enable Clock Driver
-------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER`` is defined if the application
wishes to include the Clock Device Driver.

**NOTES:**

This device driver is responsible for providing a regular interrupt which
invokes the ``rtems_clock_tick`` directive.

If neither the Clock Driver not Benchmark Timer is enabled and the
configuration parameter ``CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER`` is
not defined, then a compile time error will occur.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER ===

.. _Enable the Benchmark Timer Driver:

Enable the Benchmark Timer Driver
---------------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER`` is defined if the
application wishes to include the Timer Driver.  This device driver is
used to benchmark execution times by the RTEMS Timing Test Suites.

**NOTES:**

If neither the Clock Driver not Benchmark Timer is enabled and the
configuration parameter ``CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER`` is
not defined, then a compile time error will occur.

.. COMMENT: === CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER ===

.. _Specify Clock and Benchmark Timer Drivers Are Not Needed:

Specify Clock and Benchmark Timer Drivers Are Not Needed
--------------------------------------------------------
.. index:: CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER`` is defined when the
application does *NOT* want the Clock Device Driver and is *NOT* using the
Timer Driver.  The inclusion or exclusion of the Clock Driver must be explicit
in user applications.

**NOTES:**

This configuration parameter is intended to prevent the common user error of
using the Hello World example as the baseline for an application and leaving
out a clock tick source.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER ===

.. _Enable Real-Time Clock Driver:

Enable Real-Time Clock Driver
-----------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER`` is defined if the application wishes
to include the Real-Time Clock Driver.

**NOTES:**

Most BSPs do not include support for a real-time clock. This is because many
boards do not include the required hardware.

If this is defined and the BSP does not have this device driver, then the user
will get a link time error for an undefined symbol.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER ===

.. _Enable the Watchdog Device Driver:

Enable the Watchdog Device Driver
---------------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER`` is defined if the application
wishes to include the Watchdog Driver.

**NOTES:**

Most BSPs do not include support for a watchdog device driver. This is because
many boards do not include the required hardware.

If this is defined and the BSP does not have this device driver, then the user
will get a link time error for an undefined symbol.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER ===

.. _Enable the Graphics Frame Buffer Device Driver:

Enable the Graphics Frame Buffer Device Driver
----------------------------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER`` is defined if the
application wishes to include the BSP's Frame Buffer Device Driver.

**NOTES:**

Most BSPs do not include support for a Frame Buffer Device Driver. This is
because many boards do not include the required hardware.

If this is defined and the BSP does not have this device driver, then the user
will get a link time error for an undefined symbol.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER ===

.. _Enable Stub Device Driver:

Enable Stub Device Driver
-------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER`` is defined if the application
wishes to include the Stub Device Driver.

**NOTES:**

This device driver simply provides entry points that return successful and is
primarily a test fixture. It is supported by all BSPs.

.. COMMENT: === CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS ===

.. _Specify Application Prerequisite Device Drivers:

Specify Application Prerequisite Device Drivers
-----------------------------------------------
.. index:: CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS

*CONSTANT:*
    ``CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS``

*DATA TYPE:*
    device driver entry structures

*RANGE:*
    Undefined or set of device driver entry structures

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS`` is defined if the application
has device drivers it needs to include in the Device Driver Table.  This should
be defined to the set of device driver entries that will be placed in the table
at the *FRONT* of the Device Driver Table and initialized before any other
drivers *EXCEPT* any BSP prerequisite drivers.

**NOTES:**

In some cases, it is used by System On Chip BSPs to support peripheral buses
beyond those normally found on the System On Chip. For example, this is used by
one RTEMS system which has implemented a SPARC/ERC32 based board with
VMEBus. The VMEBus Controller initialization is performed by a device driver
configured via this configuration parameter.

.. COMMENT: XXX Add example

.. COMMENT: === CONFIGURE_APPLICATION_EXTRA_DRIVERS ===

.. _Specify Extra Application Device Drivers:

Specify Extra Application Device Drivers
----------------------------------------
.. index:: CONFIGURE_APPLICATION_EXTRA_DRIVERS

*CONSTANT:*
    ``CONFIGURE_APPLICATION_EXTRA_DRIVERS``

*DATA TYPE:*
    device driver entry structures

*RANGE:*
    Undefined or set of device driver entry structures

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_APPLICATION_EXTRA_DRIVERS`` is defined if the application has
device drivers it needs to include in the Device Driver Table.  This should be
defined to the set of device driver entries that will be placed in the table at
the *END* of the Device Driver Table.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER ===

.. _Enable /dev/null Device Driver:

Enable /dev/null Device Driver
------------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
.. index:: /dev/null

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

This configuration variable is specified to enable ``/dev/null`` device driver.

**NOTES:**

This device driver is supported by all BSPs.

.. COMMENT: === CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER ===

.. _Enable /dev/zero Device Driver:

Enable /dev/zero Device Driver
------------------------------
.. index:: CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
.. index:: /dev/zero

*CONSTANT:*
    ``CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

This configuration variable is specified to enable ``/dev/zero`` device driver.

**NOTES:**

This device driver is supported by all BSPs.

.. COMMENT: === CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE ===

.. _Specifying Application Defined Device Driver Table:

Specifying Application Defined Device Driver Table
--------------------------------------------------
.. index:: CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE

*CONSTANT:*
    ``CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default, indicating the ``<rtems/confdefs.h>`` is
    providing the device driver table.

**DESCRIPTION:**

``CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE`` is defined if the application wishes
to provide their own Device Driver Table.

The table must be an array of ``rtems_driver_address_table`` entries named``
_IO_Driver_address_table``.  The application must also provide a const variable
``_IO_Number_of_drivers`` of type ``size_t`` indicating the number of entries
in the ``_IO_Driver_address_table``.

**NOTES:**

It is expected that there the application would only rarely need to do this.

.. COMMENT: === Multiprocessing Configuration ===

Multiprocessing Configuration
=============================

This section defines the multiprocessing related system configuration
parameters supported by ``<rtems/confdefs.h>``.  They are only used if the
Multiprocessing Support (distinct from the SMP support) is enabled at configure
time using the ``--enable-multiprocessing`` option.

Additionally, this class of Configuration Constants are only applicable if
``CONFIGURE_MP_APPLICATION`` is defined.

.. COMMENT: === CONFIGURE_MP_APPLICATION ===

.. _Specify Application Will Use Multiprocessing:

Specify Application Will Use Multiprocessing
--------------------------------------------
.. index:: CONFIGURE_MP_APPLICATION

*CONSTANT:*
    ``CONFIGURE_MP_APPLICATION``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

This configuration parameter must be defined to indicate that the application
intends to be part of a multiprocessing configuration. Additional configuration
parameters are assumed to be provided.

**NOTES:**

This has no impact unless RTEMS was configured and built using the
``--enable-multiprocessing`` option.

.. COMMENT: === CONFIGURE_MP_NODE_NUMBER ===

.. _Configure Node Number in Multiprocessor Configuration:

Configure Node Number in Multiprocessor Configuration
-----------------------------------------------------
.. index:: CONFIGURE_MP_NODE_NUMBER

*CONSTANT:*
    ``CONFIGURE_MP_NODE_NUMBER``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is ``NODE_NUMBER``, which is assumed to be set by the
    compilation environment.

**DESCRIPTION:**

``CONFIGURE_MP_NODE_NUMBER`` is the node number of this node in a
multiprocessor system.

**NOTES:**

In the RTEMS Multiprocessing Test Suite, the node number is derived from the
Makefile variable ``NODE_NUMBER``. The same code is compiled with the
``NODE_NUMBER`` set to different values. The test programs behave differently
based upon their node number.

.. COMMENT: === CONFIGURE_MP_MAXIMUM_NODES ===

.. _Configure Maximum Node in Multiprocessor Configuration:

Configure Maximum Node in Multiprocessor Configuration
------------------------------------------------------
.. index:: CONFIGURE_MP_MAXIMUM_NODES

*CONSTANT:*
    ``CONFIGURE_MP_MAXIMUM_NODES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 2.

**DESCRIPTION:**

``CONFIGURE_MP_MAXIMUM_NODES`` is the maximum number of nodes in a
multiprocessor system.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS ===

.. _Configure Maximum Global Objects in Multiprocessor Configuration:

Configure Maximum Global Objects in Multiprocessor Configuration
----------------------------------------------------------------
.. index:: CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS

*CONSTANT:*
    ``CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Positive.

*DEFAULT VALUE:*
    The default value is 32.

**DESCRIPTION:**

``CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS`` is the maximum number of concurrently
active global objects in a multiprocessor system.

**NOTES:**

This value corresponds to the total number of objects which can be created with
the ``RTEMS_GLOBAL`` attribute.

.. COMMENT: === CONFIGURE_MP_MAXIMUM_PROXIES ===

.. _Configure Maximum Proxies in Multiprocessor Configuration:

Configure Maximum Proxies in Multiprocessor Configuration
---------------------------------------------------------
.. index:: CONFIGURE_MP_MAXIMUM_PROXIES

*CONSTANT:*
    ``CONFIGURE_MP_MAXIMUM_PROXIES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    The default value is 32.

**DESCRIPTION:**

``CONFIGURE_MP_MAXIMUM_PROXIES`` is the maximum number of concurrently
active thread/task proxies on this node in a multiprocessor system.

**NOTES:**

Since a proxy is used to represent a remote task/thread which is blocking on
this node. This configuration parameter reflects the maximum number of remote
tasks/threads which can be blocked on objects on this node.

.. COMMENT: XXX - add xref to proxy discussion in MP chapter

.. COMMENT: === CONFIGURE_MP_MPCI_TABLE_POINTER ===

.. _Configure MPCI in Multiprocessor Configuration:

Configure MPCI in Multiprocessor Configuration
----------------------------------------------
.. index:: CONFIGURE_MP_MPCI_TABLE_POINTER

*CONSTANT:*
    ``CONFIGURE_MP_MPCI_TABLE_POINTER``

*DATA TYPE:*
    pointer to ``rtems_mpci_table``

*RANGE:*
    undefined or valid pointer

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_MP_MPCI_TABLE_POINTER`` is the pointer to the MPCI Configuration
Table.  The default value of this field is``&MPCI_table``.

**NOTES:**

RTEMS provides a Shared Memory MPCI Device Driver which can be used on any
Multiprocessor System assuming the BSP provides the proper set of supporting
methods.

.. COMMENT: === CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE ===

.. _Do Not Generate Multiprocessor Configuration Table:

Do Not Generate Multiprocessor Configuration Table
--------------------------------------------------
.. index:: CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE

*CONSTANT:*
    ``CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE`` is defined if the application
wishes to provide their own Multiprocessing Configuration Table.  The generated
table is named ``Multiprocessing_configuration``.

**NOTES:**

This is a configuration parameter which is very unlikely to be used by an
application. If you find yourself wanting to use it in an application, please
reconsider and discuss this on the RTEMS Users mailing list.

.. COMMENT: === Ada Tasks ===

Ada Tasks
=========

This section defines the system configuration parameters supported by
``<rtems/confdefs.h>`` related to configuring RTEMS to support a task using Ada
tasking with GNAT/RTEMS.

These configuration parameters are only available when RTEMS is built with the
``--enable-ada`` configure option and the application specifies
``CONFIGURE_GNAT_RTEMS``.

Additionally RTEMS includes an Ada language binding to the Classic API which
has a test suite. This test suite is enabled only when``--enable-tests`` and
``--enable-expada`` are specified on the configure command.

.. COMMENT: === CONFIGURE_GNAT_RTEMS ===

.. _Specify Application Includes Ada Code:

Specify Application Includes Ada Code
-------------------------------------
.. index:: CONFIGURE_GNAT_RTEMS

*CONSTANT:*
    ``CONFIGURE_GNAT_RTEMS``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_GNAT_RTEMS`` is defined to inform RTEMS that the GNAT Ada run-time
is to be used by the application.

**NOTES:**

This configuration parameter is critical as it makes``<rtems/confdefs.h>``
configure the resources (POSIX API Threads, Mutexes, Condition Variables, and
Keys) used implicitly by the GNAT run-time.

.. COMMENT: === CONFIGURE_MAXIMUM_ADA_TASKS ===

.. _Specify the Maximum Number of Ada Tasks.:

Specify the Maximum Number of Ada Tasks.
----------------------------------------
.. index:: CONFIGURE_MAXIMUM_ADA_TASKS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_ADA_TASKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Undefined or positive.

*DEFAULT VALUE:*
    If ``CONFIGURE_GNAT_RTEMS`` is defined, then the default value is 20,
    otherwise the default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_ADA_TASKS`` is the number of Ada tasks that can be
concurrently active in the system.

**NOTES:**

None.

.. COMMENT: === CONFIGURE_MAXIMUM_FAKE_ADA_TASKS ===

.. _Specify the Maximum Fake Ada Tasks:

Specify the Maximum Fake Ada Tasks
----------------------------------
.. index:: CONFIGURE_MAXIMUM_FAKE_ADA_TASKS

*CONSTANT:*
    .. index:: ``CONFIGURE_MAXIMUM_FAKE_ADA_TASKS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 0.

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_FAKE_ADA_TASKS`` is the number of *fake* Ada tasks that can
be concurrently active in the system.  A *fake* Ada task is a non-Ada task that
makes calls back into Ada code and thus implicitly uses the Ada run-time.

**NOTES:**

None.

.. COMMENT: === PCI Library ===

PCI Library
===========

This section defines the system configuration parameters supported by
``rtems/confdefs.h`` related to configuring the PCI Library for RTEMS.

The PCI Library startup behaviour can be configured in four different ways
depending on how ``CONFIGURE_PCI_CONFIG_LIB`` is defined:

.. index:: PCI_LIB_AUTO

``PCI_LIB_AUTO``
  Used to enable the PCI auto configuration software. PCI will be automatically
  probed, PCI buses enumerated, all devices and bridges will be initialized
  using Plug & Play software routines. The PCI device tree will be populated
  based on the PCI devices found in the system, PCI devices will be configured
  by allocating address region resources automatically in PCI space according
  to the BSP or host bridge driver set up.

.. index:: PCI_LIB_READ

``PCI_LIB_READ``
  Used to enable the PCI read configuration software. The current PCI
  configuration is read to create the RAM representation (the PCI device tree)
  of the PCI devices present. PCI devices are assumed to already have been
  initialized and PCI buses enumerated, it is therefore required that a BIOS or
  a boot loader has set up configuration space prior to booting into RTEMS.

.. index:: PCI_LIB_STATIC

``PCI_LIB_STATIC``
  Used to enable the PCI static configuration software. The user provides a PCI
  tree with information how all PCI devices are to be configured at compile
  time by linking in a custom ``struct pci_bus pci_hb`` tree. The static PCI
  library will not probe PCI for devices, instead it will assume that all
  devices defined by the user are present, it will enumerate the PCI buses and
  configure all PCI devices in static configuration accordingly. Since probe
  and allocation software is not needed the startup is faster, has smaller
  footprint and does not require dynamic memory allocation.

.. index:: PCI_LIB_PERIPHERAL

``PCI_LIB_PERIPHERAL``
  Used to enable the PCI peripheral configuration. It is similar to
  ``PCI_LIB_STATIC``, but it will never write the configuration to the PCI
  devices since PCI peripherals are not allowed to access PCI configuration
  space.

Note that selecting ``PCI_LIB_STATIC`` or ``PCI_LIB_PERIPHERAL`` but not
defining ``pci_hb`` will reuslt in link errors. Note also that in these modes
Plug & Play is not performed.

.. COMMENT: === Go Tasks ===

Go Tasks
========

.. COMMENT: === CONFIGURE_ENABLE_GO ===

.. _Specify Application Includes Go Code:

Specify Application Includes Go Code
------------------------------------
.. index:: CONFIGURE_ENABLE_GO

*CONSTANT:*
    ``CONFIGURE_ENABLE_GO``

*DATA TYPE:*
    Boolean feature macro.

*RANGE:*
    Defined or undefined.

*DEFAULT VALUE:*
    This is not defined by default.

**DESCRIPTION:**

``CONFIGURE_ENABLE_GO`` is defined to inform RTEMS that the Go run-time is to
be used by the application.

**NOTES:**

The Go language support is experimental

.. COMMENT: === CONFIGURE_MAXIMUM_GOROUTINES ===

.. _Specify the maximum number of Go routines:

Specify the maximum number of Go routines
-----------------------------------------
.. index:: CONFIGURE_MAXIMUM_GOROUTINES

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_GOROUTINES``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 400

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_GOROUTINES`` is defined to specify the maximum number of Go
routines.

**NOTES:**

The Go language support is experimental

.. COMMENT: === CONFIGURE_MAXIMUM_GO_CHANNELS ===

.. _Specify the maximum number of Go Channels:

Specify the maximum number of Go Channels
-----------------------------------------
.. index:: CONFIGURE_MAXIMUM_GO_CHANNELS

*CONSTANT:*
    ``CONFIGURE_MAXIMUM_GO_CHANNELS``

*DATA TYPE:*
    Unsigned integer (``uint32_t``).

*RANGE:*
    Zero or positive.

*DEFAULT VALUE:*
    The default value is 500

**DESCRIPTION:**

``CONFIGURE_MAXIMUM_GO_CHANNELS`` is defined to specify the maximum number of
Go channels.

**NOTES:**

The Go language support is experimental

.. COMMENT: === Configuration Data Structures ===

Configuration Data Structures
=============================

It is recommended that applications be configured using ``<rtems/confdefs.h>``
as it is simpler and insulates applications from changes in the underlying data
structures.  However, it is sometimes important to understand the data
structures that are automatically filled in by the configuration parameters.
This section describes the primary configuration data structures.

If the user wishes to see the details of a particular data structure, they are
are advised to look at the source code. After all, that is one of the
advantages of RTEMS.