October 2017
Intermediate to advanced
586 pages
14h 8m
English
Resources represent all the elements that characterize the device from the hardware point of view, and that the device needs in order to be set up and work properly. There are only six types of resources in the kernel, all listed in include/linux/ioport.h, and used as flags to describe the resource's type:
#define IORESOURCE_IO 0x00000100 /* PCI/ISA I/O ports */ #define IORESOURCE_MEM 0x00000200 /* Memory regions */ #define IORESOURCE_REG 0x00000300 /* Register offsets */ #define IORESOURCE_IRQ 0x00000400 /* IRQ line */ #define IORESOURCE_DMA 0x00000800 /* DMA channels */ #define IORESOURCE_BUS 0x00001000 /* Bus */
A resource is represented in the kernel as an instance of struct resource:
struct resource { resource_size_t start; ...