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