]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/asm.h
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 */
106 #define ummcr2 928 /* Performance monitor control */
107 #define upmc5 929 /* Performance monitor counter */
108 #define upmc6 930 /* Performance monitor counter */
109 #define ubamr 935 /* Performance monitor mask */
110 #define ummcr0 936 /* Performance monitor control */
111 #define upmc1 937 /* Performance monitor counter */
112 #define upmc2 938 /* Performance monitor counter */
113 #define usia 939 /* User sampled instruction address */
114 #define ummcr1 940 /* Performance monitor control */
115 #define upmc3 941 /* Performance monitor counter */
116 #define upmc4 942 /* Performance monitor counter */
117 #define usda 943 /* User sampled data address */
118 #define mmcr2 944 /* Performance monitor control */
119 #define pmc5 945 /* Performance monitor counter */
120 #define pmc6 946 /* Performance monitor counter */
121 #define bamr 951 /* Performance monitor mask */
129 #define sda 959 /* Sampled data address */
130 #define dmiss 976 /* ea that missed */
132 #define dcmp 977 /* compare value for the va that missed */
134 #define hash1 978 /* pointer to first hash pteg */
136 #define hash2 979 /* pointer to second hash pteg */
137 #define imiss 980 /* ea that missed */
138 #define tlbmiss 980 /* ea that missed */
139 #define icmp 981 /* compare value for the va that missed */
140 #define ptehi 981 /* compare value for the va that missed */
141 #define rpa 982 /* required physical address register */
142 #define ptelo 982 /* required physical address register */
143 #define l3pdet 984 /* l3pdet */
145 #define HID0 1008 /* Checkstop and misc enables */
146 #define hid0 1008 /* Checkstop and misc enables */
147 #define HID1 1009 /* Clock configuration */
148 #define hid1 1009 /* Clock configuration */
149 #define HID2 1016 /* Other processor controls */
150 #define hid2 1016 /* Other processor controls */
151 #define iabr 1010 /* Instruction address breakpoint register */
152 #define ictrl 1011 /* Instruction Cache Control */
153 #define ldstdb 1012 /* Load/Store Debug */
154 #define hid4 1012 /* Misc stuff */
155 #define dabr 1013 /* Data address breakpoint register */
156 #define msscr0 1014 /* Memory subsystem control */
157 #define hid5 1014 /* Misc stuff */
158 #define msscr1 1015 /* Memory subsystem debug */
159 #define msssr0 1015 /* Memory Subsystem Status */
160 #define ldstcr 1016 /* Load/Store Status/Control */
161 #define l2cr2 1016 /* L2 Cache control 2 */
162 #define l2cr 1017 /* L2 Cache control */
163 #define l3cr 1018 /* L3 Cache control */
164 #define ictc 1019 /* I-cache throttling control */
165 #define thrm1 1020 /* Thermal management 1 */
166 #define thrm2 1021 /* Thermal management 2 */
167 #define thrm3 1022 /* Thermal management 3 */
168 #define pir 1023 /* Processor ID Register */
171 /* SPR registers (64-bit, PPC970 specific) */
187 #define ummcra_gp 770
196 #define ummcr0_gp 779
199 #define ummcr1_gp 782
225 #define emcpm 0x80000000
227 #define dbpm 0x40000000
229 #define ebam 0x20000000
231 #define ebdm 0x10000000
233 #define sbclkm 0x08000000
235 #define eclkm 0x02000000
237 #define parm 0x01000000
239 #define stenm 0x01000000
241 #define dozem 0x00800000
243 #define napm 0x00400000
245 #define sleepm 0x00200000
247 #define dpmm 0x00100000
249 #define risegm 0x00080000
251 #define eiecm 0x00040000
253 #define mumm 0x00020000
255 #define nhrm 0x00010000
257 #define icem 0x00008000
259 #define dcem 0x00004000
261 #define ilockm 0x00002000
263 #define dlockm 0x00001000
266 #define icfim 0x00000800
268 #define dcfim 0x00000400
270 #define spdm 0x00000200
272 #define sgem 0x00000080
274 #define dcfam 0x00000040
276 #define bticm 0x00000020
278 #define lrstkm 0x00000010
280 #define abem 0x00000008
282 #define foldm 0x00000008
284 #define bhtm 0x00000004
286 #define nopdstm 0x00000002
288 #define noptim 0x00000001
291 #define hid1pcem 0xF8000000
292 #define hid1prem 0x06000000
294 #define hid1dfs0m 0x00800000
296 #define hid1dfs1m 0x00400000
298 #define hid1pi0m 0x00020000
299 #define hid1FCPErr 14
301 #define hid1FCD0PErr 15
302 #define hid1psm 0x00010000
303 #define hid1pc0 0x0000F800
304 #define hid1pr0 0x00000600
305 #define hid1pc1 0x000000F8
306 #define hid1pc0 0x0000F800
307 #define hid1pr1 0x00000006
308 #define hid1FCD1PErr 16
309 #define hid1FIERATErr 17
313 #define hid2vminm 0x00002000
317 #define shdenm 0x80000000
319 #define shdenm3 0x40000000
322 #define l1intvb 0x38000000
325 #define l2intvb 0x07000000
327 #define dl1hwfm 0x00800000
329 #define dbsizm 0x00400000
331 #define emodem 0x00200000
333 #define abgdm 0x00100000
336 #define tfstm 0x000000C0
339 #define l2pfem 0x00000003
343 #define cqdm 0x00010000
346 #define csqm 0x60000000
372 #define icmckm 0x40000000
374 #define dcmckm 0x20000000
376 #define l2mckm 0x10000000
378 #define tlbmckm 0x08000000
380 #define brmckm 0x04000000
382 #define othmckm 0x00200000
384 #define l2dpmckm 0x00100000
386 #define mcpmckm 0x00080000
388 #define teamckm 0x00040000
390 #define dpmckm 0x00020000
392 #define apmckm 0x00010000
405 #define mckUETwDfr 17
413 #define AsyMCKSrc 0x0226
414 #define AsyMCKRSrc 0x0227
419 #define AsyMCKncstp 4
423 #define cFIRrst 0x0310
424 #define cFIRICachePE 0
425 #define cFIRITagPE0 1
426 #define cFIRITagPE1 2
427 #define cFIRIEratPE 3
428 #define cFIRIFUL2UE 4
430 #define cFIRDCachePE 6
432 #define cFIRDEratPE 8
438 #define CoreErrI 0x0350
449 #define l2FIRrst 0x0410
452 #define busFIR 0x0A00
453 #define busFIRrst 0x0A10
456 #define GUSModeReg 0x0430
457 #define GUSMdmapen 0x00008000
458 #define GUSMstgtdis 0x00000080
459 #define GUSMstgttim 0x00000038
460 #define GUSMstgttoff 0x00000004
467 #define hid4EnSPTW 27
468 #define hid4L1DCFI 28
469 #define hid4DisDERpg 31
470 #define hid4DisDCTpg 36
471 #define hid4DisDCpg 41
472 #define hid4DisTLBpg 48
473 #define hid4DisSLBpg 54
474 #define hid4MckEIEna 55
478 #define l2em 0x80000000
480 #define l2pem 0x40000000
483 #define l2sizm 0x30000000
486 #define l2clkm 0x0E000000
489 #define l2ramm 0x01800000
491 #define l2dom 0x00400000
493 #define l2im 0x00200000
495 #define l2ctlm 0x00100000
497 #define l2ionlym 0x00100000
499 #define l2wtm 0x00080000
501 #define l2tsm 0x00040000
504 #define l2ohm 0x00030000
506 #define l2donlym 0x00010000
508 #define l2slm 0x00008000
510 #define l2dfm 0x00004000
512 #define l2bypm 0x00002000
514 #define l2fam 0x00001000
516 #define l2hwfm 0x00000800
518 #define l2iom 0x00000400
520 #define l2clkstpm 0x00000200
522 #define l2drom 0x00000100
525 #define l2ctrm 0x000000FE
527 #define l2ipm 0x00000001
531 #define l3em 0x80000000
533 #define l3pem 0x40000000
535 #define l3sizm 0x10000000
537 #define l3clkenm 0x08000000
539 #define l3dxm 0x04000000
542 #define l3clkm 0x03800000
544 #define l3iom 0x00400000
546 #define l3spom 0x00040000
549 #define l3ckspm 0x00030000
552 #define l3pspm 0x0000E000
554 #define l3repm 0x00001000
556 #define l3hwfm 0x00000800
558 #define l3im 0x00000400
561 #define l3rtm 0x00000300
563 #define l3drom 0x00000100
565 #define l3cyam 0x00000080
567 #define l3donlym 0x00000040
569 #define l3dmemm 0x00000004
571 #define l3dmsizm 0x00000001
574 #define thrmtinm 0x80000000
576 #define thrmtivm 0x40000000
579 #define thrmthrm 0x3F800000
581 #define thrmtidm 0x00000004
583 #define thrmtiem 0x00000002
585 #define thrmvm 0x00000001
589 #define thrmsitvm 0x0001FFFE
591 #define thrmem 0x00000001
595 #define ictcfim 0x000001FE
597 #define ictcem 0x00000001
644 #define slbVm 0x08000000
648 * Macros to access high and low word values of an address
651 #define HIGH_CADDR(x) ha16(x)
652 #define HIGH_ADDR(x) hi16(x)
653 #define LOW_ADDR(x) lo16(x)
655 #endif /* ASSEMBLER */
657 /* Tags are placed before Immediately Following Code (IFC) for the debugger
658 * to be able to deduce where to find various registers when backtracing
660 * We only define the values as we use them, see SVR4 ABI PowerPc Supplement
661 * for more details (defined in ELF spec).
664 #define TAG_NO_FRAME_USED 0x00000000
666 /* (should use genassym to get these offsets) */
670 #define FM_LR_SAVE 8 /* MacOSX is NOT following the ABI at the moment.. */
671 #define FM_SIZE 64 /* minimum frame contents, backptr and LR save. Make sure it is quadaligned */
673 #define FM_ALIGN(l) ((l+15)&-16)
674 #define PK_SYSCALL_BEGIN 0x7000
677 /* redzone is the area under the stack pointer which must be preserved
678 * when taking a trap, interrupt etc.
680 #define FM_REDZONE 224 /* is ((32-14+1)*4) */
682 #define COPYIN_ARG0_OFFSET FM_ARG0
685 #include <mach_kdb.h>
686 #else /* MACH_KERNEL */
688 #endif /* MACH_KERNEL */
690 #define BREAKPOINT_TRAP tw 4,r4,r4
692 /* There is another definition of ALIGN for .c sources */
693 #ifndef __LANGUAGE_ASSEMBLY
695 #endif /* __LANGUAGE_ASSEMBLY */
698 #define FALIGN 4 /* Align functions on words for now. Cachelines is better */
703 #define LCL(x) L ## x
704 #define EXT(x) _ ## x
705 #define LEXT(x) _ ## x ## :
706 #define LBc(x,n) n ## :
707 #define LBb(x,n) n ## b
708 #define LBf(x,n) n ## f
710 #define LCL(x) L/**/x
711 #define EXT(x) _/**/x
712 #define LEXT(x) _/**/x/**/:
713 #define LBc(x,n) n/**/:
714 #define LBb(x,n) n/**/b
715 #define LBf(x,n) n/**/f
716 #endif /* __STDC__ */
718 #define String .asciz
720 #define Times(a,b) (a*b)
721 #define Divide(a,b) (a/b)
723 #define data16 .byte 0x66
724 #define addr16 .byte 0x67
730 #define ELF_SIZE(x,s)
732 #define Entry(x,tag) .text@.align FALIGN@ .globl EXT(x)@ LEXT(x)
733 #define ENTRY(x,tag) Entry(x,tag)@MCOUNT
734 #define ENTRY2(x,y,tag) .text@ .align FALIGN@ .globl EXT(x)@ .globl EXT(y)@ \
738 #define ASENTRY(x) .globl x @ .align FALIGN; x ## @ MCOUNT
740 #define ASENTRY(x) .globl x @ .align FALIGN; x @ MCOUNT
741 #endif /* __STDC__ */
742 #define DATA(x) .globl EXT(x) @ .align ALIGN @ LEXT(x)
745 #define End(x) ELF_SIZE(x,.-x)
746 #define END(x) End(EXT(x))
747 #define ENDDATA(x) END(x)
748 #define Enddata(x) End(x)
750 /* These defines are here for .c files that wish to reference global symbols
751 * within __asm__ statements.
753 #define CC_SYM_PREFIX "_"
755 #endif /* _PPC_ASM_H_ */