File : s-bbpara-sam4s.ads


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                  GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                --
   4 --                                                                          --
   5 --                   S Y S T E M . B B . P A R A M E T E R S                --
   6 --                                                                          --
   7 --                                  S p e c                                 --
   8 --                                                                          --
   9 --        Copyright (C) 1999-2002 Universidad Politecnica de Madrid         --
  10 --             Copyright (C) 2003-2005 The European Space Agency            --
  11 --                     Copyright (C) 2003-2016, 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 -- GNAT was originally developed  by the GNAT team at  New York 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 package defines basic parameters used by the low level tasking system
  38 
  39 --  This is the SAM (ARMv7-M) version of this package
  40 
  41 pragma Restrictions (No_Elaboration_Code);
  42 
  43 with System.BB.Board_Parameters;
  44 with System.BB.MCU_Parameters;
  45 
  46 package System.BB.Parameters is
  47    pragma Preelaborate (System.BB.Parameters);
  48 
  49    Clock_Frequency : constant := Board_Parameters.Clock_Frequency;
  50 
  51    Ticks_Per_Second : constant := Clock_Frequency;
  52 
  53    Has_FPU : constant Boolean := MCU_Parameters.Has_FPU;
  54    --  Set to true if core has a FPU
  55 
  56    ----------------
  57    -- Interrupts --
  58    ----------------
  59 
  60    --  These definitions are in this package in order to isolate target
  61    --  dependencies.
  62 
  63    Number_Of_Interrupt_ID : constant := MCU_Parameters.Number_Of_Interrupts;
  64    --  Number of interrupts (for both the interrupt controller and the
  65    --  Sys_Tick_Trap). This static constant is used to declare a type, and
  66    --  the handler table.
  67 
  68    Trap_Vectors : constant := 17;
  69    --  While on this target there is little difference between interrupts
  70    --  and traps, we consider the following traps:
  71    --
  72    --    Name                        Nr
  73    --
  74    --    Reset_Vector                 1
  75    --    NMI_Vector                   2
  76    --    Hard_Fault_Vector            3
  77    --    Mem_Manage_Vector            4
  78    --    Bus_Fault_Vector             5
  79    --    Usage_Fault_Vector           6
  80    --    SVC_Vector                  11
  81    --    Debug_Mon_Vector            12
  82    --    Pend_SV_Vector              14
  83    --    Sys_Tick_Vector             15
  84    --    Interrupt_Request_Vector    16
  85    --
  86    --  These trap vectors correspond to different low-level trap handlers in
  87    --  the run time. Note that as all interrupt requests (IRQs) will use the
  88    --  same interrupt wrapper, there is no benefit to consider using separate
  89    --  vectors for each.
  90 
  91    Context_Buffer_Capacity : constant := 10;
  92    --  The context buffer contains registers r4 .. r11 and the SP_process
  93    --  (PSP). The size is rounded up to an even number for alignment
  94 
  95    ------------
  96    -- Stacks --
  97    ------------
  98 
  99    Interrupt_Stack_Size : constant := 2 * 1024;
 100    --  Size of each of the interrupt stacks in bytes. While there nominally is
 101    --  an interrupt stack per interrupt priority, the entire space is used as a
 102    --  single stack.
 103 
 104    Interrupt_Sec_Stack_Size : constant := 128;
 105    --  Size of the secondary stack for interrupt handlers
 106 
 107    ----------
 108    -- CPUS --
 109    ----------
 110 
 111    Max_Number_Of_CPUs : constant := 1;
 112    --  Maximum number of CPUs
 113 
 114    Multiprocessor : constant Boolean := Max_Number_Of_CPUs /= 1;
 115    --  Are we on a multiprocessor board?
 116 
 117 end System.BB.Parameters;