xref: /openbsd/sys/dev/pci/drm/include/linux/ioport.h (revision d52f258d)
1 /* Public domain. */
2 
3 #ifndef _LINUX_IOPORT_H
4 #define _LINUX_IOPORT_H
5 
6 #include <linux/types.h>
7 
8 #define IORESOURCE_MEM	0x0001
9 
10 struct resource {
11 	u_long	start;
12 	u_long	end;
13 	const char *name;
14 };
15 
16 static inline resource_size_t
resource_size(const struct resource * r)17 resource_size(const struct resource *r)
18 {
19 	return r->end - r->start + 1;
20 }
21 
22 #define DEFINE_RES_MEM(_start, _size)		\
23 (struct resource) {				\
24 		.start = (_start),		\
25 		.end = (_start) + (_size) - 1,	\
26 		.name = NULL,			\
27 	}
28 
29 #endif
30