f21759fccade4bf5a877ee58168c2188c4ce35ea
[cacao.git] / src / vm / jit / powerpc64 / linux / md-abi.h
1 /* src/vm/jit/powerpc64/linux/md-abi.h - defines for PowerPC64 Linux ABI
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    $Id: md-abi.h 7596 2007-03-28 21:05:53Z twisti $
26
27 */
28
29
30 #ifndef _MD_ABI_H
31 #define _MD_ABI_H
32
33 /* preallocated registers *****************************************************/
34
35 /* integer registers */
36
37 #define REG_ZERO         0   /* almost always zero (in address caluclation)   */
38 #define REG_TOC          2   /* TOC (see function descriptors ELF ABI)        */
39 #define REG_RESULT       3   /* to deliver method results                     */
40
41 #define REG_PV          14   /* procedure vector, must be provided by caller  */
42 #define REG_METHODPTR   12   /* pointer to the place from where the procedure */
43                              /* vector has been fetched                       */
44 #define REG_ITMP1       11   /* temporary register                            */
45 #define REG_ITMP2       12   /* temporary register and method pointer         */
46 #define REG_ITMP3       16   /* temporary register                            */
47
48 #define REG_ITMP1_XPTR  11   /* exception pointer = temporary register 1      */
49 #define REG_ITMP2_XPC   12   /* exception pc = temporary register 2           */
50
51 #define REG_SP           1   /* stack pointer                                 */
52 #define REG_ZERO         0   /* almost always zero: only in address calc.     */
53
54 #define REG_A0           3   /* define some argument registers                */
55 #define REG_A1           4
56 #define REG_A2           5
57 #define REG_A3           6
58
59 /* floating point registers */
60
61 #define REG_FRESULT      1   /* to deliver floating point method results      */
62 #define REG_FTMP1       16   /* temporary floating point register             */
63 #define REG_FTMP2       17   /* temporary floating point register             */
64 #define REG_FTMP3        0   /* temporary floating point register             */
65
66 #define REG_IFTMP       16   /* temporary integer and floating point register */
67
68 #define REG_FA0          1   /* define some argument registers                */
69 #define REG_FA1          2
70
71
72 #define INT_REG_CNT     32   /* number of integer registers                   */
73 #define INT_SAV_CNT      9   /* number of int callee saved registers          */
74 #define INT_ARG_CNT      8   /* number of int argument registers              */
75 #define INT_TMP_CNT      7   /* number of integer temporary registers         */
76 #define INT_RES_CNT      8   /* number of integer reserved registers          */
77
78 #define FLT_REG_CNT     32   /* number of float registers                     */
79 #define FLT_SAV_CNT     16   /* number of float callee saved registers        */
80 #define FLT_ARG_CNT     13   /* number of float argument registers            */
81 #define FLT_TMP_CNT      0   /* number of float temporary registers           */
82 #define FLT_RES_CNT      3   /* number of float reserved registers            */
83
84 #define TRACE_ARGS_NUM   8
85
86
87 /* ABI defines ****************************************************************/
88
89 #define LA_SIZE         48   /* linkage area size                             */
90 #define LA_SIZE_ALIGNED 16   /* linkage area size aligned to 16-byte          */
91 #define LA_SIZE_IN_POINTERS     (LA_SIZE / SIZEOF_VOID_P)
92 #define LA_LR_OFFSET    16   /* link register offset in linkage area          */
93 #define PA_SIZE         (PA_SIZE_IN_POINTERS*8) 
94 #define PA_SIZE_IN_POINTERS     8 /* linux/ppc64 has a minimun parameter save area size, XXX:darwin? */
95
96 /* #define ALIGN_FRAME_SIZE(sp)       (sp) */
97
98 #endif /* _MD_ABI_H */
99
100
101 /*
102  * These are local overrides for various environment variables in Emacs.
103  * Please do not remove this and leave it at the end of the file, where
104  * Emacs will automagically detect them.
105  * ---------------------------------------------------------------------
106  * Local variables:
107  * mode: c
108  * indent-tabs-mode: t
109  * c-basic-offset: 4
110  * tab-width: 4
111  * End:
112  */