Initial commit
[kernel/linux-3.0.git] / drivers / gpu / vithar_rev0 / kbase / src / common / mali_kbase_security.h
1 /*
2  *
3  * (C) COPYRIGHT 2011 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
6  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7  * 
8  * A copy of the licence is included with the program, and can also be obtained from Free Software
9  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
10  * 
11  */
12
13
14
15 /**
16  * @file mali_kbase_security.h
17  * Base kernel security capability APIs
18  */
19
20 #ifndef _KBASE_SECURITY_H_
21 #define _KBASE_SECURITY_H_
22
23 /* Security flags */
24 #define KBASE_SEC_FLAG_NOAUDIT (0u << 0)              /* Silently handle privilege failure */
25 #define KBASE_SEC_FLAG_AUDIT   (1u << 0)              /* Write audit message on privilege failure */
26 #define KBASE_SEC_FLAG_MASK    (KBASE_SEC_FLAG_AUDIT) /* Mask of all valid flag bits */
27
28 /* List of unique capabilities that have security access privileges */
29 typedef enum {
30                 /* Instrumentation Counters access privilege */
31         KBASE_SEC_INSTR_HW_COUNTERS_COLLECT = 1,
32         KBASE_SEC_MODIFY_PRIORITY
33                 /* Add additional access privileges here */
34 } kbase_security_capability;
35
36
37 /**
38  * kbase_security_has_capability - determine whether a task has a particular effective capability
39  * @param[in]   kctx    The task context.
40  * @param[in]   cap     The capability to check for.
41  * @param[in]   flags   Additional configuration information
42  *                      Such as whether to write an audit message or not.
43  * @return MALI_TRUE if success (capability is allowed), MALI_FALSE otherwise.
44  */
45
46 mali_bool kbase_security_has_capability(kbase_context *kctx, kbase_security_capability cap, u32 flags);
47
48 #endif /* _KBASE_SECURITY_H_ */
49