drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c
Extension
.c
Size
4001 bytes
Lines
141
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.

Dependency Surface

Detected Declarations

Annotated Snippet

while (start + fetch < limit) {
			int ret = acpi_read_bios(data, bios->data,
						 start + fetch, 0x1000);
			if (ret != 0x1000)
				break;
			fetch += 0x1000;
		}
	}

	return fetch;
}

static void *
acpi_init(struct nvkm_bios *bios, const char *name)
{
#if defined(CONFIG_ACPI) && defined(CONFIG_X86)
	acpi_status status;
	acpi_handle dhandle, rom_handle;

	dhandle = ACPI_HANDLE(bios->subdev.device->dev);
	if (!dhandle)
		return ERR_PTR(-ENODEV);

	status = acpi_get_handle(dhandle, "_ROM", &rom_handle);
	if (ACPI_FAILURE(status))
		return ERR_PTR(-ENODEV);

	return rom_handle;
#else
	return ERR_PTR(-ENODEV);
#endif
}

const struct nvbios_source
nvbios_acpi_fast = {
	.name = "ACPI",
	.init = acpi_init,
	.read = acpi_read_fast,
	.rw = false,
	.require_checksum = true,
};

const struct nvbios_source
nvbios_acpi_slow = {
	.name = "ACPI",
	.init = acpi_init,
	.read = acpi_read_slow,
	.rw = false,
};

Annotation

Implementation Notes