In kerne, there are several places to get stack page address of
task and when using AMLOGIC_VMAP, task_stack_page() does not
return page address. Add aml_task_stack() to get task stack page
for amlogic vmap.
Change-Id: I64cd827f98bec74357227dcc3ed546807b5406e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
}
#endif
+void *aml_task_stack(struct task_struct *tsk)
+{
+ unsigned long stack = (unsigned long)tsk->stack;
+ unsigned long addr;
+ struct page *page;
+
+ if (unlikely(!is_vmap_addr(stack))) {
+ /* stack get from kmalloc, currently no method to get page */
+ return NULL;
+ }
+
+ addr = stack + STACK_TOP_PAGE_OFF;
+ page = vmalloc_to_page((const void *)addr);
+ return page ? page_address(page) : NULL;
+}
+
void *aml_stack_alloc(int node, struct task_struct *tsk)
{
unsigned long bitmap_no, raw_start;
extern void update_vmap_stack(int diff);
extern int get_vmap_stack_size(void);
extern int is_vmap_addr(unsigned long addr);
+extern void *aml_task_stack(struct task_struct *tsk);
extern void aml_stack_free(struct task_struct *tsk);
extern void *aml_stack_alloc(int node, struct task_struct *tsk);
extern void aml_account_task_stack(struct task_struct *tsk, int account);