Add a Kconfig option to control whether full kmem_cache_free() and kmem_cache_destroy() implementations are provided in lib/linux_compat.c Most boards do not need these functions, so they can use simple inline stubs in slab.h. Subsystems like ext4 that require proper cache management can select CONFIG_LIB_KMEM_CACHE. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com>
21 lines
365 B
C
21 lines
365 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* kmem_cache implementation for U-Boot
|
|
*
|
|
* Copyright 2025 Canonical Ltd
|
|
* Written by Simon Glass <simon.glass@canonical.com>
|
|
*/
|
|
|
|
#include <malloc.h>
|
|
#include <linux/slab.h>
|
|
|
|
void kmem_cache_free(struct kmem_cache *cachep, void *obj)
|
|
{
|
|
free(obj);
|
|
}
|
|
|
|
void kmem_cache_destroy(struct kmem_cache *cachep)
|
|
{
|
|
free(cachep);
|
|
}
|