File : s-bb.ads


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
   4 --                                                                          --
   5 --                             S Y S T E M . B B                            --
   6 --                                                                          --
   7 --                                  S p e c                                 --
   8 --                                                                          --
   9 --        Copyright (C) 1999-2002 Universidad Politecnica de Madrid         --
  10 --             Copyright (C) 2003-2004 The European Space Agency            --
  11 --                     Copyright (C) 2003-2011, AdaCore                     --
  12 --                                                                          --
  13 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14 -- terms of the  GNU General Public License as published  by the Free Soft- --
  15 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
  16 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18 -- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
  19 --                                                                          --
  20 --                                                                          --
  21 --                                                                          --
  22 --                                                                          --
  23 --                                                                          --
  24 -- You should have received a copy of the GNU General Public License and    --
  25 -- a copy of the GCC Runtime Library Exception along with this program;     --
  26 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
  27 -- <http://www.gnu.org/licenses/>.                                          --
  28 --                                                                          --
  29 -- GNARL was developed by the GNARL team at Florida State University.       --
  30 -- Extensive contributions were provided by Ada Core Technologies, Inc.     --
  31 --                                                                          --
  32 -- The port of GNARL to bare board targets was initially developed by the   --
  33 -- Real-Time Systems Group at the Technical University of Madrid.           --
  34 --                                                                          --
  35 ------------------------------------------------------------------------------
  36 
  37 --  This is the root package of the bare board implementation of the low level
  38 --  tasking support for Ravenscar compliant run times.
  39 
  40 pragma Restrictions (No_Elaboration_Code);
  41 --  Ensure no elaboration code to avoid possible elaboration circularities
  42 
  43 package System.BB is
  44    pragma Pure;
  45 
  46    --  All of the package specifications in the System.BB hierarchy are system
  47    --  independent with the exception of the Parameters package which specifies
  48    --  values of constants describing facts about a given system/architecture,
  49    --  such as number of interrupt levels or trap vectors. Each box represents
  50    --  a package specification, with directly below it the main subprograms
  51    --  provided. Lines indicate a dependency of the upper spec on the lower
  52    --  one. In addition to the packages listed here, specific ports may define
  53    --  specifications for functionality unique to each platform, or to factor
  54    --  out common definitions needed in the implementation.
  55 
  56    --  Most ports will need just two system-specific implementation bodies:
  57 
  58    --     * s-bbcppr.adb: CPU_Primitives body for each CPU architecture
  59 
  60    --     * s-bbbosu.adb: Board_Support body for each supported board
  61 
  62    --   .----------------------------------------------------------.
  63    --   |          S Y S T E M . O S _ I N T E R F A C E           |
  64    --   '----------------------------------------------------------'
  65    --       |              |                              |     |
  66    --       |              |        .-------------------. |     |
  67    --       |              |        | BB.Threads.Queues | |     |
  68    --       |              |        '-------------------' |     |
  69    --       |              |                Insert        |     |
  70    --       |              |                Extract       |     |
  71    --       |              |            Change_Priority   |     |
  72    --       |              |                   |          |     |
  73    --       |     .------------------.     .----------------.   |
  74    --       |     | BB.Board_Support |     |   BB.Threads   |   |
  75    --       |     '------------------'     '----------------'   |
  76    --       |       Initialize_Board          Thread_Self       |
  77    --       |           Set_Alarm             Set_Priority      |
  78    --       |          Read_Clock             Get_Priority      |
  79    --       |     Get_Interrupt_Request       Sleep/Wakeup      |
  80    --       |        |     |     |             |        |       |
  81    --   .---------------.  |  .-------------------.  .-------------.
  82    --   | BB.Interrupts |  |  | BB.CPU_Primitives |  |   BB.Time   |
  83    --   '---------------'  |  '-------------------'  '-------------'
  84    --    Attach_Handler    |   Context_Switch             Clock
  85    --   Current_Interrupt  |   Get_Context             Delay_Until
  86    --                |     |   Set_Context
  87    --                |     |   Install_Handler
  88    --                |     |   Disable_Interrupts
  89    --                |     |   Enable_Interrupts
  90    --                |     |     |
  91    --            .-------------------.          .---------------.
  92    --            |   BB.Parameters   |-.        | BB.Protection |
  93    --            '-------------------' |-.      '---------------'
  94    --              '-------------------' |         Enter_Kernel
  95    --                 '------------------'         Leave_Kernel
  96 
  97 end System.BB;