File : s-bbpara-xtratum-tms570.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-2013, AdaCore                     --
  12 --                                                                          --
  13 -- GNARL 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. GNARL 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 package defines basic parameters used by the low level tasking system
  38 
  39 --  This is the TMS570 (ARMv7) version of this package
  40 
  41 pragma Restrictions (No_Elaboration_Code);
  42 
  43 package System.BB.Parameters is
  44    pragma Pure;
  45 
  46    --------------------
  47    -- Hardware clock --
  48    --------------------
  49 
  50    Clock_Frequency : constant := 1_000_000;  --  Hertz
  51    --  Frequency of the system clock (XtratuM resolution is 1 microsecond)
  52 
  53    ----------------
  54    -- Interrupts --
  55    ----------------
  56 
  57    --  These definitions are in this package in order to isolate target
  58    --  dependencies.
  59 
  60    Number_Of_Interrupt_ID : constant := 96 + 32;
  61    --  Number of interrupts supported by the VIC. For the TMS570 interrupts,
  62    --  we really only consider the 95 usable interrupt channels. The run time
  63    --  assumes the interrupt source to interrupt channel map is direct (1:1),
  64    --  as is the default, but the user can change this as long as the IRQ used
  65    --  by the system for alarms stays unchanged.
  66 
  67    Trap_Vectors : constant := 7;
  68    --  ARM in general has these traps:
  69    --    0   (at 16#0000#) Reset
  70    --    1   (at 16#0004#) Undefined Instruction (synchronous)
  71    --    2   (at 16#0008#) Supervisor Call (synchronous)
  72    --    3   (at 16#000C#) Abort - Prefetch (synchronous)
  73    --    4   (at 16#0010#) Abort - Data (asynchronous)
  74    --    5   (at 16#0014#) IRQ Trap (asynchronous)
  75    --    6   (at 16#0018#) FIQ Trap (asynchronous)
  76 
  77    ------------------------
  78    -- Context Management --
  79    ------------------------
  80 
  81    --  The run time stores a minimal amount of state in the thread context.
  82    --  Most state will be saved on the task's stack when calling a potentially
  83    --  blocking operation, or on the interrupt stack when the task is pre-
  84    --  empted. Most of the space is currently required for floating point
  85    --  state, which is saved lazily.
  86 
  87    --  The TMS570 processor needs to save:
  88 
  89    --   * 8 + 2 registers of 32 bits: r4-r11 (v1-v8), LR, SP
  90    --     for normal processing
  91    --   * 16 for s16-s31
  92    --   * 1 for fpscr
  93 
  94    Context_Buffer_Capacity : constant := 28;
  95 
  96    ------------
  97    -- Stacks --
  98    ------------
  99 
 100    Interrupt_Stack_Size : constant := 512;  --  bytes
 101    --  Size of each of the interrupt stacks. Each processor has its own
 102    --  set of interrupt stacks, one per interrupt priority.
 103 
 104    ----------
 105    -- CPUS --
 106    ----------
 107 
 108    Max_Number_Of_CPUs : constant := 1;
 109    --  Maximum number of CPUs
 110 
 111    Multiprocessor : constant Boolean := Max_Number_Of_CPUs /= 1;
 112    --  Are we on a multiprocessor board?
 113 
 114 end System.BB.Parameters;