Files
nvdriver/kernel-open/nvidia/rom_buffer.c
Eric Hartford 33ff608a88 Add MIT LICENSE and unify repository SPDX/Cargo/module licensing
- Add root LICENSE (MIT License, Copyright (c) 2026 QuixiAI / Eric Hartford).
- Set license = "MIT" in workspace Cargo.toml and member crates (zero non-MIT dependencies).
- Update all kernel-open/ and tests/vm/ SPDX headers to MIT and EXPORT_SYMBOL_GPL -> EXPORT_SYMBOL.
- Use MODULE_LICENSE("Dual MIT/GPL") in Linux .ko modules so Linux modpost permits linking against the kernel's own EXPORT_SYMBOL_GPL symbols while keeping the repository source 100% MIT.

Closes #12.
2026-12-01 00:20:02 +00:00

24 lines
646 B
C

/* SPDX-License-Identifier: MIT */
#ifdef NV_RS_ROM_HOST_FIXTURE
#include <stdlib.h>
#define kvzalloc(bytes, flags) calloc(1, (bytes))
#define kvfree(buffer) free(buffer)
#define GFP_KERNEL 0
#else
#include <linux/slab.h>
#include <linux/mm.h>
#endif
#include "rom_buffer.h"
void *nv_rs_rom_buffer_alloc(size_t bytes)
{
/* CPU storage follows the constructor's u32 length. PROM acquisition and
* physical FW allocation impose their own independent hardware bounds. */
if (!bytes || bytes > 0xffffffffULL)
return NULL;
return kvzalloc(bytes, GFP_KERNEL);
}
void nv_rs_rom_buffer_free(void *buffer)
{
kvfree(buffer);
}