Commit 4e99f18f authored by Artem Kuzmitskiy's avatar Artem Kuzmitskiy Committed by Pavel Emelyanov

Expand task_size variable for AArch32

Task size depends from VM_SPLIT_* kernel option and cannot be hard coded.
This patch based on c0c0546c from
Christopher Covington.
Signed-off-by: 's avatarArtem Kuzmitskiy <artem.kuzmitskiy@lge.com>
Reviewed-by: 's avatarChristopher Covington <cov@codeaurora.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9bbb2b09
......@@ -96,9 +96,27 @@ struct user_vfp_exc {
#define REG_IP(regs) ((regs).ARM_pc)
#define REG_SYSCALL_NR(regs) ((regs).ARM_r7)
#define TASK_SIZE 0xbf000000
/*
* Range for task size calculated from the following Linux kernel files:
* arch/arm/include/asm/memory.h
* arch/arm/Kconfig (PAGE_OFFSET values in Memory split section)
*/
#define TASK_SIZE_MIN 0x3f000000
#define TASK_SIZE_MAX 0xbf000000
#define SZ_1G 0x40000000
static inline unsigned long task_size() { return TASK_SIZE; }
int munmap(void *addr, size_t length);
static inline unsigned long task_size(void)
{
unsigned long task_size;
for (task_size = TASK_SIZE_MIN; task_size < TASK_SIZE_MAX; task_size += SZ_1G)
if (munmap((void *)task_size, page_size()))
break;
return task_size;
}
#define AT_VECTOR_SIZE 40
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment