1244197Sgonzo------------------------------------------------------------------------------
2244197Sgonzo--                                                                          --
3244197Sgonzo--                         GNAT RUN-TIME COMPONENTS                         --
4244197Sgonzo--                                                                          --
5244197Sgonzo--                       S Y S T E M . P A C K _ 1 2                        --
6244197Sgonzo--                                                                          --
7244197Sgonzo--                                 S p e c                                  --
8244197Sgonzo--                                                                          --
9244197Sgonzo--          Copyright (C) 1992-2014, Free Software Foundation, Inc.         --
10244197Sgonzo--                                                                          --
11244197Sgonzo-- GNAT is free software;  you can  redistribute it  and/or modify it under --
12244197Sgonzo-- terms of the  GNU General Public License as published  by the Free Soft- --
13244197Sgonzo-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14244197Sgonzo-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15244197Sgonzo-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16244197Sgonzo-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
17244197Sgonzo--                                                                          --
18244197Sgonzo-- As a special exception under Section 7 of GPL version 3, you are granted --
19244197Sgonzo-- additional permissions described in the GCC Runtime Library Exception,   --
20244197Sgonzo-- version 3.1, as published by the Free Software Foundation.               --
21244197Sgonzo--                                                                          --
22244197Sgonzo-- You should have received a copy of the GNU General Public License and    --
23244197Sgonzo-- a copy of the GCC Runtime Library Exception along with this program;     --
24244197Sgonzo-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
25244197Sgonzo-- <http://www.gnu.org/licenses/>.                                          --
26244197Sgonzo--                                                                          --
27244197Sgonzo-- GNAT was originally developed  by the GNAT team at  New York University. --
28244197Sgonzo-- Extensive contributions were provided by Ada Core Technologies Inc.      --
29244197Sgonzo--                                                                          --
30244197Sgonzo------------------------------------------------------------------------------
31244197Sgonzo
32244197Sgonzo--  Handling of packed arrays with Component_Size = 12
33244197Sgonzo
34244197Sgonzopackage System.Pack_12 is
35244197Sgonzo   pragma Preelaborate;
36244197Sgonzo
37244197Sgonzo   Bits : constant := 12;
38244197Sgonzo
39244197Sgonzo   type Bits_12 is mod 2 ** Bits;
40244197Sgonzo   for Bits_12'Size use Bits;
41244197Sgonzo
42244197Sgonzo   --  In all subprograms below, Rev_SSO is set True if the array has the
43244197Sgonzo   --  non-default scalar storage order.
44244197Sgonzo
45244197Sgonzo   function Get_12
46244197Sgonzo     (Arr     : System.Address;
47244197Sgonzo      N       : Natural;
48244197Sgonzo      Rev_SSO : Boolean) return Bits_12 with Inline;
49244197Sgonzo   --  Arr is the address of the packed array, N is the zero-based
50244197Sgonzo   --  subscript. This element is extracted and returned.
51244197Sgonzo
52244197Sgonzo   procedure Set_12
53244197Sgonzo     (Arr     : System.Address;
54244197Sgonzo      N       : Natural;
55244197Sgonzo      E       : Bits_12;
56244197Sgonzo      Rev_SSO : Boolean) with Inline;
57244197Sgonzo   --  Arr is the address of the packed array, N is the zero-based
58244197Sgonzo   --  subscript. This element is set to the given value.
59244197Sgonzo
60244197Sgonzo   function GetU_12
61244197Sgonzo     (Arr     : System.Address;
62244197Sgonzo      N       : Natural;
63244197Sgonzo      Rev_SSO : Boolean) return Bits_12 with Inline;
64244197Sgonzo   --  Arr is the address of the packed array, N is the zero-based
65244197Sgonzo   --  subscript. This element is extracted and returned. This version
66244197Sgonzo   --  is used when Arr may represent an unaligned address.
67244197Sgonzo
68244197Sgonzo   procedure SetU_12
69244197Sgonzo     (Arr     : System.Address;
70244197Sgonzo      N       : Natural;
71244197Sgonzo      E       : Bits_12;
72244197Sgonzo      Rev_SSO : Boolean) with Inline;
73244197Sgonzo   --  Arr is the address of the packed array, N is the zero-based
74244197Sgonzo   --  subscript. This element is set to the given value. This version
75244197Sgonzo   --  is used when Arr may represent an unaligned address
76244197Sgonzo
77244197Sgonzoend System.Pack_12;
78244197Sgonzo