summaryrefslogtreecommitdiff
path: root/include/linux/ioport.h
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-10-15 22:05:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 11:21:51 -0700
commitc9f66169f1c696f9489503d7de92daff135c1efd (patch)
treeb96efd22193122874196c4809b94069f8e46cb34 /include/linux/ioport.h
parentc26ec88ea86ad5122a6ea5ad635e6a1f6c395d74 (diff)
resource: add resource_type() and IORESOURCE_TYPE_BITS
Add resource_type() and IORESOURCE_TYPE_BITS. They make it easier to add more resource types without having to rewrite tons of code. Signed-off-by: Magnus Damm <damm@igel.co.jp> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/ioport.h')
-rw-r--r--include/linux/ioport.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index ee9bcc6f32b6..0dde77272d7a 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -34,7 +34,8 @@ struct resource_list {
*/
#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
-#define IORESOURCE_IO 0x00000100 /* Resource type */
+#define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */
+#define IORESOURCE_IO 0x00000100
#define IORESOURCE_MEM 0x00000200
#define IORESOURCE_IRQ 0x00000400
#define IORESOURCE_DMA 0x00000800
@@ -126,6 +127,10 @@ static inline resource_size_t resource_size(struct resource *res)
{
return res->end - res->start + 1;
}
+static inline unsigned long resource_type(struct resource *res)
+{
+ return res->flags & IORESOURCE_TYPE_BITS;
+}
/* Convenience shorthand with allocation */
#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))