Annotation of kernel/machdep/ppc/exception.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
        !             7:  * Reserved.  This file contains Original Code and/or Modifications of
        !             8:  * Original Code as defined in and that are subject to the Apple Public
        !             9:  * Source License Version 1.1 (the "License").  You may not use this file
        !            10:  * except in compliance with the License.  Please obtain a copy of the
        !            11:  * License at http://www.apple.com/publicsource and read it before using
        !            12:  * this file.
        !            13:  * 
        !            14:  * The Original Code and all software distributed under the License are
        !            15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            19:  * License for the specific language governing rights and limitations
        !            20:  * under the License.
        !            21:  * 
        !            22:  * @APPLE_LICENSE_HEADER_END@
        !            23:  */
        !            24: 
        !            25: /*
        !            26:  * HISTORY
        !            27:  * Revision 1.3  1997/11/06 21:07:55  umeshv
        !            28:  * Cleaned up incorrect use of __PPC__, and __I386__
        !            29:  * Fixed the feature inclusion to be #ifdef KERNEL_BUILD
        !            30:  *
        !            31:  * Revision 1.2  1997/10/29 02:13:46  tmason
        !            32:  * Fixed oodles of bugs related to pmap issues as well as bcopy, FLOAT!, and cached accesses.
        !            33:  * Radar Bug ID:
        !            34:  *
        !            35:  * Revision 1.1.1.1  1997/09/30 02:45:20  wsanchez
        !            36:  * Import of kernel from umeshv/kernel
        !            37:  *
        !            38:  * Radar #1660195
        !            39:  * Revision 1.1.??.?  1997/06/29  01:52:00  rvega
        !            40:  *     Radar #1660195
        !            41:  *     Add LR plus volatile regs in PP area. This is
        !            42:  *     needed for the MMU support (PTEG overflow)
        !            43:  *     [1997/06/29  01:52:00  rvega]
        !            44:  *
        !            45: */
        !            46: 
        !            47: /*
        !            48:  * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991  
        !            49:  *              All Rights Reserved 
        !            50:  *  
        !            51:  * Permission to use, copy, modify, and distribute this software and 
        !            52:  * its documentation for any purpose and without fee is hereby granted, 
        !            53:  * provided that the above copyright notice appears in all copies and 
        !            54:  * that both the copyright notice and this permission notice appear in 
        !            55:  * supporting documentation. 
        !            56:  *  
        !            57:  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 
        !            58:  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
        !            59:  * FOR A PARTICULAR PURPOSE. 
        !            60:  *  
        !            61:  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 
        !            62:  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
        !            63:  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 
        !            64:  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
        !            65:  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
        !            66:  */
        !            67: /*
        !            68:  * MKLINUX-1.0DR2
        !            69:  */
        !            70: 
        !            71: /* Miscellaneous constants and structures used by the exception
        !            72:  * handlers
        !            73:  */
        !            74: 
        !            75: #ifndef _PPC_EXCEPTION_H_
        !            76: #define _PPC_EXCEPTION_H_
        !            77: 
        !            78: #ifndef __ASSEMBLER__
        !            79: 
        !            80: #include <machdep/ppc/mem.h>
        !            81: #if defined(KERNEL_BUILD)
        !            82: #include <cpus.h>
        !            83: #endif /* KERNEL_BUILD */
        !            84: #include <machdep/ppc/thread.h>
        !            85: 
        !            86: /* When an exception is taken, this info is accessed via sprg0 */
        !            87: 
        !            88: struct per_proc_info {
        !            89:        unsigned int save_cr;
        !            90:        unsigned int save_lr;
        !            91:        unsigned int save_srr0;
        !            92:        unsigned int save_srr1;
        !            93:        unsigned int save_dar;
        !            94:        unsigned int save_dsisr;
        !            95:        unsigned int save_sprg0;
        !            96:        unsigned int save_sprg1;
        !            97:        unsigned int save_sprg2;
        !            98:        unsigned int save_sprg3;
        !            99:        unsigned int save_exception_type;
        !           100:        
        !           101:        unsigned int phys_exception_handlers;
        !           102:        unsigned int virt_per_proc_info; /* virt addr for our CPU */
        !           103:        
        !           104:        /*      This save area is for the volatile registers used by the
        !           105:                firmware functions.
        !           106:        */
        !           107:        unsigned int save_r0;
        !           108:        unsigned int save_r1;
        !           109:        unsigned int save_r2;
        !           110:        unsigned int save_r3;
        !           111:        unsigned int save_r4;
        !           112:        unsigned int save_r5;
        !           113:        unsigned int save_r6;
        !           114:        unsigned int save_r7;
        !           115:        unsigned int save_r8;
        !           116:        unsigned int save_r9;
        !           117:        unsigned int save_r10;
        !           118:        unsigned int save_r11;
        !           119:        unsigned int save_r12;
        !           120: #if TRUE
        !           121:        unsigned int save_r13;
        !           122:        unsigned int save_r14;
        !           123:        unsigned int save_r15;
        !           124:        unsigned int save_r16;
        !           125:        unsigned int save_r17;
        !           126:        unsigned int save_r18;
        !           127:        unsigned int save_r19;
        !           128:        unsigned int save_r20;
        !           129:        unsigned int save_r21;
        !           130:        unsigned int save_r22;
        !           131:        unsigned int save_r23;
        !           132:        unsigned int save_r24;
        !           133:        unsigned int save_r25;
        !           134:        unsigned int save_r26;
        !           135:        unsigned int save_r27;
        !           136:        unsigned int save_r28;
        !           137:        unsigned int save_r29;
        !           138:        unsigned int save_r30;
        !           139:        unsigned int save_r31;
        !           140: #endif
        !           141:        
        !           142:        unsigned int active_kloaded;    /* pointer to active_kloaded[CPU_NO] */
        !           143:        unsigned int cpu_data;          /* pointer to cpu_data[CPU_NO] */
        !           144:        unsigned int active_stacks;     /* pointer to active_stacks[CPU_NO] */
        !           145:        unsigned int need_ast;          /* pointer to need_ast[CPU_NO] */
        !           146:        pcb_t        fpu_pcb;           /* pcb owning the fpu on this cpu */
        !           147: };
        !           148: 
        !           149: extern struct per_proc_info per_proc_info[NCPUS];
        !           150: 
        !           151: extern char *trap_type[];
        !           152: 
        !           153: #ifdef DEBUG
        !           154: extern int kdp_trap_codes[];
        !           155: #define kdp_code(x) kdp_trap_codes[((x)==EXC_AST?0x30:(x)/EXC_VECTOR_SIZE)]
        !           156: #endif /* DEBUG */
        !           157: 
        !           158: #endif /* ! __ASSEMBLER__ */
        !           159: 
        !           160: #define EXC_VECTOR_SIZE                4               /* function pointer size */
        !           161: 
        !           162: /* Hardware exceptions */
        !           163: 
        !           164: #define EXC_INVALID            (0x00 * EXC_VECTOR_SIZE)
        !           165: #define EXC_RESET              (0x01 * EXC_VECTOR_SIZE)
        !           166: #define EXC_MACHINE_CHECK      (0x02 * EXC_VECTOR_SIZE)
        !           167: #define EXC_DATA_ACCESS                (0x03 * EXC_VECTOR_SIZE)
        !           168: #define EXC_INSTRUCTION_ACCESS (0x04 * EXC_VECTOR_SIZE)
        !           169: #define EXC_INTERRUPT          (0x05 * EXC_VECTOR_SIZE)
        !           170: #define EXC_ALIGNMENT          (0x06 * EXC_VECTOR_SIZE)
        !           171: #define EXC_PROGRAM            (0x07 * EXC_VECTOR_SIZE)
        !           172: #define EXC_FP_UNAVAILABLE     (0x08 * EXC_VECTOR_SIZE)
        !           173: #define EXC_DECREMENTER                (0x09 * EXC_VECTOR_SIZE)
        !           174: #define EXC_IO_ERROR           (0x0a * EXC_VECTOR_SIZE)
        !           175: #define EXC_RESERVED_0B                (0x0b * EXC_VECTOR_SIZE)
        !           176: #define EXC_SYSTEM_CALL                (0x0c * EXC_VECTOR_SIZE)
        !           177: #define EXC_TRACE              (0x0d * EXC_VECTOR_SIZE)
        !           178: #define EXC_FP_ASSIST          (0x0e * EXC_VECTOR_SIZE)
        !           179: #define EXC_PERFORMANCE_MON    (0x0f * EXC_VECTOR_SIZE)
        !           180: #define EXC_603_IT_MISS                (0x10 * EXC_VECTOR_SIZE)
        !           181: #define EXC_603_DLT_MISS       (0x11 * EXC_VECTOR_SIZE)
        !           182: #define EXC_603_DST_MISS       (0x12 * EXC_VECTOR_SIZE)
        !           183: #define EXC_INSTRUCTION_BKPT   (0x13 * EXC_VECTOR_SIZE)
        !           184: #define EXC_SYSTEM_MANAGEMENT  (0x14 * EXC_VECTOR_SIZE)
        !           185: #define EXC_RESERVED_15                (0x15 * EXC_VECTOR_SIZE)
        !           186: #define EXC_RESERVED_16                (0x16 * EXC_VECTOR_SIZE)
        !           187: #define EXC_RESERVED_17                (0x17 * EXC_VECTOR_SIZE)
        !           188: #define EXC_RESERVED_18                (0x18 * EXC_VECTOR_SIZE)
        !           189: #define EXC_RESERVED_19                (0x19 * EXC_VECTOR_SIZE)
        !           190: #define EXC_RESERVED_1A                (0x1a * EXC_VECTOR_SIZE)
        !           191: #define EXC_RESERVED_1B                (0x1b * EXC_VECTOR_SIZE)
        !           192: #define EXC_RESERVED_1C                (0x1c * EXC_VECTOR_SIZE)
        !           193: #define EXC_RESERVED_1D                (0x1d * EXC_VECTOR_SIZE)
        !           194: #define EXC_RESERVED_1E                (0x1e * EXC_VECTOR_SIZE)
        !           195: #define EXC_RESERVED_1F                (0x1f * EXC_VECTOR_SIZE)
        !           196: #define EXC_RUNMODE_TRACE      (0x20 * EXC_VECTOR_SIZE) /* 601 only */
        !           197: #define EXC_RESERVED_21                (0x21 * EXC_VECTOR_SIZE)
        !           198: #define EXC_RESERVED_22                (0x22 * EXC_VECTOR_SIZE)
        !           199: #define EXC_RESERVED_23                (0x23 * EXC_VECTOR_SIZE)
        !           200: #define EXC_RESERVED_24                (0x24 * EXC_VECTOR_SIZE)
        !           201: #define EXC_RESERVED_25                (0x25 * EXC_VECTOR_SIZE)
        !           202: #define EXC_RESERVED_26                (0x26 * EXC_VECTOR_SIZE)
        !           203: #define EXC_RESERVED_27                (0x27 * EXC_VECTOR_SIZE)
        !           204: #define EXC_RESERVED_28                (0x28 * EXC_VECTOR_SIZE)
        !           205: #define EXC_RESERVED_29                (0x29 * EXC_VECTOR_SIZE)
        !           206: #define EXC_RESERVED_2A                (0x2a * EXC_VECTOR_SIZE)
        !           207: #define EXC_RESERVED_2B                (0x2b * EXC_VECTOR_SIZE)
        !           208: #define EXC_RESERVED_2C                (0x2c * EXC_VECTOR_SIZE)
        !           209: #define EXC_RESERVED_2D                (0x2d * EXC_VECTOR_SIZE)
        !           210: #define EXC_RESERVED_2E                (0x2e * EXC_VECTOR_SIZE)
        !           211: #define EXC_RESERVED_2F                (0x2f * EXC_VECTOR_SIZE)
        !           212: 
        !           213: 
        !           214: /* software exceptions */
        !           215: 
        !           216: #define EXC_AST                        (0x100 * EXC_VECTOR_SIZE) 
        !           217: #define EXC_MAX                        EXC_RESERVED_2F /* Maximum exception no */
        !           218: 
        !           219: #endif /* _PPC_EXCEPTION_H_ */

unix.superglobalmegacorp.com

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