File : s-bbpara-xtratum-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-2012, 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 XtratuM 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 to isolate target dependencies
  58 
  59    Number_Of_Interrupt_ID : constant := 15 + 32;
  60    --  Number of interrupts in XtratuM. There are 15 hardware interrupts (as
  61    --  expected for SPARC architectures) plus other 32 for extended interrupts
  62    --  corresponding to traps 0xE0 to 0xFF.
  63 
  64    Trap_Vectors : constant := 256;
  65    --  The SPARC arquitecture supports 256 vectors (the last 32 for XtratuM
  66    --  extended interrupts).
  67 
  68    ------------------------
  69    -- Context Management --
  70    ------------------------
  71 
  72    --  The SPARC processor needs to save:
  73 
  74    --   * 18 integer registers of 32 bits (7 global, 8 output, PSR, Y, and WIM)
  75    --     for normal processing
  76 
  77    --   * 33 floating point registers of 32 bits
  78 
  79    --   * the number of register windows saved to the stack
  80    --     (the input and local registers are saved to the stack).
  81 
  82    --   * interrupt nesting level corresponding to the task
  83 
  84    --   * for LEON, to slots for the Cache Control Register
  85 
  86    --  This would be 55 slots for LEON/LEON3 and 53 otherwise, but this need to
  87    --  be rounded up to an even number to allow more efficient access.
  88 
  89    --  For LEON, we store the Cache Control Register to be able to keep the
  90    --  cache status per task. We keep the base Cache Control Register (which
  91    --  is not affected by automatic changes related to the freeze-on-interrupt
  92    --  capability) and the actual Cache Control Register (the one directly
  93    --  extracted from the hardware).
  94 
  95    Base_CCR_Context_Index : constant := 53;
  96    CCR_Context_Index      : constant := 54;
  97 
  98    Context_Buffer_Capacity : constant := 56;
  99 
 100    ------------
 101    -- Stacks --
 102    ------------
 103 
 104    Interrupt_Stack_Size : constant := 4 * 1024;
 105    --  Size of each of the interrupt stacks in bytes
 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;