Annotation of XNU/pexpert/ppc/pe_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: #include <pexpert/pexpert.h>
        !            23: #include <pexpert/protos.h>
        !            24: #include <pexpert/ppc/powermac.h>
        !            25: #include <pexpert/ppc/interrupts.h>
        !            26: #include <machine/machine_routines.h>
        !            27: #include <kern/debug.h>
        !            28: 
        !            29: #include <IOKit/IOInterrupts.h>
        !            30: 
        !            31: void   (*platform_interrupt)(int type, struct ppc_saved_state *ssp,
        !            32:                unsigned int dsisr, unsigned int dar, spl_t old_lvl);
        !            33: 
        !            34: static void *             interrupt_nub;
        !            35: static int                interrupt_source;
        !            36: static void *             interrupt_target;
        !            37: static IOInterruptHandler interrupt_handler;
        !            38: static void *             interrupt_refCon;
        !            39: 
        !            40: 
        !            41: static int DEBUGFlag;
        !            42: 
        !            43: void PE_enter_debugger( char * cause )
        !            44: {
        !            45:        if( DEBUGFlag & DB_NMI)
        !            46:             Debugger(cause);
        !            47: }
        !            48: 
        !            49: void PE_install_interrupt_handler(void *nub, int source,
        !            50:                                  void *target,
        !            51:                                  IOInterruptHandler handler,
        !            52:                                  void *refCon)
        !            53: {
        !            54:   interrupt_nub     = nub;
        !            55:   interrupt_source  = source;
        !            56:   interrupt_target  = target;
        !            57:   interrupt_handler = handler;
        !            58:   interrupt_refCon  = refCon;
        !            59: 
        !            60:   ml_init_interrupts();
        !            61: 
        !            62:     if( !PE_parse_boot_arg( "debug", &DEBUGFlag ))
        !            63:         DEBUGFlag = 0;
        !            64: }
        !            65: 
        !            66: void PE_incoming_interrupt(int type, struct ppc_saved_state *ssp,
        !            67:                           unsigned int dsisr, unsigned int dar)
        !            68: {
        !            69:   interrupt_handler(interrupt_target, interrupt_refCon,
        !            70:                    interrupt_nub, interrupt_source);
        !            71: }

unix.superglobalmegacorp.com

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