diff options
author | Matthew Gingell <gingell@adacore.com> | 2007-06-06 12:50:30 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-06-06 12:50:30 +0200 |
commit | c956c1be72ecbe929fce84221c683442f4497f00 (patch) | |
tree | b9ec064df236278e82d16c0d220b357e26f258e4 /gcc/ada/sysdep.c | |
parent | c7f0bdd2f88d0182bf1d17dbe073754d08cb3ec3 (diff) | |
download | gcc-c956c1be72ecbe929fce84221c683442f4497f00.tar.gz |
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 <gingell@adacore.com>
Jose Ruiz <ruiz@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r-- | gcc/ada/sysdep.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 595cc3d9edf..cde8e544eb7 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 <pthread.h> + /* 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 |