uOFW
Reverse engineered PSP kernel 6.60.
Loading...
Searching...
No Matches
interruptman.h
1/* Copyright (C) 2011, 2012 The uOFW team
2 See the file COPYING for copying permission.
3*/
4
5#include "common_header.h"
6#include "loadcore.h"
7
8enum SceInterrupts {
9 SCE_GPIO_INT = 4,
10 SCE_ATA_INT = 5,
11 SCE_UMD_INT = 6,
12 SCE_MSCM0_INT = 7,
13 SCE_WLAN_INT = 8,
14 SCE_AUDIO_INT = 10,
15 SCE_I2C_INT = 12,
16 SCE_SIRCS_INT = 14,
17 SCE_SYSTIMER0_INT = 15,
18 SCE_SYSTIMER1_INT = 16,
19 SCE_SYSTIMER2_INT = 17,
20 SCE_SYSTIMER3_INT = 18,
21 SCE_THREAD0_INT = 19,
22 SCE_NAND_INT = 20,
23 SCE_DMACPLUS_INT = 21,
24 SCE_DMA0_INT = 22,
25 SCE_DMA1_INT = 23,
26 SCE_MEMLMD_INT = 24,
27 SCE_GE_INT = 25,
28 SCE_VBLANK_INT = 30,
29 SCE_MECODEC_INT = 31,
30 SCE_HPREMOTE_INT = 36,
31 SCE_MSCM1_INT = 60,
32 SCE_MSCM2_INT = 61,
33 SCE_THREAD1_INT = 65,
34 SCE_INTERRUPT_INT = 66
35};
36
37typedef struct {
38 // Handler address
39 s32 handler; // 0
40 // GP of the module
41 s32 gp; // 4
42 // Argument given by sceKernelRegisterSubIntrHandler
43 s32 arg; // 8
44 s32 u12, u16, u20;
45 // See disableCb
46 s32 enableCb; // 24
47 // Pointer to the callback called by sceKernelDisableSubIntr(), that takes the same arguments as it
48 s32 disableCb; // 28
49 // See disableCb
50 s32 suspendCb; // 32
51 // See disableCb
52 s32 resumeCb; // 36
53 // See disableCb
54 s32 isOccuredCb; // 40
55 s32 u44;
56 // Some options
57 s32 v48; // 48
58 s32 u52, u56, u60;
59} SubInterrupt; // Size: 64
60
61typedef struct {
62 s32 size; // 0
63 s32 u4;
64 // Callback called before setting sub interrupt, when registering
65 s32 (*cbRegBefore)(s32, s32, void*, void*); // 8
66 // Callback called after
67 s32 (*cbRegAfter)(s32, s32, void*, void*); // 12
68 // Callback called before resetting handler to 0
69 s32 (*cbRelBefore)(s32, s32); // 16
70 // Callback called after
71 s32 (*cbRelAfter)(s32, s32); // 20
72 s32 (*cbEnable)(s32, s32); // 24
73 s32 (*cbDisable)(s32, s32); // 28
74 s32 (*cbSuspend)(s32, s32, s32*); // 32
75 s32 (*cbResume)(s32, s32, s32); // 36
76 s32 (*cbIsOccured)(s32, s32); // 40
77} SceIntrCb; // Size: 44
78
79// Arg4 in sceKernelRegisterIntrHandler()
80typedef struct {
81 // Handler address, sometimes OR'ed with 2 ?!?
82 s32 handler; // 0
83 // GP of the module
84 s32 gp; // 4
85 // Argument given by sceKernelRegisterIntrHandler
86 void *arg; // 8
87 s32 u12, u16, u20, u24, u28, u32, u36;
88 // Pointer to sub interrupts
89 SubInterrupt *subIntrs; // 40
90 // Some value set by sceKernelRegisterIntrHandler, using arg4 SubIntrInfo.callbacks, contains some handlers ran by sceKernelRegisterSubIntrHandler
91 SceIntrCb *cb; // 44
92 // InterruptManagerForKernel_D01EAA3F changes a bit depending on arg1, sceKernelRegisterIntrHandler changes some also; lower byte is the max number of sub interrupts
93 s32 v48; // 48
94 s32 u52, u56, u60;
95} Interrupt; // Size: 64
96
97typedef struct {
98 s32 size; // must be 12
99 s32 numSubIntrs; // 4
100 SceIntrCb *callbacks; // 8
101} SubIntrInfo; // Size: 12
102
103typedef struct {
104 s32 size;
105 s32 attr;
106 void *cb;
107} SceIntrHandler;
108
109typedef s32 (*MonitorCb)(s32 intrNum, s32 subIntrNum, s32, s32, s32, s32, s8);
110
111s32 sceKernelRegisterIntrHandler(s32 intrNum, s32 arg1, void *func, void *arg3, SceIntrHandler *handler);
112s32 sceKernelSetUserModeIntrHanlerAcceptable(s32 intrNum, s32 subIntrNum, s32 setBit);
113s32 sceKernelReleaseIntrHandler(s32 intrNum);
114s32 sceKernelSetIntrLevel(s32 intrNum, s32 num);
115s32 sceKernelSetIntrLogging(s32 intrNum, s32 arg1);
116s32 sceKernelEnableIntr(s32 intNum);
117s32 sceKernelSuspendIntr(s32 arg0, s32 *arg1);
118s32 sceKernelResumeIntr(s32 intrNum, s32 arg1);
119void ReleaseContextHooks();
120void InterruptManagerForKernel_E790EAED(s32 (*arg0)(), s32 (*arg1)());
121s32 sceKernelCallSubIntrHandler(s32 intrNum, s32 subIntrNum, s32 arg2, s32 arg3);
122s32 sceKernelGetUserIntrStack();
123s32 sceKernelRegisterSubIntrHandler(s32 intrNum, s32 subIntrNum, void *handler, void *arg);
124s32 sceKernelReleaseSubIntrHandler(s32 intrNum, s32 subIntrNum);
125s32 sceKernelEnableSubIntr(s32 intrNum, s32 subIntrNum);
126s32 sceKernelDisableSubIntr(s32 intrNum, s32 subIntrNum);
127s32 sceKernelSuspendSubIntr(s32 intrNum, s32 subIntrNum, s32 *arg2);
128s32 sceKernelResumeSubIntr(s32 intrNum, s32 subIntrNum, s32 arg2);
129s32 sceKernelIsSubInterruptOccured(s32 intrNum, s32 subIntrNum);
130s32 sceKernelQueryIntrHandlerInfo(s32 intrNum, s32 subIntrNum, s32 out);
131s32 sceKernelSetPrimarySyscallHandler(s32 syscallId, void (*syscall)());
132void sceKernelCpuEnableIntr();
133s32 InterruptManagerForKernel_6FCBA912(s32 set);
134s32 sceKernelClearIntrLogging(s32 intrNum);
135s32 sceKernelIsInterruptOccurred(s32 intrNum);
136s32 sceKernelDisableIntr(s32 intrNum);
137void RegisterSubIntrruptMonitor(MonitorCb before, MonitorCb after);
138void ReleaseSubIntrruptMonitor();
139s32 UnSupportIntr(s32 intrNum);
140s32 InterruptManagerForKernel_8DFBD787();
141s32 QueryIntrHandlerInfoForUser();
142s32 sceKernelRegisterUserSpaceIntrStack(s32 addr, s32 size, s32 arg2);
143s32 sceKernelGetCpuClockCounter();
144u64 sceKernelGetCpuClockCounterWide();
145u32 _sceKernelGetCpuClockCounterLow();
146s32 sceKernelRegisterSystemCallTable(SceSyscallTable *newMap);
147s32 sceKernelQuerySystemCall(void (*sysc)());
148void InterruptManagerForKernel_E526B767(s32 arg);
149s32 sceKernelGetSyscallRA(void);
150s32 sceKernelCpuSuspendIntr(void);
151void sceKernelCpuResumeIntr(s32 intr);
152void sceKernelCpuResumeIntrWithSync(s32 intr);
153s32 sceKernelIsIntrContext(void);
154int sceKernelCallUserIntrHandler(int, int, int, int, int, int);
155
Definition loadcore.h:820