From c956c1be72ecbe929fce84221c683442f4497f00 Mon Sep 17 00:00:00 2001 From: Matthew Gingell Date: Wed, 6 Jun 2007 12:50:30 +0200 Subject: s-stchop-vxworks.adb (Set_Stack_Info): Instead of trying to map the VxWorks task descriptor in the Ada run time... 2007-04-20 Matthew Gingell Jose Ruiz * s-stchop-vxworks.adb (Set_Stack_Info): Instead of trying to map the VxWorks task descriptor in the Ada run time, call a C subprogram (__gnat_get_stack_info) that extracts the required information. * sysdep.c: Back out temporary lynxos workaround. (__gnat_get_stack_info): Add this procedure that passes to the Ada run time the stack information associated to the currently executing task. Only VxWorks systems require this function. From-SVN: r125471 --- gcc/ada/sysdep.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'gcc/ada/sysdep.c') diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 595cc3d..cde8e54 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -872,28 +872,30 @@ __gnat_get_task_options (void) #endif } -#endif +typedef struct +{ + int size; + char *base; + char *end; +} stack_info; -#ifdef __Lynx__ +/* __gnat_get_stack_info is used by s-stchop.adb only for VxWorks. This + procedure fills the stack information associated to the currently + executing task. */ +extern void __gnat_get_stack_info (stack_info *vxworks_stack_info); -/* - The following code works around a problem in LynxOS version 4.2. As - of that version, the symbol pthread_mutex_lock has been removed - from libc and replaced with an inline C function in a system - header. - - LynuxWorks has indicated that this is a bug and that they intend to - put that symbol back in libc in a future patch level, following - which this patch can be removed. However, for the time being we use - a wrapper which can be imported from the runtime. -*/ +void +__gnat_get_stack_info (stack_info *vxworks_stack_info) +{ + TASK_DESC descriptor; -#include + /* Ask the VxWorks kernel about stack values */ + taskInfoGet (taskIdSelf (), &descriptor); -int -__gnat_pthread_mutex_lock (pthread_mutex_t *mutex) -{ - return pthread_mutex_lock (mutex); + /* Fill the stack data with the information provided by the kernel */ + vxworks_stack_info->size = descriptor.td_stackSize; + vxworks_stack_info->base = descriptor.td_pStackBase; + vxworks_stack_info->end = descriptor.td_pStackEnd; } -#endif /* __Lynx__ */ +#endif -- cgit v1.1