File : s-bbcpsp-6xx.ads
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . B B . C P U _ S P E C I F I C --
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-2015, 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 ------------------------------------------------------------------------------
33
34 -- This package contains the primitives which are dependent on the
35 -- underlying processor.
36
37 pragma Restrictions (No_Elaboration_Code);
38
39 with System;
40
41 package System.BB.CPU_Specific is
42 pragma Preelaborate;
43
44 ------------------------
45 -- Context management --
46 ------------------------
47
48 -- The context buffer is a type that represents thread's state and is not
49 -- otherwise stored in main memory. This typically includes all user-
50 -- visible registers, and possibly some other status as well.
51
52 -- In case different contexts have different amounts of state (for example,
53 -- due to absence of a floating-point unit in a particular configuration,
54 -- or just the FPU not being used), it is expected that these details are
55 -- handled in the implementation.
56
57 type Context_Buffer is record
58
59 -- Only callee-saved registers need to be saved
60
61 R1 : System.Address;
62 R2 : System.Address;
63 R13 : System.Address;
64 R14 : System.Address;
65 R15 : System.Address;
66 R16 : System.Address;
67 R17 : System.Address;
68 R18 : System.Address;
69 R19 : System.Address;
70 R20 : System.Address;
71 R21 : System.Address;
72 R22 : System.Address;
73 R23 : System.Address;
74 R24 : System.Address;
75 R25 : System.Address;
76 R26 : System.Address;
77 R27 : System.Address;
78 R28 : System.Address;
79 R29 : System.Address;
80 R30 : System.Address;
81 R31 : System.Address;
82
83 CR : System.Address;
84 LR : System.Address;
85
86 F14 : Long_Float;
87 F15 : Long_Float;
88 F16 : Long_Float;
89 F17 : Long_Float;
90 F18 : Long_Float;
91 F19 : Long_Float;
92 F20 : Long_Float;
93 F21 : Long_Float;
94 F22 : Long_Float;
95 F23 : Long_Float;
96 F24 : Long_Float;
97 F25 : Long_Float;
98 F26 : Long_Float;
99 F27 : Long_Float;
100 F28 : Long_Float;
101 F29 : Long_Float;
102 F30 : Long_Float;
103 F31 : Long_Float;
104 FPSCR : Long_Long_Integer;
105 end record;
106
107 Stack_Alignment : constant := 16;
108 -- Stack alignment defined by the ABI
109
110 --------------------
111 -- Initialization --
112 --------------------
113
114 procedure Initialize_CPU;
115
116 procedure Finish_Initialize_Context
117 (Buffer : not null access Context_Buffer);
118 -- Complete context initialization
119
120 ---------------------------------
121 -- Interrupt and trap handling --
122 ---------------------------------
123
124 type Vector_Id is range 0 .. 16#2fff#;
125
126 External_Interrupt_Excp : constant Vector_Id := 16#500#;
127 Decrementer_Excp : constant Vector_Id := 16#900#;
128
129 procedure Install_Exception_Handler
130 (Service_Routine : System.Address;
131 Vector : Vector_Id);
132 -- Install a new handler in the exception table
133
134 procedure Install_Error_Handlers;
135 -- Called at system initialization time to install a CPU specific trap
136 -- handler, GNAT_Error_Handler, that converts synchronous traps to
137 -- appropriate exceptions.
138
139 -------------
140 -- Variant --
141 -------------
142
143 PowerPC_Book_E : constant Boolean := False;
144 -- Does the CPU implement PowerPC Book-E standard
145
146 end System.BB.CPU_Specific;