mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +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.
48 lines
2.4 KiB
C
48 lines
2.4 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
#ifndef NV_RS_GPU_BRIDGE_H
|
|
#define NV_RS_GPU_BRIDGE_H
|
|
#include <linux/types.h>
|
|
struct nv_rs_probe_info {
|
|
u16 vendor, device, subvendor, subdevice;
|
|
u32 boot0, boot1, boot42;
|
|
};
|
|
struct nv_rs_pci;
|
|
struct nv_rs_gpu_key { u32 index,reserved; u64 generation; };
|
|
/* Internal prepared-instance key; neither a CUDA GPU_ID nor readiness. Driver
|
|
* base remains owned until retire has unpublished it before final release. */
|
|
int nv_rs_gpu_registry_publish(void *storage,struct nv_rs_pci *,struct nv_rs_gpu_key *);
|
|
int nv_rs_gpu_registry_retire(void *storage,const struct nv_rs_gpu_key *);
|
|
int nv_rs_gpu_first_open(const struct nv_rs_gpu_key *);
|
|
bool nv_rs_hardware_inventory(void);
|
|
u32 nv_rs_bringup_level(void);
|
|
bool nv_rs_bringup_bar1(void);
|
|
void nv_rs_bringup_note(struct nv_rs_pci *pci, u32 code, u32 value);
|
|
void nv_rs_hardware_inventory_log(struct nv_rs_pci *pci, u32 offset, u32 value);
|
|
void nv_rs_hardware_inventory_firmware(struct nv_rs_pci *pci, int error, u32 records, u32 bytes);
|
|
int nv_rs_firmware_request(struct nv_rs_pci *pci, const char *name, const u8 **data,
|
|
size_t *size, void **handle);
|
|
void nv_rs_firmware_release(void *handle);
|
|
void nv_rs_rm_api_lock(void);
|
|
void nv_rs_rm_api_unlock(void);
|
|
unsigned long nv_rs_gpu_registry_lock(void);
|
|
void nv_rs_gpu_registry_unlock(unsigned long flags);
|
|
size_t nv_rs_gpu_state_size(void);
|
|
size_t nv_rs_gpu_state_align(void);
|
|
int nv_rs_gpu_prepare(struct nv_rs_pci *, const struct nv_rs_probe_info *, void *storage);
|
|
/* Lock/unlock must both be provided or both NULL. NULL makes locked register
|
|
* acquisition unsupported. Callback/context lifetime covers every GPU lease. */
|
|
int nv_rs_gpu_prepare_owned(struct nv_rs_pci *, const struct nv_rs_probe_info *,
|
|
void *storage, void *owner, void (*destroy)(void *), void (*retry)(void *),
|
|
int (*lock)(void *), void (*unlock)(void *));
|
|
int nv_rs_gpu_close(void *storage);
|
|
/* Exclusive successful probe only, before registry publication/lease exposure.
|
|
* flags bit0 is Linux is_virtfn; other bits and truncated PCI fields rejected. */
|
|
int nv_rs_gpu_set_probe_identity(void *storage,u32 domain,u32 bus,u32 slot,
|
|
u32 function,u32 flags);
|
|
int nv_rs_gpu_set_cleanup(void *storage, void *owner,
|
|
void (*destroy)(void *), void (*retry)(void *));
|
|
void nv_rs_gpu_mark_removed(void *storage);
|
|
void nv_rs_gpu_release_driver(void *storage);
|
|
void nv_rs_gpu_retry_cleanup(void *storage);
|
|
#endif
|