summaryrefslogtreecommitdiff
path: root/include/kernel/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'include/kernel/kernel')
-rw-r--r--include/kernel/kernel/cpu.h78
-rw-r--r--include/kernel/kernel/intrmgr.h60
-rw-r--r--include/kernel/kernel/threadmgr.h2
3 files changed, 127 insertions, 13 deletions
diff --git a/include/kernel/kernel/cpu.h b/include/kernel/kernel/cpu.h
index 859424d..96f51fe 100644
--- a/include/kernel/kernel/cpu.h
+++ b/include/kernel/kernel/cpu.h
@@ -80,56 +80,112 @@ int sceKernelCpuDisableInterrupts(void);
int sceKernelCpuEnableInterrupts(int flags);
/**
- * @brief Flush L1 dcache and L2
+ * @brief Writeback a range of L1 dcache (without L2)
*
- * Note: symbols currently does not work on 3.x, need to find new ones.
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheWritebackRange(void *ptr, size_t len);
+
+/**
+ * @brief Invalidate a range of L1 dcache (without L2)
*
* @param ptr The pointer
* @param[in] len The length
*
* @return Zero on success
*/
-int sceKernelCpuDcacheAndL2Flush(void *ptr, size_t len);
+int sceKernelCpuDcacheInvalidateRange(void *ptr, size_t len);
/**
- * @brief Flush L2 dcache without L2
+ * @brief Writeback and invalidate a range of L1 dcache (without L2)
*
* @param ptr The pointer
* @param[in] len The length
*
* @return Zero on success
*/
-int sceKernelCpuDcacheFlush(void *ptr, size_t len);
+int sceKernelCpuDcacheWritebackInvalidateRange(void *ptr, size_t len);
+
+/**
+ * @brief Invalidate all the L1 dcache (without L2)
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheInvalidateAll(void);
+
+/**
+ * @brief Writeback all the L1 dcache (without L2)
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheWritebackAll(void);
+
+/**
+ * @brief Writeback and invalidate all the L1 dcache (without L2)
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheWritebackInvalidateAll(void);
/**
- * @brief Writeback a range of L1 dcache (not sure if L2 too)
+ * @brief Writeback a range of L1 dcache and L2
*
* @param ptr The pointer
* @param[in] len The length
*
* @return Zero on success
*/
-int sceKernelCpuDcacheWritebackRange(void *ptr, size_t len);
+int sceKernelCpuDcacheAndL2WritebackRange(void *ptr, size_t len);
+
+/**
+ * @brief Writeback and invalidate a range of L1 dcache and L2
+ *
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheAndL2InvalidateRange(void *ptr, size_t len);
+
+/**
+ * @brief Writeback and invalidate a range of L1 dcache and L2
+ *
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheAndL2WritebackInvalidateRange(void *ptr, size_t len);
/**
- * @brief Flush L1 icache and L2
+ * @brief Invalidate a range of L1 icache (without L2)
*
* @param ptr The pointer
* @param[in] len The length
*
* @return Zero on success
*/
-int sceKernelCpuIcacheAndL2Flush(void *ptr, size_t len);
+int sceKernelCpuIcacheInvalidateRange(void *ptr, size_t len);
+
+/**
+ * @brief Invalidate all the L1 icache (without L2)
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuIcacheInvalidateAll(void);
/**
- * @brief Flush L1 dcache and L2 for DMA operations
+ * @brief Writeback and invalidate a range of L1 icache and L2
*
* @param ptr The pointer
* @param[in] len The length
*
* @return Zero on success
*/
-int sceKernelCpuDcacheAndL2AndDMAFlush(void *ptr, size_t len);
+int sceKernelCpuIcacheAndL2WritebackInvalidateRange(void *ptr, size_t len);
/**
* @brief MMU permission bypassing memcpy
diff --git a/include/kernel/kernel/intrmgr.h b/include/kernel/kernel/intrmgr.h
new file mode 100644
index 0000000..ca11136
--- /dev/null
+++ b/include/kernel/kernel/intrmgr.h
@@ -0,0 +1,60 @@
+#ifndef _PSP2_KERNEL_INTRMGR_H_
+#define _PSP2_KERNEL_INTRMGR_H_
+
+#include <psp2kern/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int (*SceKernelIntrOptParam2Callback)(int intr_code, int subintr_code);
+
+typedef struct SceKernelIntrOptParam2 {
+ uint32_t size; // 0x28
+ uint32_t unk_4;
+ uint32_t unk_8;
+ uint32_t unk_C;
+ SceKernelIntrOptParam2Callback *fptr0; // function pointer
+ SceKernelIntrOptParam2Callback *enable_subinterrupt_cb;
+ SceKernelIntrOptParam2Callback *fptr2; // function pointer
+ uint32_t unk_1C;
+ uint32_t unk_20;
+ uint32_t unk_24;
+} SceKernelIntrOptParam2;
+
+typedef struct SceKernelIntrOptParam {
+ uint32_t size; // 0x14
+ uint32_t num;
+ SceKernelIntrOptParam2 *opt2;
+ uint32_t unk_C;
+ uint32_t unk_10;
+} SceKernelIntrOptParam;
+
+typedef int (*SceKernelIntrHandler)(int unk, void *userCtx);
+typedef int (*SceKernelSubIntrHandler)(void *arg, int unk0, int unk1);
+
+int sceKernelRegisterIntrHandler(int intr_code, const char *name, int interrupt_type,
+ SceKernelIntrHandler *handler, void *userCtx, int priority, int targetcpu, SceKernelIntrOptParam *opt);
+int sceKernelReleaseIntrHandler(int intr_code);
+int sceKernelMaskIntr(int intr_code);
+int sceKernelUnmaskIntr(int intr_code);
+int sceKernelSetIntrMasked(int intr_code, int masked);
+int sceKernelGetIntrMasked(int intr_code, int *masked);
+int sceKernelIsIntrPending(int intr_code);
+int sceKernelClearIntrPending(int intr_code);
+int sceKernelSetIntrPriority(int intr_code, unsigned char priority);
+int sceKernelSetIntrTarget(int intr_code, int cpu_target_list);
+int sceKernelTriggerSGI(int intr_code, unsigned int target_list_filter, unsigned int cpu_target_list);
+int sceKernelIsIntrAllowedInCurrentContext(int intr_code);
+int sceKernelRegisterSubIntrHandler(int intr_code, int subintr_code, const char *name,
+ SceKernelSubIntrHandler handler, void *register_arg);
+int sceKernelTriggerSubIntr(int intr_code, int subintr_code, void *subintr_arg);
+int sceKernelEnableSubIntr(int intr_code, int subintr_code);
+int sceKernelDisableSubIntr(int intr_code, int subintr_code);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_KERNEL_INTRMGR_H_ */
+
diff --git a/include/kernel/kernel/threadmgr.h b/include/kernel/kernel/threadmgr.h
index 16b3234..21ee730 100644
--- a/include/kernel/kernel/threadmgr.h
+++ b/include/kernel/kernel/threadmgr.h
@@ -992,7 +992,6 @@ typedef enum SceKernelIdListType {
SceKernelIdListType sceKernelGetThreadmgrUIDClass(SceUID uid);
-
typedef struct SceKernelLwMutexWork {
SceInt64 data[4];
} SceKernelLwMutexWork;
@@ -1020,7 +1019,6 @@ int sceKernelSignalLwCond(SceKernelLwCondWork *pWork);
int sceKernelWaitLwCond(SceKernelLwCondWork *pWork, unsigned int *pTimeout);
-
/**
* Get the system time (wide version)
*