Merge branch 'topic-0620/samsung-audio-3.4' into chromeos-exynos-3.4
[cascardo/linux.git] / drivers / gpu / vithar / kbase / src / common / mali_kbase_security.h
1 /*
2  * This confidential and proprietary software may be used only as
3  * authorised by a licensing agreement from ARM Limited
4  * (C) COPYRIGHT 2011 ARM Limited
5  * ALL RIGHTS RESERVED
6  * The entire notice above must be reproduced on all authorised
7  * copies and copies may only be made to the extent permitted
8  * by a licensing agreement from ARM Limited.
9  */
10
11 /**
12  * @file mali_kbase_security.h
13  * Base kernel security capability APIs
14  */
15
16 #ifndef _KBASE_SECURITY_H_
17 #define _KBASE_SECURITY_H_
18
19 /* Security flags */
20 #define KBASE_SEC_FLAG_NOAUDIT (0u << 0)              /* Silently handle privilege failure */
21 #define KBASE_SEC_FLAG_AUDIT   (1u << 0)              /* Write audit message on privilege failure */
22 #define KBASE_SEC_FLAG_MASK    (KBASE_SEC_FLAG_AUDIT) /* Mask of all valid flag bits */
23
24 /* List of unique capabilities that have security access privileges */
25 typedef enum {
26                 /* Instrumentation Counters access privilege */
27         KBASE_SEC_INSTR_HW_COUNTERS_COLLECT = 1,
28         KBASE_SEC_MODIFY_PRIORITY
29                 /* Add additional access privileges here */
30 } kbase_security_capability;
31
32
33 /**
34  * kbase_security_has_capability - determine whether a task has a particular effective capability
35  * @param[in]   kctx    The task context.
36  * @param[in]   cap     The capability to check for.
37  * @param[in]   flags   Additional configuration information
38  *                      Such as whether to write an audit message or not.
39  * @return MALI_TRUE if success (capability is allowed), MALI_FALSE otherwise.
40  */
41
42 mali_bool kbase_security_has_capability(kbase_context *kctx, kbase_security_capability cap, u32 flags);
43
44 #endif /* _KBASE_SECURITY_H_ */