Files
nvdriver/tests/software-manager/codegen.rs
LIghtJUNction 32c8728037 Migrate the workspace and kernel crates to Rust edition 2024
Mechanical, behavior-neutral: edition/resolver keys, unsafe extern blocks,
unsafe(no_mangle)/unsafe(export_name), unsafe blocks inside unsafe fn,
r#gen renames, --edition flags in Makefiles/tools, rustfmt style_edition
pinned to 2021 so formatting stays edition-independent, and clippy
collapsible_if allowed workspace-wide (let-chain churn).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-12-02 01:52:38 +08:00

35 lines
1.2 KiB
Rust

#![no_std]
#![allow(dead_code)]
#[path = "../../src/nvidia/kernel/pf_software.rs"]
mod pf_software;
#[path = "../../src/nvidia/kernel/registry.rs"]
mod registry;
#[path = "../../src/nvidia/kernel/software_manager.rs"]
mod software_manager;
#[path = "../../src/nvidia/kernel/system_os.rs"]
mod system_os;
#[path = "../../src/nvidia/kernel/system_platform.rs"]
mod system_platform;
use core::num::NonZeroU64;
use software_manager::Manager;
#[unsafe(no_mangle)]
pub static SM_INIT: fn(nv_rs_core::hypervisor::HypervisorType) -> Result<(), i32> =
software_manager::initialize;
#[unsafe(no_mangle)]
pub static SM_SHUT: fn() -> Result<(), i32> = software_manager::shutdown;
#[unsafe(no_mangle)]
pub static SM_RANGE: fn(&mut Manager) -> Result<NonZeroU64, i32> = Manager::reserve_device_range;
#[unsafe(no_mangle)]
pub static SM_KEY: fn(&mut Manager) -> Result<nv_rs_core::gpu::timeout::GpuId, i32> =
Manager::allocate_timeout_key;
fn scoped_key() -> Result<u32, i32> {
software_manager::with(|m| m.allocate_timeout_key().map(|id| id.0))
}
#[unsafe(no_mangle)]
pub static SM_WITH: fn() -> Result<u32, i32> = scoped_key;
#[panic_handler]
fn panic(_: &core::panic::PanicInfo<'_>) -> ! {
unsafe { core::arch::asm!("ud2", options(noreturn, nostack)) }
}