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.
25 lines
735 B
C
25 lines
735 B
C
// SPDX-License-Identifier: MIT
|
|
/* Linux primitives only; exact580 delay/schedule policy is implemented in Rust. */
|
|
#include <linux/delay.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/preempt.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/printk.h>
|
|
#include "scheduling_adapter.h"
|
|
u32 nv_rs_os_context(void)
|
|
{
|
|
return (in_hardirq()?1:0) | (in_interrupt()?2:0) |
|
|
(irqs_disabled()?4:0) | (in_atomic()?8:0);
|
|
}
|
|
void nv_rs_os_busy_ms(u32 ms) { mdelay(ms); }
|
|
void nv_rs_os_busy_us(u32 us) { udelay(us); }
|
|
void nv_rs_os_schedule_tick(void)
|
|
{
|
|
set_current_state(TASK_INTERRUPTIBLE);
|
|
schedule_timeout(1);
|
|
}
|
|
void nv_rs_os_illegal_yield(void)
|
|
{
|
|
pr_err("nvidia_rs: attempted CPU yield in atomic or interrupt context\n");
|
|
}
|