mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
- 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.
21 lines
679 B
C
21 lines
679 B
C
/* SPDX-License-Identifier: MIT */
|
|
/* CPU software-object storage only. GPU/module ownership belongs to Rust. */
|
|
#include <linux/errno.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/vmalloc.h>
|
|
#include "clock_store_adapter.h"
|
|
bool nv_rs_clock_store_process_context(void)
|
|
{ return !in_interrupt() && !irqs_disabled() && !in_atomic(); }
|
|
void *nv_rs_clock_store_alloc(size_t bytes)
|
|
{
|
|
if (!bytes || !nv_rs_clock_store_process_context()) return NULL;
|
|
return kvzalloc(bytes,GFP_KERNEL);
|
|
}
|
|
int nv_rs_clock_store_free(void *buffer)
|
|
{
|
|
if (!nv_rs_clock_store_process_context()) return -EWOULDBLOCK;
|
|
kvfree(buffer);return 0;
|
|
}
|