1------------------------------------------------------------------------------ 2-- -- 3-- GNAT COMPILER COMPONENTS -- 4-- -- 5-- S Y S T E M . R I D E N T -- 6-- -- 7-- S p e c -- 8-- -- 9-- Copyright (C) 1992-2021, Free Software Foundation, Inc. -- 10-- -- 11-- GNAT is free software; you can redistribute it and/or modify it under -- 12-- terms of the GNU General Public License as published by the Free Soft- -- 13-- ware Foundation; either version 3, or (at your option) any later ver- -- 14-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 15-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 16-- or FITNESS FOR A PARTICULAR PURPOSE. -- 17-- -- 18-- As a special exception under Section 7 of GPL version 3, you are granted -- 19-- additional permissions described in the GCC Runtime Library Exception, -- 20-- version 3.1, as published by the Free Software Foundation. -- 21-- -- 22-- You should have received a copy of the GNU General Public License and -- 23-- a copy of the GCC Runtime Library Exception along with this program; -- 24-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25-- <http://www.gnu.org/licenses/>. -- 26-- -- 27-- GNAT was originally developed by the GNAT team at New York University. -- 28-- Extensive contributions were provided by Ada Core Technologies Inc. -- 29-- -- 30------------------------------------------------------------------------------ 31 32-- This package defines the set of restriction identifiers. It is a generic 33-- package that is instantiated by the compiler/binder in package Rident, and 34-- is instantiated in package System.Restrictions for use at run-time. 35 36-- The reason that we make this a generic package is so that in the case of 37-- the instantiation in Rident for use at compile time and bind time, we can 38-- generate normal image tables for the enumeration types, which are needed 39-- for diagnostic and informational messages. At run-time we really do not 40-- want to waste the space for these image tables, and they are not needed, 41-- so we can do the instantiation under control of Discard_Names to remove 42-- the tables. 43 44--------------------------------------------------- 45-- Note On Compile/Run-Time Consistency Checking -- 46--------------------------------------------------- 47 48-- This unit is with'ed by the run-time (to make System.Restrictions which is 49-- used for run-time access to restriction information), by the compiler (to 50-- determine what restrictions are implemented and what their category is) and 51-- by the binder (in processing ali files, and generating the information used 52-- at run-time to access restriction information). 53 54-- Normally the version of System.Rident referenced in all three contexts 55-- should be the same. However, problems could arise in certain inconsistent 56-- builds that used inconsistent versions of the compiler and run-time. This 57-- sort of thing is not strictly correct, but it does arise when short-cuts 58-- are taken in build procedures. 59 60-- Previously, this kind of inconsistency could cause a significant problem. 61-- If versions of System.Rident accessed by the compiler and binder differed, 62-- then the binder could fail to recognize the R (restrictions line) in the 63-- ali file, leading to bind errors when restrictions were added or removed. 64 65-- The latest implementation avoids this problem by using a named scheme 66-- for recording restrictions, rather than a positional scheme that fails 67-- completely if restrictions are added or subtracted. Now the worst that 68-- happens at bind time in inconsistent builds is that unrecognized 69-- restrictions are ignored, and the consistency checking for restrictions 70-- might be incomplete, which is no big deal. 71 72pragma Compiler_Unit_Warning; 73 74generic 75package System.Rident is 76 pragma Preelaborate; 77 78 -- The following enumeration type defines the set of restriction 79 -- identifiers that are implemented in GNAT. 80 81 -- To add a new restriction identifier, add an entry with the name to be 82 -- used in the pragma, and add calls to the Restrict.Check_Restriction 83 -- routine as appropriate. 84 85 type Restriction_Id is 86 87 -- The following cases are checked for consistency in the binder. The 88 -- binder will check that every unit either has the restriction set, or 89 -- does not violate the restriction. 90 91 (Simple_Barriers, -- Ada 2012 (D.7 (10.9/3)) 92 Pure_Barriers, -- GNAT 93 No_Abort_Statements, -- (RM D.7(5), H.4(3)) 94 No_Access_Parameter_Allocators, -- Ada 2012 (RM H.4 (8.3/3)) 95 No_Access_Subprograms, -- (RM H.4(17)) 96 No_Allocators, -- (RM H.4(7)) 97 No_Anonymous_Allocators, -- Ada 2012 (RM H.4(8/1)) 98 No_Asynchronous_Control, -- (RM J.13(3/2) 99 No_Calendar, -- GNAT 100 No_Coextensions, -- Ada 2012 (RM H.4(8.2/3)) 101 No_Default_Stream_Attributes, -- Ada 2012 (RM 13.12.1(4/2)) 102 No_Delay, -- (RM H.4(21)) 103 No_Direct_Boolean_Operators, -- GNAT 104 No_Dispatch, -- (RM H.4(19)) 105 No_Dispatching_Calls, -- GNAT 106 No_Dynamic_Accessibility_Checks, -- GNAT 107 No_Dynamic_Attachment, -- Ada 2012 (RM E.7(10/3)) 108 No_Dynamic_CPU_Assignment, -- Ada 202x (RM D.7(10/3)) 109 No_Dynamic_Priorities, -- (RM D.9(9)) 110 No_Enumeration_Maps, -- GNAT 111 No_Entry_Calls_In_Elaboration_Code, -- GNAT 112 No_Entry_Queue, -- GNAT (Ravenscar) 113 No_Exception_Handlers, -- GNAT 114 No_Exception_Propagation, -- GNAT 115 No_Exception_Registration, -- GNAT 116 No_Exceptions, -- (RM H.4(12)) 117 No_Finalization, -- GNAT 118 No_Fixed_IO, -- GNAT 119 No_Fixed_Point, -- (RM H.4(15)) 120 No_Floating_Point, -- (RM H.4(14)) 121 No_IO, -- (RM H.4(20)) 122 No_Implicit_Conditionals, -- GNAT 123 No_Implicit_Dynamic_Code, -- GNAT 124 No_Implicit_Heap_Allocations, -- (RM D.8(8), H.4(3)) 125 No_Implicit_Task_Allocations, -- GNAT 126 No_Implicit_Protected_Object_Allocations, -- GNAT 127 No_Initialize_Scalars, -- GNAT 128 No_Local_Allocators, -- (RM H.4(8)) 129 No_Local_Timing_Events, -- (RM D.7(10.2/2)) 130 No_Local_Protected_Objects, -- Ada 2012 (D.7(10/1.3)) 131 No_Long_Long_Integers, -- GNAT 132 No_Multiple_Elaboration, -- GNAT 133 No_Nested_Finalization, -- (RM D.7(4)) 134 No_Protected_Type_Allocators, -- Ada 2012 (D.7 (10.3/2)) 135 No_Protected_Types, -- (RM H.4(5)) 136 No_Recursion, -- (RM H.4(22)) 137 No_Reentrancy, -- (RM H.4(23)) 138 No_Relative_Delay, -- Ada 2012 (D.7 (10.5/3)) 139 No_Requeue_Statements, -- Ada 2012 (D.7 (10.6/3)) 140 No_Secondary_Stack, -- GNAT 141 No_Select_Statements, -- Ada 2012 (D.7 (10.7/4)) 142 No_Specific_Termination_Handlers, -- (RM D.7(10.7/2)) 143 No_Standard_Allocators_After_Elaboration, -- Ada 2012 (RM D.7(19.1/2)) 144 No_Standard_Storage_Pools, -- GNAT 145 No_Stream_Optimizations, -- GNAT 146 No_Streams, -- GNAT 147 No_Task_Allocators, -- (RM D.7(7)) 148 No_Task_Attributes_Package, -- GNAT 149 No_Task_At_Interrupt_Priority, -- GNAT 150 No_Task_Hierarchy, -- (RM D.7(3), H.4(3)) 151 No_Task_Termination, -- GNAT (Ravenscar) 152 No_Tasks_Unassigned_To_CPU, -- Ada 202x (D.7(10.10/4)) 153 No_Tasking, -- GNAT 154 No_Terminate_Alternatives, -- (RM D.7(6)) 155 No_Unchecked_Access, -- (RM H.4(18)) 156 No_Unchecked_Conversion, -- (RM J.13(4/2)) 157 No_Unchecked_Deallocation, -- (RM J.13(5/2)) 158 Static_Priorities, -- GNAT 159 Static_Storage_Size, -- GNAT 160 161 -- The following require consistency checking with special rules. See 162 -- individual routines in unit Bcheck for details of what is required. 163 164 No_Default_Initialization, -- GNAT 165 166 -- The following cases do not require consistency checking and if used 167 -- as a configuration pragma within a specific unit, apply only to that 168 -- unit (e.g. if used in the package spec, do not apply to the body) 169 170 -- Note: No_Elaboration_Code is handled specially. Like the other 171 -- non-partition-wide restrictions, it can only be set in a unit that 172 -- is part of the extended main source unit (body/spec/subunits). But 173 -- it is sticky, in that if it is found anywhere within any of these 174 -- units, it applies to all units in this extended main source. 175 176 Immediate_Reclamation, -- (RM H.4(10)) 177 No_Dynamic_Sized_Objects, -- GNAT 178 No_Implementation_Aspect_Specifications, -- Ada 2012 AI-241 179 No_Implementation_Attributes, -- Ada 2005 AI-257 180 No_Implementation_Identifiers, -- Ada 2012 AI-246 181 No_Implementation_Pragmas, -- Ada 2005 AI-257 182 No_Implementation_Restrictions, -- GNAT 183 No_Implementation_Units, -- Ada 2012 AI-242 184 No_Implicit_Aliasing, -- GNAT 185 No_Implicit_Loops, -- GNAT 186 No_Elaboration_Code, -- GNAT 187 No_Obsolescent_Features, -- Ada 2005 AI-368 188 No_Unrecognized_Aspects, -- AI12-0389-1/02 189 No_Unrecognized_Pragmas, -- AI12-0389-1/02 190 No_Wide_Characters, -- GNAT 191 Static_Dispatch_Tables, -- GNAT 192 SPARK_05, -- GNAT 193 194 -- The following cases require a parameter value 195 196 No_Specification_Of_Aspect, -- 2012 (RM 13.12.1 (6.1/3)) 197 No_Use_Of_Attribute, -- 2012 (RM 13.12.1 (6.2/3)) 198 No_Use_Of_Pragma, -- 2012 (RM 13.12.1 (6.3/3)) 199 200 -- The following entries are fully checked at compile/bind time, which 201 -- means that the compiler can in general tell the minimum value which 202 -- could be used with a restrictions pragma. The binder can deduce the 203 -- appropriate minimum value for the partition by taking the maximum 204 -- value required by any unit. 205 206 Max_Protected_Entries, -- (RM D.7(14)) 207 Max_Select_Alternatives, -- (RM D.7(12)) 208 Max_Task_Entries, -- (RM D.7(13), H.4(3)) 209 210 -- The following entries are also fully checked at compile/bind time, 211 -- and the compiler can also at least in some cases tell the minimum 212 -- value which could be used with a restriction pragma. The difference 213 -- is that the contributions are additive, so the binder deduces this 214 -- value by adding the unit contributions. 215 216 Max_Tasks, -- (RM D.7(19), H.4(3)) 217 218 -- The following entries are checked at compile time only for zero/ 219 -- nonzero entries. This means that the compiler can tell at compile 220 -- time if a restriction value of zero is (would be) violated, but that 221 -- the compiler cannot distinguish between different non-zero values. 222 223 Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3)) 224 Max_Entry_Queue_Length, -- Ada 2012 (RM D.7 (19.1/2)) 225 226 -- The remaining entries are not checked at compile/bind time 227 228 Max_Storage_At_Blocking, -- (RM D.7(17)) 229 230 Not_A_Restriction_Id); 231 232 -- Synonyms permitted for historical purposes of compatibility. 233 -- Must be coordinated with Restrict.Process_Restriction_Synonym. 234 235 Boolean_Entry_Barriers : Restriction_Id renames Simple_Barriers; 236 Max_Entry_Queue_Depth : Restriction_Id renames Max_Entry_Queue_Length; 237 No_Dynamic_Interrupts : Restriction_Id renames No_Dynamic_Attachment; 238 No_Requeue : Restriction_Id renames No_Requeue_Statements; 239 No_Task_Attributes : Restriction_Id renames No_Task_Attributes_Package; 240 241 subtype All_Restrictions is Restriction_Id range 242 Simple_Barriers .. Max_Storage_At_Blocking; 243 -- All restrictions (excluding only Not_A_Restriction_Id) 244 245 subtype All_Boolean_Restrictions is Restriction_Id range 246 Simple_Barriers .. SPARK_05; 247 -- All restrictions which do not take a parameter 248 249 subtype Partition_Boolean_Restrictions is All_Boolean_Restrictions range 250 Simple_Barriers .. Static_Storage_Size; 251 -- Boolean restrictions that are checked for partition consistency. 252 -- Note that all parameter restrictions are checked for partition 253 -- consistency by default, so this distinction is only needed in the 254 -- case of Boolean restrictions. 255 256 subtype Cunit_Boolean_Restrictions is All_Boolean_Restrictions range 257 Immediate_Reclamation .. SPARK_05; 258 -- Boolean restrictions that are not checked for partition consistency 259 -- and that thus apply only to the current unit. Note that for these 260 -- restrictions, the compiler does not apply restrictions found in 261 -- with'ed units, parent specs etc. to the main unit, and vice versa. 262 263 subtype All_Parameter_Restrictions is 264 Restriction_Id range 265 No_Specification_Of_Aspect .. Max_Storage_At_Blocking; 266 -- All restrictions that take a parameter 267 268 subtype Integer_Parameter_Restrictions is 269 Restriction_Id range 270 Max_Protected_Entries .. Max_Storage_At_Blocking; 271 -- All restrictions taking an integer parameter 272 273 subtype Checked_Parameter_Restrictions is 274 All_Parameter_Restrictions range 275 Max_Protected_Entries .. Max_Entry_Queue_Length; 276 -- These are the parameter restrictions that can be at least partially 277 -- checked at compile/binder time. Minimally, the compiler can detect 278 -- violations of a restriction pragma with a value of zero reliably. 279 280 subtype Checked_Max_Parameter_Restrictions is 281 Checked_Parameter_Restrictions range 282 Max_Protected_Entries .. Max_Task_Entries; 283 -- Restrictions with parameters that can be checked in some cases by 284 -- maximizing among statically detected instances where the compiler 285 -- can determine the count. 286 287 subtype Checked_Add_Parameter_Restrictions is 288 Checked_Parameter_Restrictions range 289 Max_Tasks .. Max_Tasks; 290 -- Restrictions with parameters that can be checked in some cases by 291 -- summing the statically detected instances where the compiler can 292 -- determine the count. 293 294 subtype Checked_Val_Parameter_Restrictions is 295 Checked_Parameter_Restrictions range 296 Max_Protected_Entries .. Max_Tasks; 297 -- Restrictions with parameter where the count is known at least in some 298 -- cases by the compiler/binder. 299 300 subtype Checked_Zero_Parameter_Restrictions is 301 Checked_Parameter_Restrictions range 302 Max_Asynchronous_Select_Nesting .. Max_Entry_Queue_Length; 303 -- Restrictions with parameters where the compiler can detect the use of 304 -- the feature, and hence violations of a restriction specifying a value 305 -- of zero, but cannot detect specific values other than zero/nonzero. 306 307 subtype Unchecked_Parameter_Restrictions is 308 All_Parameter_Restrictions range 309 Max_Storage_At_Blocking .. Max_Storage_At_Blocking; 310 -- Restrictions with parameters where the compiler cannot ever detect 311 -- corresponding compile time usage, so the binder and compiler never 312 -- detect violations of any restriction. 313 314 ------------------------------------- 315 -- Restriction Status Declarations -- 316 ------------------------------------- 317 318 -- The following declarations are used to record the current status or 319 -- restrictions (for the current unit, or related units, at compile time, 320 -- and for all units in a partition at bind time or run time). 321 322 type Restriction_Flags is array (All_Restrictions) of Boolean; 323 type Restriction_Values is array (All_Parameter_Restrictions) of Natural; 324 type Parameter_Flags is array (All_Parameter_Restrictions) of Boolean; 325 326 type Restrictions_Info is record 327 Set : Restriction_Flags; 328 -- An entry is True in the Set array if a restrictions pragma has been 329 -- encountered for the given restriction. If the value is True for a 330 -- parameter restriction, then the corresponding entry in the Value 331 -- array gives the minimum value encountered for any such restriction. 332 333 Value : Restriction_Values; 334 -- If the entry for a parameter restriction in Set is True (i.e. a 335 -- restrictions pragma for the restriction has been encountered), then 336 -- the corresponding entry in the Value array is the minimum value 337 -- specified by any such restrictions pragma. Note that a restrictions 338 -- pragma specifying a value greater than Int'Last is simply ignored. 339 340 Violated : Restriction_Flags; 341 -- An entry is True in the violations array if the compiler has detected 342 -- a violation of the restriction. For a parameter restriction, the 343 -- Count and Unknown arrays have additional information. 344 345 Count : Restriction_Values; 346 -- If an entry for a parameter restriction is True in Violated, the 347 -- corresponding entry in the Count array may record additional 348 -- information. If the actual minimum count is known (by taking 349 -- maximums, or sums, depending on the restriction), it will be 350 -- recorded in this array. If not, then the value will remain zero. 351 -- The value is also zero for a non-violated restriction. 352 353 Unknown : Parameter_Flags; 354 -- If an entry for a parameter restriction is True in Violated, the 355 -- corresponding entry in the Unknown array may record additional 356 -- information. If the actual count is not known by the compiler (but 357 -- is known to be non-zero), then the entry in Unknown will be True. 358 -- This indicates that the value in Count is not known to be exact, 359 -- and the actual violation count may be higher. 360 361 -- Note: If Violated (K) is True, then either Count (K) > 0 or 362 -- Unknown (K) = True. It is possible for both these to be set. 363 -- For example, if Count (K) = 3 and Unknown (K) is True, it means 364 -- that the actual violation count is at least 3 but might be higher. 365 end record; 366 367 No_Restrictions : constant Restrictions_Info := 368 (Set => (others => False), 369 Value => (others => 0), 370 Violated => (others => False), 371 Count => (others => 0), 372 Unknown => (others => False)); 373 -- Used to initialize Restrictions_Info variables 374 375 ---------------------------------- 376 -- Profile Definitions and Data -- 377 ---------------------------------- 378 379 -- Note: to add a profile, modify the following declarations appropriately, 380 -- add Name_xxx to Snames, and add a branch to the conditions for pragmas 381 -- Profile and Profile_Warnings in the body of Sem_Prag. 382 383 type Profile_Name is 384 (No_Profile, 385 No_Implementation_Extensions, 386 Restricted_Tasking, 387 Restricted, 388 Ravenscar, 389 Jorvik, 390 GNAT_Extended_Ravenscar, 391 GNAT_Ravenscar_EDF); 392 -- Names of recognized profiles. No_Profile is used to indicate that a 393 -- restriction came from pragma Restrictions[_Warning], as opposed to 394 -- pragma Profile[_Warning]. Restricted_Tasking is a non-user profile that 395 -- contaings the minimal set of restrictions to trigger the user of the 396 -- restricted tasking runtime. Restricted is the corresponding user profile 397 -- that also restrict protected types. 398 399 subtype Profile_Name_Actual is Profile_Name 400 range No_Implementation_Extensions .. Profile_Name'Last; 401 -- Actual used profile names 402 403 type Profile_Data is record 404 Set : Restriction_Flags; 405 -- Set to True if given restriction must be set for the profile, and 406 -- False if it need not be set (False does not mean that it must not be 407 -- set, just that it need not be set). If the flag is True for a 408 -- parameter restriction, then the Value array gives the maximum value 409 -- permitted by the profile. 410 411 Value : Restriction_Values; 412 -- An entry in this array is meaningful only if the corresponding flag 413 -- in Set is True. In that case, the value in this array is the maximum 414 -- value of the parameter permitted by the profile. 415 end record; 416 417 Profile_Info : constant array (Profile_Name_Actual) of Profile_Data := ( 418 419 -- No_Implementation_Extensions profile 420 421 No_Implementation_Extensions => 422 423 (Set => 424 (No_Implementation_Aspect_Specifications => True, 425 No_Implementation_Attributes => True, 426 No_Implementation_Identifiers => True, 427 No_Implementation_Pragmas => True, 428 No_Implementation_Units => True, 429 others => False), 430 431 -- Value settings for Restricted profile (none 432 433 Value => 434 (others => 0)), 435 436 -- Restricted_Tasking Profile 437 438 Restricted_Tasking => 439 440 -- Restrictions for Restricted_Tasking profile 441 442 (Set => 443 (No_Abort_Statements => True, 444 No_Asynchronous_Control => True, 445 No_Dynamic_Attachment => True, 446 No_Dynamic_CPU_Assignment => True, 447 No_Dynamic_Priorities => True, 448 No_Local_Protected_Objects => True, 449 No_Protected_Type_Allocators => True, 450 No_Requeue_Statements => True, 451 No_Task_Allocators => True, 452 No_Task_Attributes_Package => True, 453 No_Task_Hierarchy => True, 454 No_Terminate_Alternatives => True, 455 Max_Asynchronous_Select_Nesting => True, 456 Max_Select_Alternatives => True, 457 Max_Task_Entries => True, 458 others => False), 459 460 -- Value settings for Restricted_Tasking profile 461 462 Value => 463 (Max_Asynchronous_Select_Nesting => 0, 464 Max_Select_Alternatives => 0, 465 Max_Task_Entries => 0, 466 others => 0)), 467 468 -- Restricted Profile 469 470 Restricted => 471 472 -- Restrictions for Restricted profile 473 474 (Set => 475 (No_Abort_Statements => True, 476 No_Asynchronous_Control => True, 477 No_Dynamic_Attachment => True, 478 No_Dynamic_CPU_Assignment => True, 479 No_Dynamic_Priorities => True, 480 No_Entry_Queue => True, 481 No_Local_Protected_Objects => True, 482 No_Protected_Type_Allocators => True, 483 No_Requeue_Statements => True, 484 No_Task_Allocators => True, 485 No_Task_Attributes_Package => True, 486 No_Task_Hierarchy => True, 487 No_Terminate_Alternatives => True, 488 Max_Asynchronous_Select_Nesting => True, 489 Max_Protected_Entries => True, 490 Max_Select_Alternatives => True, 491 Max_Task_Entries => True, 492 others => False), 493 494 -- Value settings for Restricted profile 495 496 Value => 497 (Max_Asynchronous_Select_Nesting => 0, 498 Max_Protected_Entries => 1, 499 Max_Select_Alternatives => 0, 500 Max_Task_Entries => 0, 501 others => 0)), 502 503 -- Ravenscar Profile 504 505 -- Note: the table entries here only represent the 506 -- required restriction profile for Ravenscar. The 507 -- full Ravenscar profile also requires: 508 509 -- pragma Dispatching_Policy (FIFO_Within_Priorities); 510 -- pragma Locking_Policy (Ceiling_Locking); 511 -- pragma Detect_Blocking; 512 513 Ravenscar => 514 515 -- Restrictions for Ravenscar = Restricted profile .. 516 517 (Set => 518 (No_Abort_Statements => True, 519 No_Asynchronous_Control => True, 520 No_Dynamic_Attachment => True, 521 No_Dynamic_CPU_Assignment => True, 522 No_Dynamic_Priorities => True, 523 No_Entry_Queue => True, 524 No_Local_Protected_Objects => True, 525 No_Protected_Type_Allocators => True, 526 No_Requeue_Statements => True, 527 No_Task_Allocators => True, 528 No_Task_Attributes_Package => True, 529 No_Task_Hierarchy => True, 530 No_Terminate_Alternatives => True, 531 Max_Asynchronous_Select_Nesting => True, 532 Max_Protected_Entries => True, 533 Max_Select_Alternatives => True, 534 Max_Task_Entries => True, 535 536 -- plus these additional restrictions: 537 538 No_Calendar => True, 539 No_Implicit_Heap_Allocations => True, 540 No_Local_Timing_Events => True, 541 No_Relative_Delay => True, 542 No_Select_Statements => True, 543 No_Specific_Termination_Handlers => True, 544 No_Task_Termination => True, 545 Simple_Barriers => True, 546 others => False), 547 548 -- Value settings for Ravenscar (same as Restricted) 549 550 Value => 551 (Max_Asynchronous_Select_Nesting => 0, 552 Max_Protected_Entries => 1, 553 Max_Select_Alternatives => 0, 554 Max_Task_Entries => 0, 555 others => 0)), 556 557 Jorvik | GNAT_Extended_Ravenscar => 558 559 -- Restrictions for Jorvik profile, previously known 560 -- known as the GNAT_Extended_Ravenscar profile. 561 562 -- Note: the table entries here only represent the 563 -- required restriction profile for Jorvik. The 564 -- full Jorvik profile also requires: 565 566 -- pragma Dispatching_Policy (FIFO_Within_Priorities); 567 -- pragma Locking_Policy (Ceiling_Locking); 568 -- pragma Detect_Blocking; 569 570 -- The differences between Ravenscar and Jorvik are 571 -- as follows: 572 -- 1) Ravenscar includes restriction Simple_Barriers; 573 -- Jorvik includes Pure_Barriers instead. 574 -- 2) The No_Implicit_Heap_Allocations restriction is 575 -- lifted and replaced with the following 576 -- restrictions: 577 -- No_Implicit_Task_Allocations 578 -- No_Implicit_Protected_Object_Allocations 579 -- 3) The following 6 restrictions are included in 580 -- Ravenscar but not in Jorvik: 581 -- No_Implicit_Heap_Allocations 582 -- No_Relative_Delay 583 -- Max_Entry_Queue_Length => 1 584 -- Max_Protected_Entries => 1 585 -- No_Dependence => Ada.Calendar 586 -- No_Dependence => Ada.Synchronous_Barriers 587 -- 588 -- The last of those 7 (i.e., No_Dep => Ada.Synch_Bars) 589 -- is not reflected here (see sem_prag.adb). 590 591 (Set => 592 (No_Abort_Statements => True, 593 No_Asynchronous_Control => True, 594 No_Dynamic_Attachment => True, 595 No_Dynamic_CPU_Assignment => True, 596 No_Dynamic_Priorities => True, 597 No_Local_Protected_Objects => True, 598 No_Protected_Type_Allocators => True, 599 No_Requeue_Statements => True, 600 No_Task_Allocators => True, 601 No_Task_Attributes_Package => True, 602 No_Task_Hierarchy => True, 603 No_Terminate_Alternatives => True, 604 Max_Asynchronous_Select_Nesting => True, 605 Max_Select_Alternatives => True, 606 Max_Task_Entries => True, 607 608 -- plus these additional restrictions: 609 610 No_Implicit_Task_Allocations => True, 611 No_Implicit_Protected_Object_Allocations 612 => True, 613 No_Local_Timing_Events => True, 614 No_Select_Statements => True, 615 No_Specific_Termination_Handlers => True, 616 No_Task_Termination => True, 617 Pure_Barriers => True, 618 others => False), 619 620 -- Value settings for Ravenscar (same as Restricted) 621 622 Value => 623 (Max_Asynchronous_Select_Nesting => 0, 624 Max_Select_Alternatives => 0, 625 Max_Task_Entries => 0, 626 others => 0)), 627 628 -- GNAT_Ravenscar_EDF Profile 629 630 -- Note: the table entries here only represent the 631 -- required restriction profile for GNAT_Ravenscar_EDF. 632 -- The full GNAT_Ravenscar_EDF profile also requires: 633 634 -- pragma Dispatching_Policy (EDF_Across_Priorities); 635 -- pragma Locking_Policy (Ceiling_Locking); 636 -- pragma Detect_Blocking; 637 638 GNAT_Ravenscar_EDF => 639 640 -- Restrictions for Ravenscar = Restricted profile .. 641 642 (Set => 643 (No_Abort_Statements => True, 644 No_Asynchronous_Control => True, 645 No_Dynamic_Attachment => True, 646 No_Dynamic_CPU_Assignment => True, 647 No_Dynamic_Priorities => True, 648 No_Entry_Queue => True, 649 No_Local_Protected_Objects => True, 650 No_Protected_Type_Allocators => True, 651 No_Requeue_Statements => True, 652 No_Task_Allocators => True, 653 No_Task_Attributes_Package => True, 654 No_Task_Hierarchy => True, 655 No_Terminate_Alternatives => True, 656 Max_Asynchronous_Select_Nesting => True, 657 Max_Protected_Entries => True, 658 Max_Select_Alternatives => True, 659 Max_Task_Entries => True, 660 661 -- plus these additional restrictions: 662 663 No_Calendar => True, 664 No_Implicit_Heap_Allocations => True, 665 No_Local_Timing_Events => True, 666 No_Relative_Delay => True, 667 No_Select_Statements => True, 668 No_Specific_Termination_Handlers => True, 669 No_Task_Termination => True, 670 Simple_Barriers => True, 671 others => False), 672 673 -- Value settings for Ravenscar (same as Restricted) 674 675 Value => 676 (Max_Asynchronous_Select_Nesting => 0, 677 Max_Protected_Entries => 1, 678 Max_Select_Alternatives => 0, 679 Max_Task_Entries => 0, 680 others => 0))); 681 682end System.Rident; 683