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.
26 lines
870 B
C
26 lines
870 B
C
/* SPDX-License-Identifier: MIT */
|
|
/* Actual Linux CPU-only source storage; not firmware DMA backing. */
|
|
#include <linux/kernel.h>
|
|
#include <linux/string.h>
|
|
#include "rom_buffer.h"
|
|
int vm_rom_cpu_test(void)
|
|
{
|
|
const size_t bytes=0x80001;
|
|
volatile u8 *buffer;
|
|
size_t i;
|
|
unsigned int checks=0;
|
|
#define CPU_CHECK(p) do {if(!(p))panic("NV_RS_VM_FAIL CPU-ROM line%d",__LINE__);checks++;}while(0)
|
|
CPU_CHECK(!nv_rs_rom_buffer_alloc(0));
|
|
CPU_CHECK(!nv_rs_rom_buffer_alloc((size_t)U32_MAX+1));
|
|
buffer=nv_rs_rom_buffer_alloc(bytes);
|
|
CPU_CHECK(buffer!=NULL);
|
|
CPU_CHECK(!memchr_inv((const void *)buffer,0,bytes));
|
|
for(i=0;i<bytes;i++)buffer[i]=(u8)(i*13+97);
|
|
for(i=0;i<bytes;i++) {
|
|
if(buffer[i]!=(u8)(i*13+97))panic("NV_RS_VM_FAIL CPU-ROM data");
|
|
}
|
|
checks++;
|
|
nv_rs_rom_buffer_free((void *)buffer);
|
|
return checks;
|
|
}
|