Commit 084c663c by Arnaud Charlet Committed by Arnaud Charlet

Renaming of target specific files for clarity

        * Makefile.in: Rename GNAT target specific files.

	* 31soccon.ads, 31soliop.ads 35soccon.ads, 3asoccon.ads,
	3bsoccon.ads, 3gsoccon.ads, 3hsoccon.ads, 3psoccon.ads,
	3ssoccon.ads, 3ssoliop.ads, 3veacodu.adb, 3vexpect.adb,
	3vsoccon.ads, 3vsocthi.adb, 3vsocthi.ads, 3vtrasym.adb,
	3wsoccon.ads, 3wsocthi.adb, 3wsocthi.ads, 3wsoliop.ads,
	3zsoccon.ads, 3zsocthi.adb, 3zsocthi.ads, 41intnam.ads,
	42intnam.ads, 45intnam.ads, 4aintnam.ads, 4cintnam.ads,
	4gintnam.ads, 4hexcpol.adb, 4hintnam.ads, 4lintnam.ads,
	4nintnam.ads, 4ointnam.ads, 4onumaux.ads, 4pintnam.ads,
	4sintnam.ads, 4vcaldel.adb, 4vcalend.adb, 4vcalend.ads,
	4vintnam.ads, 4wcalend.adb, 4wexcpol.adb, 4wintnam.ads,
	4zintnam.ads, 4znumaux.ads, 4zsytaco.adb, 4zsytaco.ads,
	51osinte.adb, 51osinte.ads, 51system.ads,
	52osinte.adb, 52osinte.ads, 53osinte.ads, 54osinte.ads,
	55osinte.adb, 55osinte.ads, 55system.ads, 56osinte.adb,
	56osinte.ads, 56system.ads, 56taprop.adb, 56taspri.ads,
	56tpopsp.adb, 57system.ads, 58system.ads,
	5amastop.adb, 5aml-tgt.adb, 5aosinte.adb, 5aosinte.ads,
	5asystem.ads, 5ataprop.adb, 5atasinf.ads, 5ataspri.ads,
	5atpopsp.adb, 5avxwork.ads, 5bml-tgt.adb, 5bosinte.adb,
	5bosinte.ads, 5bsystem.ads, 5cosinte.ads, 5csystem.ads,
	5dsystem.ads, 5esystem.ads, 5fintman.adb, 5fosinte.adb,
	5fosinte.ads, 5fsystem.ads, 5ftaprop.adb, 5ftasinf.ads,
	5ginterr.adb, 5gintman.adb, 5gmastop.adb, 5gml-tgt.adb,
	5gosinte.ads, 5gproinf.adb, 5gproinf.ads, 5gsystem.ads,
	5gtaprop.adb, 5gtasinf.adb, 5gtasinf.ads, 5gtpgetc.adb,
	5hml-tgt.adb, 5hosinte.adb, 5hosinte.ads, 5hparame.ads,
	5hsystem.ads, 5htaprop.adb, 5htaspri.ads, 5htraceb.adb,
	5iosinte.adb, 5iosinte.ads, 5itaprop.adb, 5itaspri.ads,
	5ksystem.ads, 5kvxwork.ads, 5lml-tgt.adb, 5losinte.ads,
	5lparame.adb, 5lsystem.ads, 5msystem.ads, 5mvxwork.ads,
	5ninmaop.adb, 5nintman.adb, 5nosinte.ads, 5nsystem.ads,
	5ntaprop.adb, 5ntaspri.ads, 5ointerr.adb, 5omastop.adb,
	5oosinte.adb, 5oosinte.ads, 5oosprim.adb, 5oparame.adb,
	5osystem.ads, 5otaprop.adb, 5otaspri.ads, 5posinte.ads,
	5posprim.adb, 5psystem.ads, 5pvxwork.ads, 5sintman.adb,
	5sml-tgt.adb, 5sosinte.adb, 5sosinte.ads, 5sosprim.adb,
	5sparame.adb, 5ssystem.ads, 5staprop.adb, 5stasinf.adb,
	5stasinf.ads, 5staspri.ads, 5stpopsp.adb, 5svxwork.ads,
	5tosinte.ads, 5usystem.ads, 5vasthan.adb, 5vdirval.adb,
	5vinmaop.adb, 5vinterr.adb, 5vintman.adb, 5vintman.ads,
	5vmastop.adb, 5vml-tgt.adb, 5vosinte.adb, 5vosinte.ads,
	5vosprim.adb, 5vosprim.ads, 5vparame.ads, 5vsymbol.adb,
	5vsystem.ads, 5vtaprop.adb, 5vtaspri.ads, 5vtpopde.adb,
	5vtpopde.ads, 5vtraent.adb, 5vtraent.ads, 5vvaflop.adb,
	5wdirval.adb, 5wgloloc.adb, 5wintman.adb, 5wmemory.adb,
	5wml-tgt.adb, 5wosinte.ads, 5wosprim.adb, 5wsystem.ads,
	5wtaprop.adb, 5wtaspri.ads, 5xparame.ads, 5xsystem.ads,
	5xvxwork.ads, 5yparame.ads, 5ysystem.ads, 5zinterr.adb,
	5zintman.adb, 5zintman.ads, 5zml-tgt.adb, 5zosinte.adb,
	5zosinte.ads, 5zosprim.adb, 5zparame.ads, 5zstchop.adb,
	5zsystem.ads, 5ztaprop.adb, 5ztaspri.ads, 5ztfsetr.adb,
	5ztpopsp.adb, 6vcpp.adb, 6vcstrea.adb, 6vinterf.ads,
	7sinmaop.adb, 7sintman.adb, 7sosinte.adb, 7sosprim.adb,
	7staprop.adb, 7staspri.ads, 7stfsetr.adb, 7stpopsp.adb,
	7straceb.adb, 7straces.adb, 7strafor.adb, 7strafor.ads,
	7stratas.adb, 86numaux.adb, 86numaux.ads: Replaced by files below.

	* a-caldel-vms.adb, a-calend-mingw.adb, a-calend-vms.adb,
	a-calend-vms.ads, a-dirval-mingw.adb, a-dirval-vms.adb,
	a-excpol-abort.adb, a-excpol-interix.adb, a-intnam-aix.ads,
	a-intnam-dummy.ads, a-intnam-freebsd.ads, a-intnam-hpux.ads,
	a-intnam-interix.ads, a-intnam-irix.ads, a-intnam-linux.ads,
	a-intnam-lynxos.ads, a-intnam-mingw.ads, a-intnam-os2.ads,
	a-intnam-solaris.ads, a-intnam-tru64.ads, a-intnam-unixware.ads,
	a-intnam-vms.ads, a-intnam-vxworks.ads, a-numaux-libc-x86.ads,
	a-numaux-vxworks.ads, a-numaux-x86.adb, a-numaux-x86.ads,
	a-sytaco-vxworks.adb, a-sytaco-vxworks.ads, g-eacodu-vms.adb,
	g-expect-vms.adb, g-soccon-aix.ads, g-soccon-freebsd.ads,
	g-soccon-hpux.ads, g-soccon-interix.ads, g-soccon-irix.ads,
	g-soccon-mingw.ads, g-soccon-solaris.ads, g-soccon-tru64.ads,
	g-soccon-unixware.ads, g-soccon-vms.adb, g-soccon-vxworks.ads,
	g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi-vms.adb,
	g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads,
	g-soliop-mingw.ads, g-soliop-solaris.ads, g-soliop-unixware.ads,
	g-trasym-vms.adb, i-cpp-vms.adb, i-cstrea-vms.adb,
	interfac-vms.ads, mlib-tgt-aix.adb, mlib-tgt-hpux.adb,
	mlib-tgt-irix.adb, mlib-tgt-linux.adb, mlib-tgt-mingw.adb,
	mlib-tgt-solaris.adb, mlib-tgt-tru64.adb, mlib-tgt-vms.adb,
	mlib-tgt-vxworks.adb, s-asthan-vms.adb, s-gloloc-mingw.adb,
	s-inmaop-dummy.adb, s-inmaop-posix.adb, s-inmaop-vms.adb,
	s-interr-dummy.adb, s-interr-sigaction.adb, s-interr-vms.adb,
	s-interr-vxworks.adb, s-intman-dummy.adb, s-intman-irix.adb,
	s-intman-irix-athread.adb, s-intman-mingw.adb, s-intman-posix.adb,
	s-intman-solaris.adb, s-intman-vms.adb, s-intman-vms.ads,
	s-intman-vxworks.adb, s-intman-vxworks.ads, s-mastop-irix.adb,
	s-mastop-tru64.adb, s-mastop-vms.adb, s-mastop-x86.adb,
	s-memory-mingw.adb, s-osinte-aix.adb, s-osinte-aix.ads,
	s-osinte-aix-fsu.ads, s-osinte-dummy.ads, s-osinte-freebsd.adb,
	s-osinte-freebsd.ads, s-osinte-fsu.adb, s-osinte-hpux.ads,
	s-osinte-hpux-dce.adb, s-osinte-hpux-dce.ads, s-osinte-interix.ads,
	s-osinte-irix.adb, s-osinte-irix.ads, s-osinte-irix-athread.ads,
	s-osinte-linux.ads, s-osinte-linux-fsu.ads, s-osinte-linux-ia64.ads,
	s-osinte-lynxos-3.adb, s-osinte-lynxos-3.ads, s-osinte-lynxos.adb,
	s-osinte-lynxos.ads, s-osinte-mingw.ads, s-osinte-os2.adb,
	s-osinte-os2.ads, s-osinte-posix.adb, s-osinte-solaris.adb,
	s-osinte-solaris.ads, s-osinte-solaris-fsu.ads,
	s-osinte-solaris-posix.ads, s-osinte-tru64.adb, s-osinte-tru64.ads,
	s-osinte-unixware.adb, s-osinte-unixware.ads, s-osinte-vms.adb,
	s-osinte-vms.ads, s-osinte-vxworks.adb,
	s-osinte-vxworks.ads, s-osprim-mingw.adb,
	s-osprim-os2.adb, s-osprim-posix.adb, s-osprim-solaris.adb,
	s-osprim-unix.adb, s-osprim-vms.adb, s-osprim-vms.ads,
	s-osprim-vxworks.adb, s-parame-ae653.ads, s-parame-hpux.ads,
	s-parame-linux.adb, s-parame-os2.adb, s-parame-solaris.adb,
	s-parame-vms.ads, s-parame-vms-restrict.ads, s-parame-vxworks.ads,
	s-proinf-irix-athread.adb, s-proinf-irix-athread.ads,
	s-stchop-vxworks.adb, s-taprop-dummy.adb,
	s-taprop-hpux-dce.adb, s-taprop-irix.adb,
	s-taprop-irix-athread.adb, s-taprop-linux.adb, s-taprop-lynxos.adb,
	s-taprop-mingw.adb, s-taprop-os2.adb, s-taprop-posix.adb,
	s-taprop-solaris.adb, s-taprop-tru64.adb, s-taprop-vms.adb,
	s-taprop-vxworks.adb, s-tasinf-irix.ads, s-tasinf-irix-athread.adb,
	s-tasinf-irix-athread.ads, s-tasinf-solaris.adb, s-tasinf-solaris.ads,
	s-tasinf-tru64.ads, s-taspri-dummy.ads, s-taspri-hpux-dce.ads,
	s-taspri-linux.ads, s-taspri-lynxos.ads, s-taspri-mingw.ads,
	s-taspri-os2.ads, s-taspri-posix.ads, s-taspri-solaris.ads,
	s-taspri-tru64.ads, s-taspri-vms.ads, s-taspri-vxworks.ads,
	s-tfsetr-default.adb, s-tfsetr-vxworks.adb, s-tpopde-vms.adb,
	s-tpopde-vms.ads, s-tpopsp-lynxos.adb, s-tpopsp-posix.adb,
	s-tpopsp-posix-foreign.adb, s-tpopsp-solaris.adb, s-tpopsp-vxworks.adb,
	s-traceb-hpux.adb, s-traceb-mastop.adb, s-traces-default.adb,
	s-traent-vms.adb, s-traent-vms.ads, s-trafor-default.adb,
	s-trafor-default.ads, s-tratas-default.adb, s-vaflop-vms.adb,
	s-vxwork-alpha.ads, s-vxwork-m68k.ads, s-vxwork-mips.ads,
	s-vxwork-ppc.ads, s-vxwork-sparcv9.ads, s-vxwork-xscale.ads,
	symbols-vms.adb, system-aix.ads, system-freebsd-x86.ads,
	system-hpux.ads, system-interix.ads, system-irix-n32.ads,
	system-irix-o32.ads, system-linux-x86_64.ads,
	system-linux-x86.ads, system-lynxos-ppc.ads, system-lynxos-x86.ads,
	system-mingw.ads, system-os2.ads, system-solaris-sparc.ads,
	system-solaris-sparcv9.ads, system-solaris-x86.ads, system-tru64.ads,
	system-unixware.ads, system-vms.ads, system-vms-zcx.ads,
	system-vxworks-alpha.ads, system-vxworks-m68k.ads,
	system-vxworks-mips.ads, system-vxworks-ppc.ads,
	system-vxworks-sparcv9.ads, system-vxworks-xscale.ads: Replace files
	above.

From-SVN: r81834
parent 02ea8d06
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ P R I M I T I V E S . G E N _ T C B I N F --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2000 Free Software Fundation --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is an SGI Irix version of this package
-- This procedure creates the file "a-tcbinf.c"
-- "A-tcbinf.c" is subsequently compiled and made part of the RTL
-- to be referenced by the SGI Workshop debugger. The main procedure:
-- "Gen_Tcbinf" imports this child procedure and runs as part of the
-- RTL build process. Because of the complex process used to build
-- the GNAT RTL for all the different systems and the frequent changes
-- made to the internal data structures, its impractical to create
-- "a-tcbinf.c" using a standalone process.
with System.Tasking;
with Ada.Text_IO;
with Unchecked_Conversion;
procedure System.Task_Primitives.Gen_Tcbinf is
use System.Tasking;
subtype Version_String is String (1 .. 4);
Version : constant Version_String := "3.11";
function To_Integer is new Unchecked_Conversion
(Version_String, Integer);
type Dummy_TCB_Ptr is access Ada_Task_Control_Block (Entry_Num => 0);
Dummy_TCB : constant Dummy_TCB_Ptr := new Ada_Task_Control_Block (0);
C_File : Ada.Text_IO.File_Type;
procedure Pl (S : String);
procedure Nl (C : Ada.Text_IO.Positive_Count := 1);
function State_Name (S : Task_States) return String;
procedure Pl (S : String) is
begin
Ada.Text_IO.Put_Line (C_File, S);
end Pl;
procedure Nl (C : Ada.Text_IO.Positive_Count := 1) is
begin
Ada.Text_IO.New_Line (C_File, C);
end Nl;
function State_Name (S : Task_States) return String is
begin
case S is
when Unactivated =>
return "Unactivated";
when Runnable =>
return "Runnable";
when Terminated =>
return "Terminated";
when Activator_Sleep =>
return "Child Activation Wait";
when Acceptor_Sleep =>
return "Accept/Select Wait";
when Entry_Caller_Sleep =>
return "Waiting on Entry Call";
when Async_Select_Sleep =>
return "Async_Select Wait";
when Delay_Sleep =>
return "Delay Sleep";
when Master_Completion_Sleep =>
return "Child Termination Wait";
when Master_Phase_2_Sleep =>
return "Wait Child in Term Alt";
when Interrupt_Server_Idle_Sleep =>
return "Int Server Idle Sleep";
when Interrupt_Server_Blocked_Interrupt_Sleep =>
return "Int Server Blk Int Sleep";
when Timer_Server_Sleep =>
return "Timer Server Sleep";
when AST_Server_Sleep =>
return "AST Server Sleep";
when Asynchronous_Hold =>
return "Asynchronous Hold";
when Interrupt_Server_Blocked_On_Event_Flag =>
return "Int Server Blk Evt Flag";
end case;
end State_Name;
All_Tasks_Link_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.All_Tasks_Link'Position;
Entry_Count_Offset : constant Integer
:= Dummy_TCB.Entry_Num'Position;
Entry_Point_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.Task_Entry_Point'Position;
Parent_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.Parent'Position;
Base_Priority_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.Base_Priority'Position;
Current_Priority_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.Current_Priority'Position;
Stack_Size_Offset : constant Integer
:= Dummy_TCB.Common'Position +
Dummy_TCB.Common.Compiler_Data.Pri_Stack_Info.Size'Position;
State_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.State'Position;
Task_Image_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.Task_Image'Position;
Thread_Offset : constant Integer
:= Dummy_TCB.Common'Position + Dummy_TCB.Common.LL'Position +
Dummy_TCB.Common.LL.Thread'Position;
begin
Ada.Text_IO.Create (C_File, Ada.Text_IO.Out_File, "a-tcbinf.c");
Pl ("");
Pl ("#include <sys/types.h>");
Pl ("");
Pl ("#define TCB_INFO_VERSION 2");
Pl ("#define TCB_LIBRARY_VERSION "
& Integer'Image (To_Integer (Version)));
Pl ("");
Pl ("typedef struct {");
Pl ("");
Pl (" __uint32_t info_version;");
Pl (" __uint32_t library_version;");
Pl ("");
Pl (" __uint32_t All_Tasks_Link_Offset;");
Pl (" __uint32_t Entry_Count_Offset;");
Pl (" __uint32_t Entry_Point_Offset;");
Pl (" __uint32_t Parent_Offset;");
Pl (" __uint32_t Base_Priority_Offset;");
Pl (" __uint32_t Current_Priority_Offset;");
Pl (" __uint32_t Stack_Size_Offset;");
Pl (" __uint32_t State_Offset;");
Pl (" __uint32_t Task_Image_Offset;");
Pl (" __uint32_t Thread_Offset;");
Pl ("");
Pl (" char **state_names;");
Pl (" __uint32_t state_names_max;");
Pl ("");
Pl ("} task_control_block_info_t;");
Pl ("");
Pl ("static char *accepting_state_names = NULL;");
Pl ("");
Pl ("static char *task_state_names[] = {");
for State in Task_States loop
Pl (" """ & State_Name (State) & """,");
end loop;
Pl (" """"};");
Pl ("");
Pl ("");
Pl ("task_control_block_info_t __task_control_block_info = {");
Pl ("");
Pl (" TCB_INFO_VERSION,");
Pl (" TCB_LIBRARY_VERSION,");
Pl ("");
Pl (" " & All_Tasks_Link_Offset'Img & ",");
Pl (" " & Entry_Count_Offset'Img & ",");
Pl (" " & Entry_Point_Offset'Img & ",");
Pl (" " & Parent_Offset'Img & ",");
Pl (" " & Base_Priority_Offset'Img & ",");
Pl (" " & Current_Priority_Offset'Img & ",");
Pl (" " & Stack_Size_Offset'Img & ",");
Pl (" " & State_Offset'Img & ",");
Pl (" " & Task_Image_Offset'Img & ",");
Pl (" " & Thread_Offset'Img & ",");
Pl ("");
Pl (" task_state_names,");
Pl (" sizeof (task_state_names),");
Pl ("");
Pl ("");
Pl ("};");
Ada.Text_IO.Close (C_File);
end System.Task_Primitives.Gen_Tcbinf;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M --
-- --
-- S p e c --
-- (VxWorks Version Alpha) --
-- --
-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package System is
pragma Pure (System);
-- Note that we take advantage of the implementation permission to
-- make this unit Pure instead of Preelaborable, see RM 13.7(36)
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
-- System-Dependent Named Numbers
Min_Int : constant := Long_Long_Integer'First;
Max_Int : constant := Long_Long_Integer'Last;
Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
Max_Nonbinary_Modulus : constant := Integer'Last;
Max_Base_Digits : constant := Long_Long_Float'Digits;
Max_Digits : constant := Long_Long_Float'Digits;
Max_Mantissa : constant := 63;
Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
Tick : constant := 1.0 / 60.0;
-- Storage-related Declarations
type Address is private;
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := 64;
Memory_Size : constant := 2 ** 64;
-- Address comparison
function "<" (Left, Right : Address) return Boolean;
function "<=" (Left, Right : Address) return Boolean;
function ">" (Left, Right : Address) return Boolean;
function ">=" (Left, Right : Address) return Boolean;
function "=" (Left, Right : Address) return Boolean;
pragma Import (Intrinsic, "<");
pragma Import (Intrinsic, "<=");
pragma Import (Intrinsic, ">");
pragma Import (Intrinsic, ">=");
pragma Import (Intrinsic, "=");
-- Other System-Dependent Declarations
type Bit_Order is (High_Order_First, Low_Order_First);
Default_Bit_Order : constant Bit_Order := Low_Order_First;
-- Priority-related Declarations (RM D.1)
-- 256 is reserved for the VxWorks kernel
-- 248 - 255 correspond to hardware interrupt levels 0 .. 7
-- 247 is a catchall default "interrupt" priority for signals,
-- allowing higher priority than normal tasks, but lower than
-- hardware priority levels. Protected Object ceilings can
-- override these values.
-- 246 is used by the Interrupt_Manager task
Max_Priority : constant Positive := 245;
Max_Interrupt_Priority : constant Positive := 255;
subtype Any_Priority is Integer range 0 .. 255;
subtype Priority is Any_Priority range 0 .. 245;
subtype Interrupt_Priority is Any_Priority range 246 .. 255;
Default_Priority : constant Priority := 122;
private
type Address is mod Memory_Size;
Null_Address : constant Address := 0;
--------------------------------------
-- System Implementation Parameters --
--------------------------------------
-- These parameters provide information about the target that is used
-- by the compiler. They are in the private part of System, where they
-- can be accessed using the special circuitry in the Targparm unit
-- whose source should be consulted for more detailed descriptions
-- of the individual switch values.
AAMP : constant Boolean := False;
Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := False;
Command_Line_Args : constant Boolean := False;
Configurable_Run_Time : constant Boolean := False;
Denorm : constant Boolean := False;
Duration_32_Bits : constant Boolean := False;
Exit_Status_Supported : constant Boolean := True;
Fractional_Fixed_Ops : constant Boolean := False;
Frontend_Layout : constant Boolean := False;
Functions_Return_By_DSP : constant Boolean := False;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
OpenVMS : constant Boolean := False;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := False;
Support_64_Bit_Divides : constant Boolean := True;
Support_Aggregates : constant Boolean := True;
Support_Composite_Assign : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts : constant Boolean := True;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
ZCX_By_Default : constant Boolean := False;
GCC_ZCX_Support : constant Boolean := False;
Front_End_ZCX_Support : constant Boolean := False;
-- Obsolete entries, to be removed eventually (bootstrap issues!)
High_Integrity_Mode : constant Boolean := False;
Long_Shifts_Inlined : constant Boolean := False;
end System;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ P R I M I T I V E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2002 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a VxWorks version of this package.
pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during
-- tasking operations. It causes infinite loops and other problems.
with System.OS_Interface;
package System.Task_Primitives is
type Lock is limited private;
-- Should be used for implementation of protected objects.
type RTS_Lock is limited private;
-- Should be used inside the runtime system.
-- The difference between Lock and the RTS_Lock is that the later
-- one serves only as a semaphore so that do not check for
-- ceiling violations.
type Task_Body_Access is access procedure;
-- Pointer to the task body's entry point (or possibly a wrapper
-- declared local to the GNARL).
type Private_Data is limited private;
-- Any information that the GNULLI needs maintained on a per-task
-- basis. A component of this type is guaranteed to be included
-- in the Ada_Task_Control_Block.
private
type Priority_Type is (Prio_None, Prio_Protect, Prio_Inherit);
type Lock is record
Mutex : System.OS_Interface.SEM_ID;
Protocol : Priority_Type;
Prio_Ceiling : System.OS_Interface.int;
-- priority ceiling of lock
end record;
type RTS_Lock is new Lock;
type Private_Data is record
Thread : aliased System.OS_Interface.t_id := 0;
pragma Atomic (Thread);
-- Thread field may be updated by two different threads of control.
-- (See, Enter_Task and Create_Task in s-taprop.adb).
-- They put the same value (thr_self value). We do not want to
-- use lock on those operations and the only thing we have to
-- make sure is that they are updated in atomic fashion.
LWP : aliased System.Address;
-- The purpose of this field is to provide a better tasking support on
-- gdb. The order of the two first fields (Thread and LWP) is important.
-- On targets where lwp is not relevant, this is equivalent to Thread.
CV : aliased System.OS_Interface.SEM_ID;
L : aliased RTS_Lock;
-- Protection for all components is lock L
end record;
end System.Task_Primitives;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . S E N D --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This version is for VxWorks targets.
-- Trace information is sent to WindView using the wvEvent function.
-- Note that wvEvent is from the VxWorks API.
-- When adding a new event, just give an Id to then event, and then modify
-- the WindView events database.
-- Refer to WindView User's Guide for more details on how to add new events
-- to the events database.
----------------
-- Send_Trace --
----------------
-- This procedure formats the string, maps the event Id to an Id
-- recognized by WindView, and send the event using wvEvent
separate (System.Traces.Format)
procedure Send_Trace (Id : Trace_T; Info : String) is
procedure Wv_Event
(Id : Integer;
Buffer : System.Address;
Size : Integer);
pragma Import (C, Wv_Event, "wvEvent");
Info_Trace : String_Trace;
Id_Event : Integer;
begin
Info_Trace := Format_Trace (Info);
case Id is
when M_Accept_Complete => Id_Event := 30000;
when M_Select_Else => Id_Event := 30001;
when M_RDV_Complete => Id_Event := 30002;
when M_Call_Complete => Id_Event := 30003;
when M_Delay => Id_Event := 30004;
when E_Kill => Id_Event := 30005;
when E_Missed => Id_Event := 30006;
when E_Timeout => Id_Event := 30007;
when W_Call => Id_Event := 30010;
when W_Accept => Id_Event := 30011;
when W_Select => Id_Event := 30012;
when W_Completion => Id_Event := 30013;
when W_Delay => Id_Event := 30014;
when WT_Select => Id_Event := 30015;
when WT_Call => Id_Event := 30016;
when WT_Completion => Id_Event := 30017;
when WU_Delay => Id_Event := 30018;
when PO_Call => Id_Event := 30020;
when POT_Call => Id_Event := 30021;
when PO_Run => Id_Event := 30022;
when PO_Lock => Id_Event := 30023;
when PO_Unlock => Id_Event := 30024;
when PO_Done => Id_Event := 30025;
when T_Create => Id_Event := 30030;
when T_Activate => Id_Event := 30031;
when T_Abort => Id_Event := 30032;
when T_Terminate => Id_Event := 30033;
-- Unrecognized events are given the special Id_Event value 29999
when others => Id_Event := 29999;
end case;
Wv_Event (Id_Event, Info_Trace'Address, Max_Size);
end Send_Trace;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S . C _ S T R E A M S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the Alpha/VMS version.
with Unchecked_Conversion;
package body Interfaces.C_Streams is
use type System.CRTL.size_t;
-- As the functions fread, fwrite and setvbuf are too big to be inlined,
-- they are just wrappers to the following implementation functions.
function fread_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function fread_impl
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function fwrite_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function setvbuf_impl
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int;
------------
-- fread --
------------
function fread_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Get_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
Ch : int;
begin
-- This Fread goes with the Fwrite below.
-- The C library fread sometimes can't read fputc generated files.
for C in 1 .. count loop
for S in 1 .. size loop
Ch := fgetc (stream);
if Ch = EOF then
return Get_Count;
end if;
BA.all (C, S) := Character'Val (Ch);
end loop;
Get_Count := Get_Count + 1;
end loop;
return Get_Count;
end fread_impl;
function fread_impl
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Get_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
Ch : int;
begin
-- This Fread goes with the Fwrite below.
-- The C library fread sometimes can't read fputc generated files.
for C in 1 + index .. count + index loop
for S in 1 .. size loop
Ch := fgetc (stream);
if Ch = EOF then
return Get_Count;
end if;
BA.all (C, S) := Character'Val (Ch);
end loop;
Get_Count := Get_Count + 1;
end loop;
return Get_Count;
end fread_impl;
function fread
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fread_impl (buffer, size, count, stream);
end fread;
function fread
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fread_impl (buffer, index, size, count, stream);
end fread;
------------
-- fwrite --
------------
function fwrite_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Put_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
begin
-- Fwrite on VMS has the undesirable effect of always generating at
-- least one record of output per call, regardless of buffering. To
-- get around this, we do multiple fputc calls instead.
for C in 1 .. count loop
for S in 1 .. size loop
if fputc (Character'Pos (BA.all (C, S)), stream) = EOF then
return Put_Count;
end if;
end loop;
Put_Count := Put_Count + 1;
end loop;
return Put_Count;
end fwrite_impl;
function fwrite
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fwrite_impl (buffer, size, count, stream);
end fwrite;
-------------
-- setvbuf --
-------------
function setvbuf_impl
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int
is
use type System.Address;
begin
-- In order for the above fwrite hack to work, we must always buffer
-- stdout and stderr. Is_regular_file on VMS cannot detect when
-- these are redirected to a file, so checking for that condition
-- doesnt help.
if mode = IONBF
and then (stream = stdout or else stream = stderr)
then
return System.CRTL.setvbuf
(stream, buffer, IOLBF, System.CRTL.size_t (size));
else
return System.CRTL.setvbuf
(stream, buffer, mode, System.CRTL.size_t (size));
end if;
end setvbuf_impl;
function setvbuf
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int
is
begin
return setvbuf_impl (stream, buffer, mode, size);
end setvbuf;
end Interfaces.C_Streams;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2003 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the implementation dependent sections of this file. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the OpenVMS version of this package which adds Float_Representation
-- pragmas to the IEEE floating point types to ensure they remain IEEE in
-- the presence of a configuration pragma Float_Representation (Vax_Float).
-- It assumes integer sizes of 8, 16, 32 and 64 are available, and that IEEE
-- floating-point formats are available.
package Interfaces is
pragma Pure (Interfaces);
type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
for Integer_8'Size use 8;
type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
for Integer_16'Size use 16;
type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
for Integer_32'Size use 32;
type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
for Integer_64'Size use 64;
type Unsigned_8 is mod 2 ** 8;
for Unsigned_8'Size use 8;
type Unsigned_16 is mod 2 ** 16;
for Unsigned_16'Size use 16;
type Unsigned_32 is mod 2 ** 32;
for Unsigned_32'Size use 32;
type Unsigned_64 is mod 2 ** 64;
for Unsigned_64'Size use 64;
function Shift_Left
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Shift_Right
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Shift_Right_Arithmetic
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Rotate_Left
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Rotate_Right
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Shift_Left
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Shift_Right
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Shift_Right_Arithmetic
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Rotate_Left
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Rotate_Right
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Shift_Left
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Shift_Right
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Shift_Right_Arithmetic
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Rotate_Left
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Rotate_Right
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Shift_Left
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Shift_Right
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Shift_Right_Arithmetic
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Rotate_Left
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Rotate_Right
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
pragma Import (Intrinsic, Shift_Left);
pragma Import (Intrinsic, Shift_Right);
pragma Import (Intrinsic, Shift_Right_Arithmetic);
pragma Import (Intrinsic, Rotate_Left);
pragma Import (Intrinsic, Rotate_Right);
-- Floating point types. We use the digits value to define the IEEE
-- forms, otherwise a configuration pragma specifying VAX float can
-- default the digits to an illegal value for IEEE.
-- Note: it is harmless, and explicitly permitted, to include additional
-- types in interfaces, so it is not wrong to have IEEE_Extended_Float
-- defined even if the extended format is not available.
type IEEE_Float_32 is digits 6;
pragma Float_Representation (IEEE_Float, IEEE_Float_32);
type IEEE_Float_64 is digits 15;
pragma Float_Representation (IEEE_Float, IEEE_Float_64);
type IEEE_Extended_Float is digits 15;
pragma Float_Representation (IEEE_Float, IEEE_Extended_Float);
end Interfaces;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ P R I M I T I V E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This version is for POSIX-like operating systems
package body System.OS_Primitives is
-- ??? These definitions are duplicated from System.OS_Interface
-- because we don't want to depend on any package. Consider removing
-- these declarations in System.OS_Interface and move these ones in
-- the spec.
type struct_timezone is record
tz_minuteswest : Integer;
tz_dsttime : Integer;
end record;
pragma Convention (C, struct_timezone);
type struct_timezone_ptr is access all struct_timezone;
type time_t is new Long_Integer;
type struct_timeval is record
tv_sec : time_t;
tv_usec : Long_Integer;
end record;
pragma Convention (C, struct_timeval);
function gettimeofday
(tv : access struct_timeval;
tz : struct_timezone_ptr) return Integer;
pragma Import (C, gettimeofday, "gettimeofday");
type timespec is record
tv_sec : time_t;
tv_nsec : Long_Integer;
end record;
pragma Convention (C, timespec);
function nanosleep (rqtp, rmtp : access timespec) return Integer;
pragma Import (C, nanosleep, "nanosleep");
-----------
-- Clock --
-----------
function Clock return Duration is
TV : aliased struct_timeval;
Result : Integer;
pragma Unreferenced (Result);
begin
Result := gettimeofday (TV'Access, null);
return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6;
end Clock;
---------------------
-- Monotonic_Clock --
---------------------
function Monotonic_Clock return Duration renames Clock;
-----------------
-- To_Timespec --
-----------------
function To_Timespec (D : Duration) return timespec;
function To_Timespec (D : Duration) return timespec is
S : time_t;
F : Duration;
begin
S := time_t (Long_Long_Integer (D));
F := D - Duration (S);
-- If F has negative value due to a round-up, adjust for positive F
-- value.
if F < 0.0 then
S := S - 1;
F := F + 1.0;
end if;
return
timespec'(tv_sec => S,
tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9)));
end To_Timespec;
-----------------
-- Timed_Delay --
-----------------
procedure Timed_Delay
(Time : Duration;
Mode : Integer)
is
Request : aliased timespec;
Remaind : aliased timespec;
Rel_Time : Duration;
Abs_Time : Duration;
Check_Time : Duration := Clock;
Result : Integer;
pragma Unreferenced (Result);
begin
if Mode = Relative then
Rel_Time := Time;
Abs_Time := Time + Check_Time;
else
Rel_Time := Time - Check_Time;
Abs_Time := Time;
end if;
if Rel_Time > 0.0 then
loop
Request := To_Timespec (Rel_Time);
Result := nanosleep (Request'Access, Remaind'Access);
Check_Time := Clock;
exit when Abs_Time <= Check_Time;
Rel_Time := Abs_Time - Check_Time;
end loop;
end if;
end Timed_Delay;
end System.OS_Primitives;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ P R I M I T I V E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2003, Ada Core Technologies --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a POSIX-like version of this package.
-- Note: this file can only be used for POSIX compliant systems.
pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during
-- tasking operations. It causes infinite loops and other problems.
with System.OS_Interface;
-- used for pthread_mutex_t
-- pthread_cond_t
-- pthread_t
package System.Task_Primitives is
type Lock is limited private;
-- Should be used for implementation of protected objects.
type RTS_Lock is limited private;
-- Should be used inside the runtime system.
-- The difference between Lock and the RTS_Lock is that the later
-- one serves only as a semaphore so that do not check for
-- ceiling violations.
type Task_Body_Access is access procedure;
-- Pointer to the task body's entry point (or possibly a wrapper
-- declared local to the GNARL).
type Private_Data is limited private;
-- Any information that the GNULLI needs maintained on a per-task
-- basis. A component of this type is guaranteed to be included
-- in the Ada_Task_Control_Block.
private
type Lock is new System.OS_Interface.pthread_mutex_t;
type RTS_Lock is new System.OS_Interface.pthread_mutex_t;
type Private_Data is record
Thread : aliased System.OS_Interface.pthread_t;
pragma Atomic (Thread);
-- Thread field may be updated by two different threads of control.
-- (See, Enter_Task and Create_Task in s-taprop.adb).
-- They put the same value (thr_self value). We do not want to
-- use lock on those operations and the only thing we have to
-- make sure is that they are updated in atomic fashion.
LWP : aliased System.Address;
-- The purpose of this field is to provide a better tasking support on
-- gdb. The order of the two first fields (Thread and LWP) is important.
-- On targets where lwp is not relevant, this is equivalent to Thread.
CV : aliased System.OS_Interface.pthread_cond_t;
L : aliased RTS_Lock;
-- Protection for all components is lock L
end record;
end System.Task_Primitives;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2004, Free Software Fundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a POSIX-like version of this package.
separate (System.Task_Primitives.Operations)
package body Specific is
----------------
-- Initialize --
----------------
procedure Initialize (Environment_Task : Task_ID) is
pragma Warnings (Off, Environment_Task);
Result : Interfaces.C.int;
begin
Result := pthread_key_create (ATCB_Key'Access, null);
pragma Assert (Result = 0);
end Initialize;
-------------------
-- Is_Valid_Task --
-------------------
function Is_Valid_Task return Boolean is
begin
return pthread_getspecific (ATCB_Key) /= System.Null_Address;
end Is_Valid_Task;
---------
-- Set --
---------
procedure Set (Self_Id : Task_ID) is
Result : Interfaces.C.int;
begin
Result := pthread_setspecific (ATCB_Key, To_Address (Self_Id));
pragma Assert (Result = 0);
end Set;
----------
-- Self --
----------
function Self return Task_ID is
begin
return To_Task_ID (pthread_getspecific (ATCB_Key));
end Self;
end Specific;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . T R A C E B A C K --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2003 Ada Core Technologies, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This version assumes that System.Machine_State_Operations.Pop_Frame can
-- work with the Info parameter being null.
with System.Machine_State_Operations;
package body System.Traceback is
use System.Machine_State_Operations;
----------------
-- Call_Chain --
----------------
procedure Call_Chain
(Traceback : System.Address;
Max_Len : Natural;
Len : out Natural;
Exclude_Min : System.Address := System.Null_Address;
Exclude_Max : System.Address := System.Null_Address;
Skip_Frames : Natural := 1)
is
type Tracebacks_Array is array (1 .. Max_Len) of Code_Loc;
pragma Suppress_Initialization (Tracebacks_Array);
M : Machine_State;
Code : Code_Loc;
Trace : Tracebacks_Array;
for Trace'Address use Traceback;
N_Skips : Natural := 0;
begin
M := Allocate_Machine_State;
Set_Machine_State (M);
-- Skip the requested number of frames
loop
Code := Get_Code_Loc (M);
exit when Code = Null_Address or else N_Skips = Skip_Frames;
Pop_Frame (M, System.Null_Address);
N_Skips := N_Skips + 1;
end loop;
-- Now, record the frames outside the exclusion bounds, updating
-- the Len output value along the way.
Len := 0;
loop
Code := Get_Code_Loc (M);
exit when Code = Null_Address or else Len = Max_Len;
if Code < Exclude_Min or else Code > Exclude_Max then
Len := Len + 1;
Trace (Len) := Code;
end if;
Pop_Frame (M, System.Null_Address);
end loop;
Free_Machine_State (M);
end Call_Chain;
------------------
-- C_Call_Chain --
------------------
function C_Call_Chain
(Traceback : System.Address;
Max_Len : Natural) return Natural
is
Val : Natural;
begin
Call_Chain (Traceback, Max_Len, Val);
return Val;
end C_Call_Chain;
end System.Traceback;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Soft_Links;
with System.Parameters;
with System.Traces.Format;
package body System.Traces is
package SSL renames System.Soft_Links;
use System.Traces.Format;
----------------------
-- Send_Trace_Info --
----------------------
procedure Send_Trace_Info (Id : Trace_T) is
Task_S : String := SSL.Task_Name.all;
Trace_S : String (1 .. 3 + Task_S'Length);
begin
if Parameters.Runtime_Traces then
Trace_S (1 .. 3) := "/N:";
Trace_S (4 .. Trace_S'Last) := Task_S;
Send_Trace (Id, Trace_S);
end if;
end Send_Trace_Info;
procedure Send_Trace_Info (Id : Trace_T; Timeout : Duration) is
Task_S : String := SSL.Task_Name.all;
Timeout_S : String := Duration'Image (Timeout);
Trace_S : String (1 .. 6 + Task_S'Length + Timeout_S'Length);
begin
if Parameters.Runtime_Traces then
Trace_S (1 .. 3) := "/N:";
Trace_S (4 .. 3 + Task_S'Length) := Task_S;
Trace_S (4 + Task_S'Length .. 6 + Task_S'Length) := "/T:";
Trace_S (7 + Task_S'Length .. Trace_S'Last) := Timeout_S;
Send_Trace (Id, Trace_S);
end if;
end Send_Trace_Info;
end System.Traces;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . F O R M A T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Parameters;
package body System.Traces.Format is
procedure Send_Trace (Id : Trace_T; Info : String) is separate;
------------------
-- Format_Trace --
------------------
function Format_Trace (Source : in String) return String_Trace is
Length : Integer := Source'Length;
Result : String_Trace := (others => ' ');
begin
-- If run-time tracing active, then fill the string
if Parameters.Runtime_Traces then
if Max_Size - Length > 0 then
Result (1 .. Length) := Source (1 .. Length);
Result (Length + 1 .. Max_Size) := (others => ' ');
Result (Length + 1) := ASCII.NUL;
else
Result (1 .. Max_Size - 1) := Source (1 .. Max_Size - 1);
Result (Max_Size) := ASCII.NUL;
end if;
end if;
return Result;
end Format_Trace;
------------
-- Append --
------------
function Append
(Source : String_Trace;
Annex : String)
return String_Trace
is
Result : String_Trace := (others => ' ');
Source_Length : Integer := 1;
Annex_Length : Integer := Annex'Length;
begin
if Parameters.Runtime_Traces then
-- First we determine the size used, without the spaces at the
-- end, if a String_Trace is present. Look at
-- System.Traces.Tasking for examples.
while Source (Source_Length) /= ASCII.NUL loop
Source_Length := Source_Length + 1;
end loop;
-- Then we fill the string.
if Source_Length - 1 + Annex_Length <= Max_Size then
Result (1 .. Source_Length - 1) :=
Source (1 .. Source_Length - 1);
Result (Source_Length .. Source_Length - 1 + Annex_Length) :=
Annex (1 .. Annex_Length);
Result (Source_Length + Annex_Length) := ASCII.NUL;
Result (Source_Length + Annex_Length + 1 .. Max_Size) :=
(others => ' ');
else
Result (1 .. Source_Length - 1) := Source (1 .. Source_Length - 1);
Result (Source_Length .. Max_Size - 1) :=
Annex (1 .. Max_Size - Source_Length);
Result (Max_Size) := ASCII.NUL;
end if;
end if;
return Result;
end Append;
end System.Traces.Format;
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . F O R M A T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements functions to format run-time traces
package System.Traces.Format is
Max_Size : constant Integer := 128;
-- Event messages' maximum size.
subtype String_Trace is String (1 .. Max_Size);
-- Specific type in which trace information is stored. An ASCII.NUL
-- character ends the string so that it is compatible with C strings
-- which is useful on some targets (eg. VxWorks)
-- These private functions handles String_Trace formatting
function Format_Trace (Source : String) return String_Trace;
-- Put a String in a String_Trace, truncates the string if necessary.
-- Similar to Head( .. ) found in Ada.Strings.Bounded
function Append
(Source : String_Trace;
Annex : String)
return String_Trace;
pragma Inline (Append);
-- Concatenates two string, similar to & operator from Ada.String.Unbounded
procedure Send_Trace (Id : Trace_T; Info : String);
-- This function (which is a subunit) send messages to external programs
end System.Traces.Format;
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . N U M E R I C S . A U X --
-- --
-- S p e c --
-- (Machine Version for x86) --
-- --
-- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides the basic computational interface for the generic
-- elementary functions. This implementation is based on the glibc assembly
-- sources for the x86 glibc math library.
-- Note: there are two versions of this package. One using the 80-bit x86
-- long double format (which is this version), and one using 64-bit IEEE
-- double (see file a-numaux.ads). The latter version imports the C
-- routines directly.
package Ada.Numerics.Aux is
pragma Pure (Aux);
type Double is new Long_Long_Float;
function Sin (X : Double) return Double;
function Cos (X : Double) return Double;
function Tan (X : Double) return Double;
function Exp (X : Double) return Double;
function Sqrt (X : Double) return Double;
function Log (X : Double) return Double;
function Atan (X : Double) return Double;
function Acos (X : Double) return Double;
function Asin (X : Double) return Double;
function Sinh (X : Double) return Double;
function Cosh (X : Double) return Double;
function Tanh (X : Double) return Double;
function Pow (X, Y : Double) return Double;
private
pragma Inline (Atan);
pragma Inline (Cos);
pragma Inline (Tan);
pragma Inline (Exp);
pragma Inline (Log);
pragma Inline (Sin);
pragma Inline (Sqrt);
end Ada.Numerics.Aux;
2004-05-14 Arnaud Charlet <charlet@act-europe.fr>
Renaming of target specific files for clarity
* Makefile.in: Rename GNAT target specific files.
* 31soccon.ads, 31soliop.ads 35soccon.ads, 3asoccon.ads,
3bsoccon.ads, 3gsoccon.ads, 3hsoccon.ads, 3psoccon.ads,
3ssoccon.ads, 3ssoliop.ads, 3veacodu.adb, 3vexpect.adb,
3vsoccon.ads, 3vsocthi.adb, 3vsocthi.ads, 3vtrasym.adb,
3wsoccon.ads, 3wsocthi.adb, 3wsocthi.ads, 3wsoliop.ads,
3zsoccon.ads, 3zsocthi.adb, 3zsocthi.ads, 41intnam.ads,
42intnam.ads, 45intnam.ads, 4aintnam.ads, 4cintnam.ads,
4gintnam.ads, 4hexcpol.adb, 4hintnam.ads, 4lintnam.ads,
4nintnam.ads, 4ointnam.ads, 4onumaux.ads, 4pintnam.ads,
4sintnam.ads, 4vcaldel.adb, 4vcalend.adb, 4vcalend.ads,
4vintnam.ads, 4wcalend.adb, 4wexcpol.adb, 4wintnam.ads,
4zintnam.ads, 4znumaux.ads, 4zsytaco.adb, 4zsytaco.ads,
51osinte.adb, 51osinte.ads, 51system.ads,
52osinte.adb, 52osinte.ads, 53osinte.ads, 54osinte.ads,
55osinte.adb, 55osinte.ads, 55system.ads, 56osinte.adb,
56osinte.ads, 56system.ads, 56taprop.adb, 56taspri.ads,
56tpopsp.adb, 57system.ads, 58system.ads,
5amastop.adb, 5aml-tgt.adb, 5aosinte.adb, 5aosinte.ads,
5asystem.ads, 5ataprop.adb, 5atasinf.ads, 5ataspri.ads,
5atpopsp.adb, 5avxwork.ads, 5bml-tgt.adb, 5bosinte.adb,
5bosinte.ads, 5bsystem.ads, 5cosinte.ads, 5csystem.ads,
5dsystem.ads, 5esystem.ads, 5fintman.adb, 5fosinte.adb,
5fosinte.ads, 5fsystem.ads, 5ftaprop.adb, 5ftasinf.ads,
5ginterr.adb, 5gintman.adb, 5gmastop.adb, 5gml-tgt.adb,
5gosinte.ads, 5gproinf.adb, 5gproinf.ads, 5gsystem.ads,
5gtaprop.adb, 5gtasinf.adb, 5gtasinf.ads, 5gtpgetc.adb,
5hml-tgt.adb, 5hosinte.adb, 5hosinte.ads, 5hparame.ads,
5hsystem.ads, 5htaprop.adb, 5htaspri.ads, 5htraceb.adb,
5iosinte.adb, 5iosinte.ads, 5itaprop.adb, 5itaspri.ads,
5ksystem.ads, 5kvxwork.ads, 5lml-tgt.adb, 5losinte.ads,
5lparame.adb, 5lsystem.ads, 5msystem.ads, 5mvxwork.ads,
5ninmaop.adb, 5nintman.adb, 5nosinte.ads, 5nsystem.ads,
5ntaprop.adb, 5ntaspri.ads, 5ointerr.adb, 5omastop.adb,
5oosinte.adb, 5oosinte.ads, 5oosprim.adb, 5oparame.adb,
5osystem.ads, 5otaprop.adb, 5otaspri.ads, 5posinte.ads,
5posprim.adb, 5psystem.ads, 5pvxwork.ads, 5sintman.adb,
5sml-tgt.adb, 5sosinte.adb, 5sosinte.ads, 5sosprim.adb,
5sparame.adb, 5ssystem.ads, 5staprop.adb, 5stasinf.adb,
5stasinf.ads, 5staspri.ads, 5stpopsp.adb, 5svxwork.ads,
5tosinte.ads, 5usystem.ads, 5vasthan.adb, 5vdirval.adb,
5vinmaop.adb, 5vinterr.adb, 5vintman.adb, 5vintman.ads,
5vmastop.adb, 5vml-tgt.adb, 5vosinte.adb, 5vosinte.ads,
5vosprim.adb, 5vosprim.ads, 5vparame.ads, 5vsymbol.adb,
5vsystem.ads, 5vtaprop.adb, 5vtaspri.ads, 5vtpopde.adb,
5vtpopde.ads, 5vtraent.adb, 5vtraent.ads, 5vvaflop.adb,
5wdirval.adb, 5wgloloc.adb, 5wintman.adb, 5wmemory.adb,
5wml-tgt.adb, 5wosinte.ads, 5wosprim.adb, 5wsystem.ads,
5wtaprop.adb, 5wtaspri.ads, 5xparame.ads, 5xsystem.ads,
5xvxwork.ads, 5yparame.ads, 5ysystem.ads, 5zinterr.adb,
5zintman.adb, 5zintman.ads, 5zml-tgt.adb, 5zosinte.adb,
5zosinte.ads, 5zosprim.adb, 5zparame.ads, 5zstchop.adb,
5zsystem.ads, 5ztaprop.adb, 5ztaspri.ads, 5ztfsetr.adb,
5ztpopsp.adb, 6vcpp.adb, 6vcstrea.adb, 6vinterf.ads,
7sinmaop.adb, 7sintman.adb, 7sosinte.adb, 7sosprim.adb,
7staprop.adb, 7staspri.ads, 7stfsetr.adb, 7stpopsp.adb,
7straceb.adb, 7straces.adb, 7strafor.adb, 7strafor.ads,
7stratas.adb, 86numaux.adb, 86numaux.ads: Replaced by files below.
* a-caldel-vms.adb, a-calend-mingw.adb, a-calend-vms.adb,
a-calend-vms.ads, a-dirval-mingw.adb, a-dirval-vms.adb,
a-excpol-abort.adb, a-excpol-interix.adb, a-intnam-aix.ads,
a-intnam-dummy.ads, a-intnam-freebsd.ads, a-intnam-hpux.ads,
a-intnam-interix.ads, a-intnam-irix.ads, a-intnam-linux.ads,
a-intnam-lynxos.ads, a-intnam-mingw.ads, a-intnam-os2.ads,
a-intnam-solaris.ads, a-intnam-tru64.ads, a-intnam-unixware.ads,
a-intnam-vms.ads, a-intnam-vxworks.ads, a-numaux-libc-x86.ads,
a-numaux-vxworks.ads, a-numaux-x86.adb, a-numaux-x86.ads,
a-sytaco-vxworks.adb, a-sytaco-vxworks.ads, g-eacodu-vms.adb,
g-expect-vms.adb, g-soccon-aix.ads, g-soccon-freebsd.ads,
g-soccon-hpux.ads, g-soccon-interix.ads, g-soccon-irix.ads,
g-soccon-mingw.ads, g-soccon-solaris.ads, g-soccon-tru64.ads,
g-soccon-unixware.ads, g-soccon-vms.adb, g-soccon-vxworks.ads,
g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi-vms.adb,
g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads,
g-soliop-mingw.ads, g-soliop-solaris.ads, g-soliop-unixware.ads,
g-trasym-vms.adb, i-cpp-vms.adb, i-cstrea-vms.adb,
interfac-vms.ads, mlib-tgt-aix.adb, mlib-tgt-hpux.adb,
mlib-tgt-irix.adb, mlib-tgt-linux.adb, mlib-tgt-mingw.adb,
mlib-tgt-solaris.adb, mlib-tgt-tru64.adb, mlib-tgt-vms.adb,
mlib-tgt-vxworks.adb, s-asthan-vms.adb, s-gloloc-mingw.adb,
s-inmaop-dummy.adb, s-inmaop-posix.adb, s-inmaop-vms.adb,
s-interr-dummy.adb, s-interr-sigaction.adb, s-interr-vms.adb,
s-interr-vxworks.adb, s-intman-dummy.adb, s-intman-irix.adb,
s-intman-irix-athread.adb, s-intman-mingw.adb, s-intman-posix.adb,
s-intman-solaris.adb, s-intman-vms.adb, s-intman-vms.ads,
s-intman-vxworks.adb, s-intman-vxworks.ads, s-mastop-irix.adb,
s-mastop-tru64.adb, s-mastop-vms.adb, s-mastop-x86.adb,
s-memory-mingw.adb, s-osinte-aix.adb, s-osinte-aix.ads,
s-osinte-aix-fsu.ads, s-osinte-dummy.ads, s-osinte-freebsd.adb,
s-osinte-freebsd.ads, s-osinte-fsu.adb, s-osinte-hpux.ads,
s-osinte-hpux-dce.adb, s-osinte-hpux-dce.ads, s-osinte-interix.ads,
s-osinte-irix.adb, s-osinte-irix.ads, s-osinte-irix-athread.ads,
s-osinte-linux.ads, s-osinte-linux-fsu.ads, s-osinte-linux-ia64.ads,
s-osinte-lynxos-3.adb, s-osinte-lynxos-3.ads, s-osinte-lynxos.adb,
s-osinte-lynxos.ads, s-osinte-mingw.ads, s-osinte-os2.adb,
s-osinte-os2.ads, s-osinte-posix.adb, s-osinte-solaris.adb,
s-osinte-solaris.ads, s-osinte-solaris-fsu.ads,
s-osinte-solaris-posix.ads, s-osinte-tru64.adb, s-osinte-tru64.ads,
s-osinte-unixware.adb, s-osinte-unixware.ads, s-osinte-vms.adb,
s-osinte-vms.ads, s-osinte-vxworks.adb,
s-osinte-vxworks.ads, s-osprim-mingw.adb,
s-osprim-os2.adb, s-osprim-posix.adb, s-osprim-solaris.adb,
s-osprim-unix.adb, s-osprim-vms.adb, s-osprim-vms.ads,
s-osprim-vxworks.adb, s-parame-ae653.ads, s-parame-hpux.ads,
s-parame-linux.adb, s-parame-os2.adb, s-parame-solaris.adb,
s-parame-vms.ads, s-parame-vms-restrict.ads, s-parame-vxworks.ads,
s-proinf-irix-athread.adb, s-proinf-irix-athread.ads,
s-stchop-vxworks.adb, s-taprop-dummy.adb,
s-taprop-hpux-dce.adb, s-taprop-irix.adb,
s-taprop-irix-athread.adb, s-taprop-linux.adb, s-taprop-lynxos.adb,
s-taprop-mingw.adb, s-taprop-os2.adb, s-taprop-posix.adb,
s-taprop-solaris.adb, s-taprop-tru64.adb, s-taprop-vms.adb,
s-taprop-vxworks.adb, s-tasinf-irix.ads, s-tasinf-irix-athread.adb,
s-tasinf-irix-athread.ads, s-tasinf-solaris.adb, s-tasinf-solaris.ads,
s-tasinf-tru64.ads, s-taspri-dummy.ads, s-taspri-hpux-dce.ads,
s-taspri-linux.ads, s-taspri-lynxos.ads, s-taspri-mingw.ads,
s-taspri-os2.ads, s-taspri-posix.ads, s-taspri-solaris.ads,
s-taspri-tru64.ads, s-taspri-vms.ads, s-taspri-vxworks.ads,
s-tfsetr-default.adb, s-tfsetr-vxworks.adb, s-tpopde-vms.adb,
s-tpopde-vms.ads, s-tpopsp-lynxos.adb, s-tpopsp-posix.adb,
s-tpopsp-posix-foreign.adb, s-tpopsp-solaris.adb, s-tpopsp-vxworks.adb,
s-traceb-hpux.adb, s-traceb-mastop.adb, s-traces-default.adb,
s-traent-vms.adb, s-traent-vms.ads, s-trafor-default.adb,
s-trafor-default.ads, s-tratas-default.adb, s-vaflop-vms.adb,
s-vxwork-alpha.ads, s-vxwork-m68k.ads, s-vxwork-mips.ads,
s-vxwork-ppc.ads, s-vxwork-sparcv9.ads, s-vxwork-xscale.ads,
symbols-vms.adb, system-aix.ads, system-freebsd-x86.ads,
system-hpux.ads, system-interix.ads, system-irix-n32.ads,
system-irix-o32.ads, system-linux-x86_64.ads,
system-linux-x86.ads, system-lynxos-ppc.ads, system-lynxos-x86.ads,
system-mingw.ads, system-os2.ads, system-solaris-sparc.ads,
system-solaris-sparcv9.ads, system-solaris-x86.ads, system-tru64.ads,
system-unixware.ads, system-vms.ads, system-vms-zcx.ads,
system-vxworks-alpha.ads, system-vxworks-m68k.ads,
system-vxworks-mips.ads, system-vxworks-ppc.ads,
system-vxworks-sparcv9.ads, system-vxworks-xscale.ads: Replace files
above.
2004-05-13 Zack Weinberg <zack@codesourcery.com>
* trans.c (gnat_stabilize_reference_1): Remove case 'b'.
......
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . N U M E R I C S . A U X --
-- --
-- S p e c --
-- (Machine Version for x86) --
-- --
-- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides the basic computational interface for the generic
-- elementary functions. This implementation is based on the glibc assembly
-- sources for the x86 glibc math library.
-- Note: there are two versions of this package. One using the 80-bit x86
-- long double format (which is this version), and one using 64-bit IEEE
-- double (see file a-numaux.ads). The latter version imports the C
-- routines directly.
package Ada.Numerics.Aux is
pragma Pure (Aux);
type Double is new Long_Long_Float;
function Sin (X : Double) return Double;
function Cos (X : Double) return Double;
function Tan (X : Double) return Double;
function Exp (X : Double) return Double;
function Sqrt (X : Double) return Double;
function Log (X : Double) return Double;
function Atan (X : Double) return Double;
function Acos (X : Double) return Double;
function Asin (X : Double) return Double;
function Sinh (X : Double) return Double;
function Cosh (X : Double) return Double;
function Tanh (X : Double) return Double;
function Pow (X, Y : Double) return Double;
private
pragma Inline (Atan);
pragma Inline (Cos);
pragma Inline (Tan);
pragma Inline (Exp);
pragma Inline (Log);
pragma Inline (Sin);
pragma Inline (Sqrt);
end Ada.Numerics.Aux;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S . C _ S T R E A M S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the Alpha/VMS version.
with Unchecked_Conversion;
package body Interfaces.C_Streams is
use type System.CRTL.size_t;
-- As the functions fread, fwrite and setvbuf are too big to be inlined,
-- they are just wrappers to the following implementation functions.
function fread_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function fread_impl
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function fwrite_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t;
function setvbuf_impl
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int;
------------
-- fread --
------------
function fread_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Get_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
Ch : int;
begin
-- This Fread goes with the Fwrite below.
-- The C library fread sometimes can't read fputc generated files.
for C in 1 .. count loop
for S in 1 .. size loop
Ch := fgetc (stream);
if Ch = EOF then
return Get_Count;
end if;
BA.all (C, S) := Character'Val (Ch);
end loop;
Get_Count := Get_Count + 1;
end loop;
return Get_Count;
end fread_impl;
function fread_impl
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Get_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
Ch : int;
begin
-- This Fread goes with the Fwrite below.
-- The C library fread sometimes can't read fputc generated files.
for C in 1 + index .. count + index loop
for S in 1 .. size loop
Ch := fgetc (stream);
if Ch = EOF then
return Get_Count;
end if;
BA.all (C, S) := Character'Val (Ch);
end loop;
Get_Count := Get_Count + 1;
end loop;
return Get_Count;
end fread_impl;
function fread
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fread_impl (buffer, size, count, stream);
end fread;
function fread
(buffer : voids;
index : size_t;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fread_impl (buffer, index, size, count, stream);
end fread;
------------
-- fwrite --
------------
function fwrite_impl
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
Put_Count : size_t := 0;
type Buffer_Type is array (size_t range 1 .. count,
size_t range 1 .. size) of Character;
type Buffer_Access is access Buffer_Type;
function To_BA is new Unchecked_Conversion (voids, Buffer_Access);
BA : constant Buffer_Access := To_BA (buffer);
begin
-- Fwrite on VMS has the undesirable effect of always generating at
-- least one record of output per call, regardless of buffering. To
-- get around this, we do multiple fputc calls instead.
for C in 1 .. count loop
for S in 1 .. size loop
if fputc (Character'Pos (BA.all (C, S)), stream) = EOF then
return Put_Count;
end if;
end loop;
Put_Count := Put_Count + 1;
end loop;
return Put_Count;
end fwrite_impl;
function fwrite
(buffer : voids;
size : size_t;
count : size_t;
stream : FILEs) return size_t
is
begin
return fwrite_impl (buffer, size, count, stream);
end fwrite;
-------------
-- setvbuf --
-------------
function setvbuf_impl
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int
is
use type System.Address;
begin
-- In order for the above fwrite hack to work, we must always buffer
-- stdout and stderr. Is_regular_file on VMS cannot detect when
-- these are redirected to a file, so checking for that condition
-- doesnt help.
if mode = IONBF
and then (stream = stdout or else stream = stderr)
then
return System.CRTL.setvbuf
(stream, buffer, IOLBF, System.CRTL.size_t (size));
else
return System.CRTL.setvbuf
(stream, buffer, mode, System.CRTL.size_t (size));
end if;
end setvbuf_impl;
function setvbuf
(stream : FILEs;
buffer : chars;
mode : int;
size : size_t) return int
is
begin
return setvbuf_impl (stream, buffer, mode, size);
end setvbuf;
end Interfaces.C_Streams;
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2003 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the implementation dependent sections of this file. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the OpenVMS version of this package which adds Float_Representation
-- pragmas to the IEEE floating point types to ensure they remain IEEE in
-- the presence of a configuration pragma Float_Representation (Vax_Float).
-- It assumes integer sizes of 8, 16, 32 and 64 are available, and that IEEE
-- floating-point formats are available.
package Interfaces is
pragma Pure (Interfaces);
type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
for Integer_8'Size use 8;
type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
for Integer_16'Size use 16;
type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
for Integer_32'Size use 32;
type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
for Integer_64'Size use 64;
type Unsigned_8 is mod 2 ** 8;
for Unsigned_8'Size use 8;
type Unsigned_16 is mod 2 ** 16;
for Unsigned_16'Size use 16;
type Unsigned_32 is mod 2 ** 32;
for Unsigned_32'Size use 32;
type Unsigned_64 is mod 2 ** 64;
for Unsigned_64'Size use 64;
function Shift_Left
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Shift_Right
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Shift_Right_Arithmetic
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Rotate_Left
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Rotate_Right
(Value : Unsigned_8;
Amount : Natural)
return Unsigned_8;
function Shift_Left
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Shift_Right
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Shift_Right_Arithmetic
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Rotate_Left
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Rotate_Right
(Value : Unsigned_16;
Amount : Natural)
return Unsigned_16;
function Shift_Left
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Shift_Right
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Shift_Right_Arithmetic
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Rotate_Left
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Rotate_Right
(Value : Unsigned_32;
Amount : Natural)
return Unsigned_32;
function Shift_Left
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Shift_Right
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Shift_Right_Arithmetic
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Rotate_Left
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
function Rotate_Right
(Value : Unsigned_64;
Amount : Natural)
return Unsigned_64;
pragma Import (Intrinsic, Shift_Left);
pragma Import (Intrinsic, Shift_Right);
pragma Import (Intrinsic, Shift_Right_Arithmetic);
pragma Import (Intrinsic, Rotate_Left);
pragma Import (Intrinsic, Rotate_Right);
-- Floating point types. We use the digits value to define the IEEE
-- forms, otherwise a configuration pragma specifying VAX float can
-- default the digits to an illegal value for IEEE.
-- Note: it is harmless, and explicitly permitted, to include additional
-- types in interfaces, so it is not wrong to have IEEE_Extended_Float
-- defined even if the extended format is not available.
type IEEE_Float_32 is digits 6;
pragma Float_Representation (IEEE_Float, IEEE_Float_32);
type IEEE_Float_64 is digits 15;
pragma Float_Representation (IEEE_Float, IEEE_Float_64);
type IEEE_Extended_Float is digits 15;
pragma Float_Representation (IEEE_Float, IEEE_Extended_Float);
end Interfaces;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment