Root/
Source at commit 1146 created 12 years 11 months ago. By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing). | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. Please obtain a copy of the License at␊ |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
11 | * file.␊ |
12 | * ␊ |
13 | * The Original Code and all software distributed under the License are␊ |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
18 | * Please see the License for the specific language governing rights and␊ |
19 | * limitations under the License.␊ |
20 | * ␊ |
21 | * @APPLE_LICENSE_HEADER_END@␊ |
22 | */␊ |
23 | /* Copyright (c) 1996 NeXT Software, Inc. All rights reserved.␊ |
24 | *␊ |
25 | *␉File:␉architecture/ppc/reg_help.h␊ |
26 | *␉Author:␉Doug Mitchell, NeXT Computer, Inc.␊ |
27 | *␊ |
28 | *␉m98k-specific macros and inlines for defining machine registers.␊ |
29 | *␊ |
30 | * HISTORY␊ |
31 | * 05-Nov-92 Doug Mitchell at NeXT␊ |
32 | *␉Created.␊ |
33 | *␊ |
34 | * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com)␊ |
35 | *␉Ported from m98k. Removed dependency on nrw directory.␊ |
36 | *␉Merged code from architecture/nrw/reg_help.h.␊ |
37 | *␉Moved Register Usage #defines from asm_help.h in here.␊ |
38 | */␊ |
39 | ␊ |
40 | #ifndef _ARCH_PPC_REG_HELP_H_␊ |
41 | #define _ARCH_PPC_REG_HELP_H_␊ |
42 | ␊ |
43 | #if defined(__ASSEMBLER__)␊ |
44 | /*␊ |
45 | * GRF Register Usage Aliases␊ |
46 | */␊ |
47 | #define␉zt␉␉r0␉␉// architecturally 0 for mem refs only!␊ |
48 | ␉␉␉␉␉// real reg other inst, caller-saved␊ |
49 | #define␉sp␉␉r1␉␉// stack pointer, callee-saved␊ |
50 | #define␉toc␉␉r2␉␉// tbl of contents, callee-saved␊ |
51 | #define␉a0␉␉r3␉␉// arg 0, return value 0, caller saved␊ |
52 | #define␉a1␉␉r4␉␉// arg 1, return value 1, caller saved␊ |
53 | #define␉a2␉␉r5␉␉// ....␊ |
54 | #define␉a3␉␉r6␊ |
55 | #define␉a4␉␉r7␊ |
56 | #define␉a5␉␉r8␊ |
57 | #define␉a6␉␉r9␊ |
58 | #define␉a7␉␉r10␉␉// arg 7, return value 7, caller saved␊ |
59 | #define␉ep␉␉r11␉␉// environment ptr, caller saved␊ |
60 | #define␉at␉␉r12␉␉// assembler temp, caller saved␊ |
61 | #define␉s17␉␉r13␉␉// callee-saved 17␊ |
62 | #define␉s16␉␉r14␊ |
63 | #define␉s15␉␉r15␊ |
64 | #define␉s14␉␉r16␊ |
65 | #define␉s13␉␉r17␊ |
66 | #define␉s12␉␉r18␊ |
67 | #define␉s11␉␉r19␊ |
68 | #define␉s10␉␉r20␊ |
69 | #define␉s9␉␉r21␊ |
70 | #define␉s8␉␉r22␊ |
71 | #define␉s7␉␉r23␊ |
72 | #define␉s6␉␉r24␊ |
73 | #define␉s5␉␉r25␊ |
74 | #define␉s4␉␉r26␊ |
75 | #define␉s3␉␉r27␊ |
76 | #define␉s2␉␉r28␊ |
77 | #define␉s1␉␉r29␉␉// ....␊ |
78 | #define␉s0␉␉r30␉␉// callee-saved 0␊ |
79 | #define␉fp␉␉r31␉␉// frame-pointer, callee-saved␊ |
80 | ␊ |
81 | /*␊ |
82 | * Conversion of GRF aliases to register numbers␊ |
83 | */␊ |
84 | #define␉GRF_ZT␉␉0␉␉// architecturally 0 for mem refs only!␊ |
85 | ␉␉␉␉␉// real reg other inst, caller-saved␊ |
86 | #define␉GRF_SP␉␉1␉␉// stack pointer, callee-saved␊ |
87 | #define␉GRF_TOC␉␉2␉␉// tbl of contents, callee-saved␊ |
88 | #define␉GRF_A0␉␉3␉␉// arg 0, return value 0, caller saved␊ |
89 | #define␉GRF_A1␉␉4␉␉// arg 1, return value 1, caller saved␊ |
90 | #define␉GRF_A2␉␉5␉␉// ....␊ |
91 | #define␉GRF_A3␉␉6␊ |
92 | #define␉GRF_A4␉␉7␊ |
93 | #define␉GRF_A5␉␉8␊ |
94 | #define␉GRF_A6␉␉9␊ |
95 | #define␉GRF_A7␉␉10␉␉// arg 7, return value 7, caller saved␊ |
96 | #define␉GRF_EP␉␉11␉␉// environment ptr, caller saved␊ |
97 | #define␉GRF_AT␉␉12␉␉// assembler temp, caller saved␊ |
98 | #define␉GRF_S17␉␉13␉␉// callee-saved 17␊ |
99 | #define␉GRF_S16␉␉14␊ |
100 | #define␉GRF_S15␉␉15␊ |
101 | #define␉GRF_S14␉␉16␊ |
102 | #define␉GRF_S13␉␉17␊ |
103 | #define␉GRF_S12␉␉18␊ |
104 | #define␉GRF_S11␉␉19␊ |
105 | #define␉GRF_S10␉␉20␊ |
106 | #define␉GRF_S9␉␉21␊ |
107 | #define␉GRF_S8␉␉22␊ |
108 | #define␉GRF_S7␉␉23␊ |
109 | #define␉GRF_S6␉␉24␊ |
110 | #define␉GRF_S5␉␉25␊ |
111 | #define␉GRF_S4␉␉26␊ |
112 | #define␉GRF_S3␉␉27␊ |
113 | #define␉GRF_S2␉␉28␊ |
114 | #define␉GRF_S1␉␉29␉␉// ....␊ |
115 | #define␉GRF_S0␉␉30␉␉// callee-saved 0␊ |
116 | #define␉GRF_FP␉␉31␉␉// frame pointer, callee-saved␊ |
117 | ␊ |
118 | /*␊ |
119 | * FPF Register names␊ |
120 | */␊ |
121 | #define␉ft0␉␉f0␉␉// scratch reg, caller-saved␊ |
122 | #define␉fa0␉␉f1␉␉// fp arg 0, return 0, caller-saved␊ |
123 | #define␉fa1␉␉f2␉␉// fp arg 1, caller-saved␊ |
124 | #define␉fa2␉␉f3␉␉// fp arg 2, caller-saved␊ |
125 | #define␉fa3␉␉f4␊ |
126 | #define␉fa4␉␉f5␊ |
127 | #define␉fa5␉␉f6␊ |
128 | #define␉fa6␉␉f7␊ |
129 | #define␉fa7␉␉f8␊ |
130 | #define␉fa8␉␉f9␊ |
131 | #define␉fa9␉␉f10␊ |
132 | #define␉fa10␉␉f11␊ |
133 | #define␉fa11␉␉f12␊ |
134 | #define␉fa12␉␉f13␉␉// fp arg 12, caller-saved␊ |
135 | #define␉fs17␉␉f14␉␉// callee-saved 17␊ |
136 | #define␉fs16␉␉f15␊ |
137 | #define␉fs15␉␉f16␊ |
138 | #define␉fs14␉␉f17␊ |
139 | #define␉fs13␉␉f18␊ |
140 | #define␉fs12␉␉f19␊ |
141 | #define␉fs11␉␉f20␊ |
142 | #define␉fs10␉␉f21␊ |
143 | #define␉fs9␉␉f22␊ |
144 | #define␉fs8␉␉f23␊ |
145 | #define␉fs7␉␉f24␊ |
146 | #define␉fs6␉␉f25␊ |
147 | #define␉fs5␉␉f26␊ |
148 | #define␉fs4␉␉f27␊ |
149 | #define␉fs3␉␉f28␊ |
150 | #define␉fs2␉␉f29␊ |
151 | #define␉fs1␉␉f30␊ |
152 | #define␉fs0␉␉f31␉␉// callee-saved 0␊ |
153 | ␊ |
154 | /*␊ |
155 | * Conversion of FPF aliases to register numbers␊ |
156 | */␊ |
157 | #define␉FPF_FT0␉␉0␉␉// scratch reg, caller-saved␊ |
158 | #define␉FPF_FA0␉␉1␉␉// fp arg 0, return 0, caller-saved␊ |
159 | #define␉FPF_FA1␉␉2␉␉// fp arg 1, caller-saved␊ |
160 | #define␉FPF_FA2␉␉3␉␉// fp arg 2, caller-saved␊ |
161 | #define␉FPF_FA3␉␉4␊ |
162 | #define␉FPF_FA4␉␉5␊ |
163 | #define␉FPF_FA5␉␉6␊ |
164 | #define␉FPF_FA6␉␉7␊ |
165 | #define␉FPF_FA7␉␉8␊ |
166 | #define␉FPF_FA8␉␉9␊ |
167 | #define␉FPF_FA9␉␉10␊ |
168 | #define␉FPF_FA10␉11␊ |
169 | #define␉FPF_FA11␉12␊ |
170 | #define␉FPF_FA12␉13␉␉// fp arg 12, caller-saved␊ |
171 | #define␉FPF_FS17␉14␉␉// callee-saved 17␊ |
172 | #define␉FPF_FS16␉15␊ |
173 | #define␉FPF_FS15␉16␊ |
174 | #define␉FPF_FS14␉17␊ |
175 | #define␉FPF_FS13␉18␊ |
176 | #define␉FPF_FS12␉19␊ |
177 | #define␉FPF_FS11␉20␊ |
178 | #define␉FPF_FS10␉21␊ |
179 | #define␉FPF_FS9␉␉22␊ |
180 | #define␉FPF_FS8␉␉23␊ |
181 | #define␉FPF_FS7␉␉24␊ |
182 | #define␉FPF_FS6␉␉25␊ |
183 | #define␉FPF_FS5␉␉26␊ |
184 | #define␉FPF_FS4␉␉27␊ |
185 | #define␉FPF_FS3␉␉28␊ |
186 | #define␉FPF_FS2␉␉29␊ |
187 | #define␉FPF_FS1␉␉30␊ |
188 | #define␉FPF_FS0␉␉31␉␉// callee-saved 0␊ |
189 | ␊ |
190 | #endif␉/* __ASSEMBLER__ */␊ |
191 | ␊ |
192 | ␊ |
193 | /* Bitfield definition aid */␊ |
194 | #define␉BITS_WIDTH(msb, lsb)␉((msb)-(lsb)+1)␊ |
195 | #define␉BIT_WIDTH(pos)␉␉(1)␉/* mostly to record the position */␊ |
196 | ␊ |
197 | /* Mask creation */␊ |
198 | #define␉MKMASK(width, offset)␉(((unsigned)-1)>>(32-(width))<<(offset))␊ |
199 | #define␉BITSMASK(msb, lsb)␉MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f)␊ |
200 | #define␉BITMASK(pos)␉␉MKMASK(BIT_WIDTH(pos), pos & 0x1f)␊ |
201 | ␊ |
202 | /* Register addresses */␊ |
203 | #if␉__ASSEMBLER__␊ |
204 | # define␉REG_ADDR(type, addr)␉(addr)␊ |
205 | #else␉/* ! __ASSEMBLER__ */␊ |
206 | # define␉REG_ADDR(type, addr)␉(*(volatile type *)(addr))␊ |
207 | #endif␉/* __ASSEMBLER__ */␊ |
208 | ␊ |
209 | /* Cast a register to be an unsigned */␊ |
210 | /* CAUTION :␉non naturally aligned foo can result into alignment traps␊ |
211 | *␉␉use at own risk.␊ |
212 | */␊ |
213 | #define␉CONTENTS(foo)␉(*(unsigned *) &(foo))␊ |
214 | ␊ |
215 | /* STRINGIFY -- perform all possible substitutions, then stringify */␊ |
216 | #define␉__STR(x)␉#x␉␉/* just a helper macro */␊ |
217 | #define␉STRINGIFY(x)␉__STR(x)␊ |
218 | ␊ |
219 | /* ␊ |
220 | * Stack pointer must always be a multiple of 16␊ |
221 | */␊ |
222 | #define␉STACK_INCR␉16␊ |
223 | #define␉ROUND_FRAME(x)␉((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1))␊ |
224 | ␊ |
225 | #endif /* _ARCH_PPC_REG_HELP_H_ */␊ |
226 |