diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-08 06:43:15 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-08 06:43:15 +0000 |
commit | 0244eba9499e50ee95d1b579cdd9dab7582ac878 (patch) | |
tree | 0e9bcf675dab91b0449162ce9f89d2a5215ca347 /gcc/ada/s-osinte-darwin.ads | |
parent | 1f39e3a77c742111144284de796328ff5796a421 (diff) | |
download | gcc-0244eba9499e50ee95d1b579cdd9dab7582ac878.tar.gz |
2008-04-08 Eric Botcazou <ebotcazou@adacore.com>
Arnaud Charlet <charlet@adacore.com>
* s-osinte-linux-alpha.ads, s-osinte-linux-hppa.ads: Removed.
s-taspri-posix-noaltstack.ads, s-linux.ads, s-linux-alpha.ads,
s-linux-hppa.ads: New files. Disable alternate stack on ia64-hpux.
* s-osinte-lynxos-3.ads,
(Alternate_Stack): Remove when not needed. Simplify declaration
otherwise.
(Alternate_Stack_Size): New constant.
s-osinte-mingw.ads, s-taprop-mingw.adb: Code clean up: avoid use of
'Unrestricted_Access.
* s-osinte-hpux.ads, s-osinte-solaris-posix.ads, s-osinte-aix.ads,
s-osinte-lynxos.ads, s-osinte-freebsd.ads s-osinte-darwin.ads,
s-osinte-tru64.ads, s-osinte-irix.ads, s-osinte-linux.ads,
s-osinte-solaris.ads, s-osinte-vms.ads
(SA_ONSTACK): New constant.
(stack_t): New record type.
(sigaltstack): New imported function.
(Alternate_Stack): New imported variable.
(Alternate_Stack_Size): New constant.
* system-linux-x86_64.ads: (Stack_Check_Probes): Set to True.
* s-taspri-lynxos.ads, s-taspri-solaris.ads, s-taspri-tru64.ads,
s-taspri-hpux-dce.ads (Task_Address): New subtype of System.Address
(Task_Address_Size): New constant size of System.Address
(Alternate_Stack_Size): New constant.
* s-taprop-posix.adb, s-taprop-linux.adb (Get_Stack_Attributes): Delete.
(Enter_Task): Do not notify stack to System.Stack_Checking.Operations.
Establish the alternate stack if the platform makes use of n alternate
signal stack for stack overflows.
(Create_Task): Take into account the alternate stack in the stack size.
(Initialize): Save the address of the alternate stack into the ATCB for
the environment task.
(Create_Task): Fix assertions for NPTL library (vs old LinuxThreads).
* s-parame.adb (Minimum_Stack_Size): Increase value to 16K to
* system-linux-x86.ads: (Stack_Check_Probes): Set to True.
* s-intman-posix.adb:
(Initialize): Set SA_ONSTACK for SIGSEGV if the platform makes use of an
alternate signal stack for stack overflows.
* init.c (__gnat_adjust_context_for_raise, Linux version): On i386 and
x86-64, adjust the saved value of the stack pointer if the signal was
raised by a stack checking probe.
(HP-UX section): Use global __gnat_alternate_stack as signal handler
stack and only for SIGSEGV.
(Linux section): Likewise on x86 and x86-64.
[VxWorks section]
(__gnat_map_signal): Now static.
(__gnat_error_handler): Not static any more.
(__gnat_adjust_context_for_raise): New function. Signal context
adjustment for PPC && !VTHREADS && !RTP, as required by the zcx
propagation circuitry.
(__gnat_error_handler): Second argument of a sigaction handler is a
pointer, not an int, and is unused.
Adjust signal context before mapping to exception.
Install signal handlers for LynxOS case.
* s-taskin.ads (Common_ATCB): New field Task_Alternate_Stack.
(Task_Id): Set size to Task_Address_Size
(To_Task_id): Unchecked convert from Task_Address vice System.Address
(To_Address): Unchecked convert to Task_Address vice System.Address
* s-tassta.adb (Task_Wrapper): Define the alternate stack and save its
address into the ATCB if the platform makes use of an alternate signal
stack for stack overflows.
(Free_Task): Add call to Finalize_Attributes_Link.
Add argument Relative_Deadline to pass the value specified for
the task. This is not yet used for any target.
* s-tassta.ads (Create_Task): Add argument Relative_Deadline to pass
the value specified for the task.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134004 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-osinte-darwin.ads')
-rw-r--r-- | gcc/ada/s-osinte-darwin.ads | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/gcc/ada/s-osinte-darwin.ads b/gcc/ada/s-osinte-darwin.ads index da97aa0323c..8dd28dbd0e5 100644 --- a/gcc/ada/s-osinte-darwin.ads +++ b/gcc/ada/s-osinte-darwin.ads @@ -162,6 +162,7 @@ package System.OS_Interface is SIG_IGN : constant := 1; SA_SIGINFO : constant := 16#0040#; + SA_ONSTACK : constant := 16#0001#; function sigaction (sig : Signal; @@ -229,10 +230,10 @@ package System.OS_Interface is --------- function lwp_self return System.Address; + pragma Import (C, lwp_self, "pthread_self"); -- lwp_self does not exist on this thread library, revert to pthread_self -- which is the closest approximation (with getpid). This function is -- needed to share 7staprop.adb across POSIX-like targets. - pragma Import (C, lwp_self, "pthread_self"); ------------- -- Threads -- @@ -264,22 +265,39 @@ package System.OS_Interface is -- Stack -- ----------- + type stack_t is record + ss_sp : System.Address; + ss_size : size_t; + ss_flags : int; + end record; + pragma Convention (C, stack_t); + + function sigaltstack + (ss : not null access stack_t; + oss : access stack_t) return int; + pragma Import (C, sigaltstack, "sigaltstack"); + + Alternate_Stack : aliased System.Address; + -- This is a dummy definition, never used (Alternate_Stack_Size is null) + + Alternate_Stack_Size : constant := 0; + -- No alternate signal stack is used on this platform + Stack_Base_Available : constant Boolean := False; - -- Indicates wether the stack base is available on this target. - -- This allows us to share s-osinte.adb between all the FSU run time. - -- Note that this value can only be true if pthread_t has a complete - -- definition that corresponds exactly to the C header files. + -- Indicates wether the stack base is available on this target. This allows + -- us to share s-osinte.adb between all the FSU run time. Note that this + -- value can only be true if pthread_t has a complete definition that + -- corresponds exactly to the C header files. function Get_Stack_Base (thread : pthread_t) return System.Address; pragma Inline (Get_Stack_Base); - -- returns the stack base of the specified thread. - -- Only call this function when Stack_Base_Available is True. + -- returns the stack base of the specified thread. Only call this function + -- when Stack_Base_Available is True. function Get_Page_Size return size_t; function Get_Page_Size return System.Address; pragma Import (C, Get_Page_Size, "getpagesize"); - -- returns the size of a page, or 0 if this is not relevant on this - -- target + -- Returns the size of a page, or 0 if this is not relevant on this target PROT_NONE : constant := 0; PROT_READ : constant := 1; @@ -290,9 +308,10 @@ package System.OS_Interface is PROT_ON : constant := PROT_NONE; PROT_OFF : constant := PROT_ALL; - function mprotect (addr : System.Address; - len : size_t; - prot : int) return int; + function mprotect + (addr : System.Address; + len : size_t; + prot : int) return int; pragma Import (C, mprotect); --------------------------------------- @@ -528,13 +547,6 @@ private end record; pragma Convention (C, siginfo_t); - type stack_t is record - ss_sp : System.Address; - ss_size : int; - ss_flags : int; - end record; - pragma Convention (C, stack_t); - type mcontext_t is new System.Address; type ucontext_t is record |