From 24b96698781218b8749d9a0c8b2433376a7434b5 Mon Sep 17 00:00:00 2001 From: bmax Date: Sun, 26 May 2024 12:13:41 +0800 Subject: [PATCH] make user hdr --- kernel/patch/include/uapi/scdefs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/patch/include/uapi/scdefs.h b/kernel/patch/include/uapi/scdefs.h index 8db8ca88..33e61f41 100644 --- a/kernel/patch/include/uapi/scdefs.h +++ b/kernel/patch/include/uapi/scdefs.h @@ -6,6 +6,15 @@ #ifndef _KP_UAPI_SCDEF_H_ #define _KP_UAPI_SCDEF_H_ +static inline long hash_key(const char *key) +{ + long hash = 1000000007; + for (int i = 0; key[i]; i++) { + hash = hash * 31 + key[i]; + } + return hash; +} + #define SUPERCALL_HELLO_ECHO "hello1158" // #define __NR_supercall __NR3264_truncate // 45