mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
Add safe Rust abstractions over the Linux kernel's GPU buddy allocator for physical memory management. The GPU buddy allocator implements a binary buddy system useful for GPU physical memory allocation. nova-core will use it for physical memory allocation. Cc: Nikola Djukic <[email protected]> Signed-off-by: Joel Fernandes <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Link: https://patch.msgid.link/[email protected] [ * Use doc-comments for GpuBuddyAllocMode methods and GpuBuddyGuard, * Fix comma splice in GpuBuddyParams::chunk_size doc-comment, * Remove redundant summary in GpuBuddy::new doc-comment, * Drop Rust helper for gpu_buddy_block_size(). - Danilo ] Signed-off-by: Danilo Krummrich <[email protected]>
18 lines
391 B
C
18 lines
391 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/gpu_buddy.h>
|
|
|
|
#ifdef CONFIG_GPU_BUDDY
|
|
|
|
__rust_helper u64 rust_helper_gpu_buddy_block_offset(const struct gpu_buddy_block *block)
|
|
{
|
|
return gpu_buddy_block_offset(block);
|
|
}
|
|
|
|
__rust_helper unsigned int rust_helper_gpu_buddy_block_order(struct gpu_buddy_block *block)
|
|
{
|
|
return gpu_buddy_block_order(block);
|
|
}
|
|
|
|
#endif /* CONFIG_GPU_BUDDY */
|