/* * IO resources have these defined flags. * * PCI devices expose these flags to userspace in the "resource" sysfs file, * so don't move them.
*/ #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
/* IORESOURCE_SYSRAM specific bits. */ #define IORESOURCE_SYSRAM_DRIVER_MANAGED 0x02000000 /* Always detected via a driver. */ #define IORESOURCE_SYSRAM_MERGEABLE 0x04000000 /* Resource can be merged. */
#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
#define IORESOURCE_DISABLED 0x10000000 #define IORESOURCE_UNSET 0x20000000 /* No address assigned yet */ #define IORESOURCE_AUTO 0x40000000 #define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */
/* PCI ROM control bits (IORESOURCE_BITS) */ #define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ #define IORESOURCE_ROM_SHADOW (1<<1) /* Use RAM image, not ROM BAR */
/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ #define IORESOURCE_PCI_EA_BEI (1<<5) /* BAR Equivalent Indicator */
/* * I/O Resource Descriptors * * Descriptors are used by walk_iomem_res_desc() and region_intersects() * for searching a specific resource range in the iomem table. Assign * a new descriptor when a resource range supports the search interfaces. * Otherwise, resource.desc must be set to IORES_DESC_NONE (0).
*/ enum {
IORES_DESC_NONE = 0,
IORES_DESC_CRASH_KERNEL = 1,
IORES_DESC_ACPI_TABLES = 2,
IORES_DESC_ACPI_NV_STORAGE = 3,
IORES_DESC_PERSISTENT_MEMORY = 4,
IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5,
IORES_DESC_DEVICE_PRIVATE_MEMORY = 6,
IORES_DESC_RESERVED = 7,
IORES_DESC_SOFT_RESERVED = 8,
IORES_DESC_CXL = 9,
};
/** * typedef resource_alignf - Resource alignment callback * @data: Private data used by the callback * @res: Resource candidate range (an empty resource space) * @size: The minimum size of the empty space * @align: Alignment from the constraints * * Callback allows calculating resource placement and alignment beyond min, * max, and align fields in the struct resource_constraint. * * Return: Start address for the resource.
*/ typedef resource_size_t (*resource_alignf)(void *data, conststruct resource *res,
resource_size_t size,
resource_size_t align);
/** * struct resource_constraint - constraints to be met while searching empty * resource space * @min: The minimum address for the memory range * @max: The maximum address for the memory range * @align: Alignment for the start address of the empty space * @alignf: Additional alignment constraints callback * @alignf_data: Data provided for @alignf callback * * Contains the range and alignment constraints that have to be met during * find_resource_space(). @alignf can be NULL indicating no alignment beyond * @align is necessary.
*/ struct resource_constraint {
resource_size_t min, max, align;
resource_alignf alignf; void *alignf_data;
};
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ externstruct resource ioport_resource; externstruct resource iomem_resource;
/** * resource_set_size - Calculate resource end address from size and start * @res: Resource descriptor * @size: Size of the resource * * Calculate the end address for @res based on @size. * * Note: The start address of @res must be set when calling this function. * Prefer resource_set_range() if setting both the start address and @size.
*/ staticinlinevoid resource_set_size(struct resource *res, resource_size_t size)
{
res->end = res->start + size - 1;
}
/** * resource_set_range - Set resource start and end addresses * @res: Resource descriptor * @start: Start address for the resource * @size: Size of the resource * * Set @res start address and calculate the end address based on @size.
*/ staticinlinevoid resource_set_range(struct resource *res,
resource_size_t start,
resource_size_t size)
{
res->start = start;
resource_set_size(res, size);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.