dde_linux: generalize kmalloc_order() implementation

This commit is contained in:
Christian Helmuth 2023-02-09 16:40:00 +01:00
parent 0a8ac9fe4d
commit 73f7f8aef6
5 changed files with 12 additions and 31 deletions

View File

@ -70,14 +70,6 @@ int __must_check get_random_bytes_arch(void * buf, int nbytes)
}
#include <linux/slab.h>
void * kmalloc_order(size_t size,gfp_t flags,unsigned int order)
{
return kmalloc(size, flags);
}
#include <linux/mm.h>
void * kvmalloc_node(size_t size,gfp_t flags,int node)

View File

@ -14,6 +14,7 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <../mm/slab.h>
#include <../mm/internal.h>
#include <lx_emul/alloc.h>
#include <lx_emul/debug.h>
@ -48,3 +49,13 @@ size_t ksize(const void * objp)
return __ksize(objp);
}
/*
* We can use our __kmalloc() implementation here as it supports large
* allocations well.
*/
void * kmalloc_order(size_t size, gfp_t flags, unsigned int order)
{
return __kmalloc(size, flags);
}

View File

@ -47,7 +47,6 @@ SRC_C += lx_emul/shadow/fs/sysfs/symlink.c
SRC_C += lx_emul/mapping.c
SRC_C += lx_emul/page_alloc.c
SRC_C += lx_emul/sched_core.c
SRC_C += lx_emul/slab_common.c
SRC_C += lx_emul/vmalloc.c
SRC_C += lx_emul/delay.c

View File

@ -1,22 +0,0 @@
/*
* \brief Supplement for emulation of mm/slab_common.c
* \author Josef Soentgen
* \date 2022-04-05
*/
/*
* Copyright (C) 2022 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <linux/slab.h>
void * kmalloc_order(size_t size, gfp_t flags, unsigned int order)
{
return kmalloc(size, flags);
}

View File

@ -47,6 +47,7 @@ LX_ENABLE += FB
# mandatory fs support
LX_ENABLE += PROC_FS SYSFS
# disable optimization not possible in PIC code under Genode
LX_DISABLE += CC_HAS_ASM_GOTO
# slim down kernel by removing superfluous drivers