[PATCH v1 02/10] port resource_overlaps() from kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



needed for kexec support

Signed-off-by: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
---
 include/linux/ioport.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 2a944cc73..f05937ead 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -130,6 +130,12 @@ static inline unsigned long resource_type(const struct resource *res)
 	return res->flags & IORESOURCE_TYPE_BITS;
 }
 
+/* True if any part of r1 overlaps r2 */
+static inline bool resource_overlaps(struct resource *r1, struct resource *r2)
+{
+       return (r1->start <= r2->end && r1->end >= r2->start);
+}
+
 struct resource *request_iomem_region(const char *name,
 		resource_size_t start, resource_size_t end);
 struct resource *request_ioport_region(const char *name,
-- 
2.14.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux