------------------------------------------------------------------------------ -- -- -- POSIX ADA LANGUAGE INTERFACES COMPONENTS -- -- -- -- P O S I X . M E M O R Y _ M A P P I N G -- -- -- -- S p e c -- -- -- -- $Revision: 1.2 $ -- -- -- -- -- -- This package specification is part of the Florida State -- -- University (FSU) prototype implementation of IEEE Draft Std -- -- 1003.5b, for use with the Gnu NYU Ada Translator (GNAT) and the -- -- FSU Gnu Ada Runtime Library (GNARL). -- -- -- -- This package specification contains some text extracted from IEEE -- -- Draft Std 1003.5b/D5 (August 1995), IEEE Draft Standard for -- -- Information Technology -- POSIX Ada Language Interfaces -- Part 1: -- -- Binding for System Application Program Interface, Amendment 1: -- -- Realtime Extensions, copyright 1995 by the Institute of Electrical -- -- and Electronics Engineers, Inc. -- -- -- -- This package specification differs from the package specifications -- -- in IEEE Draft Std 1003.5/D5 in several respects. For example, it -- -- includes additional with-clause dependences, comments, and -- -- complete definitions for certain types, ranges, and constants that -- -- are left implementation-defined in the draft standard. These -- -- differences appear to be within the scope of variation which the -- -- draft standard permits for implementations, but no warranty is -- -- made to that effect. -- -- -- -- These package specifications are distributed in the hope that they -- -- will be useful, but WITHOUT ANY WARRANTY; without even the implied -- -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- The package specifications in IEEE Draft Std 1003.5b/D5 represent -- -- only a portion of the document and are not to be interpreteted -- -- outside the context of the document, nor is the draft document to -- -- be interpreted as an approved consensus standard. -- -- -- -- When IEEE Std 1003.5b is approved, it must be used in conjunction -- -- with the final version of the package specifications contained in -- -- that document in order to claim conformance. The IEEE takes no -- -- responsibility for and will assume no liability for damages -- -- resulting from the reader's misinterpretation of said information -- -- resulting from its out-of-context nature. To order copies of the -- -- IEEE Draft Std 1003.5/D5, please contact the IEEE Service Center -- -- at 445 Hoes Lane, PO Box 1331, Piscataway, NJ 08855-1331; via -- -- phone at 1-800-678-IEEE, 908-981-1393; or via fax at 908-981-9667. -- -- -- -- For bodies to these packages, and other free products of the FSU -- -- POSIX/Ada Real-Time project, see the ftp site "ftp.cs.fsu.edu", -- -- subdirectory "pub/PART", or send e-mail to "part@ada.cs.fsu.edu". -- -- -- ------------------------------------------------------------------------------ with POSIX, POSIX.IO, POSIX.Signals, System.Storage_Elements, Implementation_Constants, System; package POSIX.Memory_Mapping is package IC renames Implementation_Constants; type Protection_Options is new POSIX.Option_Set; function Int_To_PrOption is new Unchecked_Conversion (Interfaces.C.Int, Protection_Options); function PrOption_To_Int is new Unchecked_Conversion (Protection_Options, Interfaces.C.Int); Allow_Read : constant Protection_Options := Int_To_PrOption (IC.PROT_READ); Allow_Write : constant Protection_Options := Int_To_PrOption (IC.PROT_WRITE); Allow_Execute : constant Protection_Options := Int_To_PrOption (IC.PROT_EXEC); type Mapping_Options is new POSIX.Option_Set; function Int_To_MaOption is new Unchecked_Conversion (Interfaces.C.Int, Mapping_Options); function MaOption_To_Int is new Unchecked_Conversion (Mapping_Options, Interfaces.C.Int); Map_Shared : constant Mapping_Options := Int_To_MaOption (IC.MAP_SHARED); Map_Private : constant Mapping_Options := Int_To_MaOption (IC.MAP_PRIVATE); type Location_Options is new POSIX.Option_Set; function Int_To_LoOption is new Unchecked_Conversion (Interfaces.C.Int, Location_Options); function LoOption_To_Int is new Unchecked_Conversion (Location_Options, Interfaces.C.Int); Exact_Address : constant Location_Options := Int_To_LoOption (IC.MAP_FIXED); Nearby_Address : constant Location_Options := Int_To_LoOption (IC.MAP_UNFIXED); function Map_Memory (First : System.Address; Length : System.Storage_Elements.Storage_Offset; Protection : Protection_Options; Mapping : Mapping_Options; Location : Location_Options; File : POSIX.IO.File_Descriptor; Offset : POSIX.IO_Count) return System.Address; function Map_Memory (Length : System.Storage_Elements.Storage_Offset; Protection : Protection_Options; Mapping : Mapping_Options; File : POSIX.IO.File_Descriptor; Offset : POSIX.IO_Count) return System.Address; procedure Unmap_Memory (First : in System.Address; Length : in System.Storage_Elements.Storage_Offset); procedure Change_Protection (First : in System.Address; Length : in System.Storage_Elements.Storage_Offset; Protection : in Protection_Options); type Synchronize_Memory_Options is new POSIX.Option_Set; function Int_To_SyOption is new Unchecked_Conversion (Interfaces.C.Int, Synchronize_Memory_Options); function SyOption_To_Int is new Unchecked_Conversion (Synchronize_Memory_Options, Interfaces.C.Int); Wait_For_Completion : constant Synchronize_Memory_Options := Int_To_SyOption (IC.MS_SYNC); No_Wait_For_Completion : constant Synchronize_Memory_Options := Int_To_SyOption (IC.MS_ASYNC); Invalidate_Cached_Data : constant Synchronize_Memory_Options := Int_To_SyOption (IC.MS_INVALIDATE); procedure Synchronize_Memory (First : in System.Address; Length : in System.Storage_Elements.Storage_Offset; Options : in Synchronize_Memory_Options := Wait_For_Completion); end POSIX.Memory_Mapping;