Annotation of XNU/osfmk/ppc/interrupt.c, revision 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:  * @APPLE_FREE_COPYRIGHT@
        !            27:  */
        !            28: #include <kern/misc_protos.h>
        !            29: #include <kern/assert.h>
        !            30: #include <kern/thread.h>
        !            31: #include <kern/counters.h>
        !            32: #include <ppc/misc_protos.h>
        !            33: #include <ppc/proc_reg.h>
        !            34: #include <ppc/exception.h>
        !            35: #include <ppc/savearea.h>
        !            36: #include <pexpert/pexpert.h>
        !            37: #if    NCPUS > 1
        !            38: #include <ppc/POWERMAC/mp/MPPlugIn.h>
        !            39: #endif /* NCPUS > 1 */
        !            40: #include <sys/kdebug.h>
        !            41: 
        !            42: struct ppc_saved_state * interrupt(
        !            43:         int type,
        !            44:         struct ppc_saved_state *ssp,
        !            45:        unsigned int dsisr,
        !            46:        unsigned int dar)
        !            47: {
        !            48:        int     current_cpu;
        !            49: 
        !            50:        disable_preemption();
        !            51: 
        !            52:        switch (type) {
        !            53:        case T_DECREMENTER:
        !            54:                KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_DECI, 0) | DBG_FUNC_NONE,
        !            55:                       isync_mfdec(), ((savearea *)ssp)->save_srr0, 0, 0, 0);
        !            56: 
        !            57:                if (pcsample_enable)
        !            58:                  {
        !            59:                    if (find_user_regs(current_act()))
        !            60:                      add_pcsamples (user_pc(current_act()));
        !            61:                  }
        !            62:                rtclock_intr(0,ssp, 0);
        !            63:                break;
        !            64: 
        !            65:        case T_INTERRUPT:
        !            66:                /* Call the platform interrupt routine */
        !            67:                counter_always(c_incoming_interrupts++);
        !            68: 
        !            69:                current_cpu = cpu_number();
        !            70: 
        !            71:                KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_INTR, 0) | DBG_FUNC_START,
        !            72:                       current_cpu, ((savearea *)ssp)->save_srr0, 0, 0, 0);
        !            73: 
        !            74:                per_proc_info[current_cpu].interrupt_handler(
        !            75:                        per_proc_info[current_cpu].interrupt_target, 
        !            76:                        per_proc_info[current_cpu].interrupt_refCon,
        !            77:                        per_proc_info[current_cpu].interrupt_nub, 
        !            78:                        per_proc_info[current_cpu].interrupt_source);
        !            79: 
        !            80:                KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_INTR, 0) | DBG_FUNC_END,
        !            81:                       0, 0, 0, 0, 0);
        !            82: 
        !            83:                break;
        !            84: 
        !            85:        case T_SIGP:
        !            86:                /* Did the other processor signal us? */ 
        !            87:                cpu_signal_handler();
        !            88:                break;
        !            89:                        
        !            90:        default:
        !            91: #if     MACH_KDP || MACH_KDB
        !            92:                (void)Call_Debugger(type, ssp);
        !            93: #else
        !            94:                panic("Invalid interrupt type %x\n", type);
        !            95: #endif
        !            96:                break;
        !            97:        }
        !            98: 
        !            99:        enable_preemption();
        !           100:        return ssp;
        !           101: }

unix.superglobalmegacorp.com

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