~thopiekar/arm-mali/mali-400-kernel-drivers-sunxi

« back to all changes in this revision

Viewing changes to driver/src/devicedrv/mali/common/mali_kernel_mem_mmu.h

  • Committer: Dmitriy Beykun
  • Date: 2012-10-21 16:12:55 UTC
  • Revision ID: git-v1:23debc5a26ce858ef020405dbf91b2f268a72f44
added r3p0-04rel0 kernel drivers

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3
 
 * 
4
 
 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5
 
 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6
 
 * 
7
 
 * A copy of the licence is included with the program, and can also be obtained from Free Software
8
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9
 
 */
10
 
 
11
 
#ifndef __MALI_KERNEL_MEM_MMU_H__
12
 
#define __MALI_KERNEL_MEM_MMU_H__
13
 
 
14
 
#include "mali_kernel_session_manager.h"
15
 
 
16
 
/**
17
 
 * Lookup a MMU core by ID.
18
 
 * @param id ID of the MMU to find
19
 
 * @return NULL if ID not found or valid, non-NULL if a core was found.
20
 
 */
21
 
void* mali_memory_core_mmu_lookup(u32 id);
22
 
 
23
 
/**
24
 
 * Set the core pointer of MMU to core owner of MMU
25
 
 *
26
 
 * @param core Core holding this MMU
27
 
 * @param mmu_ptr The MMU whose core pointer needs set to core holding the MMU
28
 
 * 
29
 
 */
30
 
void mali_memory_core_mmu_owner(void *core, void *mmu_ptr);
31
 
 
32
 
/**
33
 
 * Activate a user session with its address space on the given MMU.
34
 
 * If the session can't be activated due to that the MMU is busy and
35
 
 * a callback pointer is given, the callback will be called once the MMU becomes idle.
36
 
 * If the same callback pointer is registered multiple time it will only be called once.
37
 
 * Nested activations are supported.
38
 
 * Each call must be matched by a call to @see mali_memory_core_mmu_release_address_space_reference
39
 
 *
40
 
 * @param mmu The MMU to activate the address space on
41
 
 * @param mali_session_data The user session object which address space to activate
42
 
 * @param callback Pointer to the function to call when the MMU becomes idle
43
 
 * @param callback_arg Argument given to the callback
44
 
 * @return 0 if the address space was activated, -EBUSY if the MMU was busy, -EFAULT in all other cases.
45
 
 */
46
 
int mali_memory_core_mmu_activate_page_table(void* mmu_ptr, struct mali_session_data * mali_session_data, void(*callback)(void*), void * callback_argument);
47
 
 
48
 
/**
49
 
 * Release a reference to the current active address space.
50
 
 * Once the last reference is released any callback(s) registered will be called before the function returns
51
 
 *
52
 
 * @note Caution must be shown calling this function with locks held due to that callback can be called
53
 
 * @param mmu The mmu to release a reference to the active address space of
54
 
 */
55
 
void mali_memory_core_mmu_release_address_space_reference(void* mmu);
56
 
 
57
 
/**
58
 
 * Soft reset of MMU - needed after power up
59
 
 *
60
 
 * @param mmu_ptr The MMU pointer registered with the relevant core
61
 
 */
62
 
void mali_kernel_mmu_reset(void * mmu_ptr);
63
 
 
64
 
void mali_kernel_mmu_force_bus_reset(void * mmu_ptr);
65
 
 
66
 
/**
67
 
 * Unregister a previously registered callback.
68
 
 * @param mmu The MMU to unregister the callback on
69
 
 * @param callback The function to unregister
70
 
 */
71
 
void mali_memory_core_mmu_unregister_callback(void* mmu, void(*callback)(void*));
72
 
 
73
 
 
74
 
 
75
 
#endif /* __MALI_KERNEL_MEM_MMU_H__ */