]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/asm.h
496b31c05a1d98e1cf4f60e58c21fdc13aa391cc
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
29 #define STRINGD .ascii
45 #define tmp0 r0 /* Temporary GPR remapping (603e specific) */
52 #define mq 0 /* MQ register for 601 emulation */
53 #define rtcu 4 /* RTCU - upper word of RTC for 601 emulation */
54 #define rtcl 5 /* RTCL - lower word of RTC for 601 emulation */
63 #define vrsave 256 /* Vector Register save */
104 #define ummcr2 928 /* Performance monitor control */
105 #define ubamr 935 /* Performance monitor mask */
106 #define ummcr0 936 /* Performance monitor control */
107 #define upmc1 937 /* Performance monitor counter */
108 #define upmc2 938 /* Performance monitor counter */
109 #define usia 939 /* User sampled instruction address */
110 #define ummcr1 940 /* Performance monitor control */
111 #define upmc3 941 /* Performance monitor counter */
112 #define upmc4 942 /* Performance monitor counter */
113 #define usda 943 /* User sampled data address */
114 #define mmcr2 944 /* Performance monitor control */
115 #define bamr 951 /* Performance monitor mask */
123 #define sda 959 /* Sampled data address */
124 #define dmiss 976 /* ea that missed */
125 #define dcmp 977 /* compare value for the va that missed */
126 #define hash1 978 /* pointer to first hash pteg */
127 #define hash2 979 /* pointer to second hash pteg */
128 #define imiss 980 /* ea that missed */
129 #define tlbmiss 980 /* ea that missed */
130 #define icmp 981 /* compare value for the va that missed */
131 #define ptehi 981 /* compare value for the va that missed */
132 #define rpa 982 /* required physical address register */
133 #define ptelo 982 /* required physical address register */
134 #define l3pdet 984 /* l3pdet */
136 #define HID0 1008 /* Checkstop and misc enables */
137 #define hid0 1008 /* Checkstop and misc enables */
138 #define HID1 1009 /* Clock configuration */
139 #define hid1 1009 /* Clock configuration */
140 #define iabr 1010 /* Instruction address breakpoint register */
141 #define ictrl 1011 /* Instruction Cache Control */
142 #define dabr 1013 /* Data address breakpoint register */
143 #define msscr0 1014 /* Memory subsystem control */
144 #define msscr1 1015 /* Memory subsystem debug */
145 #define msssr0 1015 /* Memory Subsystem Status */
146 #define ldstcr 1016 /* Load/Store Status/Control */
147 #define l2cr2 1016 /* L2 Cache control 2 */
148 #define l2cr 1017 /* L2 Cache control */
149 #define l3cr 1018 /* L3 Cache control */
150 #define ictc 1019 /* I-cache throttling control */
151 #define thrm1 1020 /* Thermal management 1 */
152 #define thrm2 1021 /* Thermal management 2 */
153 #define thrm3 1022 /* Thermal management 3 */
154 #define pir 1023 /* Processor ID Register */
158 #define emcpm 0x80000000
160 #define dbpm 0x40000000
162 #define ebam 0x20000000
164 #define ebdm 0x10000000
166 #define sbclkm 0x08000000
168 #define eclkm 0x02000000
170 #define parm 0x01000000
172 #define stenm 0x01000000
174 #define dozem 0x00800000
176 #define napm 0x00400000
178 #define sleepm 0x00200000
180 #define dpmm 0x00100000
182 #define risegm 0x00080000
184 #define eiecm 0x00040000
186 #define nhrm 0x00010000
188 #define icem 0x00008000
190 #define dcem 0x00004000
192 #define ilockm 0x00002000
194 #define dlockm 0x00001000
196 #define icfim 0x00000800
198 #define dcfim 0x00000400
200 #define spdm 0x00000200
202 #define sgem 0x00000080
204 #define dcfam 0x00000040
206 #define bticm 0x00000020
208 #define lrstkm 0x00000010
210 #define abem 0x00000008
212 #define foldm 0x00000008
214 #define bhtm 0x00000004
216 #define nopdstm 0x00000002
218 #define noptim 0x00000001
222 #define shdenm 0x80000000
224 #define shdenm3 0x40000000
227 #define l1intvb 0x38000000
230 #define l2intvb 0x07000000
232 #define dl1hwfm 0x00800000
234 #define dbsizm 0x00400000
236 #define emodem 0x00200000
238 #define abgdm 0x00100000
241 #define tfstm 0x000000C0
245 #define cqdm 0x00010000
248 #define csqm 0x60000000
274 #define icmckm 0x40000000
276 #define dcmckm 0x20000000
278 #define l2mckm 0x10000000
280 #define tlbmckm 0x08000000
282 #define brmckm 0x04000000
284 #define othmckm 0x00200000
286 #define l2dpmckm 0x00100000
288 #define mcpmckm 0x00080000
290 #define teamckm 0x00040000
292 #define dpmckm 0x00020000
294 #define apmckm 0x00010000
298 #define l2em 0x80000000
300 #define l2pem 0x40000000
303 #define l2sizm 0x30000000
306 #define l2clkm 0x0E000000
309 #define l2ramm 0x01800000
311 #define l2dom 0x00400000
313 #define l2im 0x00200000
315 #define l2ctlm 0x00100000
317 #define l2ionlym 0x00100000
319 #define l2wtm 0x00080000
321 #define l2tsm 0x00040000
324 #define l2ohm 0x00030000
326 #define l2donlym 0x00010000
328 #define l2slm 0x00008000
330 #define l2dfm 0x00004000
332 #define l2bypm 0x00002000
334 #define l2fam 0x00001000
336 #define l2hwfm 0x00000800
338 #define l2iom 0x00000400
340 #define l2clkstpm 0x00000200
342 #define l2drom 0x00000100
345 #define l2ctrm 0x000000FE
347 #define l2ipm 0x00000001
351 #define l3em 0x80000000
353 #define l3pem 0x40000000
355 #define l3sizm 0x10000000
357 #define l3clkenm 0x08000000
359 #define l3dxm 0x04000000
362 #define l3clkm 0x03800000
364 #define l3iom 0x00400000
366 #define l3spom 0x00040000
369 #define l3ckspm 0x00030000
372 #define l3pspm 0x0000E000
374 #define l3repm 0x00001000
376 #define l3hwfm 0x00000800
378 #define l3im 0x00000400
381 #define l3rtm 0x00000300
383 #define l3drom 0x00000100
385 #define l3cyam 0x00000080
387 #define l3donlym 0x00000040
389 #define l3dmemm 0x00000004
391 #define l3dmsizm 0x00000001
394 #define thrmtinm 0x80000000
396 #define thrmtivm 0x40000000
399 #define thrmthrm 0x3F800000
401 #define thrmtidm 0x00000004
403 #define thrmtiem 0x00000002
405 #define thrmvm 0x00000001
409 #define thrmsitvm 0x0001FFFE
411 #define thrmem 0x00000001
415 #define ictcfim 0x000001FE
417 #define ictcem 0x00000001
461 * Macros to access high and low word values of an address
464 #define HIGH_CADDR(x) ha16(x)
465 #define HIGH_ADDR(x) hi16(x)
466 #define LOW_ADDR(x) lo16(x)
468 #endif /* ASSEMBLER */
470 /* Tags are placed before Immediately Following Code (IFC) for the debugger
471 * to be able to deduce where to find various registers when backtracing
473 * We only define the values as we use them, see SVR4 ABI PowerPc Supplement
474 * for more details (defined in ELF spec).
477 #define TAG_NO_FRAME_USED 0x00000000
479 /* (should use genassym to get these offsets) */
483 #define FM_LR_SAVE 8 /* MacOSX is NOT following the ABI at the moment.. */
484 #define FM_SIZE 64 /* minimum frame contents, backptr and LR save. Make sure it is quadaligned */
486 #define FM_ALIGN(l) ((l+15)&-16)
487 #define PK_SYSCALL_BEGIN 0x7000
490 /* redzone is the area under the stack pointer which must be preserved
491 * when taking a trap, interrupt etc.
493 #define FM_REDZONE 224 /* is ((32-14+1)*4) */
495 #define COPYIN_ARG0_OFFSET FM_ARG0
498 #include <mach_kdb.h>
499 #else /* MACH_KERNEL */
501 #endif /* MACH_KERNEL */
503 #define BREAKPOINT_TRAP tw 4,r4,r4
505 /* There is another definition of ALIGN for .c sources */
506 #ifndef __LANGUAGE_ASSEMBLY
508 #endif /* __LANGUAGE_ASSEMBLY */
511 #define FALIGN 4 /* Align functions on words for now. Cachelines is better */
516 #define LCL(x) L ## x
517 #define EXT(x) _ ## x
518 #define LEXT(x) _ ## x ## :
519 #define LBc(x,n) n ## :
520 #define LBb(x,n) n ## b
521 #define LBf(x,n) n ## f
523 #define LCL(x) L/**/x
524 #define EXT(x) _/**/x
525 #define LEXT(x) _/**/x/**/:
526 #define LBc(x,n) n/**/:
527 #define LBb(x,n) n/**/b
528 #define LBf(x,n) n/**/f
529 #endif /* __STDC__ */
531 #define String .asciz
533 #define Times(a,b) (a*b)
534 #define Divide(a,b) (a/b)
536 #define data16 .byte 0x66
537 #define addr16 .byte 0x67
545 #define ELF_SIZE(x,s)
547 #define Entry(x,tag) .text@.align FALIGN@ .globl EXT(x)@ LEXT(x)
548 #define ENTRY(x,tag) Entry(x,tag)@MCOUNT
549 #define ENTRY2(x,y,tag) .text@ .align FALIGN@ .globl EXT(x)@ .globl EXT(y)@ \
553 #define ASENTRY(x) .globl x @ .align FALIGN; x ## @ MCOUNT
555 #define ASENTRY(x) .globl x @ .align FALIGN; x @ MCOUNT
556 #endif /* __STDC__ */
557 #define DATA(x) .globl EXT(x) @ .align ALIGN @ LEXT(x)
560 #define End(x) ELF_SIZE(x,.-x)
561 #define END(x) End(EXT(x))
562 #define ENDDATA(x) END(x)
563 #define Enddata(x) End(x)
565 /* These defines are here for .c files that wish to reference global symbols
566 * within __asm__ statements.
568 #define CC_SYM_PREFIX "_"
570 #endif /* _PPC_ASM_H_ */