This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR14538 patch *-rtems ada fixes



2004-03-12 Joel Sherrill <joel@OARcorp.com>


        * ada/5rosinte.adb, ada/5rosinte.ads, ada/5rtpopsp.adb,
         ada/5rosinte.adb: Update RTEMS specific files to account
        for modifications to shared code.
        * ada/init.c: Move RTEMS code ahead of others using conditionals
        which mix checks for embedded systems (particularly vxworks) and
        Unix hosts
--
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985

2004-03-12	Joel Sherrill <joel@OARcorp.com>

	* ada/5rosinte.adb, ada/5rosinte.ads, ada/5rtpopsp.adb,
	 ada/5rosinte.adb: Update RTEMS specific files to account
	for modifications to shared code.
	* ada/init.c: Move RTEMS code ahead of others using conditionals
	which mix checks for embedded systems (particularly vxworks) and
	Unix hosts. 

ada/init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5rosinte.adb,v
retrieving revision 1.3
diff -u -r1.3 5rosinte.adb
--- ada/5rosinte.adb	24 Apr 2003 17:53:51 -0000	1.3
+++ ada/5rosinte.adb	11 Mar 2004 19:22:35 -0000
@@ -118,10 +118,4 @@
       return 0;
    end Get_Page_Size;
 
-   function mprotect
-     (addr : Address; len : size_t; prot : int) return int is
-   begin
-      return 0;
-   end mprotect;
-
 end System.OS_Interface;
Index: ada/5rosinte.ads
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5rosinte.ads,v
retrieving revision 1.5
diff -u -r1.5 5rosinte.ads
--- ada/5rosinte.ads	24 Apr 2003 17:53:51 -0000	1.5
+++ ada/5rosinte.ads	11 Mar 2004 19:22:36 -0000
@@ -139,6 +139,8 @@
    pragma Convention (C, struct_sigaction);
    type struct_sigaction_ptr is access all struct_sigaction;
 
+   SA_SIGINFO  : constant := 16#02#;
+
    SIG_BLOCK   : constant := 1;
    SIG_UNBLOCK : constant := 2;
    SIG_SETMASK : constant := 3;
@@ -229,7 +231,7 @@
    type pthread_attr_t      is limited private;
    type pthread_mutexattr_t is limited private;
    type pthread_condattr_t  is limited private;
-   type pthread_key_t       is private;
+   type pthread_key_t       is new Interfaces.C.unsigned;
 
    PTHREAD_CREATE_DETACHED : constant := 0;
 
@@ -261,7 +263,7 @@
    PROT_OFF : constant := 0;
 
    function mprotect (addr : Address; len : size_t; prot : int) return int;
-   --  Do nothing on RTEMS.
+   pragma Import (C, mprotect);
 
    -----------------------------------------
    --  Nonstandard Thread Initialization  --
@@ -519,7 +521,5 @@
    type pthread_mutex_t is new rtems_id;
 
    type pthread_cond_t is new rtems_id;
-
-   type pthread_key_t is new rtems_id;
 
 end System.OS_Interface;
Index: ada/5rtpopsp.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5rtpopsp.adb,v
retrieving revision 1.2
diff -u -r1.2 5rtpopsp.adb
--- ada/5rtpopsp.adb	29 Jan 2003 17:43:57 -0000	1.2
+++ ada/5rtpopsp.adb	11 Mar 2004 19:22:36 -0000
@@ -110,7 +110,7 @@
       --  We dare not call anything that might require an ATCB, until
       --  we have the new ATCB in place.
 
-      Write_Lock (All_Tasks_L'Access);
+      Lock_RTS;
       Q := null;
       P := Fake_ATCB_List;
 
@@ -188,7 +188,7 @@
 
       --  Must not unlock until Next_ATCB is again allocated.
 
-      Unlock (All_Tasks_L'Access);
+      Unlock_RTS;
       return Self_ID;
    end New_Fake_ATCB;
 
@@ -199,6 +199,9 @@
    procedure Initialize (Environment_Task : Task_ID) is
 
    begin
+      --  just to eliminate a warning
+      ATCB_Key := 0;
+
       RTEMS_Ada_Self := To_Address (Environment_Task);
 
       --  Create a free ATCB for use on the Fake_ATCB_List.
@@ -216,6 +219,13 @@
       RTEMS_Ada_Self := To_Address (Self_Id);
    end Set;
 
+   -----------------------
+   -- Local Subprograms --
+   -----------------------
+
+   function To_Task_ID is new Unchecked_Conversion (System.Address, Task_ID);
+
+
    ----------
    -- Self --
    ----------
@@ -262,5 +272,10 @@
 
       return To_Task_ID (Result);
    end Self;
+
+   function Is_Valid_Task return Boolean is
+   begin
+      return RTEMS_Ada_Self /= System.Null_Address;
+   end Is_Valid_Task;
 
 end Specific;
Index: ada/init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/init.c,v
retrieving revision 1.22
diff -u -r1.22 init.c
--- ada/init.c	11 Dec 2003 16:21:39 -0000	1.22
+++ ada/init.c	11 Mar 2004 19:22:43 -0000
@@ -352,6 +352,22 @@
 {
 }
 
+/***************************************/
+/* __gnat_initialize (RTEMS version) */
+/***************************************/
+
+#elif defined(__rtems__)
+
+extern void __gnat_install_handler (void);
+
+/* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */
+
+void
+__gnat_initialize (void)
+{
+   __gnat_install_handler ();
+}
+
 /****************************************/
 /* __gnat_initialize (Dec Unix Version) */
 /****************************************/
@@ -1780,22 +1796,6 @@
 {
   __gnat_install_handler ();
   __gnat_init_float ();
-}
-
-/***************************************/
-/* __gnat_initialize (RTEMS version) */
-/***************************************/
-
-#elif defined(__rtems__)
-
-extern void __gnat_install_handler (void);
-
-/* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */
-
-void
-__gnat_initialize (void)
-{
-   __gnat_install_handler ();
 }
 
 #else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]