The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/powerpc/powerpc/interrupt.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright 2002 by Peter Grehan. All rights reserved.
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright
   10  *    notice, this list of conditions and the following disclaimer in the
   11  *    documentation and/or other materials provided with the distribution.
   12  * 3. The name of the author may not be used to endorse or promote products
   13  *    derived from this software without specific prior written permission.
   14  *
   15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   20  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
   22  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   23  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   25  * SUCH DAMAGE.
   26  *
   27  * $FreeBSD$
   28  */
   29 
   30 /*
   31  * Interrupts are dispatched to here from locore asm
   32  */
   33 
   34 #include <sys/cdefs.h>                  /* RCS ID & Copyright macro defns */
   35 
   36 #include <sys/param.h>
   37 #include <sys/systm.h>
   38 #include <sys/bus.h>
   39 #include <sys/interrupt.h>
   40 #include <sys/kernel.h>
   41 #include <sys/kthread.h>
   42 #include <sys/ktr.h>
   43 #include <sys/lock.h>
   44 #include <sys/malloc.h>
   45 #include <sys/mutex.h>
   46 #include <sys/proc.h>
   47 #include <sys/smp.h>
   48 #include <sys/unistd.h>
   49 #include <sys/vmmeter.h>
   50 
   51 #include <machine/cpu.h>
   52 #include <machine/clock.h>
   53 #include <machine/db_machdep.h>
   54 #include <machine/fpu.h>
   55 #include <machine/frame.h>
   56 #include <machine/intr_machdep.h>
   57 #include <machine/md_var.h>
   58 #include <machine/pcb.h>
   59 #include <machine/psl.h>
   60 #include <machine/trap.h>
   61 #include <machine/spr.h>
   62 #include <machine/sr.h>
   63 
   64 #include "pic_if.h"
   65 
   66 /*
   67  * A very short dispatch, to try and maximise assembler code use
   68  * between all exception types. Maybe 'true' interrupts should go
   69  * here, and the trap code can come in separately
   70  */
   71 void
   72 powerpc_interrupt(struct trapframe *framep)
   73 {
   74         struct thread *td;
   75         register_t ee;
   76 
   77         td = curthread;
   78 
   79         switch (framep->exc) {
   80         case EXC_EXI:
   81                 atomic_add_int(&td->td_intr_nesting_level, 1);
   82                 PIC_DISPATCH(pic, framep);
   83                 atomic_subtract_int(&td->td_intr_nesting_level, 1);     
   84                 break;
   85 
   86         case EXC_DECR:
   87                 atomic_add_int(&td->td_intr_nesting_level, 1);
   88                 decr_intr(framep);
   89                 atomic_subtract_int(&td->td_intr_nesting_level, 1);     
   90                 break;
   91 
   92         default:
   93                 /* Re-enable interrupts if applicable. */
   94                 ee = framep->srr1 & PSL_EE;
   95                 if (ee != 0) {
   96                         mtmsr(mfmsr() | ee);
   97                         isync();
   98                 }
   99                 trap(framep);
  100         }               
  101 }

Cache object: b15f507d6ab9cfd7c59cbb306226bc1e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.