diff options
-rw-r--r-- | include/linux/ioport.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index e9bb22cba764..c2ebfe66177c 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -109,6 +109,36 @@ struct resource_list { | |||
109 | /* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ | 109 | /* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ |
110 | #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ | 110 | #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ |
111 | 111 | ||
112 | |||
113 | /* helpers to define resources */ | ||
114 | #define DEFINE_RES_NAMED(_start, _size, _name, _flags) \ | ||
115 | { \ | ||
116 | .start = (_start), \ | ||
117 | .end = (_start) + (_size) - 1, \ | ||
118 | .name = (_name), \ | ||
119 | .flags = (_flags), \ | ||
120 | } | ||
121 | |||
122 | #define DEFINE_RES_IO_NAMED(_start, _size, _name) \ | ||
123 | DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO) | ||
124 | #define DEFINE_RES_IO(_start, _size) \ | ||
125 | DEFINE_RES_IO_NAMED((_start), (_size), NULL) | ||
126 | |||
127 | #define DEFINE_RES_MEM_NAMED(_start, _size, _name) \ | ||
128 | DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM) | ||
129 | #define DEFINE_RES_MEM(_start, _size) \ | ||
130 | DEFINE_RES_MEM_NAMED((_start), (_size), NULL) | ||
131 | |||
132 | #define DEFINE_RES_IRQ_NAMED(_irq, _name) \ | ||
133 | DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ) | ||
134 | #define DEFINE_RES_IRQ(_irq) \ | ||
135 | DEFINE_RES_IRQ_NAMED((_irq), NULL) | ||
136 | |||
137 | #define DEFINE_RES_DMA_NAMED(_dma, _name) \ | ||
138 | DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA) | ||
139 | #define DEFINE_RES_DMA(_dma) \ | ||
140 | DEFINE_RES_DMA_NAMED((_dma), NULL) | ||
141 | |||
112 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ | 142 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ |
113 | extern struct resource ioport_resource; | 143 | extern struct resource ioport_resource; |
114 | extern struct resource iomem_resource; | 144 | extern struct resource iomem_resource; |