3 * (C) COPYRIGHT 2011-2015 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
21 * @file mali_kbase_security.h
22 * Base kernel security capability APIs
25 #ifndef _KBASE_SECURITY_H_
26 #define _KBASE_SECURITY_H_
29 #define KBASE_SEC_FLAG_NOAUDIT (0u << 0) /* Silently handle privilege failure */
30 #define KBASE_SEC_FLAG_AUDIT (1u << 0) /* Write audit message on privilege failure */
31 #define KBASE_SEC_FLAG_MASK (KBASE_SEC_FLAG_AUDIT) /* Mask of all valid flag bits */
33 /* List of unique capabilities that have security access privileges */
34 enum kbase_security_capability {
35 /* Instrumentation Counters access privilege */
36 KBASE_SEC_INSTR_HW_COUNTERS_COLLECT = 1,
37 KBASE_SEC_MODIFY_PRIORITY
38 /* Add additional access privileges here */
42 * kbase_security_has_capability - determine whether a task has a particular effective capability
43 * @param[in] kctx The task context.
44 * @param[in] cap The capability to check for.
45 * @param[in] flags Additional configuration information
46 * Such as whether to write an audit message or not.
47 * @return true if success (capability is allowed), false otherwise.
50 bool kbase_security_has_capability(struct kbase_context *kctx, enum kbase_security_capability cap, u32 flags);
52 #endif /* _KBASE_SECURITY_H_ */