2
* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
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.
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.
11
#ifndef __MALI_KERNEL_MEM_MMU_H__
12
#define __MALI_KERNEL_MEM_MMU_H__
14
#include "mali_kernel_session_manager.h"
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.
21
void* mali_memory_core_mmu_lookup(u32 id);
24
* Set the core pointer of MMU to core owner of MMU
26
* @param core Core holding this MMU
27
* @param mmu_ptr The MMU whose core pointer needs set to core holding the MMU
30
void mali_memory_core_mmu_owner(void *core, void *mmu_ptr);
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
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.
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);
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
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
55
void mali_memory_core_mmu_release_address_space_reference(void* mmu);
58
* Soft reset of MMU - needed after power up
60
* @param mmu_ptr The MMU pointer registered with the relevant core
62
void mali_kernel_mmu_reset(void * mmu_ptr);
64
void mali_kernel_mmu_force_bus_reset(void * mmu_ptr);
67
* Unregister a previously registered callback.
68
* @param mmu The MMU to unregister the callback on
69
* @param callback The function to unregister
71
void mali_memory_core_mmu_unregister_callback(void* mmu, void(*callback)(void*));
75
#endif /* __MALI_KERNEL_MEM_MMU_H__ */