File : s-bbpara-sparc.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 -- 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 ERC32/LEON/LEON3 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 Natural;  --  Hertz
  51    pragma Import (Asm, Clock_Frequency, "clock_frequency");
  52    --  Frequency of the system clock
  53 
  54    ----------------
  55    -- Interrupts --
  56    ----------------
  57 
  58    --  The following are ERC32/LEON/LEON3 definitions and they cannot be
  59    --  modified.
  60 
  61    --  These definitions are in this package in order to isolate target
  62    --  dependencies.
  63 
  64    Number_Of_Interrupt_ID : constant := 15;
  65    --  Number of interrupts in the SPARC architecture
  66 
  67    Trap_Vectors : constant := 256;
  68    --  The SPARC arquitecture supports 256 vectors
  69 
  70    ------------------------
  71    -- Context Management --
  72    ------------------------
  73 
  74    --  The SPARC processor needs to save:
  75    --
  76    --   * 18 integer registers of 32 bits (7 global, 8 output, PSR, Y, and WIM)
  77    --     for normal processing
  78    --
  79    --   * 33 floating point registers of 32 bits
  80    --
  81    --   * the number of register windows saved to the stack
  82    --     (the input and local registers are saved to the stack).
  83    --
  84    --   * interrupt nesting level corresponding to the task
  85    --
  86    --   * for LEON, to slots for the Cache Control Register
  87    --
  88    --  This would be 55 slots for LEON/LEON3 and 53 otherwise, but
  89    --  this need to be rounded up to an even number to allow more
  90    --  efficient access.
  91    --
  92    --  For LEON, we store the Cache Control Register to be able to keep the
  93    --  cache status per task. We keep the base Cache Control Register (which
  94    --  is not affected by automatic changes related to the freeze-on-interrupt
  95    --  capability) and the actual Cache Control Register (the one directly
  96    --  extracted from the hardware).
  97 
  98    Base_CCR_Context_Index  : constant := 53;
  99    CCR_Context_Index       : constant := 54;
 100 
 101    Context_Buffer_Capacity : constant := 56;
 102 
 103    ------------
 104    -- Stacks --
 105    ------------
 106 
 107    Interrupt_Stack_Size : constant := 4 * 1024;  --  bytes
 108    --  Size of each of the interrupt stacks
 109 
 110    ----------
 111    -- CPUS --
 112    ----------
 113 
 114    Max_Number_Of_CPUs : constant := 1;
 115    --  Maximum number of CPUs
 116 
 117    Multiprocessor : constant Boolean := Max_Number_Of_CPUs /= 1;
 118    --  Are we on a multiprocessor board?
 119 
 120 end System.BB.Parameters;