This allows us to find the BM context from the value of the directory list.
This is required for the next patch.
Signed-off-by: Mark Underwood <mark.underwood@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
#include "hash.h"
#include "ra.h"
#include "pdump_km.h"
+#include "mmu.h"
#define MIN(a, b) (a > b ? b : a)
return ((struct BM_BUF *)
psMemInfo->sMemBlk.hBuffer)->pMapping->hOSMemHandle;
}
+
+struct BM_CONTEXT *bm_find_context(struct BM_CONTEXT *head_context,
+ u32 page_dir)
+{
+ struct BM_CONTEXT *context = head_context;
+
+ /* Walk all the contexts until we find the right one */
+ while (context) {
+ if (mmu_get_page_dir(context->psMMUContext) == page_dir)
+ break;
+ context = context->psNext;
+ }
+ return context;
+}
void *BM_GetMappingHandle(struct PVRSRV_KERNEL_MEM_INFO *psMemInfo);
+struct BM_CONTEXT *bm_find_context(struct BM_CONTEXT *head_context,
+ u32 page_dir);
#endif
}
}
+u32 mmu_get_page_dir(struct MMU_CONTEXT *psMMUContext)
+{
+ return psMMUContext->sPDDevPAddr.uiAddr;
+}
void MMU_BIFResetPDFree(struct PVRSRV_SGXDEV_INFO *psDevInfo);
+u32 mmu_get_page_dir(struct MMU_CONTEXT *pMMUContext);
#endif