Files
u-boot/lib/kmem_cache.c
Simon Glass e63fc511c3 lib: Add CONFIG_LIB_KMEM_CACHE for full kmem_cache support
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>
2025-12-30 15:47:04 -07:00

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);
}