1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
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 --
9 -- Copyright (C) 1999-2009, Free Software Foundation, Inc. --
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. --
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. --
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/>. --
27 -- GNARL was developed by the GNARL team at Florida State University. --
28 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
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.
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
);
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
);
72 end Notify_Stack_Attributes
;
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
;
86 rtems_stack_checker_is_blown
, "rtems_stack_checker_is_blown");
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");
101 ------------------------
102 -- Update_Stack_Cache --
103 ------------------------
105 procedure Update_Stack_Cache
(Stack
: Stack_Access
) is
107 if not Multi_Processor
then
110 end Update_Stack_Cache
;
112 end System
.Stack_Checking
.Operations
;