drm/bridge: adv7511: Switch to atomic operations
[drm/drm-misc.git] / tools / testing / selftests / lsm / common.h
blob06d12110d241b2a838fa079d94f2df563b429bb8
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Linux Security Module infrastructure tests
5 * Copyright © 2023 Casey Schaufler <casey@schaufler-ca.com>
6 */
8 #ifndef lsm_get_self_attr
9 static inline int lsm_get_self_attr(unsigned int attr, struct lsm_ctx *ctx,
10 __u32 *size, __u32 flags)
12 return syscall(__NR_lsm_get_self_attr, attr, ctx, size, flags);
14 #endif
16 #ifndef lsm_set_self_attr
17 static inline int lsm_set_self_attr(unsigned int attr, struct lsm_ctx *ctx,
18 __u32 size, __u32 flags)
20 return syscall(__NR_lsm_set_self_attr, attr, ctx, size, flags);
22 #endif
24 #ifndef lsm_list_modules
25 static inline int lsm_list_modules(__u64 *ids, __u32 *size, __u32 flags)
27 return syscall(__NR_lsm_list_modules, ids, size, flags);
29 #endif
31 extern int read_proc_attr(const char *attr, char *value, size_t size);
32 extern int read_sysfs_lsms(char *lsms, size_t size);
33 int attr_lsm_count(void);