Example #1
0
        // SDK location: /user/pspintrman.h:119
        // SDK declaration: int sceKernelRegisterSubIntrHandler(int intno, int no, void *handler, void *arg);
        public int sceKernelRegisterSubIntrHandler(int intno, int no, int address, int arg)
        {
            KIntHandler handler = new KIntHandler(_kernel, intno, no, ( uint )address, ( uint )arg);

            Debug.Assert(_kernel.Interrupts[intno][no] == null);
            _kernel.Interrupts[intno][no] = handler;

            Log.WriteLine(Verbosity.Verbose, Feature.Bios, "sceKernelRegisterSubIntrHandler: registered handler for interrupt {0} (slot {1}), calling code at {2:X8}", intno, no, address);

            // Handlers are not enabled by default

            return(0);
        }
Example #2
0
        // SDK location: /user/pspintrman.h:149
        // SDK declaration: int sceKernelDisableSubIntr(int intno, int no);
        public int sceKernelDisableSubIntr(int intno, int no)
        {
            KIntHandler handler = _kernel.Interrupts[intno][no];

            Debug.Assert(handler != null);
            if (handler == null)
            {
                return(-1);
            }

            handler.Enabled = false;

            return(0);
        }
Example #3
0
        // SDK location: /user/pspintrman.h:170
        // SDK declaration: int QueryIntrHandlerInfo(SceUID intr_code, SceUID sub_intr_code, PspIntrHandlerOptionParam *data);
        public int QueryIntrHandlerInfo(int intr_code, int sub_intr_code, int data)
        {
            KIntHandler handler = _kernel.Interrupts[intr_code][sub_intr_code];

            Debug.Assert(handler != null);
            if (handler == null)
            {
                return(-1);
            }

            unsafe
            {
                byte *p = _memorySystem.Translate(( uint )data);

                *(( uint * )p)            = 0x38;             // size
                *(( uint * )(p + 4))      = handler.Address;
                *(( uint * )(p + 8))      = handler.Argument; // common
                *(( uint * )(p + 0xC))    = 0;                // gp?
                *(( ushort * )(p + 0x10)) = ( ushort )handler.InterruptNumber;
                *(( ushort * )(p + 0x12)) = ( ushort )handler.Slot;
                *(( ushort * )(p + 0x14)) = 0;
                *(( ushort * )(p + 0x16)) = handler.Enabled ? ( ushort )1 : ( ushort )0;
                *(( uint * )(p + 0x18))   = handler.CallCount;
                *(( uint * )(p + 0x1C))   = 0;                  // ?
                *(( uint * )(p + 0x20))   = 0;                  // total clock lo
                *(( uint * )(p + 0x24))   = 0;                  // total clock hi
                *(( uint * )(p + 0x28))   = 0;                  // min clock lo
                *(( uint * )(p + 0x2C))   = 0;                  // min clock hi
                *(( uint * )(p + 0x30))   = 0;                  // max clock lo
                *(( uint * )(p + 0x34))   = 0;                  // max clock hi
            }

            Log.WriteLine(Verbosity.Verbose, Feature.Bios, "QueryIntrHandlerInfo: called, but a lot of it isn't implemented - make sure nothing is used!");

            return(0);
        }
Example #4
0
        public int sceKernelRegisterSubIntrHandler( int intno, int no, int address, int arg )
        {
            KIntHandler handler = new KIntHandler( _kernel, intno, no, ( uint )address, ( uint )arg );

            Debug.Assert( _kernel.Interrupts[ intno ][ no ] == null );
            _kernel.Interrupts[ intno ][ no ] = handler;

            Log.WriteLine( Verbosity.Verbose, Feature.Bios, "sceKernelRegisterSubIntrHandler: registered handler for interrupt {0} (slot {1}), calling code at {2:X8}", intno, no, address );

            // Handlers are not enabled by default

            return 0;
        }