sh.c (shift_insns_rtx, [...]): Truncate shift counts to avoid out-of-bounds array...
[official-gcc.git] / gcc / ada / s-stchop-rtems.adb
blob615950e7fee790e245123a806eb13e1bbf69c386
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . S T A C K _ C H E C K I N G . O P E R A T I O N S --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
10 -- --
11 -- GNARL is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNARL was developed by the GNARL team at Florida State University. --
28 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
29 -- --
30 ------------------------------------------------------------------------------
32 -- This is the RTEMS version of this package.
33 -- This file should be kept synchronized with the general implementation
34 -- provided by s-stchop.adb.
36 pragma Restrictions (No_Elaboration_Code);
37 -- We want to guarantee the absence of elaboration code because the
38 -- binder does not handle references to this package.
40 with Ada.Exceptions;
42 with Interfaces.C; use Interfaces.C;
44 package body System.Stack_Checking.Operations is
46 ----------------------------
47 -- Invalidate_Stack_Cache --
48 ----------------------------
50 procedure Invalidate_Stack_Cache (Any_Stack : Stack_Access) is
51 pragma Warnings (Off, Any_Stack);
52 begin
53 Cache := Null_Stack;
54 end Invalidate_Stack_Cache;
56 -----------------------------
57 -- Notify_Stack_Attributes --
58 -----------------------------
60 procedure Notify_Stack_Attributes
61 (Initial_SP : System.Address;
62 Size : System.Storage_Elements.Storage_Offset)
65 -- RTEMS keeps all the information we need.
67 pragma Unreferenced (Size);
68 pragma Unreferenced (Initial_SP);
70 begin
71 null;
72 end Notify_Stack_Attributes;
74 -----------------
75 -- Stack_Check --
76 -----------------
78 function Stack_Check
79 (Stack_Address : System.Address) return Stack_Access
81 pragma Unreferenced (Stack_Address);
83 -- RTEMS has a routine to check this. So use it.
84 function rtems_stack_checker_is_blown return Interfaces.C.int;
85 pragma Import (C,
86 rtems_stack_checker_is_blown, "rtems_stack_checker_is_blown");
88 begin
89 -- RTEMS has a routine to check this. So use it.
91 if rtems_stack_checker_is_blown /= 0 then
92 Ada.Exceptions.Raise_Exception
93 (E => Storage_Error'Identity,
94 Message => "stack overflow detected");
95 end if;
97 return null;
99 end Stack_Check;
101 ------------------------
102 -- Update_Stack_Cache --
103 ------------------------
105 procedure Update_Stack_Cache (Stack : Stack_Access) is
106 begin
107 if not Multi_Processor then
108 Cache := Stack;
109 end if;
110 end Update_Stack_Cache;
112 end System.Stack_Checking.Operations;