From 4f681eaea2aa1c7b0f85f981cc467a5d805bf88d Mon Sep 17 00:00:00 2001 From: Reiko Asakura Date: Sat, 25 Jul 2020 02:39:11 -0400 Subject: Add all remaining NIDs in SceSysclibForDriver --- include/kernel/kernel/sysclib.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/kernel/kernel/sysclib.h (limited to 'include/kernel') diff --git a/include/kernel/kernel/sysclib.h b/include/kernel/kernel/sysclib.h new file mode 100644 index 0000000..c255e56 --- /dev/null +++ b/include/kernel/kernel/sysclib.h @@ -0,0 +1,41 @@ +#ifndef _DOLCESDK_PSP2KERN_KERNEL_SYSCLIB_H_ +#define _DOLCESDK_PSP2KERN_KERNEL_SYSCLIB_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Left shift with only register operations (no memory access). + */ +SceInt64 lshift(SceInt64 value, int shift); + +/** + * Arithmetic right shift with only register operations (no memory access). + */ +SceInt64 rshift(SceInt64 value, int shift); + +/** + * Arithmetic right shift with only register operations (no memory access). + * May be faster than rshift for shift less than 32. + */ +SceInt64 rshift_fast(SceInt64 value, int shift); + +/** + * Like memcmp but checks all n bytes of s1 and s2 without early return. + */ +int memcmp_consttime(const void *s1, const void *s2, size_t n); + +/** + * Like strncpy but puts 0 or 1 zero bytes after copying src to dest, + * rather than filling dest with zero bytes up to n. + */ +char *strncpy_fast(char *dest, const char *src, size_t n); + +#ifdef __cplusplus +} +#endif + +#endif /* _DOLCESDK_PSP2KERN_KERNEL_SYSCLIB_H_ */ -- cgit v1.2.3