drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/vfn/uvfn.c- Extension
.c- Size
- 2142 bytes
- Lines
- 68
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
priv.hcore/object.h
Detected Declarations
struct nvkm_uvfnfunction nvkm_uvfn_mapfunction nvkm_uvfn_new
Annotated Snippet
struct nvkm_uvfn {
struct nvkm_object object;
struct nvkm_vfn *vfn;
};
static int
nvkm_uvfn_map(struct nvkm_object *object, void *argv, u32 argc,
enum nvkm_object_map *type, u64 *addr, u64 *size)
{
struct nvkm_vfn *vfn = nvkm_uvfn(object)->vfn;
struct nvkm_device *device = vfn->subdev.device;
*addr = device->func->resource_addr(device, NVKM_BAR0_PRI) + vfn->addr.user;
*size = vfn->func->user.size;
*type = NVKM_OBJECT_MAP_IO;
return 0;
}
static const struct nvkm_object_func
nvkm_uvfn = {
.map = nvkm_uvfn_map,
};
int
nvkm_uvfn_new(struct nvkm_device *device, const struct nvkm_oclass *oclass,
void *argv, u32 argc, struct nvkm_object **pobject)
{
struct nvkm_uvfn *uvfn;
if (argc != 0)
return -ENOSYS;
if (!(uvfn = kzalloc_obj(*uvfn)))
return -ENOMEM;
nvkm_object_ctor(&nvkm_uvfn, oclass, &uvfn->object);
uvfn->vfn = device->vfn;
*pobject = &uvfn->object;
return 0;
}
Annotation
- Immediate include surface: `priv.h`, `core/object.h`.
- Detected declarations: `struct nvkm_uvfn`, `function nvkm_uvfn_map`, `function nvkm_uvfn_new`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.