diff options
Diffstat (limited to 'include/kernel')
-rw-r--r-- | include/kernel/kernel/cpu.h | 20 | ||||
-rw-r--r-- | include/kernel/lowio/gpio.h | 42 |
2 files changed, 62 insertions, 0 deletions
diff --git a/include/kernel/kernel/cpu.h b/include/kernel/kernel/cpu.h index 96f51fe..f7c4c52 100644 --- a/include/kernel/kernel/cpu.h +++ b/include/kernel/kernel/cpu.h @@ -200,6 +200,26 @@ int sceKernelCpuIcacheAndL2WritebackInvalidateRange(void *ptr, size_t len); */ int sceKernelCpuUnrestrictedMemcpy(void *dst, const void *src, size_t len); +/** + * @brief Suspend all interrupts (disables IRQs) + * + * @param[in] addr Mutex associated to the suspend-resume pair + * + * @return The current state of the interrupt controller, to be used with sceKernelCpuResumeIntr. + */ +int sceKernelCpuSuspendIntr(int *addr); + +/** + * @brief Resume all interrupts (enables IRQs) + * + * @param[in] addr Mutex associated to the suspend-resume pair + * @param[in] prev_state State obtained from sceKernelCpuSuspendIntr + * + * @return The previous state of the interrupt controller. + */ +int sceKernelCpuResumeIntr(int *addr, int prev_state); + + #ifdef __cplusplus } #endif diff --git a/include/kernel/lowio/gpio.h b/include/kernel/lowio/gpio.h new file mode 100644 index 0000000..2850494 --- /dev/null +++ b/include/kernel/lowio/gpio.h @@ -0,0 +1,42 @@ +#ifndef _PSP2_LOWIO_GPIO_H_ +#define _PSP2_LOWIO_GPIO_H_ + +#include <psp2/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + SCE_GPIO_ERROR_INVALID_BUS = 0x803F0100, + SCE_GPIO_ERROR_INVALID_PORT = 0x803F0101, + SCE_GPIO_ERROR_INVALID_MODE = 0x803F0102 +}; + +enum SceGpioPortMasks { + SCE_GPIO_PORT_MASK_LED_GAMECARD = 1 << 6, + SCE_GPIO_PORT_MASK_LED_PS_BUTTON = 1 << 7 +}; + +enum SceGpioPortMode { + SCE_GPIO_PORT_MODE_OUTPUT = 0, + SCE_GPIO_PORT_MODE_INPUT = 1 +}; + +int sceGpioPortRead(int bus, int port); +int sceGpioPortSet(int bus, int port); +int sceGpioPortClear(int bus, int port); +int sceGpioPortReset(int bus, int port); +int sceGpioSetPortMode(int bus, int port, int mode); +int sceGpioGetPortMode(int bus, int port); +int sceGpioSetIntrMode(int bus, int port, int intr_mode); +int sceGpioGetIntrMode(int bus, int port); +int sceGpioAcquireIntr(int bus, int port); +int sceGpioQueryIntr(int bus, int port); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_LOWIO_GPIO_H_ */ + |