* These commits are carefully picked from upstream (tiann/KernelSU)
- Picked range:
8c5f485f27..e5f43a3427
Signed-off-by: Faris <rissu.ntk@gmail.com>
Co-authored-by: Wang Han <416810799@qq.com>
Co-authored-by: TwinbornPlate75 <3342733415@qq.com>
Co-authored-by: KOWX712 <leecc0503@gmail.com>
Co-authored-by: Ylarod <me@ylarod.cn>
Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Co-authored-by: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Co-authored-by: weishu <twsxtd@gmail.com>
37 lines
773 B
C
37 lines
773 B
C
#ifndef __KSU_H_FEATURE
|
|
#define __KSU_H_FEATURE
|
|
|
|
#include <linux/types.h>
|
|
|
|
enum ksu_feature_id {
|
|
KSU_FEATURE_SU_COMPAT = 0,
|
|
KSU_FEATURE_KERNEL_UMOUNT = 1,
|
|
KSU_FEATURE_ENHANCED_SECURITY = 2,
|
|
|
|
KSU_FEATURE_MAX
|
|
};
|
|
|
|
typedef int (*ksu_feature_get_t)(u64 *value);
|
|
typedef int (*ksu_feature_set_t)(u64 value);
|
|
|
|
struct ksu_feature_handler {
|
|
u32 feature_id;
|
|
const char *name;
|
|
ksu_feature_get_t get_handler;
|
|
ksu_feature_set_t set_handler;
|
|
};
|
|
|
|
int ksu_register_feature_handler(const struct ksu_feature_handler *handler);
|
|
|
|
int ksu_unregister_feature_handler(u32 feature_id);
|
|
|
|
int ksu_get_feature(u32 feature_id, u64 *value, bool *supported);
|
|
|
|
int ksu_set_feature(u32 feature_id, u64 value);
|
|
|
|
void ksu_feature_init(void);
|
|
|
|
void ksu_feature_exit(void);
|
|
|
|
#endif // __KSU_H_FEATURE
|