OSDN Git Service

2010-04-06 Matthias Klose <doko@ubuntu.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / sysdep.c
index a27c147..5af4299 100644 (file)
 
 #ifdef __vxworks
 #include "ioLib.h"
+#if ! defined (__VXWORKSMILS__)
 #include "dosFsLib.h"
-#if ! defined ( __RTP__) && ! defined (VTHREADS)
+#endif
+#if ! defined (__RTP__) && (! defined (VTHREADS) || defined (__VXWORKSMILS__))
 # include "nfsLib.h"
 #endif
 #include "selectLib.h"
@@ -868,6 +870,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
 
   (*Unlock_Task) ();
 
+  /* Correct the offset if Daylight Saving Time is in effect */
+
   if (tp.tm_isdst > 0)
     *off = *off + 3600;
 }
@@ -902,9 +906,16 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
     tz_end = index (tz_start, ':');
     tz_end = '\0';
 
-    /* The Ada layer expects an offset in seconds */
+    /* The Ada layer expects an offset in seconds. Note that we must reverse
+       the sign of the result since west is positive and east is negative on
+       VxWorks targets. */
+
+    *off = -atol (tz_start) * 60;
 
-    *off = atol (tz_start) * 60;
+    /* Correct the offset if Daylight Saving Time is in effect */
+
+    if (tp.tm_isdst > 0)
+      *off = *off + 3600;
   }
 
   (*Unlock_Task) ();
@@ -940,7 +951,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
    function returns the options to be set when creating a new task. It fetches
    the options assigned to the current task (parent), so offering some user
    level control over the options for a task hierarchy. It forces VX_FP_TASK
-   because it is almost always required. */
+   because it is almost always required. On processors with the SPE
+   category, VX_SPE_TASK is needed to enable the SPE. */
 extern int __gnat_get_task_options (void);
 
 int
@@ -953,6 +965,9 @@ __gnat_get_task_options (void)
 
   /* Force VX_FP_TASK because it is almost always required */
   options |= VX_FP_TASK;
+#if defined (__SPE__)
+  options |= VX_SPE_TASK;
+#endif
 
   /* Mask those bits that are not under user control */
 #ifdef VX_USR_TASK_OPTIONS
@@ -972,8 +987,10 @@ __gnat_is_file_not_found_error (int errno_val) {
       /* In the case of VxWorks, we also have to take into account various
        * filesystem-specific variants of this error.
        */
+#if ! defined (__VXWORKSMILS__)
       case S_dosFsLib_FILE_NOT_FOUND:
-#if ! defined (__RTP__) && ! defined (VTHREADS)
+#endif
+#if ! defined (__RTP__) && (! defined (VTHREADS) || defined (__VXWORKSMILS__))
       case S_nfsLib_NFSERR_NOENT:
 #endif
 #endif