1 /* -----------------------------------------------------------------------
2 ia64_flags.h - Copyright (c) 2000 Hewlett Packard Company
4 IA64/unix Foreign Function Interface
6 Original author: Hans Boehm, HP Labs
8 Permission is hereby granted, free of charge, to any person obtaining
9 a copy of this software and associated documentation files (the
10 ``Software''), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
16 The above copyright notice and this permission notice shall be included
17 in all copies or substantial portions of the Software.
19 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 OTHER DEALINGS IN THE SOFTWARE.
26 ----------------------------------------------------------------------- */
29 /* Homogeneous Floating Point Aggregates (HFAs) which are returned */
30 /* in FP registers. The least significant bits specify the size in */
32 #define FFI_IS_FLOAT_FP_AGGREGATE 0x1000
33 #define FFI_IS_DOUBLE_FP_AGGREGATE 0x0800
34 #define FLOAT_FP_AGGREGATE_BIT 12
35 #define DOUBLE_FP_AGGREGATE_BIT 11
37 /* Small structures containing N words. If N=1, they are returned */
38 /* as though they were integers. */
39 #define FFI_IS_SMALL_STRUCT2 0x40 /* Struct > 8, <=16 bytes */
40 #define FFI_IS_SMALL_STRUCT3 0x41 /* Struct > 16 <= 24 bytes */
41 #define FFI_IS_SMALL_STRUCT4 0x42 /* Struct > 24, <=32 bytes */
43 /* Flag values identifying particularly simple cases, which are */
44 /* handled specially. We treat functions as simple if they take all */
45 /* arguments can be passed as 32 or 64 bit integer quantities, there is */
46 /* either no return value or it can be treated as a 64bit integer, and */
47 /* if there are at most 2 arguments. */
48 /* This is OR'ed with the normal flag values. */
49 #define FFI_SIMPLE_V 0x10000 /* () -> X */
50 #define FFI_SIMPLE_I 0x20000 /* (int) -> X */
51 #define FFI_SIMPLE_L 0x30000 /* (long) -> X */
52 #define FFI_SIMPLE_II 0x40000 /* (int,int) -> X */
53 #define FFI_SIMPLE_IL 0x50000 /* (int,long) -> X */
54 #define FFI_SIMPLE_LI 0x60000 /* (long,int) -> X */
55 #define FFI_SIMPLE_LL 0x70000 /* (long,long) -> X */
57 /* Mask for all of the FFI_SIMPLE bits: */
58 #define FFI_SIMPLE 0xf0000
60 /* An easy way to build FFI_SIMPLE flags from FFI_SIMPLE_V: */
61 #define FFI_ADD_LONG_ARG(flag) (((flag) << 1) | 0x10000)
62 #define FFI_ADD_INT_ARG(flag) ((flag) << 1)