Annotation of XNU/osfmk/ppc/asm.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      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.
                     11:  * 
                     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
                     18:  * under the License.
                     19:  * 
                     20:  * @APPLE_LICENSE_HEADER_END@
                     21:  */
                     22: /*
                     23:  * @OSF_COPYRIGHT@
                     24:  */
                     25: 
                     26: #ifndef        _PPC_ASM_H_
                     27: #define        _PPC_ASM_H_
                     28: 
                     29: #define        __ASMNL__       @
                     30: #define STRINGD .ascii
                     31: 
                     32: #ifdef ASSEMBLER
                     33: 
                     34: 
                     35: #define br0 0
                     36: 
                     37: #define ARG0 r3
                     38: #define ARG1 r4
                     39: #define ARG2 r5
                     40: #define ARG3 r6
                     41: #define ARG4 r7
                     42: #define ARG5 r8
                     43: #define ARG6 r9
                     44: #define ARG7 r10
                     45: 
                     46: #define tmp0   r0      /* Temporary GPR remapping (603e specific) */
                     47: #define tmp1   r1
                     48: #define tmp2   r2
                     49: #define tmp3   r3
                     50: 
                     51: /* SPR registers */
                     52: 
                     53: #define mq             0               /* MQ register for 601 emulation */
                     54: #define rtcu   4               /* RTCU - upper word of RTC for 601 emulation */
                     55: #define rtcl   5               /* RTCL - lower word of RTC for 601 emulation */
                     56: #define dsisr  18
                     57: #define ppcDAR 19
                     58: #define ppcdar 19
                     59: #define dar            19
                     60: #define SDR1   25
                     61: #define sdr1   25
                     62: #define srr0   26
                     63: #define srr1   27
                     64: #define vrsave 256             /* Vector Register save */
                     65: #define sprg0  272
                     66: #define sprg1  273
                     67: #define sprg2  274
                     68: #define sprg3  275
                     69: #define pvr            287
                     70: 
                     71: #define IBAT0U 528
                     72: #define IBAT0L 529
                     73: #define IBAT1U 530
                     74: #define IBAT1L 531
                     75: #define IBAT2U 532
                     76: #define IBAT2L 533
                     77: #define IBAT3U 534
                     78: #define IBAT3L 535
                     79: #define ibat0u 528
                     80: #define ibat0l 529
                     81: #define ibat1u 530
                     82: #define ibat1l 531
                     83: #define ibat2u 532
                     84: #define ibat2l 533
                     85: #define ibat3u 534
                     86: #define ibat3l 535
                     87: 
                     88: #define DBAT0U 536
                     89: #define DBAT0L 537
                     90: #define DBAT1U 538
                     91: #define DBAT1L 539
                     92: #define DBAT2U 540
                     93: #define DBAT2L 541
                     94: #define DBAT3U 542
                     95: #define DBAT3L 543
                     96: #define dbat0u 536
                     97: #define dbat0l 537
                     98: #define dbat1u 538
                     99: #define dbat1l 539
                    100: #define dbat2u 540
                    101: #define dbat2l 541
                    102: #define dbat3u 542
                    103: #define dbat3l 543
                    104: 
                    105: #define ummcr2 928             /* Performance monitor control */
                    106: #define ubamr  935             /* Performance monitor mask */
                    107: #define ummcr0 936             /* Performance monitor control */
                    108: #define upmc1  937             /* Performance monitor counter */
                    109: #define upmc2  938             /* Performance monitor counter */
                    110: #define usia   939             /* User sampled instruction address */
                    111: #define ummcr1 940             /* Performance monitor control */
                    112: #define upmc3  941             /* Performance monitor counter */
                    113: #define upmc4  942             /* Performance monitor counter */
                    114: #define usda   943             /* User sampled data address */
                    115: #define mmcr2  944             /* Performance monitor control */
                    116: #define bamr   951             /* Performance monitor mask */
                    117: #define mmcr0  952
                    118: #define pmc1   953
                    119: #define        pmc2    954
                    120: #define        sia             955
                    121: #define        mmcr1   956
                    122: #define        pmc3    957
                    123: #define        pmc4    958
                    124: #define        sda             959             /* Sampled data address */
                    125: #define dmiss  976             /* ea that missed */
                    126: #define dcmp   977             /* compare value for the va that missed */
                    127: #define hash1  978             /* pointer to first hash pteg */
                    128: #define        hash2   979             /* pointer to second hash pteg */
                    129: #define imiss  980             /* ea that missed */
                    130: #define icmp   981             /* compare value for the va that missed */
                    131: #define rpa            982             /* required physical address register */
                    132: 
                    133: #define HID0   1008    /* Checkstop and misc enables */
                    134: #define hid0   1008    /* Checkstop and misc enables */
                    135: #define HID1   1009    /* Clock configuration */
                    136: #define hid1   1009    /* Clock configuration */
                    137: #define iabr   1010    /* Instruction address breakpoint register */
                    138: #define dabr   1013    /* Data address breakpoint register */
                    139: #define msscr0 1014    /* Memory subsystem control */
                    140: #define msscr1 1015    /* Memory subsystem debug */
                    141: #define l2cr   1017    /* L2 Cache control */
                    142: #define ictc   1019    /* I-cache throttling control */
                    143: #define thrm1  1020    /* Thermal management 1 */
                    144: #define thrm2  1021    /* Thermal management 2 */
                    145: #define thrm3  1022    /* Thermal management 3 */
                    146: #define pir            1023    /* Processor ID Register */
                    147: 
                    148: ;      hid0 bits
                    149: #define emcp   0
                    150: #define emcpm  0x80000000
                    151: #define dbp            1
                    152: #define dbpm   0x40000000
                    153: #define eba            2
                    154: #define ebam   0x20000000
                    155: #define ebd            3
                    156: #define ebdm   0x10000000
                    157: #define sbclk  4
                    158: #define sbclkm 0x08000000
                    159: #define eclk   6
                    160: #define eclkm  0x02000000
                    161: #define par            7
                    162: #define parm   0x01000000
                    163: #define doze   8
                    164: #define dozem  0x00800000
                    165: #define nap            9
                    166: #define napm   0x00400000
                    167: #define sleep  10
                    168: #define sleepm 0x00200000
                    169: #define dpm            11
                    170: #define dpmm   0x00100000
                    171: #define riseg  12
                    172: #define risegm 0x00080000
                    173: #define eiec   13
                    174: #define eiecm  0x00040000
                    175: #define nhr            15
                    176: #define nhrm   0x00010000
                    177: #define ice            16
                    178: #define icem   0x00008000
                    179: #define dce            17
                    180: #define dcem   0x00004000
                    181: #define ilock  18
                    182: #define ilockm 0x00002000
                    183: #define dlock  19
                    184: #define dlockm 0x00001000
                    185: #define icfi   20
                    186: #define icfim  0x00000800
                    187: #define dcfi   21
                    188: #define dcfim  0x00000400
                    189: #define spd            22
                    190: #define spdm   0x00000200
                    191: #define sge            24
                    192: #define sgem   0x00000080
                    193: #define dcfa   25
                    194: #define dcfam  0x00000040
                    195: #define btic   26
                    196: #define bticm  0x00000020
                    197: #define abe            28
                    198: #define abem   0x00000008
                    199: #define bht            29
                    200: #define bhtm   0x00000004
                    201: #define nopdst 30
                    202: #define nopdstm        0x00000002
                    203: #define nopti  31
                    204: #define noptim 0x00000001
                    205: 
                    206: ;      msscr0 bits
                    207: #define shden  0
                    208: #define shdenm 0x80000000
                    209: #define shden3 1
                    210: #define shdenm3        0x40000000
                    211: #define l1intvs        2       
                    212: #define l1intve        4       
                    213: #define l1intvb        0x38000000      
                    214: #define l2intvs        5       
                    215: #define l2intve        7       
                    216: #define l2intvb        0x07000000      
                    217: #define dl1hwf 8
                    218: #define dl1hwfm        0x00800000
                    219: #define dbsiz  9
                    220: #define dbsizm 0x00400000
                    221: #define emode  10
                    222: #define emodem 0x00200000
                    223: #define abgd   11
                    224: #define abgdm  0x00100000
                    225: #define tfsts  24
                    226: #define tfste  25
                    227: #define tfstm  0x000000C0
                    228: 
                    229: ;      msscr1 bits
                    230: #define cqd            15
                    231: #define cqdm   0x00010000
                    232: #define csqs   1
                    233: #define csqe   2
                    234: #define csqm   0x60000000
                    235: 
                    236: ;      srr1 bits
                    237: #define icmck  1
                    238: #define icmckm 0x40000000
                    239: #define dcmck  2
                    240: #define dcmckm 0x20000000
                    241: #define l2mck  3
                    242: #define l2mckm 0x10000000
                    243: #define tlbmck 4
                    244: #define tlbmckm        0x08000000
                    245: #define brmck  5
                    246: #define brmckm 0x04000000
                    247: #define othmck 10
                    248: #define othmckm        0x00200000
                    249: #define l2dpmck        11
                    250: #define l2dpmckm       0x00100000
                    251: #define mcpmck 12
                    252: #define mcpmckm        0x00080000
                    253: #define teamck 13
                    254: #define teamckm        0x00040000
                    255: #define dpmck  14
                    256: #define dpmckm 0x00020000
                    257: #define apmck  15
                    258: #define apmckm 0x00010000
                    259: 
                    260: #define cr0_lt 0
                    261: #define cr0_gt 1
                    262: #define cr0_eq 2
                    263: #define cr0_so 3
                    264: #define cr0_un 3
                    265: #define cr1_lt 4
                    266: #define cr1_gt 5
                    267: #define cr1_eq 6
                    268: #define cr1_so 7
                    269: #define cr1_un 7
                    270: #define cr2_lt 8
                    271: #define cr2_gt 9
                    272: #define cr2_eq 10
                    273: #define cr2_so 11
                    274: #define cr2_un 11
                    275: #define cr3_lt 12
                    276: #define cr3_gt 13
                    277: #define cr3_eq 14
                    278: #define cr3_so 15
                    279: #define cr3_un 15
                    280: #define cr4_lt 16
                    281: #define cr4_gt 17
                    282: #define cr4_eq 18
                    283: #define cr4_so 19
                    284: #define cr4_un 19
                    285: #define cr5_lt 20
                    286: #define cr5_gt 21
                    287: #define cr5_eq 22
                    288: #define cr5_so 23
                    289: #define cr5_un 23
                    290: #define cr6_lt 24
                    291: #define cr6_gt 25
                    292: #define cr6_eq 26
                    293: #define cr6_so 27
                    294: #define cr6_un 27
                    295: #define cr7_lt 28
                    296: #define cr7_gt 29
                    297: #define cr7_eq 30
                    298: #define cr7_so 31
                    299: #define cr7_un 31
                    300: 
                    301: /*
                    302:  * Macros to access high and low word values of an address
                    303:  */
                    304: 
                    305: #define        HIGH_CADDR(x)   ha16(x)
                    306: #define        HIGH_ADDR(x)    hi16(x)
                    307: #define        LOW_ADDR(x)     lo16(x)
                    308: 
                    309: #endif /* ASSEMBLER */
                    310: 
                    311: /* Tags are placed before Immediately Following Code (IFC) for the debugger
                    312:  * to be able to deduce where to find various registers when backtracing
                    313:  * 
                    314:  * We only define the values as we use them, see SVR4 ABI PowerPc Supplement
                    315:  * for more details (defined in ELF spec).
                    316:  */
                    317: 
                    318: #define TAG_NO_FRAME_USED 0x00000000
                    319: 
                    320: /* (should use genassym to get these offsets) */
                    321: 
                    322: #define FM_BACKPTR 0
                    323: #define        FM_CR_SAVE 4
                    324: #define FM_LR_SAVE 8 /* MacOSX is NOT following the ABI at the moment.. */
                    325: #define FM_SIZE    64   /* minimum frame contents, backptr and LR save. Make sure it is quadaligned */
                    326: #define FM_ARG0           56
                    327: #define FM_ALIGN(l) ((l+15)&-16)
                    328: 
                    329: #define        FM_ELF_ARG0             8
                    330: #define        FM_MACHO_ARG0           56
                    331: #define        MACHO_SYSCALL_BEGIN     0x2000
                    332: #define        PK_SYSCALL_BEGIN        0x7000
                    333: 
                    334: 
                    335: /* redzone is the area under the stack pointer which must be preserved
                    336:  * when taking a trap, interrupt etc.
                    337:  */
                    338: #define FM_REDZONE 224                         /* is ((32-14+1)*4) */
                    339: 
                    340: #define COPYIN_ARG0_OFFSET FM_ARG0
                    341: 
                    342: #ifdef MACH_KERNEL
                    343: #include <mach_kdb.h>
                    344: #else  /* MACH_KERNEL */
                    345: #define MACH_KDB 0
                    346: #endif /* MACH_KERNEL */
                    347: 
                    348: #define BREAKPOINT_TRAP tw     4,r4,r4
                    349: 
                    350: /* There is another definition of ALIGN for .c sources */
                    351: #ifndef __LANGUAGE_ASSEMBLY
                    352: #define ALIGN 4
                    353: #endif /* __LANGUAGE_ASSEMBLY */
                    354: 
                    355: #ifndef FALIGN
                    356: #define FALIGN 4 /* Align functions on words for now. Cachelines is better */
                    357: #endif
                    358: 
                    359: #define LB(x,n) n
                    360: #if    __STDC__
                    361: #define        LCL(x)  L ## x
                    362: #define EXT(x) _ ## x
                    363: #define LEXT(x) _ ## x ## :
                    364: #define LBc(x,n) n ## :
                    365: #define LBb(x,n) n ## b
                    366: #define LBf(x,n) n ## f
                    367: #else /* __STDC__ */
                    368: #define LCL(x) L/**/x
                    369: #define EXT(x) _/**/x
                    370: #define LEXT(x) _/**/x/**/:
                    371: #define LBc(x,n) n/**/:
                    372: #define LBb(x,n) n/**/b
                    373: #define LBf(x,n) n/**/f
                    374: #endif /* __STDC__ */
                    375: 
                    376: #define String .asciz
                    377: #define Value  .word
                    378: #define Times(a,b) (a*b)
                    379: #define Divide(a,b) (a/b)
                    380: 
                    381: #define data16 .byte 0x66
                    382: #define addr16 .byte 0x67
                    383: 
                    384: #if !GPROF
                    385: #define MCOUNT
                    386: #endif /* GPROF */
                    387: 
                    388: #define ELF_FUNC(x)
                    389: #define ELF_DATA(x)
                    390: #define ELF_SIZE(x,s)
                    391: 
                    392: #define        Entry(x,tag)    [email protected] FALIGN@ .globl EXT(x)@ LEXT(x)
                    393: #define        ENTRY(x,tag)    Entry(x,tag)@MCOUNT
                    394: #define        ENTRY2(x,y,tag) .text@ .align FALIGN@ .globl EXT(x)@ .globl EXT(y)@ \
                    395:                        LEXT(x)@ LEXT(y) @\
                    396:                        MCOUNT
                    397: #if __STDC__
                    398: #define        ASENTRY(x)      .globl x @ .align FALIGN; x ## @ MCOUNT
                    399: #else
                    400: #define        ASENTRY(x)      .globl x @ .align FALIGN; x @ MCOUNT
                    401: #endif /* __STDC__ */
                    402: #define        DATA(x)         .globl EXT(x) @ .align ALIGN @ LEXT(x)
                    403: 
                    404: 
                    405: #define End(x)         ELF_SIZE(x,.-x)
                    406: #define END(x)         End(EXT(x))
                    407: #define ENDDATA(x)     END(x)
                    408: #define Enddata(x)     End(x)
                    409: 
                    410: /* These defines are here for .c files that wish to reference global symbols
                    411:  * within __asm__ statements. 
                    412:  */
                    413: #define CC_SYM_PREFIX "_"
                    414: 
                    415: #endif /* _PPC_ASM_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.