summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-16 18:23:00 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2002-12-16 18:23:00 +0000
commit805e22b2051e9c6a75377ea6599654d7415da483 (patch)
treec259697c448b0c6f548f153c48c46a8d7a75970f /contrib
parent2c27ce73ee2229b0871c4ccad2342d8a4be85eff (diff)
downloadgcc-805e22b2051e9c6a75377ea6599654d7415da483.tar.gz
Merge basic-improvements-branch to trunk
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog10
-rw-r--r--contrib/gthr_supp_vxw_5x.c92
2 files changed, 99 insertions, 3 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index a8adeb3439a..c5f7da03029 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2002-11-09 Zack Weinberg <zack@codesourcery.com>
+
+ * gthr_supp_vxw_5x.c: New file.
+
2002-10-21 Richard Henderson <rth@redhat.com>
* paranoia.cc (real_c_float::image): Accomodate size of
@@ -181,7 +185,7 @@ Mon Jul 23 15:47:19 CEST 2001 Jan Hubicka <jh@suse.cz>
2001-06-14 Albert Chin-A-Young <china@thewrittenword.com>
- * contrib/gcc_update: Fix timestamp on gcc/f/intdoc.texi.
+ * contrib/gcc_update: Fix timestamp on gcc/f/intdoc.texi.
2001-06-13 Mark Mitchell <mark@codesourcery.com>
@@ -513,7 +517,7 @@ Sun Nov 28 00:41:44 1999 William Bader (william@nscs.fast.net)
* test_summary: Replace egcs with gcc. Update e-mail address.
1999-07-05 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
- Jerry Quinn <jquinn@nortelnetworks.com>
+ Jerry Quinn <jquinn@nortelnetworks.com>
* egcs_update (touch_files, apply_patch): New functions.
Use them. New command-line option --patch. Split test of local
@@ -668,7 +672,7 @@ Wed Aug 12 19:59:36 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* egcs_update: Assigned copyright to FSF.
Tue Aug 11 17:55:53 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
- Alexandre Oliva <oliva@dcc.unicamp.br>
+ Alexandre Oliva <oliva@dcc.unicamp.br>
* egcs_update: New switch --nostdflags and documentation
enhancements.
diff --git a/contrib/gthr_supp_vxw_5x.c b/contrib/gthr_supp_vxw_5x.c
new file mode 100644
index 00000000000..6ce288f3eb3
--- /dev/null
+++ b/contrib/gthr_supp_vxw_5x.c
@@ -0,0 +1,92 @@
+/* Kernel-side additional module for the VxWorks threading support
+ logic for GCC. Written 2002 by Zack Weinberg.
+
+ This file is distributed with GCC, but it is not part of GCC.
+ The contents of this file are in the public domain. */
+
+/* If you are using the Tornado IDE, copy this file to
+ $WIND_BASE/target/config/comps/src/gthread_supp.c. Then create a
+ file named 10comp_gthread_supp.cdf in target/config/comps/vxWorks
+ with the following contents:
+
+ Component INCLUDE_GCC_GTHREAD {
+ NAME GCC 3.x gthread support (required by C++)
+ CONFIGLETTES gthread_supp.c
+ REQUIRES INCLUDE_CPLUS
+ INCLUDE_WHEN INCLUDE_CPLUS
+ _FOLDER FOLDER_CPLUS
+ }
+
+ If you are using command line builds, instead copy this file to
+ $WIND_BASE/target/src/config/gthread_supp.c, and add the following
+ block to target/src/config/usrExtra.c:
+
+ #ifdef INCLUDE_CPLUS
+ #include "../../src/config/gthread_supp.c"
+ #endif
+
+ You should now be able to rebuild your application using GCC 3.x. */
+
+#include <vxWorks.h>
+#include <taskLib.h>
+
+/* This file provides these routines: */
+extern void *__gthread_get_tsd_data (WIND_TCB *tcb);
+extern void __gthread_set_tsd_data (WIND_TCB *tcb, void *data);
+
+extern void __gthread_enter_tsd_dtor_context (WIND_TCB *tcb);
+extern void __gthread_leave_tsd_dtor_context (WIND_TCB *tcb);
+
+/* Set and retrieve the TSD data block for the task TCB.
+
+ Possible choices for TSD_SLOT are:
+ reserved1
+ reserved2
+ spare1
+ spare2
+ spare3
+ spare4
+ (these are all fields of the TCB structure; all have type 'int').
+
+ If you find that the slot chosen by default is already used for
+ something else, simply change the #define below and recompile this
+ file. No other file should reference TSD_SLOT directly. */
+
+/* WARNING: This code is not 64-bit clean (it assumes that a pointer
+ can be held in an 'int' without truncation). As much of the rest
+ of VxWorks also makes this assumption, we can't really avoid it. */
+
+#define TSD_SLOT reserved1
+
+void *
+__gthread_get_tsd_data (WIND_TCB *tcb)
+{
+ return (void *) (tcb->TSD_SLOT);
+}
+
+void
+__gthread_set_tsd_data (WIND_TCB *tcb, void *data)
+{
+ tcb->TSD_SLOT = (int) data;
+}
+
+/* Enter and leave "TSD destructor context". This is defined as a
+ state in which it is safe to call free() from a task delete hook
+ on a memory block allocated by the task being deleted.
+ For VxWorks 5.x, nothing needs to be done. */
+
+#if __GNUC__ >= 2
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
+void
+__gthread_enter_tsd_dtor_context (WIND_TCB *tcb UNUSED)
+{
+}
+
+void
+__gthread_leave_tsd_dtor_context (WIND_TCB *tcb UNUSED)
+{
+}