예제 #1
0
        public static void triggerInterrupt(Processor processor, int interruptNumber)
        {
            if (!LLEActive)
            {
                return;
            }

            MMIOHandlerInterruptMan interruptMan = MMIOHandlerInterruptMan.getInstance(processor);

            if (!interruptMan.hasInterruptTriggered(interruptNumber))
            {
                //if (log.DebugEnabled)
                {
                    Console.WriteLine(string.Format("triggerInterrupt 0x{0:X}({1})", interruptNumber, IntrManager.getInterruptName(interruptNumber)));
                }

                interruptMan.triggerInterrupt(interruptNumber);
            }
        }
예제 #2
0
        /*
         * synchronized method as it is modifying pendingInterruptIPbits which can be updated from different threads
         */
        public static int checkPendingInterruptException(int returnAddress)
        {
            lock (typeof(RuntimeContextLLE))
            {
                Processor processor = Processor;
                if (isInterruptExceptionAllowed(processor, pendingInterruptIPbits))
                {
                    int cause = processor.cp0.Cause;
                    cause |= (pendingInterruptIPbits << 8);
                    pendingInterruptIPbits = 0;
                    processor.cp0.Cause    = cause;

                    // The compiler is only calling this function when
                    // we are not in a delay slot
                    int ebase = prepareExceptionHandlerCall(processor, ExceptionManager.EXCEP_INT, false);

                    //if (log.DebugEnabled)
                    {
                        Console.WriteLine(string.Format("Calling exception handler for {0} at 0x{1:X8}, epc=0x{2:X8}, cause=0x{3:X}", MMIOHandlerInterruptMan.getInstance(processor).toStringInterruptTriggered(), ebase, processor.cp0.Epc, processor.cp0.Cause));
                    }

                    return(ebase);
                }

                return(returnAddress);
            }
        }