2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

Expand task_size variable for AArch32

Task size depends from VM_SPLIT_* kernel option and cannot be hard coded.
This patch based on c0c0546c31e6df4932669f4740197bb830a24c8d from
Christopher Covington.

Signed-off-by: Artem Kuzmitskiy <artem.kuzmitskiy@lge.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Artem Kuzmitskiy 2015-11-09 10:49:00 +03:00 committed by Pavel Emelyanov
parent 9bbb2b092c
commit 4e99f18f64

View File

@ -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