Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
abi.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Tilera Corporation. All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation, version 2.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11  * NON INFRINGEMENT. See the GNU General Public License for
12  * more details.
13  */
14 
21 #ifndef __ARCH_ABI_H__
22 
23 #if !defined __need_int_reg_t && !defined __DOXYGEN__
24 # define __ARCH_ABI_H__
25 # include <arch/chip.h>
26 #endif
27 
28 /* Provide the basic machine types. */
29 #ifndef __INT_REG_BITS
30 
32 #if defined __tilegx__
33 # define __INT_REG_BITS 64
34 #elif defined __tilepro__
35 # define __INT_REG_BITS 32
36 #elif !defined __need_int_reg_t
37 # include <arch/chip.h>
38 # define __INT_REG_BITS CHIP_WORD_SIZE()
39 #else
40 # error Unrecognized architecture with __need_int_reg_t
41 #endif
42 
43 #if __INT_REG_BITS == 64
44 
45 #ifndef __ASSEMBLER__
46 
47 typedef unsigned long long __uint_reg_t;
48 
50 typedef long long __int_reg_t;
51 #endif
52 
54 #define __INT_REG_FMT "ll"
55 
56 #else
57 
58 #ifndef __ASSEMBLER__
59 
60 typedef unsigned long __uint_reg_t;
61 
63 typedef long __int_reg_t;
64 #endif
65 
67 #define __INT_REG_FMT "l"
68 
69 #endif
70 #endif /* __INT_REG_BITS */
71 
72 
73 #ifndef __need_int_reg_t
74 
75 
76 #ifndef __ASSEMBLER__
77 
79 
82 #endif
83 
85 #define INT_REG_FMT __INT_REG_FMT
86 
88 #define INT_REG_BITS __INT_REG_BITS
89 
90 
91 /* Registers 0 - 55 are "normal", but some perform special roles. */
92 
93 #define TREG_FP 52
94 #define TREG_TP 53
95 #define TREG_SP 54
96 #define TREG_LR 55
99 #define TREG_LAST_GPR 55
100 
101 /* Registers 56 - 62 are "special" network registers. */
102 
103 #define TREG_SN 56
104 #define TREG_IDN0 57
105 #define TREG_IDN1 58
106 #define TREG_UDN0 59
107 #define TREG_UDN1 60
108 #define TREG_UDN2 61
109 #define TREG_UDN3 62
111 /* Register 63 is the "special" zero register. */
112 
113 #define TREG_ZERO 63
117 #define TREG_SYSCALL_NR 10
118 
120 #define TREG_SYSCALL_NR_NAME r10
121 
122 
127 #define C_ABI_SAVE_AREA_SIZE (2 * (INT_REG_BITS / 8))
128 
133 #define INFO_OP_CANNOT_BACKTRACE 2
134 
135 
136 #endif /* !__need_int_reg_t */
137 
138 /* Make sure we later can get all the definitions and declarations. */
139 #undef __need_int_reg_t
140 
141 #endif /* !__ARCH_ABI_H__ */