android_kernel_xiaomi_sm8350/arch/um/kernel/skas/mem.c
Jeff Dike 23bbd586ed [PATCH] uml: fix static binary segfault
When UML is built as a static binary, it segfaults when run.  The reason is
that a memory hole that is present in dynamic binaries isn't there in static
binaries, and it contains essential stuff.

This fix removes the code which maps some anonymous memory into that hole and
cleans up some related code.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:23 -07:00

28 lines
655 B
C

/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#include "linux/config.h"
#include "linux/mm.h"
#include "asm/pgtable.h"
#include "mem_user.h"
#include "skas.h"
unsigned long set_task_sizes_skas(unsigned long *task_size_out)
{
/* Round up to the nearest 4M */
unsigned long host_task_size = ROUND_4M((unsigned long)
&host_task_size);
#ifdef CONFIG_HOST_TASK_SIZE
*host_size_out = ROUND_4M(CONFIG_HOST_TASK_SIZE);
*task_size_out = CONFIG_HOST_TASK_SIZE;
#else
if (!skas_needs_stub)
*task_size_out = host_task_size;
else *task_size_out = CONFIG_STUB_START & PGDIR_MASK;
#endif
return host_task_size;
}